diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2012-04-15 20:38:11 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2012-04-15 20:38:11 +0000 |
commit | 56335d3b7641d2a700e95c1fb1e256c7af867e35 (patch) | |
tree | e50619ae9762f1812ae1b25b957247b8db7d684d /sys | |
parent | c0f5c12e6d3270377008c0cc39c9bbbe3c85eed4 (diff) |
Tell Indy and Challenge S apart.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mips64/include/arcbios.h | 7 | ||||
-rw-r--r-- | sys/arch/sgi/hpc/hpc.c | 8 | ||||
-rw-r--r-- | sys/arch/sgi/localbus/imc.c | 12 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/ip22.h | 9 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/ip22_machdep.c | 46 |
5 files changed, 58 insertions, 24 deletions
diff --git a/sys/arch/mips64/include/arcbios.h b/sys/arch/mips64/include/arcbios.h index b4d53126202..ce38370f81f 100644 --- a/sys/arch/mips64/include/arcbios.h +++ b/sys/arch/mips64/include/arcbios.h @@ -1,4 +1,4 @@ -/* $OpenBSD: arcbios.h,v 1.20 2012/04/06 19:00:49 miod Exp $ */ +/* $OpenBSD: arcbios.h,v 1.21 2012/04/15 20:38:08 miod Exp $ */ /*- * Copyright (c) 1996 M. Warner Losh. All rights reserved. * @@ -40,10 +40,15 @@ typedef enum arc_config_class arc_SystemClass, arc_ProcessorClass, arc_CacheClass, +#ifdef __sgi__ + arc_MemoryClass, +#endif arc_AdapterClass, arc_ControllerClass, arc_PeripheralClass, +#ifdef __arc__ arc_MemoryClass +#endif } arc_config_class_t; typedef enum arc_config_type diff --git a/sys/arch/sgi/hpc/hpc.c b/sys/arch/sgi/hpc/hpc.c index 6014fa33ce8..9af8b30cc9c 100644 --- a/sys/arch/sgi/hpc/hpc.c +++ b/sys/arch/sgi/hpc/hpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpc.c,v 1.5 2012/04/08 22:08:25 miod Exp $ */ +/* $OpenBSD: hpc.c,v 1.6 2012/04/15 20:38:10 miod Exp $ */ /* $NetBSD: hpc.c,v 1.66 2011/07/01 18:53:46 dyoung Exp $ */ /* $NetBSD: ioc.c,v 1.9 2011/07/01 18:53:47 dyoung Exp $ */ @@ -475,8 +475,8 @@ hpc_attach(struct device *parent, struct device *self, void *aux) */ isonboard = (sc->sc_base == HPC_BASE_ADDRESS_0); isioplus = (sc->sc_base == HPC_BASE_ADDRESS_1 && hpctype == 3 && - sysmask == HPCDEV_IP24); - + (sysmask & HPCDEV_IP24) != 0); + printf(": SGI HPC%d%s (%s)\n", (hpctype == 3) ? 3 : 1, (hpctype == 15) ? ".5" : "", (isonboard) ? "onboard" : (isioplus) ? "IOPLUS mezzanine" : "GIO slot"); @@ -501,7 +501,7 @@ hpc_attach(struct device *parent, struct device *self, void *aux) /* XXX: the firmware should have taken care of this already */ #if 0 - if (sys_config.system_subtype == IP22_INDY) { + if (sys_config.system_subtype != IP22_INDIGO) { bus_space_write_4(sc->sc_ct, sc->sc_ch, IOC_BASE + IOC_GCSEL, 0xff); bus_space_write_4(sc->sc_ct, sc->sc_ch, diff --git a/sys/arch/sgi/localbus/imc.c b/sys/arch/sgi/localbus/imc.c index 2003029c407..65a518a8fa5 100644 --- a/sys/arch/sgi/localbus/imc.c +++ b/sys/arch/sgi/localbus/imc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: imc.c,v 1.3 2012/04/09 16:55:22 miod Exp $ */ +/* $OpenBSD: imc.c,v 1.4 2012/04/15 20:38:10 miod Exp $ */ /* $NetBSD: imc.c,v 1.32 2011/07/01 18:53:46 dyoung Exp $ */ /* @@ -571,7 +571,7 @@ imc_attach(struct device *parent, struct device *self, void *aux) */ switch (sys_config.system_type) { case SGI_IP22: - if (sys_config.system_subtype != IP22_INDY) + if (sys_config.system_subtype == IP22_INDIGO2) break; /* FALLTHROUGH */ case SGI_IP20: @@ -621,11 +621,12 @@ imc_attach(struct device *parent, struct device *self, void *aux) switch (sys_config.system_subtype) { default: case IP22_INDY: + case IP22_CHALLS: /* XXX is MST mutually exclusive? */ reg |= IMC_GIO64ARB_EXP0RT | IMC_GIO64ARB_EXP1RT; reg |= IMC_GIO64ARB_EXP0MST | IMC_GIO64ARB_EXP1MST; - /* EISA can bus-master, is 64-bit */ + /* EISA (VINO, really) can bus-master, is 64-bit */ reg |= IMC_GIO64ARB_EISAMST | IMC_GIO64ARB_EISA64; break; @@ -636,6 +637,11 @@ imc_attach(struct device *parent, struct device *self, void *aux) */ reg |= IMC_GIO64ARB_HPCEXP64 | IMC_GIO64ARB_EXP0PIPE; + /* + * The EISA bus is the real thing, and is a 32-bit bus. + */ + reg &= ~IMC_GIO64ARB_EISA64; + if (rev < 2) { /* EXP0 realtime, EXP1 can master */ reg |= IMC_GIO64ARB_EXP0RT | diff --git a/sys/arch/sgi/sgi/ip22.h b/sys/arch/sgi/sgi/ip22.h index 20c6c270a9f..abd8f1064d0 100644 --- a/sys/arch/sgi/sgi/ip22.h +++ b/sys/arch/sgi/sgi/ip22.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip22.h,v 1.3 2012/04/06 19:00:49 miod Exp $ */ +/* $OpenBSD: ip22.h,v 1.4 2012/04/15 20:38:10 miod Exp $ */ /* * Copyright (c) 2012 Miodrag Vallat. @@ -20,10 +20,11 @@ * IP20/IP22/IP24 definitions */ -/* IP22 system types */ +/* IP22/IP24 system types */ -#define IP22_INDY 0 /* Indy, Challenge S */ -#define IP22_INDIGO2 1 /* Indigo 2 */ +#define IP22_INDY 0 /* IP24 Indy */ +#define IP22_CHALLS 1 /* IP24 Challenge S */ +#define IP22_INDIGO2 2 /* IP22 Indigo 2, Challenge M */ /* Interrupt handling priority */ diff --git a/sys/arch/sgi/sgi/ip22_machdep.c b/sys/arch/sgi/sgi/ip22_machdep.c index ffffcc216ac..2d357b9e1bf 100644 --- a/sys/arch/sgi/sgi/ip22_machdep.c +++ b/sys/arch/sgi/sgi/ip22_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip22_machdep.c,v 1.3 2012/04/06 19:00:49 miod Exp $ */ +/* $OpenBSD: ip22_machdep.c,v 1.4 2012/04/15 20:38:10 miod Exp $ */ /* * Copyright (c) 2012 Miodrag Vallat. @@ -48,10 +48,14 @@ int ip22_arcbios_walk_component(arc_config_t *); void ip22_memory_setup(void); /* - * Walk the ARCBios component tree to get L2 cache information. - * This is the only way we can get the L2 cache size. + * Walk the ARCBios component tree to get hardware information we can't + * obtain by other means. */ +static int ip22_arcwalk_results = 0; +#define IP22_HAS_L2 0x01 +#define IP22_HAS_AUDIO 0x02 + int ip22_arcbios_walk_component(arc_config_t *cf) { @@ -72,9 +76,18 @@ ip22_arcbios_walk_component(arc_config_t *cf) ci->ci_l2size = (1 << 12) << (cf->key & 0x0000ffff); /* L2 line size */ ci->ci_cacheconfiguration = 1 << ((cf->key >> 16) & 0xff); - return 0; /* abort walk */ + + ip22_arcwalk_results |= IP22_HAS_L2; + } + + if (cf->class == arc_ControllerClass && + cf->type == arc_AudioController) { + ip22_arcwalk_results |= IP22_HAS_AUDIO; } + if (ip22_arcwalk_results == (IP22_HAS_L2 | IP22_HAS_AUDIO)) + return 0; /* abort walk */ + /* * It is safe to assume we have a 32-bit ARCBios, until * IP26 and IP28 support is added, hence unconditional @@ -224,11 +237,20 @@ ip22_setup() bootcpu_hwinfo.type = (bootcpu_hwinfo.c0prid >> 8) & 0xff; /* + * Scan ARCBios component list for useful information (L2 cache + * configuration, audio device availability) + */ + ip22_arcbios_walk(); + + /* * Figure out what critter we are running on. */ switch (sys_config.system_type) { case SGI_IP20: - hw_prod = "Indigo"; + if (ip22_arcwalk_results & IP22_HAS_AUDIO) + hw_prod = "Indigo"; + else + hw_prod = "VME Indigo"; break; case SGI_IP22: sysid = (volatile uint32_t *) @@ -238,8 +260,13 @@ ip22_setup() sys_config.system_subtype = IP22_INDIGO2; hw_prod = "Indigo2"; } else { - sys_config.system_subtype = IP22_INDY; - hw_prod = "Indy"; + if (ip22_arcwalk_results & IP22_HAS_AUDIO) { + sys_config.system_subtype = IP22_INDY; + hw_prod = "Indy"; + } else { + sys_config.system_subtype = IP22_CHALLS; + hw_prod = "Challenge S"; + } } break; case SGI_IP26: @@ -297,11 +324,6 @@ ip22_setup() } /* - * Scan ARCBios component list for L2 cache information. - */ - ip22_arcbios_walk(); - - /* * Get ARCBios' current time. */ bios_year = Bios_GetTime()->Year; |