Fixup attachment code to use sbus_promaddr_to_handle() and not specify
BUS_SPACE_MAP_LINEAR.
This commit is contained in:
parent
6440db6488
commit
86ff330657
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: dma_sbus.c,v 1.10 2002/03/11 16:00:56 pk Exp $ */
|
||||
/* $NetBSD: dma_sbus.c,v 1.11 2002/03/21 00:16:15 eeh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -66,7 +66,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: dma_sbus.c,v 1.10 2002/03/11 16:00:56 pk Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: dma_sbus.c,v 1.11 2002/03/21 00:16:15 eeh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -154,7 +154,6 @@ dmaattach_sbus(parent, self, aux)
|
||||
struct sbus_attach_args *sa = aux;
|
||||
struct dma_softc *dsc = (void *)self;
|
||||
struct lsi64854_softc *sc = &dsc->sc_lsi64854;
|
||||
bus_space_handle_t bh;
|
||||
bus_space_tag_t sbt;
|
||||
int sbusburst, burst;
|
||||
int node;
|
||||
@ -165,16 +164,16 @@ dmaattach_sbus(parent, self, aux)
|
||||
sc->sc_dmatag = sa->sa_dmatag;
|
||||
|
||||
/* Map registers */
|
||||
if (sa->sa_npromvaddrs != 0)
|
||||
sc->sc_regs = (bus_space_handle_t)sa->sa_promvaddrs[0];
|
||||
else {
|
||||
if (sa->sa_npromvaddrs) {
|
||||
sbus_promaddr_to_handle(sa->sa_bustag,
|
||||
sa->sa_promvaddrs[0], &sc->sc_regs);
|
||||
} else {
|
||||
if (sbus_bus_map(sa->sa_bustag,
|
||||
sa->sa_slot, sa->sa_offset, sa->sa_size,
|
||||
BUS_SPACE_MAP_LINEAR, &bh) != 0) {
|
||||
sa->sa_slot, sa->sa_offset, sa->sa_size,
|
||||
0, &sc->sc_regs) != 0) {
|
||||
printf("%s: cannot map registers\n", self->dv_xname);
|
||||
return;
|
||||
}
|
||||
sc->sc_regs = bh;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: esp_sbus.c,v 1.19 2002/03/11 16:00:56 pk Exp $ */
|
||||
/* $NetBSD: esp_sbus.c,v 1.20 2002/03/21 00:16:15 eeh Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: esp_sbus.c,v 1.19 2002/03/11 16:00:56 pk Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: esp_sbus.c,v 1.20 2002/03/21 00:16:15 eeh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -207,13 +207,19 @@ espattach_sbus(parent, self, aux)
|
||||
sizeof (lsc->sc_dev.dv_xname));
|
||||
|
||||
/* Map dma registers */
|
||||
if (sbus_bus_map(sa->sa_bustag,
|
||||
sa->sa_reg[0].sbr_slot,
|
||||
sa->sa_reg[0].sbr_offset,
|
||||
sa->sa_reg[0].sbr_size,
|
||||
BUS_SPACE_MAP_LINEAR, &lsc->sc_regs) != 0) {
|
||||
printf("%s: cannot map dma registers\n", self->dv_xname);
|
||||
return;
|
||||
if (sa->sa_npromvaddrs) {
|
||||
sbus_promaddr_to_handle(sa->sa_bustag,
|
||||
sa->sa_promvaddrs[0], &lsc->sc_regs);
|
||||
} else {
|
||||
if (sbus_bus_map(sa->sa_bustag,
|
||||
sa->sa_reg[0].sbr_slot,
|
||||
sa->sa_reg[0].sbr_offset,
|
||||
sa->sa_reg[0].sbr_size,
|
||||
0, &lsc->sc_regs) != 0) {
|
||||
printf("%s: cannot map dma registers\n",
|
||||
self->dv_xname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -251,14 +257,20 @@ espattach_sbus(parent, self, aux)
|
||||
/*
|
||||
* map SCSI core registers
|
||||
*/
|
||||
if (sbus_bus_map(sa->sa_bustag,
|
||||
sa->sa_reg[1].sbr_slot,
|
||||
sa->sa_reg[1].sbr_offset,
|
||||
sa->sa_reg[1].sbr_size,
|
||||
BUS_SPACE_MAP_LINEAR, &esc->sc_reg) != 0) {
|
||||
printf("%s @ sbus: cannot map scsi core registers\n",
|
||||
self->dv_xname);
|
||||
return;
|
||||
if (sa->sa_npromvaddrs > 1) {
|
||||
sbus_promaddr_to_handle(sa->sa_bustag,
|
||||
sa->sa_promvaddrs[1], &esc->sc_reg);
|
||||
} else {
|
||||
if (sbus_bus_map(sa->sa_bustag,
|
||||
sa->sa_reg[1].sbr_slot,
|
||||
sa->sa_reg[1].sbr_offset,
|
||||
sa->sa_reg[1].sbr_size,
|
||||
0, &esc->sc_reg) != 0) {
|
||||
printf("%s @ sbus: "
|
||||
"cannot map scsi core registers\n",
|
||||
self->dv_xname);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (sa->sa_nintr == 0) {
|
||||
@ -310,12 +322,13 @@ espattach_sbus(parent, self, aux)
|
||||
* Map my registers in, if they aren't already in virtual
|
||||
* address space.
|
||||
*/
|
||||
if (sa->sa_npromvaddrs)
|
||||
esc->sc_reg = (bus_space_handle_t)sa->sa_promvaddrs[0];
|
||||
else {
|
||||
if (sa->sa_npromvaddrs) {
|
||||
sbus_promaddr_to_handle(sa->sa_bustag,
|
||||
sa->sa_promvaddrs[0], &esc->sc_reg);
|
||||
} else {
|
||||
if (sbus_bus_map(sa->sa_bustag,
|
||||
sa->sa_slot, sa->sa_offset, sa->sa_size,
|
||||
BUS_SPACE_MAP_LINEAR, &esc->sc_reg) != 0) {
|
||||
sa->sa_slot, sa->sa_offset, sa->sa_size,
|
||||
0, &esc->sc_reg) != 0) {
|
||||
printf("%s @ sbus: cannot map registers\n",
|
||||
self->dv_xname);
|
||||
return;
|
||||
@ -370,12 +383,13 @@ espattach_dma(parent, self, aux)
|
||||
* Map my registers in, if they aren't already in virtual
|
||||
* address space.
|
||||
*/
|
||||
if (sa->sa_npromvaddrs)
|
||||
esc->sc_reg = (bus_space_handle_t)sa->sa_promvaddrs[0];
|
||||
else {
|
||||
if (sa->sa_npromvaddrs) {
|
||||
sbus_promaddr_to_handle(sa->sa_bustag,
|
||||
sa->sa_promvaddrs[0], &esc->sc_reg);
|
||||
} else {
|
||||
if (sbus_bus_map(sa->sa_bustag,
|
||||
sa->sa_slot, sa->sa_offset, sa->sa_size,
|
||||
BUS_SPACE_MAP_LINEAR, &esc->sc_reg) != 0) {
|
||||
sa->sa_slot, sa->sa_offset, sa->sa_size,
|
||||
0, &esc->sc_reg) != 0) {
|
||||
printf("%s @ dma: cannot map registers\n",
|
||||
self->dv_xname);
|
||||
return;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: isp_sbus.c,v 1.50 2002/03/11 16:00:57 pk Exp $ */
|
||||
/* $NetBSD: isp_sbus.c,v 1.51 2002/03/21 00:16:15 eeh Exp $ */
|
||||
/*
|
||||
* This driver, which is contained in NetBSD in the files:
|
||||
*
|
||||
@ -59,7 +59,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: isp_sbus.c,v 1.50 2002/03/11 16:00:57 pk Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: isp_sbus.c,v 1.51 2002/03/21 00:16:15 eeh Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -164,12 +164,12 @@ isp_sbus_attach(struct device *parent, struct device *self, void *aux)
|
||||
sbc->sbus_pri = sa->sa_pri;
|
||||
sbc->sbus_mdvec = mdvec;
|
||||
|
||||
if (sa->sa_npromvaddrs != 0) {
|
||||
sbc->sbus_reg = (bus_space_handle_t)sa->sa_promvaddrs[0];
|
||||
if (sa->sa_npromvaddrs) {
|
||||
sbus_promaddr_to_handle(sa->sa_bustag,
|
||||
sa->sa_promvaddrs[0], &sbc->sbus_reg);
|
||||
} else {
|
||||
if (sbus_bus_map(sa->sa_bustag,
|
||||
sa->sa_slot, sa->sa_offset, sa->sa_size,
|
||||
BUS_SPACE_MAP_LINEAR, &sbc->sbus_reg) != 0) {
|
||||
if (sbus_bus_map(sa->sa_bustag, sa->sa_slot, sa->sa_offset,
|
||||
sa->sa_size, 0, &sbc->sbus_reg) != 0) {
|
||||
printf("%s: cannot map registers\n", self->dv_xname);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user