From owner-svn-src-head@FreeBSD.ORG Thu Sep 4 14:57:05 2014 Return-Path: Delivered-To: svn-src-head@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 B0ED88C1; Thu, 4 Sep 2014 14:57:05 +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 9C62E1359; Thu, 4 Sep 2014 14:57:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s84Ev5PK069214; Thu, 4 Sep 2014 14:57:05 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s84Ev4ll069209; Thu, 4 Sep 2014 14:57:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201409041457.s84Ev4ll069209@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 4 Sep 2014 14:57:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271100 - head/sys/arm/freescale/imx X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Sep 2014 14:57:05 -0000 Author: ian Date: Thu Sep 4 14:57:04 2014 New Revision: 271100 URL: http://svnweb.freebsd.org/changeset/base/271100 Log: Implement the same public interface in imx51 and imx6 iomux; use the common header file for both. Remove some unused code from imx51_iomux. The iomux drivers are required, not optional, adjust the files.* entries accordingly. Deleted: head/sys/arm/freescale/imx/imx51_iomuxvar.h Modified: head/sys/arm/freescale/imx/files.imx51 head/sys/arm/freescale/imx/files.imx53 head/sys/arm/freescale/imx/files.imx6 head/sys/arm/freescale/imx/imx51_iomux.c Modified: head/sys/arm/freescale/imx/files.imx51 ============================================================================== --- head/sys/arm/freescale/imx/files.imx51 Thu Sep 4 14:56:24 2014 (r271099) +++ head/sys/arm/freescale/imx/files.imx51 Thu Sep 4 14:57:04 2014 (r271100) @@ -19,7 +19,7 @@ arm/arm/bus_space-v6.c standard arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.c optional iomux +arm/freescale/imx/imx51_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: head/sys/arm/freescale/imx/files.imx53 ============================================================================== --- head/sys/arm/freescale/imx/files.imx53 Thu Sep 4 14:56:24 2014 (r271099) +++ head/sys/arm/freescale/imx/files.imx53 Thu Sep 4 14:57:04 2014 (r271100) @@ -22,7 +22,7 @@ dev/uart/uart_dev_imx.c optional uart arm/freescale/imx/tzic.c standard # IOMUX - external pins multiplexor -arm/freescale/imx/imx51_iomux.c optional iomux +arm/freescale/imx/imx51_iomux.c standard # GPIO arm/freescale/imx/imx_gpio.c optional gpio Modified: head/sys/arm/freescale/imx/files.imx6 ============================================================================== --- head/sys/arm/freescale/imx/files.imx6 Thu Sep 4 14:56:24 2014 (r271099) +++ head/sys/arm/freescale/imx/files.imx6 Thu Sep 4 14:57:04 2014 (r271100) @@ -52,6 +52,4 @@ arm/freescale/imx/imx6_usbphy.c optiona # # Not ready yet... # -#arm/freescale/imx/imx51_iomux.c optional iomux -#dev/ata/chipsets/ata-fsl.c optional imxata #arm/freescale/imx/imx51_ipuv3.c optional sc Modified: head/sys/arm/freescale/imx/imx51_iomux.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_iomux.c Thu Sep 4 14:56:24 2014 (r271099) +++ head/sys/arm/freescale/imx/imx51_iomux.c Thu Sep 4 14:57:04 2014 (r271100) @@ -75,8 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include +#include "imx51_iomuxreg.h" #define IOMUX_WRITE(_sc, _r, _v) \ @@ -177,45 +176,23 @@ iomux_set_pad(unsigned int pin, unsigned iomux_set_pad_sub(iomuxsc, pin, config); } -#ifdef notyet -void -iomux_set_input(unsigned int input, unsigned int config) +static uint32_t +iomux_get_pad_config_sub(struct iomux_softc *sc, uint32_t pin) { - bus_size_t input_ctl_reg = input; - - bus_space_write_4(iomuxsc->iomux_memt, iomuxsc->iomux_memh, - input_ctl_reg, config); -} -#endif + bus_size_t pad_reg = IOMUX_PIN_TO_PAD_ADDRESS(pin); + uint32_t result; -void -iomux_mux_config(const struct iomux_conf *conflist) -{ - int i; + result = IOMUX_READ(sc, pad_reg); - if (iomuxsc == NULL) - return; - for (i = 0; conflist[i].pin != IOMUX_CONF_EOT; i++) { - iomux_set_pad_sub(iomuxsc, conflist[i].pin, conflist[i].pad); - iomux_set_function_sub(iomuxsc, conflist[i].pin, - conflist[i].mux); - } + return(result); } -#ifdef notyet -void -iomux_input_config(const struct iomux_input_conf *conflist) +unsigned int +iomux_get_pad_config(unsigned int pin) { - int i; - if (iomuxsc == NULL) - return; - for (i = 0; conflist[i].inout != -1; i++) { - iomux_set_inout(iomuxsc, conflist[i].inout, - conflist[i].inout_mode); - } + return(iomux_get_pad_config_sub(iomuxsc, pin)); } -#endif uint32_t imx_iomux_gpr_get(u_int regnum) @@ -268,5 +245,5 @@ static driver_t imx_iomux_driver = { static devclass_t imx_iomux_devclass; EARLY_DRIVER_MODULE(imx_iomux, simplebus, imx_iomux_driver, - imx_iomux_devclass, 0, 0, BUS_PASS_BUS - 1); + imx_iomux_devclass, 0, 0, BUS_PASS_CPU + BUS_PASS_ORDER_LATE);