summaryrefslogtreecommitdiff
path: root/sys/arch/sgi/pci
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-03-07 13:44:27 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-03-07 13:44:27 +0000
commit315653bcec7294e8114e6a431f5893e90ecd7baa (patch)
treec943a0ef38b5777b2639a73e7bf6d45e3da78e9f /sys/arch/sgi/pci
parentc566d0d296eaebdac5f59e403dfb86f3bffe046b (diff)
Allow iockbc(4) and odysseey(4) to act as console devices and attach early;
this gives us working glass console on Fuel, as well as on Octane systems with Odyssey graphics. Joint work with jsing@
Diffstat (limited to 'sys/arch/sgi/pci')
-rw-r--r--sys/arch/sgi/pci/ioc.c7
-rw-r--r--sys/arch/sgi/pci/iocvar.h6
-rw-r--r--sys/arch/sgi/pci/iof.c7
-rw-r--r--sys/arch/sgi/pci/iofvar.h6
4 files changed, 22 insertions, 4 deletions
diff --git a/sys/arch/sgi/pci/ioc.c b/sys/arch/sgi/pci/ioc.c
index 24f64f2adaa..e1aa1afe2fb 100644
--- a/sys/arch/sgi/pci/ioc.c
+++ b/sys/arch/sgi/pci/ioc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioc.c,v 1.31 2009/11/11 15:56:42 miod Exp $ */
+/* $OpenBSD: ioc.c,v 1.32 2010/03/07 13:44:26 miod Exp $ */
/*
* Copyright (c) 2008 Joel Sing.
@@ -66,6 +66,7 @@ struct ioc_intr {
struct ioc_softc {
struct device sc_dev;
+ int sc_npci;
struct mips_bus_space *sc_mem_bus_space;
@@ -170,6 +171,7 @@ ioc_attach(struct device *parent, struct device *self, void *aux)
}
sc->sc_pc = pa->pa_pc;
+ sc->sc_npci = pa->pa_device;
sc->sc_dmat = pa->pa_dmat;
/*
@@ -443,6 +445,9 @@ ioc_attach_child(struct ioc_softc *sc, const char *name, bus_addr_t base,
memset(&iaa, 0, sizeof iaa);
iaa.iaa_name = name;
+ iaa.iaa_nasid = pci_get_nasid(sc->sc_pc);
+ iaa.iaa_widget = pci_get_widget(sc->sc_pc);
+ iaa.iaa_npci = sc->sc_npci;
iaa.iaa_memt = sc->sc_memt;
iaa.iaa_memh = sc->sc_memh;
iaa.iaa_dmat = sc->sc_dmat;
diff --git a/sys/arch/sgi/pci/iocvar.h b/sys/arch/sgi/pci/iocvar.h
index 172e533e54e..6071e2bd24f 100644
--- a/sys/arch/sgi/pci/iocvar.h
+++ b/sys/arch/sgi/pci/iocvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iocvar.h,v 1.4 2009/11/11 15:56:42 miod Exp $ */
+/* $OpenBSD: iocvar.h,v 1.5 2010/03/07 13:44:26 miod Exp $ */
/*
* Copyright (c) 2008 Miodrag Vallat.
@@ -19,6 +19,10 @@
struct ioc_attach_args {
const char *iaa_name;
+ int16_t iaa_nasid;
+ int iaa_widget;
+ int iaa_npci;
+
bus_space_tag_t iaa_memt;
bus_space_handle_t iaa_memh;
bus_dma_tag_t iaa_dmat;
diff --git a/sys/arch/sgi/pci/iof.c b/sys/arch/sgi/pci/iof.c
index 7d6a6631f7a..bf95cddb66d 100644
--- a/sys/arch/sgi/pci/iof.c
+++ b/sys/arch/sgi/pci/iof.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iof.c,v 1.4 2009/10/13 21:17:13 miod Exp $ */
+/* $OpenBSD: iof.c,v 1.5 2010/03/07 13:44:26 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -56,6 +56,7 @@ struct iof_intr {
struct iof_softc {
struct device sc_dev;
+ int sc_npci;
struct mips_bus_space *sc_mem_bus_space;
@@ -126,6 +127,7 @@ iof_attach(struct device *parent, struct device *self, void *aux)
}
sc->sc_pc = pa->pa_pc;
+ sc->sc_npci = pa->pa_device;
sc->sc_dmat = pa->pa_dmat;
/*
@@ -210,6 +212,9 @@ iof_attach_child(struct device *iof, const char *name, bus_addr_t base,
struct iof_attach_args iaa;
iaa.iaa_name = name;
+ iaa.iaa_nasid = pci_get_nasid(sc->sc_pc);
+ iaa.iaa_widget = pci_get_widget(sc->sc_pc);
+ iaa.iaa_npci = sc->sc_npci;
iaa.iaa_memt = sc->sc_memt;
iaa.iaa_memh = sc->sc_memh;
iaa.iaa_dmat = sc->sc_dmat;
diff --git a/sys/arch/sgi/pci/iofvar.h b/sys/arch/sgi/pci/iofvar.h
index 5e8d7a09c93..97a3d00598f 100644
--- a/sys/arch/sgi/pci/iofvar.h
+++ b/sys/arch/sgi/pci/iofvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: iofvar.h,v 1.2 2009/10/13 21:17:13 miod Exp $ */
+/* $OpenBSD: iofvar.h,v 1.3 2010/03/07 13:44:26 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -19,6 +19,10 @@
struct iof_attach_args {
const char *iaa_name;
+ int16_t iaa_nasid;
+ int iaa_widget;
+ int iaa_npci;
+
bus_space_tag_t iaa_memt;
bus_space_handle_t iaa_memh;
bus_dma_tag_t iaa_dmat;