Skip to content

Commit fe6b929

Browse files
pkpk
authored andcommitted
Adjust for some small changes in lsi64854 back-end driver.
1 parent 73b946e commit fe6b929

File tree

5 files changed

+25
-33
lines changed

5 files changed

+25
-33
lines changed

sys/arch/sparc/dev/dma_obio.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dma_obio.c,v 1.1 1998/08/29 20:49:35 pk Exp $ */
1+
/* $NetBSD: dma_obio.c,v 1.2 1998/08/29 21:43:46 pk Exp $ */
22

33
/*-
44
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -89,19 +89,17 @@ dmaattach_obio(parent, self, aux)
8989
union obio_attach_args *uoba = aux;
9090
struct obio4_attach_args *oba = &uoba->uoba_oba4;
9191
struct lsi64854_softc *sc = (void *)self;
92-
bus_space_handle_t bh;
9392

9493
sc->sc_bustag = oba->oba_bustag;
9594
sc->sc_dmatag = oba->oba_dmatag;
9695

9796
if (obio_bus_map(oba->oba_bustag, oba->oba_paddr,
98-
0, sizeof(struct dma_regs),
97+
0, 4 * sizeof(u_int32_t),
9998
0, 0,
100-
&bh) != 0) {
99+
&sc->sc_regs) != 0) {
101100
printf("dmaattach_obio: cannot map registers\n");
102101
return;
103102
}
104-
sc->sc_regs = bh;
105103

106104
lsi64854_attach(sc);
107105
}

sys/arch/sparc/dev/esp_obio.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: esp_obio.c,v 1.1 1998/08/29 20:49:37 pk Exp $ */
1+
/* $NetBSD: esp_obio.c,v 1.2 1998/08/29 21:43:46 pk Exp $ */
22

33
/*-
44
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -149,7 +149,6 @@ espattach_obio(parent, self, aux)
149149
struct obio4_attach_args *oba = &uoba->uoba_oba4;
150150
struct esp_softc *esc = (void *)self;
151151
struct ncr53c9x_softc *sc = &esc->sc_ncr53c9x;
152-
bus_space_handle_t bh;
153152

154153
esc->sc_bustag = oba->oba_bustag;
155154
esc->sc_dmatag = oba->oba_dmatag;
@@ -167,7 +166,7 @@ espattach_obio(parent, self, aux)
167166
* and a back pointer to us, for DMA
168167
*/
169168
if (esc->sc_dma)
170-
esc->sc_dma->sc_ncr53c9x = sc;
169+
esc->sc_dma->sc_client = sc;
171170
else {
172171
printf("\n");
173172
panic("espattach: no dma found");
@@ -177,13 +176,11 @@ espattach_obio(parent, self, aux)
177176
0, /* offset */
178177
16, /* size (of ncr53c9xreg) */
179178
BUS_SPACE_MAP_LINEAR,
180-
0, &bh) != 0) {
179+
0, &esc->sc_reg) != 0) {
181180
printf("%s @ obio: cannot map registers\n", self->dv_xname);
182181
return;
183182
}
184183

185-
esc->sc_reg = bh;
186-
187184
if (oba->oba_bp != NULL && strcmp(oba->oba_bp->name, "esp") == 0 &&
188185
oba->oba_bp->val[0] == -1 &&
189186
oba->oba_bp->val[1] == sc->sc_dev.dv_unit)

sys/dev/sbus/dma_sbus.c

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: dma_sbus.c,v 1.1 1998/08/29 20:32:09 pk Exp $ */
1+
/* $NetBSD: dma_sbus.c,v 1.2 1998/08/29 21:43:00 pk Exp $ */
22

33
/*
44
* Copyright (c) 1994 Paul Kranenburg. All rights reserved.
@@ -133,7 +133,7 @@ dmaattach_sbus(parent, self, aux)
133133
else {
134134
if (sbus_bus_map(sa->sa_bustag, sa->sa_slot,
135135
sa->sa_offset,
136-
sizeof(struct dma_regs),
136+
sa->sa_size,
137137
0, 0, &bh) != 0) {
138138
printf("%s: cannot map registers\n", self->dv_xname);
139139
return;
@@ -164,11 +164,11 @@ dmaattach_sbus(parent, self, aux)
164164
char *cabletype;
165165
u_int32_t csr;
166166
/*
167-
* Check to see which cable type is currently active and set the
168-
* appropriate bit in the ledma csr so that it gets used. If we
169-
* didn't netboot, the PROM won't have the "cable-selection"
170-
* property; default to TP and then the user can change it via
171-
* a "media" option to ifconfig.
167+
* Check to see which cable type is currently active and
168+
* set the appropriate bit in the ledma csr so that it
169+
* gets used. If we didn't netboot, the PROM won't have
170+
* the "cable-selection" property; default to TP and then
171+
* the user can change it via a "media" option to ifconfig.
172172
*/
173173
cabletype = getpropstring(node, "cable-selection");
174174
csr = L64854_GCSR(sc);
@@ -181,10 +181,10 @@ dmaattach_sbus(parent, self, aux)
181181
csr |= E_TP_AUI;
182182
}
183183
L64854_SCSR(sc, csr);
184-
delay(20000); /* manual says we need 20ms delay */
185-
sc->sc_dmadev = DMA_ENET;
184+
delay(20000); /* manual says we need a 20ms delay */
185+
sc->sc_channel = L64854_CHANNEL_ENET;
186186
} else {
187-
sc->sc_dmadev = DMA_SCSI;
187+
sc->sc_channel = L64854_CHANNEL_SCSI;
188188
}
189189

