From owner-svn-src-stable@FreeBSD.ORG Sun Oct 26 02:09:59 2014 Return-Path: Delivered-To: svn-src-stable@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 617794C5; Sun, 26 Oct 2014 02:09:59 +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 334FC918; Sun, 26 Oct 2014 02:09:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s9Q29xNI072035; Sun, 26 Oct 2014 02:09:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s9Q29wHj072030; Sun, 26 Oct 2014 02:09:58 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201410260209.s9Q29wHj072030@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 26 Oct 2014 02:09:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r273656 - in stable/10/sys/arm/freescale: . imx X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Oct 2014 02:09:59 -0000 Author: ian Date: Sun Oct 26 02:09:58 2014 New Revision: 273656 URL: https://svnweb.freebsd.org/changeset/base/273656 Log: MFC r270955,r270956: make the imx6 octop and anatop drivers early attachers. Modified: stable/10/sys/arm/freescale/fsl_ocotp.c stable/10/sys/arm/freescale/imx/imx6_anatop.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/freescale/fsl_ocotp.c ============================================================================== --- stable/10/sys/arm/freescale/fsl_ocotp.c Sun Oct 26 01:58:18 2014 (r273655) +++ stable/10/sys/arm/freescale/fsl_ocotp.c Sun Oct 26 02:09:58 2014 (r273656) @@ -200,5 +200,6 @@ static driver_t ocotp_driver = { static devclass_t ocotp_devclass; -DRIVER_MODULE(ocotp, simplebus, ocotp_driver, ocotp_devclass, 0, 0); +EARLY_DRIVER_MODULE(ocotp, simplebus, ocotp_driver, ocotp_devclass, 0, 0, + BUS_PASS_CPU + BUS_PASS_ORDER_FIRST); Modified: stable/10/sys/arm/freescale/imx/imx6_anatop.c ============================================================================== --- stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun Oct 26 01:58:18 2014 (r273655) +++ stable/10/sys/arm/freescale/imx/imx6_anatop.c Sun Oct 26 02:09:58 2014 (r273656) @@ -88,6 +88,8 @@ static struct resource_spec imx6_anatop_ struct imx6_anatop_softc { device_t dev; struct resource *res[2]; + struct intr_config_hook + intr_setup_hook; uint32_t cpu_curmhz; uint32_t cpu_curmv; uint32_t cpu_minmhz; @@ -613,10 +615,22 @@ initialize_tempmon(struct imx6_anatop_so "Throttle CPU when exceeding this temperature"); } +static void +intr_setup(void *arg) +{ + struct imx6_anatop_softc *sc; + + sc = arg; + bus_setup_intr(sc->dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, + tempmon_intr, NULL, sc, &sc->temp_intrhand); + config_intrhook_disestablish(&sc->intr_setup_hook); +} + static int imx6_anatop_detach(device_t dev) { + /* This device can never detach. */ return (EBUSY); } @@ -636,10 +650,9 @@ imx6_anatop_attach(device_t dev) goto out; } - err = bus_setup_intr(dev, sc->res[IRQRES], INTR_TYPE_MISC | INTR_MPSAFE, - tempmon_intr, NULL, sc, &sc->temp_intrhand); - if (err != 0) - goto out; + sc->intr_setup_hook.ich_func = intr_setup; + sc->intr_setup_hook.ich_arg = sc; + config_intrhook_establish(&sc->intr_setup_hook); SYSCTL_ADD_UINT(device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(device_get_sysctl_tree(sc->dev)), @@ -716,5 +729,6 @@ static driver_t imx6_anatop_driver = { static devclass_t imx6_anatop_devclass; -DRIVER_MODULE(imx6_anatop, simplebus, imx6_anatop_driver, imx6_anatop_devclass, 0, 0); +EARLY_DRIVER_MODULE(imx6_anatop, simplebus, imx6_anatop_driver, + imx6_anatop_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_FIRST + 1);