Module Name:    src
Committed By:   jmcneill
Date:           Sat Jan  3 13:26:31 UTC 2015

Modified Files:
        src/sys/arch/arm/rockchip: files.rockchip obio.c

Log Message:
attach devices marked "crit 1" first


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/rockchip/files.rockchip
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/rockchip/obio.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/arm/rockchip/files.rockchip
diff -u src/sys/arch/arm/rockchip/files.rockchip:1.7 src/sys/arch/arm/rockchip/files.rockchip:1.8
--- src/sys/arch/arm/rockchip/files.rockchip:1.7	Fri Jan  2 23:20:18 2015
+++ src/sys/arch/arm/rockchip/files.rockchip	Sat Jan  3 13:26:31 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: files.rockchip,v 1.7 2015/01/02 23:20:18 jmcneill Exp $
+#	$NetBSD: files.rockchip,v 1.8 2015/01/03 13:26:31 jmcneill Exp $
 #
 # Configuration info for Rockchip ARM Peripherals
 #
@@ -19,7 +19,7 @@ file	arch/arm/rockchip/rockchip_dma.c
 file	arch/arm/arm/bus_space_a4x.S		obio
 
 # On-board I/O
-device obio {[addr = -1], [size = -1], [width = -1], [intr = -1], [mult = 1], [port = -1]}: bus_space_generic
+device obio {[addr = -1], [size = -1], [width = -1], [intr = -1], [mult = 1], [port = -1], [crit = 0]}: bus_space_generic
 attach obio at mainbus
 file arch/arm/rockchip/obio.c		obio
 

Index: src/sys/arch/arm/rockchip/obio.c
diff -u src/sys/arch/arm/rockchip/obio.c:1.10 src/sys/arch/arm/rockchip/obio.c:1.11
--- src/sys/arch/arm/rockchip/obio.c:1.10	Fri Jan  2 23:23:17 2015
+++ src/sys/arch/arm/rockchip/obio.c	Sat Jan  3 13:26:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: obio.c,v 1.10 2015/01/02 23:23:17 jmcneill Exp $	*/
+/*	$NetBSD: obio.c,v 1.11 2015/01/03 13:26:31 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #include "opt_rockchip.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.10 2015/01/02 23:23:17 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: obio.c,v 1.11 2015/01/03 13:26:31 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -101,9 +101,11 @@ obio_attach(device_t parent, device_t se
 
 	/*
 	 * Attach all on-board devices as described in the kernel
-	 * configuration file.
+	 * configuration file. Attach devices marked "crit 1" first.
 	 */
-	config_search_ia(obio_search, self, "obio", NULL);
+	for (int crit = 1; crit >= 0; crit--) {
+		config_search_ia(obio_search, self, "obio", &crit);
+	}
 }
 
 int
@@ -131,6 +133,10 @@ obio_search(device_t parent, cfdata_t cf
 {
 	struct obio_attach_args obio;
 	bus_addr_t addr = cf->cf_loc[OBIOCF_ADDR];
+	int crit = *(int *)aux;
+
+	if (cf->cf_loc[OBIOCF_CRIT] != crit)
+		return 0;
 
 	if (addr >= ROCKCHIP_CORE0_BASE &&
 	    addr < ROCKCHIP_CORE0_BASE + ROCKCHIP_CORE0_SIZE) {

Reply via email to