Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbarm/evbarm Don't assume that the root autoconfig...



details:   https://anonhg.NetBSD.org/src/rev/3f272ef8874c
branches:  trunk
changeset: 824207:3f272ef8874c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun May 28 00:30:49 2017 +0000

description:
Don't assume that the root autoconfiguration device is named "mainbus".

diffstat:

 sys/arch/evbarm/evbarm/autoconf.c |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r a11b76aae176 -r 3f272ef8874c sys/arch/evbarm/evbarm/autoconf.c
--- a/sys/arch/evbarm/evbarm/autoconf.c Sun May 28 00:29:55 2017 +0000
+++ b/sys/arch/evbarm/evbarm/autoconf.c Sun May 28 00:30:49 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.19 2016/03/05 07:33:58 mlelstv Exp $    */
+/*     $NetBSD: autoconf.c,v 1.20 2017/05/28 00:30:49 jmcneill Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.19 2016/03/05 07:33:58 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.20 2017/05/28 00:30:49 jmcneill Exp $");
 
 #include "opt_md.h"
 
@@ -50,6 +50,8 @@
 void   (*evbarm_device_register)(device_t, void *);
 void   (*evbarm_device_register_post_config)(device_t, void *);
 
+extern struct cfdata cfdata[];
+
 #ifndef MEMORY_DISK_IS_ROOT
 static int get_device(char *name, device_t *, int *);
 static void set_root_device(void);
@@ -164,13 +166,18 @@
 cpu_configure(void)
 {
        struct mainbus_attach_args maa;
+       struct cfdata *cf;
 
        (void) splhigh();
        (void) splserial();     /* XXX need an splextreme() */
 
-       maa.ma_name = "mainbus";
-
-       config_rootfound("mainbus", &maa);
+       for (cf = &cfdata[0]; cf->cf_name; cf++) {
+               if (cf->cf_pspec == NULL) {
+                       maa.ma_name = cf->cf_name;
+                       if (config_rootfound(cf->cf_name, &maa) != NULL)
+                               break;
+               }
+       }
 
        /* Time to start taking interrupts so lets open the flood gates .... */
        spl0();



Home | Main Index | Thread Index | Old Index