From owner-svn-src-all@FreeBSD.ORG Tue May 5 11:13:17 2015 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8C7175D; Tue, 5 May 2015 11:13:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CF4D1233; Tue, 5 May 2015 11:13:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t45BDHbI019860; Tue, 5 May 2015 11:13:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t45BDHme019858; Tue, 5 May 2015 11:13:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201505051113.t45BDHme019858@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 5 May 2015 11:13:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282480 - in head/sys: arm64/arm64 dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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 May 2015 11:13:17 -0000 Author: andrew Date: Tue May 5 11:13:16 2015 New Revision: 282480 URL: https://svnweb.freebsd.org/changeset/base/282480 Log: Move the point we attach the ofw driver on arm64 to nexus.c. This will allow us to have a single place to decide to use ofw or acpi. Modified: head/sys/arm64/arm64/nexus.c head/sys/dev/ofw/ofwbus.c Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Tue May 5 11:12:33 2015 (r282479) +++ head/sys/arm64/arm64/nexus.c Tue May 5 11:13:16 2015 (r282480) @@ -148,6 +148,10 @@ nexus_attach(device_t dev) if (rman_init(&mem_rman) || rman_manage_region(&mem_rman, 0, ~0)) panic("nexus_probe mem_rman"); + /* Add the ofwbus device */ + /* ARM64TODO: Alternatively add acpi */ + nexus_add_child(dev, 10, "ofwbus", 0); + /* * First, deal with the children we know about already */ Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Tue May 5 11:12:33 2015 (r282479) +++ head/sys/dev/ofw/ofwbus.c Tue May 5 11:13:16 2015 (r282480) @@ -69,7 +69,9 @@ struct ofwbus_softc { struct rman sc_mem_rman; }; +#ifndef __aarch64__ static device_identify_t ofwbus_identify; +#endif static device_probe_t ofwbus_probe; static device_attach_t ofwbus_attach; static bus_alloc_resource_t ofwbus_alloc_resource; @@ -78,7 +80,9 @@ static bus_release_resource_t ofwbus_rel static device_method_t ofwbus_methods[] = { /* Device interface */ +#ifndef __aarch64__ DEVMETHOD(device_identify, ofwbus_identify), +#endif DEVMETHOD(device_probe, ofwbus_probe), DEVMETHOD(device_attach, ofwbus_attach), @@ -97,6 +101,7 @@ EARLY_DRIVER_MODULE(ofwbus, nexus, ofwbu BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); MODULE_VERSION(ofwbus, 1); +#ifndef __aarch64__ static void ofwbus_identify(driver_t *driver, device_t parent) { @@ -108,11 +113,17 @@ ofwbus_identify(driver_t *driver, device if (device_find_child(parent, "ofwbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "ofwbus", -1); } +#endif static int ofwbus_probe(device_t dev) { +#ifdef __aarch64__ + if (OF_peer(0) == 0) + return (ENXIO); +#endif + device_set_desc(dev, "Open Firmware Device Tree"); return (BUS_PROBE_NOWILDCARD); }