diff options
-rw-r--r-- | sys/arch/sgi/include/autoconf.h | 3 | ||||
-rw-r--r-- | sys/arch/sgi/pci/ioc.c | 34 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/autoconf.c | 3 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/ip27_machdep.c | 6 |
4 files changed, 37 insertions, 9 deletions
diff --git a/sys/arch/sgi/include/autoconf.h b/sys/arch/sgi/include/autoconf.h index 296da5be1a8..9a0bc7c7d5b 100644 --- a/sys/arch/sgi/include/autoconf.h +++ b/sys/arch/sgi/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.24 2009/11/07 14:49:01 miod Exp $ */ +/* $OpenBSD: autoconf.h,v 1.25 2009/11/07 22:48:36 miod Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -89,5 +89,6 @@ void ip32_setup(void); extern char osloadpartition[256]; extern int16_t masternasid; +extern int16_t currentnasid; #endif /* _MACHINE_AUTOCONF_H_ */ diff --git a/sys/arch/sgi/pci/ioc.c b/sys/arch/sgi/pci/ioc.c index 52e1fe1a9ff..663f16986b2 100644 --- a/sys/arch/sgi/pci/ioc.c +++ b/sys/arch/sgi/pci/ioc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioc.c,v 1.25 2009/11/07 14:49:01 miod Exp $ */ +/* $OpenBSD: ioc.c,v 1.26 2009/11/07 22:48:37 miod Exp $ */ /* * Copyright (c) 2008 Joel Sing. @@ -31,6 +31,8 @@ #include <machine/autoconf.h> #include <machine/bus.h> +#include <sgi/sgi/ip27.h> + #include <dev/pci/pcireg.h> #include <dev/pci/pcivar.h> #include <dev/pci/pcidevs.h> @@ -104,6 +106,15 @@ int iocow_read_byte(void *); int iocow_triplet(void *, int); int iocow_pulse(struct ioc_softc *, int, int); +/* + * A mask of nodes on which an ioc driver has attached. + * We use this to prevent attaching a pci IOC3 card which NIC has failed, + * as the onboard IOC3. + * + * XXX This obviously will not work in N mode... + */ +static uint64_t ioc_nodemask = 0; + int ioc_match(struct device *parent, void *match, void *aux) { @@ -244,14 +255,29 @@ ioc_attach(struct device *parent, struct device *self, void *aux) /* * If no owserial device has been found, then it is * very likely that we are the on-board IOC3 found - * on IP27 and IP35 systems. + * on IP27 and IP35 systems, unless we have already + * found an on-board IOC3 on this node. */ - if (sys_config.system_type == SGI_IP27 || - sys_config.system_type == SGI_IP35) { + if ((sys_config.system_type == SGI_IP27 || + sys_config.system_type == SGI_IP35) && + !ISSET(ioc_nodemask, 1UL << currentnasid)) { + SET(currentnasid, 1UL << currentnasid); + device_mask = (1 << IOCDEV_SERIAL_A) | (1 << IOCDEV_SERIAL_B) | (1 << IOCDEV_LPT) | (1 << IOCDEV_KBC) | (1 << IOCDEV_RTC) | (1 << IOCDEV_EF); + /* + * Origin 300 onboard IOC3 do not have PS/2 ports; + * since they can only be connected to other 300 or + * 350 bricks (the latter using IOC4 devices), + * it is safe to do this regardless of the current + * nasid. + */ + if (sys_config.system_type == SGI_IP35 && + sys_config.system_subtype == IP35_O300) + device_mask &= ~(1 << IOCDEV_KBC); + rtcbase = IOC3_BYTEBUS_0; dual_irq = 1; /* diff --git a/sys/arch/sgi/sgi/autoconf.c b/sys/arch/sgi/sgi/autoconf.c index 15c6c18a040..d031893f350 100644 --- a/sys/arch/sgi/sgi/autoconf.c +++ b/sys/arch/sgi/sgi/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.27 2009/11/07 18:56:55 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.28 2009/11/07 22:48:37 miod Exp $ */ /* * Copyright (c) 2009 Miodrag Vallat. * @@ -119,6 +119,7 @@ void bootpath_next(void); */ int cold = 1; /* if 1, still working on cold-start */ struct device *bootdv = NULL; +int16_t currentnasid = 0; char osloadpartition[256]; diff --git a/sys/arch/sgi/sgi/ip27_machdep.c b/sys/arch/sgi/sgi/ip27_machdep.c index db46cd5b749..fc964679ade 100644 --- a/sys/arch/sgi/sgi/ip27_machdep.c +++ b/sys/arch/sgi/sgi/ip27_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip27_machdep.c,v 1.33 2009/11/07 14:49:01 miod Exp $ */ +/* $OpenBSD: ip27_machdep.c,v 1.34 2009/11/07 22:48:37 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -318,7 +318,7 @@ ip27_autoconf(struct device *parent) */ bzero(&maa, sizeof maa); - maa.maa_nasid = masternasid; + maa.maa_nasid = currentnasid = masternasid; maa.maa_name = "cpu"; config_found(parent, &maa, ip27_print); maa.maa_name = "clock"; @@ -345,7 +345,7 @@ ip27_attach_node(struct device *parent, int16_t nasid) bzero(&maa, sizeof maa); maa.maa_name = "xbow"; - maa.maa_nasid = nasid; + maa.maa_nasid = currentnasid = nasid; config_found(parent, &maa, ip27_print); } |