Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Sep 2014 14:57:04 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r271100 - head/sys/arm/freescale/imx
Message-ID:  <201409041457.s84Ev4ll069209@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <dev/ofw/ofw_bus_subr.h>
 
 #include <arm/freescale/imx/imx_iomuxvar.h>
-#include <arm/freescale/imx/imx51_iomuxvar.h>
-#include <arm/freescale/imx/imx51_iomuxreg.h>
+#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);
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201409041457.s84Ev4ll069209>