summaryrefslogtreecommitdiff
path: root/sys/dev/sbus
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-08-20 19:34:11 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-08-20 19:34:11 +0000
commitf24eeeec3eb0478e82f8bd8037b7a7d20f12d8a2 (patch)
tree1d6b17d5fbdcc10a550f04f1c492b121919cd8e7 /sys/dev/sbus
parent6b089005b7c77c07e099ba5c1fe6770b89c6a33f (diff)
modifications to support OpenBSD/sparc style bootpath determination
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r--sys/dev/sbus/dma_sbus.c11
-rw-r--r--sys/dev/sbus/if_le.c7
-rw-r--r--sys/dev/sbus/if_le_ledma.c14
-rw-r--r--sys/dev/sbus/sbusvar.h3
4 files changed, 28 insertions, 7 deletions
diff --git a/sys/dev/sbus/dma_sbus.c b/sys/dev/sbus/dma_sbus.c
index 2b435244a42..8e018a67e46 100644
--- a/sys/dev/sbus/dma_sbus.c
+++ b/sys/dev/sbus/dma_sbus.c
@@ -156,6 +156,7 @@ dmaattach_sbus(parent, self, aux)
struct sbus_attach_args *sa = aux;
struct dma_softc *dsc = (void *)self;
struct lsi64854_softc *sc = &dsc->sc_lsi64854;
+ struct bootpath *bp;
bus_space_handle_t bh;
bus_space_tag_t sbt;
int sbusburst, burst;
@@ -230,11 +231,21 @@ dmaattach_sbus(parent, self, aux)
sbt = dma_alloc_bustag(dsc);
lsi64854_attach(sc);
+ bp = sa->sa_bp;
+ if (bp != NULL &&
+ (strcmp(bp->name, "espdma") == 0 ||
+ strcmp(bp->name, "ledma") == 0 ||
+ strcmp(bp->name, "dma") == 0))
+ bp = bp + 1;
+ else
+ bp = NULL;
+
/* Attach children */
for (node = firstchild(sa->sa_node); node; node = nextsibling(node)) {
struct sbus_attach_args sa;
sbus_setup_attach_args((struct sbus_softc *)parent,
sbt, sc->sc_dmatag, node, &sa);
+ sa.sa_bp = bp;
(void) config_found(&sc->sc_dev, (void *)&sa, dmaprint_sbus);
sbus_destroy_attach_args(&sa);
}
diff --git a/sys/dev/sbus/if_le.c b/sys/dev/sbus/if_le.c
index b17ae99a308..87d9ad58837 100644
--- a/sys/dev/sbus/if_le.c
+++ b/sys/dev/sbus/if_le.c
@@ -163,6 +163,7 @@ leattach_sbus(parent, self, aux)
struct am7990_softc *sc = &lesc->sc_am7990;
bus_dma_tag_t dmatag;
struct sbusdev *sd;
+ struct bootpath *bp;
/* XXX the following declarations should be elsewhere */
extern void myetheraddr __P((u_char *));
@@ -180,6 +181,12 @@ leattach_sbus(parent, self, aux)
return;
}
+ bp = sa->sa_bp;
+ if (bp != NULL && strcmp(bp->name, le_cd.cd_name) == 0 &&
+ ((bp->val[0] == sa->sa_slot && bp->val[1] == sa->sa_offset) ||
+ (bp->val[0] == -1 && bp->val[1] == sc->sc_dev.dv_unit)))
+ bp->dev = &sc->sc_dev;
+
/*
* Look for an "unallocated" lebuffer and pair it with
* this `le' device on the assumption that we're on
diff --git a/sys/dev/sbus/if_le_ledma.c b/sys/dev/sbus/if_le_ledma.c
index db34c7577d1..f4ce3ff1f4f 100644
--- a/sys/dev/sbus/if_le_ledma.c
+++ b/sys/dev/sbus/if_le_ledma.c
@@ -57,6 +57,7 @@
#include <machine/bus.h>
#include <machine/intr.h>
+#include <machine/autoconf.h>
#include <dev/sbus/sbusvar.h>
@@ -102,12 +103,6 @@ struct cfattach le_ledma_ca = {
sizeof(struct le_softc), lematch_ledma, leattach_ledma
};
-#if 0
-struct cfdriver le_cd = {
- NULL, "le", DV_DULL
-};
-#endif
-
#if defined(_KERNEL_OPT)
#include "opt_ddb.h"
#endif
@@ -348,6 +343,7 @@ leattach_ledma(parent, self, aux)
bus_dma_tag_t dmatag = sa->sa_dmatag;
bus_dma_segment_t seg;
int rseg, error;
+ struct bootpath *bp;
/* XXX the following declarations should be elsewhere */
extern void myetheraddr __P((u_char *));
@@ -446,4 +442,10 @@ leattach_ledma(parent, self, aux)
/* now initialize DMA */
lehwreset(sc);
+
+ bp = sa->sa_bp;
+ if (bp != NULL && strcmp(bp->name, le_cd.cd_name) == 0 &&
+ ((bp->val[0] == sa->sa_slot && bp->val[1] == sa->sa_offset) ||
+ (bp->val[0] == -1 && bp->val[1] == sc->sc_dev.dv_unit)))
+ bp->dev = &sc->sc_dev;
}
diff --git a/sys/dev/sbus/sbusvar.h b/sys/dev/sbus/sbusvar.h
index 6b44bb89f06..73963093984 100644
--- a/sys/dev/sbus/sbusvar.h
+++ b/sys/dev/sbus/sbusvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbusvar.h,v 1.2 2001/08/19 05:36:11 jason Exp $ */
+/* $OpenBSD: sbusvar.h,v 1.3 2001/08/20 19:34:10 jason Exp $ */
/* $NetBSD: sbusvar.h,v 1.11 2000/11/01 06:18:45 eeh Exp $ */
/*-
@@ -97,6 +97,7 @@ struct sbus_attach_args {
int sa_npromvaddrs; /* Number of PROM VAs */
#define sa_promvaddr sa_promvaddrs[0]
int sa_frequency; /* SBus clockrate */
+ struct bootpath *sa_bp; /* boot path */
};
/* sbus_attach_internal() is also used from obio.c */