From owner-svn-src-all@FreeBSD.ORG Tue Aug 5 19:06:46 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79DA8AFE for ; Tue, 5 Aug 2014 19:06:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4B9622880 for ; Tue, 5 Aug 2014 19:06:46 +0000 (UTC) Received: from ian (uid 1311) (envelope-from ian@FreeBSD.org) id 55bd by svn.freebsd.org (DragonFly Mail Agent v0.9+); Tue, 05 Aug 2014 19:06:46 +0000 From: Ian Lepore Date: Tue, 5 Aug 2014 19:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r269606 - in head/sys: arm/arm conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <53e12b46.55bd.7fdfcac6@svn.freebsd.org> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2014 19:06:46 -0000 Author: ian Date: Tue Aug 5 19:06:45 2014 New Revision: 269606 URL: http://svnweb.freebsd.org/changeset/base/269606 Log: Add an arm option, ARM_DEVICE_MULTIPASS, used to opt-in to multi-pass device attachment on arm platforms. If this is defined, nexus attaches early in BUS_PASS_BUS, and other busses and devices attach later, in the pass number they are set up for. Without it defined, nexus attaches in BUS_PASS_DEFAULT and thus so does everything else, which is status quo. Arm platforms which use FDT data to enumerate devices have been relying on devices being attached in the exact order they're listed in the dts source file. That's one of things currently preventing us from using vendor-supplied fdt data (because then we don't control the order of the devices in the data). Multi-pass attachment can go a long way towards solving that problem by ensuring things like clock and interrupt drivers are attached before the more mundane devices that need them. The long-term goal is to have all arm fdt-based platforms using multipass. This option is a bridge to that, letting us enable it selectively as platforms are converted and tested (the alternative being to just throw a big switch and try to fight fires as they're reported). Modified: head/sys/arm/arm/nexus.c head/sys/conf/options.arm Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Tue Aug 5 18:51:51 2014 (r269605) +++ head/sys/arm/arm/nexus.c Tue Aug 5 19:06:45 2014 (r269606) @@ -125,7 +125,12 @@ static driver_t nexus_driver = { nexus_methods, 1 /* no softc */ }; +#ifdef ARM_DEVICE_MULTIPASS +EARLY_DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_EARLY); +#else DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); +#endif static int nexus_probe(device_t dev) Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Tue Aug 5 18:51:51 2014 (r269605) +++ head/sys/conf/options.arm Tue Aug 5 19:06:45 2014 (r269606) @@ -1,6 +1,7 @@ #$FreeBSD$ ARM9_CACHE_WRITE_THROUGH opt_global.h ARM_CACHE_LOCK_ENABLE opt_global.h +ARM_DEVICE_MULTIPASS opt_global.h ARM_KERN_DIRECTMAP opt_vm.h ARM_L2_PIPT opt_global.h ARM_MANY_BOARD opt_global.h