summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2004-09-27 18:32:36 +0000
committerJason Wright <jason@cvs.openbsd.org>2004-09-27 18:32:36 +0000
commit02454f88b0b85996acba961741273c33823922e4 (patch)
treefe3d77af105111eb9abc129d593170e3e55492d8 /sys/arch/sparc64/dev
parentaf48c30b9ae79597b2b945d233acc77c86902eca (diff)
compute the board number of each fhc
Diffstat (limited to 'sys/arch/sparc64/dev')
-rw-r--r--sys/arch/sparc64/dev/fhc.c5
-rw-r--r--sys/arch/sparc64/dev/fhc_central.c6
-rw-r--r--sys/arch/sparc64/dev/fhc_mainbus.c4
-rw-r--r--sys/arch/sparc64/dev/fhcvar.h3
4 files changed, 13 insertions, 5 deletions
diff --git a/sys/arch/sparc64/dev/fhc.c b/sys/arch/sparc64/dev/fhc.c
index 0df9cfade7e..c83a7eccc50 100644
--- a/sys/arch/sparc64/dev/fhc.c
+++ b/sys/arch/sparc64/dev/fhc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fhc.c,v 1.6 2004/09/27 18:15:32 jason Exp $ */
+/* $OpenBSD: fhc.c,v 1.7 2004/09/27 18:32:35 jason Exp $ */
/*
* Copyright (c) 2004 Jason L. Wright (jason@thought.net)
@@ -64,7 +64,8 @@ fhc_attach(struct fhc_softc *sc)
int node0, node;
u_int32_t ctrl;
- printf(": %s\n", getpropstring(sc->sc_node, "board-model"));
+ printf(" board %d: %s\n", sc->sc_board,
+ getpropstring(sc->sc_node, "board-model"));
sc->sc_cbt = fhc_alloc_bus_tag(sc);
diff --git a/sys/arch/sparc64/dev/fhc_central.c b/sys/arch/sparc64/dev/fhc_central.c
index 8b3dc347dbf..95d5f78fe50 100644
--- a/sys/arch/sparc64/dev/fhc_central.c
+++ b/sys/arch/sparc64/dev/fhc_central.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fhc_central.c,v 1.4 2004/09/27 18:15:32 jason Exp $ */
+/* $OpenBSD: fhc_central.c,v 1.5 2004/09/27 18:32:35 jason Exp $ */
/*
* Copyright (c) 2004 Jason L. Wright (jason@thought.net).
@@ -68,6 +68,7 @@ fhc_central_attach(parent, self, aux)
{
struct fhc_softc *sc = (struct fhc_softc *)self;
struct central_attach_args *ca = aux;
+ u_int32_t board;
sc->sc_node = ca->ca_node;
sc->sc_bt = ca->ca_bustag;
@@ -115,6 +116,9 @@ fhc_central_attach(parent, self, aux)
return;
}
+ board = bus_space_read_4(sc->sc_bt, sc->sc_preg, FHC_P_BSR);
+ sc->sc_board = ((board >> 16) & 0x1) | ((board >> 12) & 0xe);
+
fhc_attach(sc);
return;
}
diff --git a/sys/arch/sparc64/dev/fhc_mainbus.c b/sys/arch/sparc64/dev/fhc_mainbus.c
index dcc01f599cd..1d5b55ea0ea 100644
--- a/sys/arch/sparc64/dev/fhc_mainbus.c
+++ b/sys/arch/sparc64/dev/fhc_mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fhc_mainbus.c,v 1.3 2004/09/27 18:15:32 jason Exp $ */
+/* $OpenBSD: fhc_mainbus.c,v 1.4 2004/09/27 18:32:35 jason Exp $ */
/*
* Copyright (c) 2004 Jason L. Wright (jason@thought.net).
@@ -107,6 +107,8 @@ fhc_mainbus_attach(parent, self, aux)
return;
}
+ sc->sc_board = getpropint(sc->sc_node, "board#", -1);
+
fhc_attach(sc);
return;
diff --git a/sys/arch/sparc64/dev/fhcvar.h b/sys/arch/sparc64/dev/fhcvar.h
index 91298db9558..015ac3270f7 100644
--- a/sys/arch/sparc64/dev/fhcvar.h
+++ b/sys/arch/sparc64/dev/fhcvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: fhcvar.h,v 1.3 2004/09/27 18:15:32 jason Exp $ */
+/* $OpenBSD: fhcvar.h,v 1.4 2004/09/27 18:32:35 jason Exp $ */
/*
* Copyright (c) 2004 Jason L. Wright (jason@thought.net).
@@ -44,6 +44,7 @@ struct fhc_softc {
struct device sc_dv;
int sc_node;
int sc_is_central; /* parent is central */
+ int sc_board;
bus_space_tag_t sc_bt;
bus_space_tag_t sc_cbt;
int sc_nrange;