diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-04-19 12:52:34 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-04-19 12:52:34 +0000 |
commit | 697e8762a99f4297ea2f3a1994450ab96f4e0600 (patch) | |
tree | fdf4144848923499e0be34ce361099f5f55bad0d /sys/arch | |
parent | b6cb614f0405d63793d9df68b964b36dcd50bb45 (diff) |
Add heuristics to tell IP27 and IP35 apart, as they will need to be handled
differently at times.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mips64/include/arcbios.h | 6 | ||||
-rw-r--r-- | sys/arch/mips64/include/archtype.h | 6 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/arcbios.c | 49 | ||||
-rw-r--r-- | sys/arch/mips64/mips64/mainbus.c | 3 | ||||
-rw-r--r-- | sys/arch/sgi/sgi/machdep.c | 14 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/xbow.c | 16 | ||||
-rw-r--r-- | sys/arch/sgi/xbow/xbridge.c | 3 |
7 files changed, 71 insertions, 26 deletions
diff --git a/sys/arch/mips64/include/arcbios.h b/sys/arch/mips64/include/arcbios.h index 9bfc2357009..13af95cb95a 100644 --- a/sys/arch/mips64/include/arcbios.h +++ b/sys/arch/mips64/include/arcbios.h @@ -1,4 +1,4 @@ -/* $OpenBSD: arcbios.h,v 1.10 2008/02/18 19:48:35 miod Exp $ */ +/* $OpenBSD: arcbios.h,v 1.11 2009/04/19 12:52:31 miod Exp $ */ /*- * Copyright (c) 1996 M. Warner Losh. All rights reserved. * @@ -156,7 +156,7 @@ typedef enum arc_status */ #ifdef __arc__ typedef enum { - ExeceptionBlock, SystemParameterBlock, FreeMemory, + ExceptionBlock, SystemParameterBlock, FreeMemory, BadMemory, LoadedProgram, FirmwareTemporary, FirmwarePermanent, FreeContigous } MEMORYTYPE; @@ -164,7 +164,7 @@ typedef enum { #ifdef __sgi__ typedef enum { - ExeceptionBlock, SystemParameterBlock, FreeContigous, + ExceptionBlock, SystemParameterBlock, FreeContigous, FreeMemory, BadMemory, LoadedProgram, FirmwareTemporary, FirmwarePermanent, } MEMORYTYPE; diff --git a/sys/arch/mips64/include/archtype.h b/sys/arch/mips64/include/archtype.h index 92cfeead71b..6700ded45a8 100644 --- a/sys/arch/mips64/include/archtype.h +++ b/sys/arch/mips64/include/archtype.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archtype.h,v 1.5 2006/07/29 13:21:03 jasper Exp $ */ +/* $OpenBSD: archtype.h,v 1.6 2009/04/19 12:52:31 miod Exp $ */ /* * Copyright (c) 1997-2004 Opsycon AB, Sweden (www.opsycon.se) * @@ -48,9 +48,11 @@ #define SGI_POWER10 0x0016 /* POWER Challenge R10k */ #define SGI_POWERI 0x0017 /* POWER Indigo2 */ #define SGI_O2 0x0018 /* IP32 O2/Moosehead */ -#define SGI_O200 0x0019 /* IP27 Origin200/Speedo */ +#define SGI_O200 0x0019 /* IP27 Origin200, Onyx2/Speedo */ #define SGI_O2000 0x001a /* IP27 Origin2000/Lego */ #define SGI_OCTANE 0x001b /* IP30 Octane/Speedracer */ +#define SGI_O300 0x001c /* IP35 Origin300, Onyx3, Fuel */ +#define SGI_O3000 0x001d /* IP35 Origin3000, Tezro */ #define ALGOR_CLASS 0x0020 /* Algorithmics Class */ #define ALGOR_P4032 0x0021 /* ALGORITHMICS P-4032 */ diff --git a/sys/arch/mips64/mips64/arcbios.c b/sys/arch/mips64/mips64/arcbios.c index a8236e5cd61..92dd7eb7e33 100644 --- a/sys/arch/mips64/mips64/arcbios.c +++ b/sys/arch/mips64/mips64/arcbios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: arcbios.c,v 1.15 2008/12/03 15:43:17 sthen Exp $ */ +/* $OpenBSD: arcbios.c,v 1.16 2009/04/19 12:52:33 miod Exp $ */ /*- * Copyright (c) 1996 M. Warner Losh. All rights reserved. * Copyright (c) 1996-2004 Opsycon AB. All rights reserved. @@ -78,7 +78,8 @@ static struct systypes { { NULL, "SGI-IP26", SGI_POWERI }, { NULL, "SGI-IP27", SGI_O200 }, { NULL, "SGI-IP30", SGI_OCTANE }, - { NULL, "SGI-IP32", SGI_O2 } + { NULL, "SGI-IP32", SGI_O2 }, + { NULL, "SGI-IP35", SGI_O300 }, }; #define KNOWNSYSTEMS (sizeof(sys_types) / sizeof(struct systypes)) @@ -220,8 +221,10 @@ bios_configure_memory() uint64_t start, count; MEMORYTYPE type; vaddr_t seg_start, seg_end; - int i; + int seen_free; + int i; + seen_free = 0; descr = (arc_mem_t *)Bios_GetMemoryDescriptor(descr); while (descr != NULL) { if (bios_is_32bit) { @@ -245,24 +248,45 @@ bios_configure_memory() type = FreeMemory; #endif + if (type == FreeMemory && seen_free == 0) { + seen_free = 1; +#if defined(TGT_ORIGIN200) || defined(TGT_ORIGIN2000) + /* + * For the lack of a better way to tell + * IP27 apart from IP35, look at the + * start of the first chunk of free + * memory. On IP27, it starts under + * 0x20000 (which allows us to link + * kernels at 0xa800000000020000). + * On IP35, it starts at 0x40000. + */ + if (start >= 0x20) /* IP35 */ + sys_config.system_type = SGI_O300; +#endif + } + #if defined(TGT_ORIGIN200) || defined(TGT_ORIGIN2000) /* - * On Origin200 systems, data after the first + * On IP27 and IP35 systems, data after the first * FirmwarePermanent entry is not reliable * (entries conflict with each other), and memory * after 32MB is not listed anyway. * So, break from the loop as soon as a * FirmwarePermanent entry is found, after - * making it span the end of the first 32MB. + * making it span the end of the first 32MB + * (64MB on IP35). + * * The rest of the memory is gathered from the * node structures. This probably loses some of - * the first 32MB, but at least we're safe to + * the first few MB, but at least we're safe to * use ARCBios after going virtual. */ - if (sys_config.system_type == SGI_O200 && - type == FirmwarePermanent) { - count = (32 << (20 - 12)) - start; + if (type == FirmwarePermanent && + (sys_config.system_type == SGI_O200 || + sys_config.system_type == SGI_O300)) { descr = NULL; + count = ((sys_config.system_type == SGI_O200 ? + 32 : 64) << (20 - 12)) - start; } #endif } @@ -298,7 +322,7 @@ bios_configure_memory() } break; - case ExeceptionBlock: + case ExceptionBlock: case SystemParameterBlock: case FirmwareTemporary: case FirmwarePermanent: @@ -390,7 +414,10 @@ bios_get_system_type() } else { #if defined(TGT_ORIGIN200) || defined(TGT_ORIGIN2000) if (IP27_KLD_KLCONFIG(0)->magic == IP27_KLDIR_MAGIC) { - /* If we find a kldir assume IP27 */ + /* + * If we find a kldir assume IP27 for now. + * We'll decide whether this is IP27 or IP35 later. + */ return SGI_O200; } #endif diff --git a/sys/arch/mips64/mips64/mainbus.c b/sys/arch/mips64/mips64/mainbus.c index 2966533e719..b0f041ae6c5 100644 --- a/sys/arch/mips64/mips64/mainbus.c +++ b/sys/arch/mips64/mips64/mainbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mainbus.c,v 1.6 2008/04/07 22:36:26 miod Exp $ */ +/* $OpenBSD: mainbus.c,v 1.7 2009/04/19 12:52:33 miod Exp $ */ /* * Copyright (c) 2001-2003 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -86,6 +86,7 @@ mbattach(struct device *parent, struct device *self, void *aux) #endif #if defined(TGT_ORIGIN200) || defined(TGT_ORIGIN2000) || defined(TGT_OCTANE) case SGI_O200: + case SGI_O300: case SGI_OCTANE: nca.ca_name = "xbow"; config_found(self, &nca, mbprint); diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c index cdcf9d89c21..11d8a846a9b 100644 --- a/sys/arch/sgi/sgi/machdep.c +++ b/sys/arch/sgi/sgi/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.61 2008/12/30 05:33:17 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.62 2009/04/19 12:52:33 miod Exp $ */ /* * Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -245,6 +245,13 @@ mips_init(int argc, void *argv, caddr_t boot_esym) ip27_setup(); break; + + case SGI_O300: + bios_printf("Found SGI-IP35, setting up.\n"); + strlcpy(cpu_model, "SGI-Origin300 (IP35)", sizeof(cpu_model)); + ip27_setup(); + + break; #endif #if defined(TGT_OCTANE) @@ -444,9 +451,10 @@ mips_init(int argc, void *argv, caddr_t boot_esym) #if defined(TGT_ORIGIN200) || defined(TGT_ORIGIN2000) /* - * If an IP27 system set up Node 0's HUB. + * If an IP27 or IP35 system set up Node 0's HUB. */ - if (sys_config.system_type == SGI_O200) { + if (sys_config.system_type == SGI_O200 || + sys_config.system_type == SGI_O300) { IP27_LHUB_S(PI_REGION_PRESENT, 1); IP27_LHUB_S(PI_CALIAS_SIZE, PI_CALIAS_SIZE_0); } diff --git a/sys/arch/sgi/xbow/xbow.c b/sys/arch/sgi/xbow/xbow.c index f0c9b4a1270..63d6b16019d 100644 --- a/sys/arch/sgi/xbow/xbow.c +++ b/sys/arch/sgi/xbow/xbow.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbow.c,v 1.4 2009/04/15 18:45:41 miod Exp $ */ +/* $OpenBSD: xbow.c,v 1.5 2009/04/19 12:52:33 miod Exp $ */ /* * Copyright (c) 2008, 2009 Miodrag Vallat. @@ -189,6 +189,7 @@ xbowmatch(struct device *parent, void *match, void *aux) { switch (sys_config.system_type) { case SGI_O200: + case SGI_O300: case SGI_OCTANE: return (1); default: @@ -301,9 +302,17 @@ xbowattach(struct device *parent, struct device *self, void *aux) (wid & WIDGET_ID_REV_MASK) >> WIDGET_ID_REV_SHIFT); /* + * Default value for the interrupt register. If this system + * has a Heart widget, the Heart code will take care of changing it. + */ + xbow_intr_widget_register = (1UL << 47) /* XIO I/O space */ | + ((paddr_t)IP27_RHUB_ADDR(nasid, HUB_IR_CHANGE) - + IP27_NODE_IO_BASE(nasid)) /* HUB register offset */; + + /* * If widget 0 reports itself as a bridge, this is not a * complete XBow, but only a limited topology. This is - * found on the Origin 200 (but probably not on the Origin 2000). + * found on at least the Origin 200. */ if (vendor == XBOW_VENDOR_SGI4 && product == XBOW_PRODUCT_SGI4_BRIDGE) { /* @@ -311,9 +320,6 @@ xbowattach(struct device *parent, struct device *self, void *aux) * bridge). */ xbow_intr_widget = 0x0a; - xbow_intr_widget_register = (1UL << 47) /* XIO I/O space */ | - ((paddr_t)IP27_RHUB_ADDR(nasid, HUB_IR_CHANGE) - - IP27_NODE_IO_BASE(nasid)) /* HUB register offset */; xbow_attach_widget(self, nasid, WIDGET_MIN, xbowsubmatch_pass2, xbowprint_pass2); diff --git a/sys/arch/sgi/xbow/xbridge.c b/sys/arch/sgi/xbow/xbridge.c index 2714a02a754..b729bf2c464 100644 --- a/sys/arch/sgi/xbow/xbridge.c +++ b/sys/arch/sgi/xbow/xbridge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xbridge.c,v 1.10 2009/04/18 19:26:33 miod Exp $ */ +/* $OpenBSD: xbridge.c,v 1.11 2009/04/19 12:52:33 miod Exp $ */ /* * Copyright (c) 2008 Miodrag Vallat. @@ -618,6 +618,7 @@ xbridge_intr_establish(void *cookie, pci_intr_handle_t ih, int level, break; default: case SGI_O200: + case SGI_O300: int_addr = 0x20000 | intrsrc | (nasid << 8); break; } |