190190

@@ -224,7 +224,8 @@ dmabus_intr_establish(t, level, flags, handler, arg)
224224
{
225225
struct lsi64854_softc *sc = t->cookie;
226226

227-
if (sc->sc_dmadev == DMA_ENET) { /* XXX - for now; do esp later */
227+
/* XXX - for now only le; do esp later */
228+
if (sc->sc_channel == L64854_CHANNEL_ENET) {
228229
sc->sc_intrchain = handler;
229230
sc->sc_intrchainarg = arg;
230231
handler = lsi64854_enet_intr;

sys/dev/sbus/esp_sbus.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: esp_sbus.c,v 1.1 1998/08/29 20:32:10 pk Exp $ */
1+
/* $NetBSD: esp_sbus.c,v 1.2 1998/08/29 21:43:00 pk Exp $ */
22

33
/*-
44
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -178,7 +178,7 @@ espattach_sbus(parent, self, aux)
178178
* and a back pointer to us, for DMA
179179
*/
180180
if (esc->sc_dma)
181-
esc->sc_dma->sc_ncr53c9x = sc;
181+
esc->sc_dma->sc_client = sc;
182182
else {
183183
printf("\n");
184184
panic("espattach: no dma found");
@@ -191,17 +191,15 @@ espattach_sbus(parent, self, aux)
191191
if (sa->sa_npromvaddrs)
192192
esc->sc_reg = (bus_space_handle_t)sa->sa_promvaddrs[0];
193193
else {
194-
bus_space_handle_t bh;
195194
if (sbus_bus_map(sa->sa_bustag, sa->sa_slot,
196195
sa->sa_offset,
197196
sa->sa_size,
198197
BUS_SPACE_MAP_LINEAR,
199-
0, &bh) != 0) {
198+
0, &esc->sc_reg) != 0) {
200199
printf("%s @ sbus: cannot map registers\n",
201200
self->dv_xname);
202201
return;
203202
}
204-
esc->sc_reg = bh;
205203
}
206204

207205
esc->sc_pri = sa->sa_pri;
@@ -233,7 +231,7 @@ espattach_dma(parent, self, aux)
233231
sc->sc_freq = getpropint(sa->sa_node, "clock-frequency", -1);
234232

235233
esc->sc_dma = (struct lsi64854_softc *)parent;
236-
esc->sc_dma->sc_ncr53c9x = sc;
234+
esc->sc_dma->sc_client = sc;
237235

238236
/*
239237
* Map my registers in, if they aren't already in virtual
@@ -242,18 +240,16 @@ espattach_dma(parent, self, aux)
242240
if (sa->sa_npromvaddrs)
243241
esc->sc_reg = (bus_space_handle_t)sa->sa_promvaddrs[0];
244242
else {
245-
bus_space_handle_t bh;
246243
if (bus_space_map2(sa->sa_bustag,
247244
sa->sa_slot,
248245
sa->sa_offset,
249246
sa->sa_size,
250247
BUS_SPACE_MAP_LINEAR,
251-
0, &bh) != 0) {
248+
0, &esc->sc_reg) != 0) {
252249
printf("%s @ dma: cannot map registers\n",
253250
self->dv_xname);
254251
return;
255252
}
256-
esc->sc_reg = bh;
257253
}
258254

259255
/* Establish interrupt handler */

sys/dev/sbus/if_le_ledma.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: if_le_ledma.c,v 1.1 1998/08/29 20:32:11 pk Exp $ */
1+
/* $NetBSD: if_le_ledma.c,v 1.2 1998/08/29 21:43:00 pk Exp $ */
22

33
/*-
44
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -359,7 +359,7 @@ leattach_ledma(parent, self, aux)
359359

360360
/* Establish link to `ledma' device */
361361
lesc->sc_dma = lsi;
362-
lesc->sc_dma->sc_le = lesc;
362+
lesc->sc_dma->sc_client = lesc;
363363

364364
/* Map device registers */
365365
if (bus_space_map2(sa->sa_bustag,

0 commit comments

Comments
 (0)