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.
This commit is contained in:
parent
77b6916d2e
commit
1b8950cfab
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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_size_t pad_reg = IOMUX_PIN_TO_PAD_ADDRESS(pin);
|
||||
uint32_t result;
|
||||
|
||||
bus_space_write_4(iomuxsc->iomux_memt, iomuxsc->iomux_memh,
|
||||
input_ctl_reg, config);
|
||||
}
|
||||
#endif
|
||||
result = IOMUX_READ(sc, pad_reg);
|
||||
|
||||
void
|
||||
iomux_mux_config(const struct iomux_conf *conflist)
|
||||
{
|
||||
int i;
|
||||
|
||||
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);
|
||||
|
||||
|
@ -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 *);
|
Loading…
Reference in New Issue
Block a user