Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc64/sparc64 Match firmware paths for the boot d...
details: https://anonhg.NetBSD.org/src/rev/28c7cf241182
branches: trunk
changeset: 801610:28c7cf241182
user: martin <martin%NetBSD.org@localhost>
date: Mon Aug 11 11:51:45 2014 +0000
description:
Match firmware paths for the boot device in Mac style, as used by
QEMU/OpenBIOS.
diffstat:
sys/arch/sparc64/sparc64/autoconf.c | 29 ++++++++++++++++++++++++++---
1 files changed, 26 insertions(+), 3 deletions(-)
diffs (64 lines):
diff -r 33e740f242e0 -r 28c7cf241182 sys/arch/sparc64/sparc64/autoconf.c
--- a/sys/arch/sparc64/sparc64/autoconf.c Mon Aug 11 10:37:59 2014 +0000
+++ b/sys/arch/sparc64/sparc64/autoconf.c Mon Aug 11 11:51:45 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.198 2014/07/25 17:21:32 nakayama Exp $ */
+/* $NetBSD: autoconf.c,v 1.199 2014/08/11 11:51:45 martin Exp $ */
/*
* Copyright (c) 1996
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.198 2014/07/25 17:21:32 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.199 2014/08/11 11:51:45 martin Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@@ -775,7 +775,7 @@
dev_path_drive_match(device_t dev, int ctrlnode, int target,
uint64_t wwn, int lun)
{
- int child = 0;
+ int child = 0, ide_node = 0;
char buf[OFPATHLEN];
DPRINTF(ACDB_BOOTDEV, ("dev_path_drive_match: %s, controller %x, "
@@ -791,6 +791,27 @@
if (child == ofbootpackage)
break;
+ if (child != ofbootpackage) {
+ /*
+ * Try Mac firmware style (also used by QEMU/OpenBIOS):
+ * below the controller there is an intermediate node
+ * for each IDE channel, and individual targets always
+ * are "@0"
+ */
+ for (ide_node = prom_firstchild(ctrlnode); ide_node != 0;
+ ide_node = prom_nextsibling(ide_node)) {
+ const char * name = prom_getpropstring(ide_node,
+ "device_type");
+ if (strcmp(name, "ide") != 0) continue;
+ for (child = prom_firstchild(ide_node); child != 0;
+ child = prom_nextsibling(child))
+ if (child == ofbootpackage)
+ break;
+ if (child == ofbootpackage)
+ break;
+ }
+ }
+
if (child == ofbootpackage) {
const char * name = prom_getpropstring(child, "name");
@@ -805,6 +826,8 @@
if (wwn)
snprintf(buf, sizeof(buf), "%s@w%016" PRIx64 ",%d",
name, wwn, lun);
+ else if (ide_node)
+ snprintf(buf, sizeof(buf), "%s@0", name);
else
snprintf(buf, sizeof(buf), "%s@%d,%d",
name, target, lun);
Home |
Main Index |
Thread Index |
Old Index