summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>2004-09-22 08:01:59 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>2004-09-22 08:01:59 +0000
commit3c51611a09c0a70d86b9f5cdaf2ea30f99d472d1 (patch)
treedc2ed6478a75acec0b5442e1e969bc696ee4b7bd /sys
parent6a3e60c8a63870fa516bda32e6c0b95b85222675 (diff)
On single SCSI slot O2's the first disk is numbered 2 (the slot number)
by the ARCS Bios. To make the kernel pick up the right sd number offset the slots if the CPU is a R10K or larger. R10K's and up are those with single disk slots. A more correct solution would be to dig down and check the SCSI ID's, but right now this solutions works OK.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sgi/sgi/autoconf.c8
-rw-r--r--sys/arch/sgi/sgi/machdep.c18
2 files changed, 18 insertions, 8 deletions
diff --git a/sys/arch/sgi/sgi/autoconf.c b/sys/arch/sgi/sgi/autoconf.c
index 0ed9c6a1b0c..3e3aef9e4c8 100644
--- a/sys/arch/sgi/sgi/autoconf.c
+++ b/sys/arch/sgi/sgi/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.5 2004/08/26 13:30:25 pefo Exp $ */
+/* $OpenBSD: autoconf.c,v 1.6 2004/09/22 08:01:58 pefo Exp $ */
/*
* Copyright (c) 1996 Per Fogelstrom
* Copyright (c) 1995 Theo de Raadt
@@ -68,7 +68,7 @@ static int findblkmajor(struct device *);
static struct device * getdisk(char *, int, int, dev_t *);
struct device *getdevunit(char *, int);
struct devmap *boot_findtype(char *);
-void makebootdev(const char *cp);
+void makebootdev(const char *, int);
const char *boot_get_path_component(const char *, char *, int *);
/* Struct translating from ARCS to bsd. */
@@ -479,7 +479,7 @@ boot_findtype(char *s)
* Boot names look like: 'scsi()disk(n)rdisk()partition(0)/bsd'
*/
void
-makebootdev(const char *bp)
+makebootdev(const char *bp, int offs)
{
char namebuf[256];
const char *cp, *ncp, *ecp, *devname;
@@ -497,7 +497,7 @@ makebootdev(const char *bp)
devname = dp->dev;
break;
case DEVMAP_UNIT:
- unit = i - 1;
+ unit = i - 1 + offs;
break;
case DEVMAP_PART:
partition = i;
diff --git a/sys/arch/sgi/sgi/machdep.c b/sys/arch/sgi/sgi/machdep.c
index cb1a15c8d69..7a014492385 100644
--- a/sys/arch/sgi/sgi/machdep.c
+++ b/sys/arch/sgi/sgi/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.14 2004/09/21 08:55:20 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.15 2004/09/22 08:01:58 pefo Exp $ */
/*
* Copyright (c) 2003-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -84,7 +84,7 @@
extern struct consdev *cn_tab;
extern char kernel_text[];
-extern void makebootdev(const char *);
+extern void makebootdev(const char *, int);
extern void stacktrace(void);
/* the following is used externally (sysctl_hw) */
@@ -123,6 +123,7 @@ int ncpu = 1; /* At least one cpu in the system */
struct user *proc0paddr;
struct user *curprocpaddr;
int console_ok; /* set when console initialized */
+int bootdriveoffs = 0;
int32_t *environment;
struct sys_rec sys_config;
@@ -220,7 +221,16 @@ mips_init(int argc, int32_t *argv)
sys_config.pci_mem[0].bus_base_dma = 0x00000000;/*XXX*/
sys_config.pci_mem[0].bus_reverse = my_endian;
sys_config.cpu[0].tlbwired = 2;
- sys_config.cpu[0].clock = 200000000; /* Reasonable default */
+ sys_config.cpu[0].clock = 180000000; /* Reasonable default */
+
+ /* R1xK O2's are one disk slot machines. Offset slotno */
+ switch ((cp0_get_prid() >> 8) & 0xff) {
+ case MIPS_R10000:
+ case MIPS_R12000:
+ case MIPS_R14000:
+ bootdriveoffs = -1;
+ break;
+ }
} else {
bios_putstring("Unsupported system!!!\n");
while(1);
@@ -279,7 +289,7 @@ mips_init(int argc, int32_t *argv)
cp = Bios_GetEnvironmentVariable("OSLoadPartition");
if (cp == NULL)
cp = "unknown";
- makebootdev(cp);
+ makebootdev(cp, bootdriveoffs);
/*
* Look at arguments passed to us and compute boothowto.