Module Name: src
Committed By: mhitch
Date: Mon Sep 14 02:46:29 UTC 2009
Modified Files:
src/sys/arch/alpha/alpha: dec_1000a.c dec_2100_a500.c dec_6600.c
dec_kn300.c
Log Message:
Add support for booting off a couple of common RAID adapters found on
several models of alpha systems: mlx [Mylex DAC060] and iop [I2O].
Addresses PR #25829.
To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/alpha/alpha/dec_1000a.c \
src/sys/arch/alpha/alpha/dec_6600.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/alpha/alpha/dec_2100_a500.c
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/alpha/alpha/dec_kn300.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/alpha/alpha/dec_1000a.c
diff -u src/sys/arch/alpha/alpha/dec_1000a.c:1.28 src/sys/arch/alpha/alpha/dec_1000a.c:1.29
--- src/sys/arch/alpha/alpha/dec_1000a.c:1.28 Sat Mar 14 15:35:59 2009
+++ src/sys/arch/alpha/alpha/dec_1000a.c Mon Sep 14 02:46:29 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_1000a.c,v 1.28 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_1000a.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_1000a.c,v 1.28 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_1000a.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -98,6 +98,9 @@
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
+#include <dev/ic/mlxio.h>
+#include <dev/ic/mlxvar.h>
+
#include "pckbd.h"
#ifndef CONSPEED
@@ -255,7 +258,8 @@
return;
if (!initted) {
- diskboot = (strcasecmp(b->protocol, "SCSI") == 0);
+ diskboot = (strcasecmp(b->protocol, "SCSI") == 0) ||
+ (strcasecmp(b->protocol, "RAID") == 0);
netboot = (strcasecmp(b->protocol, "BOOTP") == 0) ||
(strcasecmp(b->protocol, "MOP") == 0);
#if 0
@@ -335,4 +339,25 @@
#endif
found = 1;
}
+
+ if (device_is_a(dev, "ld") && device_is_a(parent, "mlx")) {
+ /*
+ * Argh! The attach arguments for ld devices is not
+ * consistent, so each supported raid controller requires
+ * different checks.
+ */
+ struct mlx_attach_args *mlxa = aux;
+
+ if (parent != ctrlrdev)
+ return;
+
+ if (b->unit != mlxa->mlxa_unit)
+ return;
+ /* we've found it! */
+ booted_device = dev;
+#if 0
+ printf("\nbooted_device = %s\n", dev->dv_xname);
+#endif
+ found = 1;
+ }
}
Index: src/sys/arch/alpha/alpha/dec_6600.c
diff -u src/sys/arch/alpha/alpha/dec_6600.c:1.28 src/sys/arch/alpha/alpha/dec_6600.c:1.29
--- src/sys/arch/alpha/alpha/dec_6600.c:1.28 Sat Mar 14 15:35:59 2009
+++ src/sys/arch/alpha/alpha/dec_6600.c Mon Sep 14 02:46:29 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_6600.c,v 1.28 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_6600.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $ */
/*
* Copyright (c) 1995, 1996, 1997 Carnegie-Mellon University.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_6600.c,v 1.28 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_6600.c,v 1.29 2009/09/14 02:46:29 mhitch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,6 +63,13 @@
#include <dev/scsipi/scsiconf.h>
#include <dev/ata/atavar.h>
+#include <dev/ic/mlxio.h>
+#include <dev/ic/mlxvar.h>
+
+#include <dev/i2o/i2o.h>
+#include <dev/i2o/iopio.h>
+#include <dev/i2o/iopvar.h>
+
#include "pckbd.h"
#ifndef CONSPEED
@@ -190,6 +197,8 @@
if (!initted) {
diskboot = (strcasecmp(b->protocol, "SCSI") == 0) ||
+ (strcasecmp(b->protocol, "RAID") == 0) ||
+ (strcasecmp(b->protocol, "I2O") == 0) ||
(strcasecmp(b->protocol, "IDE") == 0);
netboot = (strcasecmp(b->protocol, "BOOTP") == 0) ||
(strcasecmp(b->protocol, "MOP") == 0);
@@ -290,6 +299,44 @@
found = 1;
}
+ if (device_is_a(dev, "ld") && device_is_a(parent, "iop")) {
+ /*
+ * Argh! The attach arguments for ld devices is not
+ * consistent, so each supported raid controller requires
+ * different checks.
+ */
+ struct iop_attach_args *iopa = aux;
+
+ if (parent != ctrlrdev)
+ return;
+
+ if (b->unit != iopa->ia_tid)
+ return;
+ /* we've found it! */
+ booted_device = dev;
+ DR_VERBOSE(printf("\nbooted_device = %s\n", dev->dv_xname));
+ found = 1;
+ }
+
+ if (device_is_a(dev, "ld") && device_is_a(parent, "mlx")) {
+ /*
+ * Argh! The attach arguments for ld devices is not
+ * consistent, so each supported raid controller requires
+ * different checks.
+ */
+ struct mlx_attach_args *mlxa = aux;
+
+ if (parent != ctrlrdev)
+ return;
+
+ if (b->unit != mlxa->mlxa_unit)
+ return;
+ /* we've found it! */
+ booted_device = dev;
+ DR_VERBOSE(printf("\nbooted_device = %s\n", dev->dv_xname));
+ found = 1;
+ }
+
/*
* Support to boot from IDE drives.
*/
Index: src/sys/arch/alpha/alpha/dec_2100_a500.c
diff -u src/sys/arch/alpha/alpha/dec_2100_a500.c:1.18 src/sys/arch/alpha/alpha/dec_2100_a500.c:1.19
--- src/sys/arch/alpha/alpha/dec_2100_a500.c:1.18 Mon Apr 28 20:23:10 2008
+++ src/sys/arch/alpha/alpha/dec_2100_a500.c Mon Sep 14 02:46:29 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_2100_a500.c,v 1.18 2008/04/28 20:23:10 martin Exp $ */
+/* $NetBSD: dec_2100_a500.c,v 1.19 2009/09/14 02:46:29 mhitch Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_2100_a500.c,v 1.18 2008/04/28 20:23:10 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_2100_a500.c,v 1.19 2009/09/14 02:46:29 mhitch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -92,6 +92,9 @@
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
+#include <dev/ic/mlxio.h>
+#include <dev/ic/mlxvar.h>
+
#include "pckbd.h"
#ifndef CONSPEED
@@ -243,7 +246,8 @@
return;
if (!initted) {
- diskboot = (strcasecmp(b->protocol, "SCSI") == 0);
+ diskboot = (strcasecmp(b->protocol, "SCSI") == 0) ||
+ (strcasecmp(b->protocol, "RAID") == 0);
netboot = (strcasecmp(b->protocol, "BOOTP") == 0) ||
(strcasecmp(b->protocol, "MOP") == 0);
#if 0
@@ -323,6 +327,27 @@
#endif
found = 1;
}
+
+ if (device_is_a(dev, "ld") && device_is_a(parent, "mlx")) {
+ /*
+ * Argh! The attach arguments for ld devices is not
+ * consistent, so each supported raid controller requires
+ * different checks.
+ */
+ struct mlx_attach_args *mlxa = aux;
+
+ if (parent != ctrlrdev)
+ return;
+
+ if (b->unit != mlxa->mlxa_unit)
+ return;
+ /* we've found it! */
+ booted_device = dev;
+#if 0
+ printf("\nbooted_device = %s\n", dev->dv_xname);
+#endif
+ found = 1;
+ }
}
/*
Index: src/sys/arch/alpha/alpha/dec_kn300.c
diff -u src/sys/arch/alpha/alpha/dec_kn300.c:1.36 src/sys/arch/alpha/alpha/dec_kn300.c:1.37
--- src/sys/arch/alpha/alpha/dec_kn300.c:1.36 Sat Mar 14 15:35:59 2009
+++ src/sys/arch/alpha/alpha/dec_kn300.c Mon Sep 14 02:46:29 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: dec_kn300.c,v 1.36 2009/03/14 15:35:59 dsl Exp $ */
+/* $NetBSD: dec_kn300.c,v 1.37 2009/09/14 02:46:29 mhitch Exp $ */
/*
* Copyright (c) 1998 by Matthew Jacob
@@ -34,7 +34,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: dec_kn300.c,v 1.36 2009/03/14 15:35:59 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dec_kn300.c,v 1.37 2009/09/14 02:46:29 mhitch Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -72,6 +72,9 @@
#include <dev/scsipi/scsipi_all.h>
#include <dev/scsipi/scsiconf.h>
+#include <dev/ic/mlxio.h>
+#include <dev/ic/mlxvar.h>
+
#include "pckbd.h"
@@ -229,7 +232,8 @@
return;
if (!initted) {
- diskboot = (strcasecmp(b->protocol, "SCSI") == 0);
+ diskboot = (strcasecmp(b->protocol, "SCSI") == 0) ||
+ (strcasecmp(b->protocol, "RAID") == 0);
netboot = (strcasecmp(b->protocol, "BOOTP") == 0) ||
(strcasecmp(b->protocol, "MOP") == 0);
#ifdef BDEBUG
@@ -345,6 +349,27 @@
#endif
found = 1;
}
+
+ if (device_is_a(dev, "ld") && device_is_a(parent, "mlx")) {
+ /*
+ * Argh! The attach arguments for ld devices is not
+ * consistent, so each supported raid controller requires
+ * different checks.
+ */
+ struct mlx_attach_args *mlxa = aux;
+
+ if (parent != ctrlrdev)
+ return;
+
+ if (b->unit != mlxa->mlxa_unit)
+ return;
+ /* we've found it! */
+ booted_device = dev;
+#if 0
+ printf("\nbooted_device = %s\n", dev->dv_xname);
+#endif
+ found = 1;
+ }
}