summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorian <ian@FreeBSD.org>2014-09-04 14:57:04 +0000
committerian <ian@FreeBSD.org>2014-09-04 14:57:04 +0000
commit5bb6e38918db9589e0ba24d575200b0ff16a751b (patch)
tree7509943120ac2086feec58cdde113212633d4804
parent6d24ae3be3237b48676a12d68b70397d3937629d (diff)
downloadFreeBSD-src-5bb6e38918db9589e0ba24d575200b0ff16a751b.zip
FreeBSD-src-5bb6e38918db9589e0ba24d575200b0ff16a751b.tar.gz
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.
-rw-r--r--sys/arm/freescale/imx/files.imx512
-rw-r--r--sys/arm/freescale/imx/files.imx532
-rw-r--r--sys/arm/freescale/imx/files.imx62
-rw-r--r--sys/arm/freescale/imx/imx51_iomux.c45
-rw-r--r--sys/arm/freescale/imx/imx51_iomuxvar.h45
5 files changed, 13 insertions, 83 deletions
diff --git a/sys/arm/freescale/imx/files.imx51 b/sys/arm/freescale/imx/files.imx51
index 17ae33e..f1c2c5d 100644
--- a/sys/arm/freescale/imx/files.imx51
+++ b/sys/arm/freescale/imx/files.imx51
@@ -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
diff --git a/sys/arm/freescale/imx/files.imx53 b/sys/arm/freescale/imx/files.imx53
index 301ea78..01fb10e 100644
--- a/sys/arm/freescale/imx/files.imx53
+++ b/sys/arm/freescale/imx/files.imx53
@@ -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
diff --git a/sys/arm/freescale/imx/files.imx6 b/sys/arm/freescale/imx/files.imx6
index 12f073b..e66ef8b 100644
--- a/sys/arm/freescale/imx/files.imx6
+++ b/sys/arm/freescale/imx/files.imx6
@@ -52,6 +52,4 @@ arm/freescale/imx/imx6_usbphy.c optional ehci
#
# 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
diff --git a/sys/arm/freescale/imx/imx51_iomux.c b/sys/arm/freescale/imx/imx51_iomux.c
index 0dc0648..1953b7a 100644
--- a/sys/arm/freescale/imx/imx51_iomux.c
+++ b/sys/arm/freescale/imx/imx51_iomux.c
@@ -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 int config)
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);
diff --git a/sys/arm/freescale/imx/imx51_iomuxvar.h b/sys/arm/freescale/imx/imx51_iomuxvar.h
deleted file mode 100644
index 55eef2f..0000000
--- a/sys/arm/freescale/imx/imx51_iomuxvar.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*-
- * Copyright (c) 2012, 2013 The FreeBSD Foundation
- * All rights reserved.
- *
- * Portions of this software were developed by Oleksandr Rybalko
- * under sponsorship from the FreeBSD Foundation.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD$
- */
-
-/* iomux utility functions */
-struct iomux_conf {
- u_int pin;
-#define IOMUX_CONF_EOT ((u_int)(-1))
- u_short mux;
- u_short pad;
-};
-
-void iomux_set_function(u_int, u_int);
-void iomux_set_pad(u_int, u_int);
-#ifdef notyet
-void iomux_set_input(u_int, u_int);
-#endif
-void iomux_mux_config(const struct iomux_conf *);
OpenPOWER on IntegriCloud