summaryrefslogtreecommitdiff
path: root/arch/arm/mach-mx23/mx23evk_pins.c
diff options
context:
space:
mode:
authorFrank Li <Frank.Li@freescale.com>2010-02-02 12:46:26 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 11:17:14 +0200
commitdb70d82e0ffca29ecb2a24602ff200bd6df2ca53 (patch)
tree7531cecf7f3f5d72fbcebda4d717620491f608ad /arch/arm/mach-mx23/mx23evk_pins.c
parente6ea0df1c331628c735044079008e743125f557e (diff)
ENGR00120882 MX23 new MSL base on plat-mxs
Add mx23 evk msl base on plat-mxs Signed-off-by: Frank Li <Frank.Li@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'arch/arm/mach-mx23/mx23evk_pins.c')
-rw-r--r--arch/arm/mach-mx23/mx23evk_pins.c722
1 files changed, 722 insertions, 0 deletions
diff --git a/arch/arm/mach-mx23/mx23evk_pins.c b/arch/arm/mach-mx23/mx23evk_pins.c
new file mode 100644
index 000000000000..1c105d8ced27
--- /dev/null
+++ b/arch/arm/mach-mx23/mx23evk_pins.c
@@ -0,0 +1,722 @@
+/*
+ * Copyright (C) 2009-2010 Freescale Semiconductor, Inc. All Rights Reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/platform_device.h>
+#include <linux/irq.h>
+#include <linux/gpio.h>
+
+#include <mach/pinctrl.h>
+
+#include "mx23_pins.h"
+
+static struct pin_desc mx23evk_fixed_pins[] = {
+ {
+ .name = "DUART.RX",
+ .id = PINID_PWM0,
+ .fun = PIN_FUN3,
+ },
+ {
+ .name = "DUART.TX",
+ .id = PINID_PWM1,
+ .fun = PIN_FUN3,
+ },
+#ifdef CONFIG_MXS_AUART0_DEVICE_ENABLE
+ {
+ .name = "AUART0.RX",
+ .id = PINID_AUART0_RX,
+ .fun = PIN_FUN1,
+ },
+ {
+ .name = "AUART0.TX",
+ .id = PINID_AUART0_TX,
+ .fun = PIN_FUN1,
+ },
+ {
+ .name = "AUART0.CTS",
+ .id = PINID_AUART0_CTS,
+ .fun = PIN_FUN1,
+ },
+ {
+ .name = "AUART0.RTS",
+ .id = PINID_AUART0_RTS,
+ .fun = PIN_FUN1,
+ },
+#endif
+#ifdef CONFIG_MXS_AUART3_DEVICE_ENABLE
+ {
+ .name = "AUART3.RX",
+ .id = PINID_AUART3_RX,
+ .fun = PIN_FUN1,
+ },
+ {
+ .name = "AUART3.TX",
+ .id = PINID_AUART3_TX,
+ .fun = PIN_FUN1,
+ },
+ {
+ .name = "AUART3.CTS",
+ .id = PINID_AUART3_CTS,
+ .fun = PIN_FUN1,
+ },
+ {
+ .name = "AUART3.RTS",
+ .id = PINID_AUART3_RTS,
+ .fun = PIN_FUN1,
+ },
+#endif
+ {
+ .name = "usb0",
+ .id = PINID_AUART2_TX,
+ .fun = PIN_GPIO,
+ .data = 1,
+ },
+ {
+ .name = "usb1",
+ .id = PINID_AUART2_RX,
+ .fun = PIN_GPIO,
+ .data = 1,
+ },
+
+#if defined(CONFIG_I2C_MXS) || \
+ defined(CONFIG_I2C_MXS_MODULE)
+ {
+ .name = "I2C0_SCL",
+ .id = PINID_I2C0_SCL,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "I2C0_SDA",
+ .id = PINID_I2C0_SDA,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+#endif
+#if defined(CONFIG_FB_MXS) || defined(CONFIG_FB_MXS_MODULE)
+ {
+ .name = "LCD_D00",
+ .id = PINID_LCD_D00,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D01",
+ .id = PINID_LCD_D01,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D02",
+ .id = PINID_LCD_D02,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D03",
+ .id = PINID_LCD_D03,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D04",
+ .id = PINID_LCD_D04,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D05",
+ .id = PINID_LCD_D05,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D06",
+ .id = PINID_LCD_D06,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D07",
+ .id = PINID_LCD_D07,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D08",
+ .id = PINID_LCD_D08,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D09",
+ .id = PINID_LCD_D09,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D10",
+ .id = PINID_LCD_D10,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D11",
+ .id = PINID_LCD_D11,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D12",
+ .id = PINID_LCD_D12,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D13",
+ .id = PINID_LCD_D13,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D14",
+ .id = PINID_LCD_D14,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D15",
+ .id = PINID_LCD_D15,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D16",
+ .id = PINID_LCD_D16,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D17",
+ .id = PINID_LCD_D17,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D18",
+ .id = PINID_LCD_D18,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D19",
+ .id = PINID_LCD_D19,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D20",
+ .id = PINID_LCD_D20,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D21",
+ .id = PINID_LCD_D21,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D22",
+ .id = PINID_LCD_D22,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_D23",
+ .id = PINID_LCD_D23,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_RESET",
+ .id = PINID_LCD_RESET,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_VSYNC",
+ .id = PINID_LCD_RD_E,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_HSYNC",
+ .id = PINID_LCD_WR_RWN,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_ENABLE",
+ .id = PINID_LCD_CS,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_DOTCLK",
+ .id = PINID_LCD_RS,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "LCD_BACKLIGHT",
+ .id = PINID_PWM2,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+#endif
+#if defined(CONFIG_MMC_MXS) || defined(CONFIG_MMC_MXS_MODULE)
+ /* Configurations of SSP0 SD/MMC port pins */
+ {
+ .name = "SSP0_DATA0",
+ .id = PINID_SSP0_DATA0,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP0_DATA1",
+ .id = PINID_SSP0_DATA1,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP0_DATA2",
+ .id = PINID_SSP0_DATA2,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP0_DATA3",
+ .id = PINID_SSP0_DATA3,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP0_DATA4",
+ .id = PINID_SSP0_DATA4,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP0_DATA5",
+ .id = PINID_SSP0_DATA5,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP0_DATA6",
+ .id = PINID_SSP0_DATA6,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP0_DATA7",
+ .id = PINID_SSP0_DATA7,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP0_CMD",
+ .id = PINID_SSP0_CMD,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP0_DETECT",
+ .id = PINID_SSP0_DETECT,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 0,
+ .drive = 1,
+ .pull = 0,
+ },
+ {
+ .name = "SSP0_SCK",
+ .id = PINID_SSP0_SCK,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 0,
+ .drive = 1,
+ .pull = 0,
+ },
+ /* Configurations of SSP1 SD/MMC port pins */
+ {
+ .name = "SSP1_DATA0",
+ .id = PINID_GPMI_D00,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP1_DATA1",
+ .id = PINID_GPMI_D01,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP1_DATA2",
+ .id = PINID_GPMI_D02,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP1_DATA3",
+ .id = PINID_GPMI_D03,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP1_DATA4",
+ .id = PINID_GPMI_D04,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP1_DATA5",
+ .id = PINID_GPMI_D05,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP1_DATA6",
+ .id = PINID_GPMI_D06,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP1_DATA7",
+ .id = PINID_GPMI_D07,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP1_CMD",
+ .id = PINID_GPMI_RDY1,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 1,
+ .drive = 1,
+ .pull = 1,
+ },
+ {
+ .name = "SSP1_DETECT",
+ .id = PINID_GPMI_RDY0,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 0,
+ .drive = 1,
+ .pull = 0,
+ },
+ {
+ .name = "SSP1_SCK",
+ .id = PINID_GPMI_WRN,
+ .fun = PIN_FUN2,
+ .strength = PAD_8MA,
+ .voltage = PAD_3_3V,
+ .pullup = 0,
+ .drive = 1,
+ .pull = 0,
+ },
+#endif
+
+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)
+ {
+ .name = "ENET0_MDC",
+ .id = PINID_ENET0_MDC,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .pull = 1,
+ .pullup = 1,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "ENET0_MDIO",
+ .id = PINID_ENET0_MDIO,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .pull = 1,
+ .pullup = 1,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "ENET0_RX_EN",
+ .id = PINID_ENET0_RX_EN,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .pull = 1,
+ .pullup = 1,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "ENET0_RXD0",
+ .id = PINID_ENET0_RXD0,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .pull = 1,
+ .pullup = 1,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "ENET0_RXD1",
+ .id = PINID_ENET0_RXD1,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .pull = 1,
+ .pullup = 1,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "ENET0_TX_EN",
+ .id = PINID_ENET0_TX_EN,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .pull = 1,
+ .pullup = 1,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "ENET0_TXD0",
+ .id = PINID_ENET0_TXD0,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .pull = 1,
+ .pullup = 1,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "ENET0_TXD1",
+ .id = PINID_ENET0_TXD1,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .pull = 1,
+ .pullup = 1,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+ {
+ .name = "ENET_CLK",
+ .id = PINID_ENET_CLK,
+ .fun = PIN_FUN1,
+ .strength = PAD_8MA,
+ .pull = 1,
+ .pullup = 1,
+ .voltage = PAD_3_3V,
+ .drive = 1,
+ },
+#endif
+};
+
+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE)
+int mx23evk_enet_gpio_init(void)
+{
+ /* pwr */
+ gpio_request(MXS_PIN_TO_GPIO(PINID_SSP1_DATA3), "ENET_PWR");
+ gpio_direction_output(MXS_PIN_TO_GPIO(PINID_SSP1_DATA3), 0);
+
+ /* reset phy */
+ gpio_request(MXS_PIN_TO_GPIO(PINID_ENET0_RX_CLK), "PHY_RESET");
+ gpio_direction_output(MXS_PIN_TO_GPIO(PINID_ENET0_RX_CLK), 0);
+ gpio_direction_output(MXS_PIN_TO_GPIO(PINID_ENET0_RX_CLK), 1);
+
+ return 0;
+}
+#else
+int mx23evk_enet_gpio_init(void)
+{
+ return 0;
+}
+#endif
+
+void __init mx23evk_pins_init(void)
+{
+ int i;
+ struct pin_desc *pin;
+ for (i = 0; i < ARRAY_SIZE(mx23evk_fixed_pins); i++) {
+ pin = &mx23evk_fixed_pins[i];
+ if (pin->fun == PIN_GPIO)
+ gpio_request(MXS_PIN_TO_GPIO(pin->id), pin->name);
+ else
+ mxs_request_pin(pin->id, pin->fun, pin->name);
+ if (pin->drive) {
+ mxs_set_strength(pin->id, pin->strength, pin->name);
+ mxs_set_voltage(pin->id, pin->voltage, pin->name);
+ }
+ if (pin->pull)
+ mxs_set_pullup(pin->id, pin->pullup, pin->name);
+ if (pin->fun == PIN_GPIO) {
+ if (pin->input)
+ gpio_direction_input(MXS_PIN_TO_GPIO(pin->id));
+ else
+ gpio_direction_output(MXS_PIN_TO_GPIO(pin->id),
+ pin->data);
+ }
+ }
+}