From owner-svn-src-all@freebsd.org Wed Jun 8 21:38:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E46E4B704E1; Wed, 8 Jun 2016 21:38:52 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 A6D6E1CD3; Wed, 8 Jun 2016 21:38:52 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u58Lcpf4024707; Wed, 8 Jun 2016 21:38:51 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u58Lcpsk024703; Wed, 8 Jun 2016 21:38:51 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606082138.u58Lcpsk024703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 8 Jun 2016 21:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301698 - in head/sys: dev/bhnd dev/bhnd/bcma dev/bhnd/siba mips/broadcom 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.22 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: Wed, 08 Jun 2016 21:38:53 -0000 Author: landonf Date: Wed Jun 8 21:38:51 2016 New Revision: 301698 URL: https://svnweb.freebsd.org/changeset/base/301698 Log: bhnd(4): Fix mips/broadcom core matching and bus pass order. Changes: - Fixed incorrect MIPS74k vendor ID in the bhnd core descriptor tables - Fixed MIPS core driver's matching against MIPS/MIPS33 cores. - Improved MIPS3302 core description. - Enabled BUS_PASS_BUS on the bhnd nexus drivers to allow early probing of the MIPS core. - Enabled BUS_PASS_CPU on the MIPS core driver to ensure correct attach order. - Disabled matching of the MIPS core driver on non-SoC devices. Reviewed by: Michael Zhilin Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6735 Modified: head/sys/dev/bhnd/bcma/bcma_nexus.c head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/siba/siba_nexus.c head/sys/mips/broadcom/bcm_mipscore.c Modified: head/sys/dev/bhnd/bcma/bcma_nexus.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_nexus.c Wed Jun 8 21:31:33 2016 (r301697) +++ head/sys/dev/bhnd/bcma/bcma_nexus.c Wed Jun 8 21:38:51 2016 (r301698) @@ -135,4 +135,5 @@ static device_method_t bcma_nexus_method DEFINE_CLASS_2(bhnd, bcma_nexus_driver, bcma_nexus_methods, sizeof(struct bcma_nexus_softc), bhnd_nexus_driver, bcma_driver); -DRIVER_MODULE(bcma_nexus, nexus, bcma_nexus_driver, bhnd_devclass, 0, 0); +EARLY_DRIVER_MODULE(bcma_nexus, nexus, bcma_nexus_driver, bhnd_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Wed Jun 8 21:31:33 2016 (r301697) +++ head/sys/dev/bhnd/bhnd_subr.c Wed Jun 8 21:38:51 2016 (r301698) @@ -86,7 +86,7 @@ static const struct bhnd_core_desc { BHND_CDESC(BCM, APHY, WLAN_PHY, "802.11a PHY"), BHND_CDESC(BCM, BPHY, WLAN_PHY, "802.11b PHY"), BHND_CDESC(BCM, GPHY, WLAN_PHY, "802.11g PHY"), - BHND_CDESC(BCM, MIPS33, CPU, "MIPS 3302 Core"), + BHND_CDESC(BCM, MIPS33, CPU, "MIPS3302 Core"), BHND_CDESC(BCM, USB11H, OTHER, "USB 1.1 Host Controller"), BHND_CDESC(BCM, USB11D, OTHER, "USB 1.1 Device Core"), BHND_CDESC(BCM, USB20H, OTHER, "USB 2.0 Host Controller"), @@ -108,7 +108,7 @@ static const struct bhnd_core_desc { BHND_CDESC(BCM, SDIOD, OTHER, "SDIO Device Core"), BHND_CDESC(BCM, ARMCM3, CPU, "ARM Cortex-M3 CPU"), BHND_CDESC(BCM, HTPHY, WLAN_PHY, "802.11n 4x4 PHY"), - BHND_CDESC(BCM, MIPS74K, CPU, "MIPS74k CPU"), + BHND_CDESC(MIPS,MIPS74K, CPU, "MIPS74k CPU"), BHND_CDESC(BCM, GMAC, ENET_MAC, "Gigabit MAC core"), BHND_CDESC(BCM, DMEMC, MEMC, "DDR1/DDR2 Memory Controller"), BHND_CDESC(BCM, PCIERC, OTHER, "PCIe Root Complex"), Modified: head/sys/dev/bhnd/siba/siba_nexus.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_nexus.c Wed Jun 8 21:31:33 2016 (r301697) +++ head/sys/dev/bhnd/siba/siba_nexus.c Wed Jun 8 21:38:51 2016 (r301698) @@ -115,4 +115,5 @@ static device_method_t siba_nexus_method DEFINE_CLASS_2(bhnd, siba_nexus_driver, siba_nexus_methods, sizeof(struct siba_nexus_softc), bhnd_nexus_driver, siba_driver); -DRIVER_MODULE(siba_nexus, nexus, siba_nexus_driver, bhnd_devclass, 0, 0); +EARLY_DRIVER_MODULE(siba_nexus, nexus, siba_nexus_driver, bhnd_devclass, 0, 0, + BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/mips/broadcom/bcm_mipscore.c ============================================================================== --- head/sys/mips/broadcom/bcm_mipscore.c Wed Jun 8 21:31:33 2016 (r301697) +++ head/sys/mips/broadcom/bcm_mipscore.c Wed Jun 8 21:38:51 2016 (r301698) @@ -53,10 +53,13 @@ static const struct resource_spec mipsco { -1, -1, 0 } }; +#define MIPSCORE_DEV(_vendor, _core) \ + BHND_DEVICE(_vendor, _core, NULL, NULL, BHND_DF_SOC) + struct bhnd_device mipscore_match[] = { - BHND_DEVICE(BCM, MIPS, NULL, NULL), - BHND_DEVICE(BCM, MIPS33, NULL, NULL), - BHND_DEVICE(MIPS, MIPS74K, NULL, NULL), + MIPSCORE_DEV(BCM, MIPS), + MIPSCORE_DEV(BCM, MIPS33), + MIPSCORE_DEV(MIPS, MIPS74K), BHND_DEVICE_END }; @@ -116,8 +119,8 @@ static device_method_t mipscore_methods[ devclass_t bhnd_mipscore_devclass; -DEFINE_CLASS_0(bhnd_mipscore, mipscore_driver, mipscore_methods, - sizeof(struct mipscore_softc)); -DRIVER_MODULE(bhnd_mipscore, bhnd, mipscore_driver, bhnd_mipscore_devclass, - 0, 0); -MODULE_VERSION(bhnd_mipscore, 1); +DEFINE_CLASS_0(bhnd_mips, mipscore_driver, mipscore_methods, + sizeof(struct mipscore_softc)); +EARLY_DRIVER_MODULE(bhnd_mips, bhnd, mipscore_driver, + bhnd_mipscore_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_EARLY); +MODULE_VERSION(bhnd_mips, 1);