Skip to contentSkip to conversation

i.MX51: Full iomux support

PATCH New Sascha Hauer 5 participants 13 messages Dec 15, 2010 – Dec 28, 2010

Subsystems (3)
lore
Share & tools
lore

Sascha Hauer

author maintainer
#0 lore raw

PATCH 1/1 i.MX51: Full iomux support

Hi,

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present. This series was tested on the babbage board, but due to the mass of defines they are of course not completely tested, so please test yourself if your board still works.

Sascha

The following changes since commit 28a4f908acb342350b9ecbfcdf0a999cb83e05aa:

ARM: mx5: check for error in ioremap (2010-12-14 09:55:53 +0100)

are available in the git repository at:
git://git.pengutronix.de/git/imx/linux-2.6.git iomux-v3

Lothar Wa?mann (1):
MXC IOMUX-V3 replace struct pad_desc with bitmapped cookie (step 2)

Sascha Hauer (1):
ARM i.MX51: Full iomux support

 arch/arm/mach-mx3/mach-pcm043.c              |   14 +-
 arch/arm/mach-mx5/board-cpuimx51.c           |   14 +-
 arch/arm/mach-mx5/board-cpuimx51sd.c         |   32 +-
 arch/arm/mach-mx5/board-mx51_3ds.c           |    4 +-
 arch/arm/mach-mx5/board-mx51_babbage.c       |   46 +-
 arch/arm/mach-mx5/board-mx51_efikamx.c       |   22 +-
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c |   10 +-
 arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c |    9 +-
 arch/arm/plat-mxc/include/mach/iomux-mx51.h  | 1904 +++++++++++++++++++++-----
 arch/arm/plat-mxc/include/mach/iomux-v3.h    |   92 +-
 arch/arm/plat-mxc/iomux-v3.c                 |   25 +-
 11 files changed, 1668 insertions(+), 504 deletions(-)
author maintainer
#1 lore raw

PATCH 1/2 MXC IOMUX-V3 replace struct pad_desc with bitmapped cookie (step 2)

From: Lothar Wa?mann <[email protected]>

This patch actually replaces the 'struct pad_desc' with a u64 cookie to facilitate adding platform specific pad_ctrl settings to an existing pad definition.

So, instead of:

	iomux_v3_cfg_t power_key = MX51_PAD_EIM_A27__GPIO_2_21;
	power_key.pad_ctrl = MX51_GPIO_PAD_CTRL_2;
	mxc_iomux_v3_setup_pad(&power_key);
one can write:
	mxc_iomux_v3_setup_pad((MX51_PAD_EIM_A27__GPIO_2_21 & ~MUX_PAD_CTRL_MASK) | MX51_GPIO_PAD_CTRL_2);

Patch applies to branch 'imx-for-2.6.38' of git://git.pengutronix.de/git/imx/linux-2.6

---
 arch/arm/mach-mx3/mach-pcm043.c           |   14 ++--
 arch/arm/mach-mx5/board-mx51_babbage.c    |   12 ++--
 arch/arm/plat-mxc/include/mach/iomux-v3.h |   90 ++++++++++++-----------------
 arch/arm/plat-mxc/iomux-v3.c              |   25 +++++---
 4 files changed, 66 insertions(+), 75 deletions(-)
arch/arm/mach-mx3/mach-pcm043.c +7 -7
index e229a74..bcf83fc 100644
@@ -237,7 +237,7 @@ static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97)
 		return;
 	}
 
-	mxc_iomux_v3_setup_pad(&txfs_gpio);
+	mxc_iomux_v3_setup_pad(txfs_gpio);
 
 	/* warm reset */
 	gpio_direction_output(AC97_GPIO_TXFS, 1);
@@ -245,7 +245,7 @@ static void pcm043_ac97_warm_reset(struct snd_ac97 *ac97)
 	gpio_set_value(AC97_GPIO_TXFS, 0);
 
 	gpio_free(AC97_GPIO_TXFS);
-	mxc_iomux_v3_setup_pad(&txfs);
+	mxc_iomux_v3_setup_pad(txfs);
 }
 
 static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97)
@@ -269,9 +269,9 @@ static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97)
 	if (ret)
 		goto err3;
 
-	mxc_iomux_v3_setup_pad(&txfs_gpio);
-	mxc_iomux_v3_setup_pad(&txd_gpio);
-	mxc_iomux_v3_setup_pad(&reset_gpio);
+	mxc_iomux_v3_setup_pad(txfs_gpio);
+	mxc_iomux_v3_setup_pad(txd_gpio);
+	mxc_iomux_v3_setup_pad(reset_gpio);
 
 	gpio_direction_output(AC97_GPIO_TXFS, 0);
 	gpio_direction_output(AC97_GPIO_TXD, 0);
@@ -281,8 +281,8 @@ static void pcm043_ac97_cold_reset(struct snd_ac97 *ac97)
 	udelay(10);
 	gpio_direction_output(AC97_GPIO_RESET, 1);
 
-	mxc_iomux_v3_setup_pad(&txd);
-	mxc_iomux_v3_setup_pad(&txfs);
+	mxc_iomux_v3_setup_pad(txd);
+	mxc_iomux_v3_setup_pad(txfs);
 
 	gpio_free(AC97_GPIO_RESET);
 err3:
arch/arm/mach-mx5/board-mx51_babbage.c +6 -6
index 368a315..24e335c 100644
@@ -193,7 +193,7 @@ static int gpio_usbh1_active(void)
 	int ret;
 
 	/* Set USBH1_STP to GPIO and toggle it */
-	mxc_iomux_v3_setup_pad(&usbh1stp_gpio);
+	mxc_iomux_v3_setup_pad(usbh1stp_gpio);
 	ret = gpio_request(BABBAGE_USBH1_STP, "usbh1_stp");
 
 	if (ret) {
@@ -206,7 +206,7 @@ static int gpio_usbh1_active(void)
 	gpio_free(BABBAGE_USBH1_STP);
 
 	/* De-assert USB PHY RESETB */
-	mxc_iomux_v3_setup_pad(&phyreset_gpio);
+	mxc_iomux_v3_setup_pad(phyreset_gpio);
 	ret = gpio_request(BABBAGE_PHY_RESET, "phy_reset");
 
 	if (ret) {
@@ -352,7 +352,8 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
 static void __init mxc_board_init(void)
 {
 	iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
-	iomux_v3_cfg_t power_key = MX51_PAD_EIM_A27__GPIO_2_21;
+	iomux_v3_cfg_t power_key = (MX51_PAD_EIM_A27__GPIO_2_21 &
+				~MUX_PAD_CTRL_MASK) | MX51_GPIO_PAD_CTRL_2;
 
 #if defined(CONFIG_CPU_FREQ_IMX)
 	get_cpu_op = mx51_get_cpu_op;
@@ -364,8 +365,7 @@ static void __init mxc_board_init(void)
 	imx51_add_fec(NULL);
 
 	/* Set the PAD settings for the pwr key. */
-	power_key.pad_ctrl = MX51_GPIO_PAD_CTRL_2;
-	mxc_iomux_v3_setup_pad(&power_key);
+	mxc_iomux_v3_setup_pad(power_key);
 	imx51_add_gpio_keys(&imx_button_data);
 
 	imx51_add_imx_i2c(0, &babbage_i2c_data);
@@ -382,7 +382,7 @@ static void __init mxc_board_init(void)
 	gpio_usbh1_active();
 	mxc_register_device(&mxc_usbh1_device, &usbh1_config);
 	/* setback USBH1_STP to be function */
-	mxc_iomux_v3_setup_pad(&usbh1stp);
+	mxc_iomux_v3_setup_pad(usbh1stp);
 	babbage_usbhub_reset();
 
 	imx51_add_sdhci_esdhc_imx(0, NULL);
arch/arm/plat-mxc/include/mach/iomux-v3.h +37 -53

102 lines not on this page · raw message

arch/arm/plat-mxc/iomux-v3.c +16 -9
index 4cbbf2c..99a9cdb 100644
@@ -34,17 +34,24 @@ static void __iomem *base;
 /*
  * configures a single pad in the iomuxer
  */
-int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t *pad)
+int mxc_iomux_v3_setup_pad(iomux_v3_cfg_t pad)
 {
-	if (MUX_CTRL_OFS(pad))
-		__raw_writel(MUX_MODE(pad), base + MUX_CTRL_OFS(pad));
+	u32 mux_ctrl_ofs = (pad & MUX_CTRL_OFS_MASK) >> MUX_CTRL_OFS_SHIFT;
+	u32 mux_mode = (pad & MUX_MODE_MASK) >> MUX_MODE_SHIFT;
+	u32 sel_input_ofs = (pad & MUX_SEL_INPUT_OFS_MASK) >> MUX_SEL_INPUT_OFS_SHIFT;
+	u32 sel_input = (pad & MUX_SEL_INPUT_MASK) >> MUX_SEL_INPUT_SHIFT;
+	u32 pad_ctrl_ofs = (pad & MUX_PAD_CTRL_OFS_MASK) >> MUX_PAD_CTRL_OFS_SHIFT;
+	u32 pad_ctrl = (pad & MUX_PAD_CTRL_MASK) >> MUX_PAD_CTRL_SHIFT;
 
-	if (MUX_SELECT_INPUT_OFS(pad))
-		__raw_writel(MUX_SELECT_INPUT(pad),
-			base + MUX_SELECT_INPUT_OFS(pad));
+	if (mux_ctrl_ofs)
+		__raw_writel(mux_mode, base + mux_ctrl_ofs);
+
+	if (sel_input_ofs)
+		__raw_writel(sel_input, base + sel_input_ofs);
+
+	if (!(pad_ctrl & NO_PAD_CTRL) && pad_ctrl_ofs)
+		__raw_writel(pad_ctrl, base + pad_ctrl_ofs);
 
-	if (!(MUX_PAD_CTRL(pad) & NO_PAD_CTRL) && MUX_PAD_CTRL_OFS(pad))
-		__raw_writel(MUX_PAD_CTRL(pad), base + MUX_PAD_CTRL_OFS(pad));
 	return 0;
 }
 EXPORT_SYMBOL(mxc_iomux_v3_setup_pad);
@@ -56,7 +63,7 @@ int mxc_iomux_v3_setup_multiple_pads(iomux_v3_cfg_t *pad_list, unsigned count)
 	int ret;
 
 	for (i = 0; i < count; i++) {
-		ret = mxc_iomux_v3_setup_pad(p);
+		ret = mxc_iomux_v3_setup_pad(*p);
 		if (ret)
 			return ret;
 		p++;
Signature · 1 line
1.7.2.3
author maintainer
#2 lore raw

PATCH 2/2 ARM i.MX51: Full iomux support

In reply to Sascha Hauer

This iomux file has been constructed from the Freescale pinmux tool. It contains all pins from the tool, but the datasheet lists some configurations not present in the tool, these are not yet added.

---
 arch/arm/mach-mx5/board-cpuimx51.c           |   14 +-
 arch/arm/mach-mx5/board-cpuimx51sd.c         |   32 +-
 arch/arm/mach-mx5/board-mx51_3ds.c           |    4 +-
 arch/arm/mach-mx5/board-mx51_babbage.c       |   38 +-
 arch/arm/mach-mx5/board-mx51_efikamx.c       |   22 +-
 arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c |   10 +-
 arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c |    9 +-
 arch/arm/plat-mxc/include/mach/iomux-mx51.h  | 1904 +++++++++++++++++++++-----
 arch/arm/plat-mxc/include/mach/iomux-v3.h    |    2 +
 9 files changed, 1604 insertions(+), 431 deletions(-)
arch/arm/mach-mx5/board-cpuimx51.c +7 -7
index 125a196..f8652ef 100644
@@ -121,15 +121,15 @@ static iomux_v3_cfg_t eukrea_cpuimx51_pads[] = {
 	MX51_PAD_UART1_CTS__UART1_CTS,
 
 	/* I2C2 */
-	MX51_PAD_GPIO_1_2__I2C2_SCL,
-	MX51_PAD_GPIO_1_3__I2C2_SDA,
-	MX51_PAD_NANDF_D10__GPIO_3_30,
+	MX51_PAD_GPIO1_2__I2C2_SCL,
+	MX51_PAD_GPIO1_3__I2C2_SDA,
+	MX51_PAD_NANDF_D10__GPIO3_30,
 
 	/* QUART IRQ */
-	MX51_PAD_NANDF_D15__GPIO_3_25,
-	MX51_PAD_NANDF_D14__GPIO_3_26,
-	MX51_PAD_NANDF_D13__GPIO_3_27,
-	MX51_PAD_NANDF_D12__GPIO_3_28,
+	MX51_PAD_NANDF_D15__GPIO3_25,
+	MX51_PAD_NANDF_D14__GPIO3_26,
+	MX51_PAD_NANDF_D13__GPIO3_27,
+	MX51_PAD_NANDF_D12__GPIO3_28,
 
 	/* USB HOST1 */
 	MX51_PAD_USBH1_CLK__USBH1_CLK,
arch/arm/mach-mx5/board-cpuimx51sd.c +16 -16
index 7e8fb82..ad93189 100644
@@ -65,9 +65,6 @@
 #define	MX51_USB_PLL_DIV_19_2_MHZ	0x01
 #define	MX51_USB_PLL_DIV_24_MHZ		0x02
 
-#define CPUIMX51SD_GPIO_3_12 IOMUX_PAD(0x57C, 0x194, 3, 0x0, 0, \
-				MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP)
-
 static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
 	/* UART1 */
 	MX51_PAD_UART1_RXD__UART1_RXD,
@@ -88,30 +85,33 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
 	MX51_PAD_USBH1_DATA6__USBH1_DATA6,
 	MX51_PAD_USBH1_DATA7__USBH1_DATA7,
 	MX51_PAD_USBH1_STP__USBH1_STP,
-	MX51_PAD_EIM_CS3__GPIO_2_28,		/* PHY nRESET */
+	MX51_PAD_EIM_CS3__GPIO2_28,		/* PHY nRESET */
 
 	/* FEC */
-	MX51_PAD_EIM_DTACK__GPIO_2_31,		/* PHY nRESET */
+	MX51_PAD_EIM_DTACK__GPIO2_31,		/* PHY nRESET */
 
 	/* HSI2C */
-	MX51_PAD_I2C1_CLK__GPIO_4_16,
-	MX51_PAD_I2C1_DAT__GPIO_4_17,
+	MX51_PAD_I2C1_CLK__GPIO4_16,
+	MX51_PAD_I2C1_DAT__GPIO4_17,
 
 	/* CAN */
 	MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
 	MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
 	MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
-	MX51_PAD_CSPI1_SS0__GPIO_4_24,		/* nCS */
-	MX51_PAD_CSI2_PIXCLK__GPIO_4_15,	/* nReset */
-	MX51_PAD_GPIO_1_1__GPIO_1_1,		/* IRQ */
-	MX51_PAD_GPIO_1_4__GPIO_1_4,		/* Control signals */
-	MX51_PAD_GPIO_1_6__GPIO_1_6,
-	MX51_PAD_GPIO_1_7__GPIO_1_7,
-	MX51_PAD_GPIO_1_8__GPIO_1_8,
-	MX51_PAD_GPIO_1_9__GPIO_1_9,
+	MX51_PAD_CSPI1_SS0__GPIO4_24,		/* nCS */
+	MX51_PAD_CSI2_PIXCLK__GPIO4_15,		/* nReset */
+	MX51_PAD_GPIO1_1__GPIO1_1,		/* IRQ */
+	MX51_PAD_GPIO1_4__GPIO1_4,		/* Control signals */
+	MX51_PAD_GPIO1_6__GPIO1_6,
+	MX51_PAD_GPIO1_7__GPIO1_7,
+	MX51_PAD_GPIO1_8__GPIO1_8,
+	MX51_PAD_GPIO1_9__GPIO1_9,
 
 	/* Touchscreen */
-	CPUIMX51SD_GPIO_3_12,			/* IRQ */
+	/* IRQ */
+	_MX51_PAD_CSI1_D8__GPIO3_12 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
+			PAD_CTL_PKE | PAD_CTL_SRE_FAST |
+			PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
 };
 
 static const struct imxuart_platform_data uart_pdata __initconst = {
arch/arm/mach-mx5/board-mx51_3ds.c +2 -2
index 6cc2805..e42bd2e 100644
@@ -50,7 +50,7 @@ static iomux_v3_cfg_t mx51_3ds_pads[] = {
 	MX51_PAD_EIM_D27__UART3_RTS,
 
 	/* CPLD PARENT IRQ PIN */
-	MX51_PAD_GPIO_1_6__GPIO_1_6,
+	MX51_PAD_GPIO1_6__GPIO1_6,
 
 	/* KPP */
 	MX51_PAD_KEY_ROW0__KEY_ROW0,
@@ -68,7 +68,7 @@ static iomux_v3_cfg_t mx51_3ds_pads[] = {
 	MX51_PAD_NANDF_RB2__ECSPI2_SCLK,
 	MX51_PAD_NANDF_RB3__ECSPI2_MISO,
 	MX51_PAD_NANDF_D15__ECSPI2_MOSI,
-	MX51_PAD_NANDF_D12__GPIO_3_28,
+	MX51_PAD_NANDF_D12__GPIO3_28,
 };
 
 /* Serial ports */
arch/arm/mach-mx5/board-mx51_babbage.c +19 -19
index 24e335c..1d231e8 100644
@@ -95,8 +95,8 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
 	MX51_PAD_KEY_COL5__I2C2_SDA,
 
 	/* HSI2C */
-	MX51_PAD_I2C1_CLK__HSI2C_CLK,
-	MX51_PAD_I2C1_DAT__HSI2C_DAT,
+	MX51_PAD_I2C1_CLK__I2C1_CLK,
+	MX51_PAD_I2C1_DAT__I2C1_DAT,
 
 	/* USB HOST1 */
 	MX51_PAD_USBH1_CLK__USBH1_CLK,
@@ -112,29 +112,29 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
 	MX51_PAD_USBH1_DATA7__USBH1_DATA7,
 
 	/* USB HUB reset line*/
-	MX51_PAD_GPIO_1_7__GPIO_1_7,
+	MX51_PAD_GPIO1_7__GPIO1_7,
 
 	/* FEC */
 	MX51_PAD_EIM_EB2__FEC_MDIO,
-	MX51_PAD_EIM_EB3__FEC_RDAT1,
-	MX51_PAD_EIM_CS2__FEC_RDAT2,
-	MX51_PAD_EIM_CS3__FEC_RDAT3,
+	MX51_PAD_EIM_EB3__FEC_RDATA1,
+	MX51_PAD_EIM_CS2__FEC_RDATA2,
+	MX51_PAD_EIM_CS3__FEC_RDATA3,
 	MX51_PAD_EIM_CS4__FEC_RX_ER,
 	MX51_PAD_EIM_CS5__FEC_CRS,
 	MX51_PAD_NANDF_RB2__FEC_COL,
-	MX51_PAD_NANDF_RB3__FEC_RXCLK,
-	MX51_PAD_NANDF_RB6__FEC_RDAT0,
-	MX51_PAD_NANDF_RB7__FEC_TDAT0,
+	MX51_PAD_NANDF_RB3__FEC_RX_CLK,
+	MX51_PAD_NANDF_D9__FEC_RDATA0,
+	MX51_PAD_NANDF_D8__FEC_TDATA0,
 	MX51_PAD_NANDF_CS2__FEC_TX_ER,
 	MX51_PAD_NANDF_CS3__FEC_MDC,
-	MX51_PAD_NANDF_CS4__FEC_TDAT1,
-	MX51_PAD_NANDF_CS5__FEC_TDAT2,
-	MX51_PAD_NANDF_CS6__FEC_TDAT3,
+	MX51_PAD_NANDF_CS4__FEC_TDATA1,
+	MX51_PAD_NANDF_CS5__FEC_TDATA2,
+	MX51_PAD_NANDF_CS6__FEC_TDATA3,
 	MX51_PAD_NANDF_CS7__FEC_TX_EN,
 	MX51_PAD_NANDF_RDY_INT__FEC_TX_CLK,
 
 	/* FEC PHY reset line */
-	MX51_PAD_EIM_A20__GPIO_2_14,
+	MX51_PAD_EIM_A20__GPIO2_14,
 
 	/* SD 1 */
 	MX51_PAD_SD1_CMD__SD1_CMD,
@@ -156,8 +156,8 @@ static iomux_v3_cfg_t mx51babbage_pads[] = {
 	MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
 	MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
 	MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
-	MX51_PAD_CSPI1_SS0__GPIO_4_24,
-	MX51_PAD_CSPI1_SS1__GPIO_4_25,
+	MX51_PAD_CSPI1_SS0__GPIO4_24,
+	MX51_PAD_CSPI1_SS1__GPIO4_25,
 };
 
 /* Serial ports */
@@ -188,8 +188,8 @@ static struct imxi2c_platform_data babbage_hsi2c_data = {
 
 static int gpio_usbh1_active(void)
 {
-	iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO_1_27;
-	iomux_v3_cfg_t phyreset_gpio = MX51_PAD_EIM_D21__GPIO_2_5;
+	iomux_v3_cfg_t usbh1stp_gpio = MX51_PAD_USBH1_STP__GPIO1_27;
+	iomux_v3_cfg_t phyreset_gpio = MX51_PAD_EIM_D21__GPIO2_5;
 	int ret;
 
 	/* Set USBH1_STP to GPIO and toggle it */
@@ -352,8 +352,8 @@ static const struct spi_imx_master mx51_babbage_spi_pdata __initconst = {
 static void __init mxc_board_init(void)
 {
 	iomux_v3_cfg_t usbh1stp = MX51_PAD_USBH1_STP__USBH1_STP;
-	iomux_v3_cfg_t power_key = (MX51_PAD_EIM_A27__GPIO_2_21 &
-				~MUX_PAD_CTRL_MASK) | MX51_GPIO_PAD_CTRL_2;
+	iomux_v3_cfg_t power_key = _MX51_PAD_EIM_A27__GPIO2_21 |
+		MUX_PAD_CTRL(PAD_CTL_SRE_FAST | PAD_CTL_DSE_HIGH | PAD_CTL_PUS_100K_UP);
 
 #if defined(CONFIG_CPU_FREQ_IMX)
 	get_cpu_op = mx51_get_cpu_op;
arch/arm/mach-mx5/board-mx51_efikamx.c +11 -11
index 94e7818..b7946f8 100644
@@ -94,15 +94,15 @@ static iomux_v3_cfg_t mx51efikamx_pads[] = {
 	MX51_PAD_SD2_DATA3__SD2_DATA3,
 
 	/* SD/MMC WP/CD */
-	MX51_PAD_GPIO_1_0__ESDHC1_CD,
-	MX51_PAD_GPIO_1_1__ESDHC1_WP,
-	MX51_PAD_GPIO_1_7__ESDHC2_WP,
-	MX51_PAD_GPIO_1_8__ESDHC2_CD,
+	MX51_PAD_GPIO1_0__SD1_CD,
+	MX51_PAD_GPIO1_1__SD1_WP,
+	MX51_PAD_GPIO1_7__SD2_WP,
+	MX51_PAD_GPIO1_8__SD2_CD,
 
 	/* leds */
-	MX51_PAD_CSI1_D9__GPIO_3_13,
-	MX51_PAD_CSI1_VSYNC__GPIO_3_14,
-	MX51_PAD_CSI1_HSYNC__GPIO_3_15,
+	MX51_PAD_CSI1_D9__GPIO3_13,
+	MX51_PAD_CSI1_VSYNC__GPIO3_14,
+	MX51_PAD_CSI1_HSYNC__GPIO3_15,
 
 	/* power key */
 	MX51_PAD_PWRKEY,
@@ -110,14 +110,14 @@ static iomux_v3_cfg_t mx51efikamx_pads[] = {
 	/* spi */
 	MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
 	MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
-	MX51_PAD_CSPI1_SS0__GPIO_4_24,
-	MX51_PAD_CSPI1_SS1__GPIO_4_25,
+	MX51_PAD_CSPI1_SS0__GPIO4_24,
+	MX51_PAD_CSPI1_SS1__GPIO4_25,
 	MX51_PAD_CSPI1_RDY__ECSPI1_RDY,
 	MX51_PAD_CSPI1_SCLK__ECSPI1_SCLK,
 
 	/* reset */
-	MX51_PAD_DI1_PIN13__GPIO_3_2,
-	MX51_PAD_GPIO_1_4__GPIO_1_4,
+	MX51_PAD_DI1_PIN13__GPIO3_2,
+	MX51_PAD_GPIO1_4__GPIO1_4,
 };
 
 /* Serial ports */
arch/arm/mach-mx5/eukrea_mbimx51-baseboard.c +5 -5
index 94c293f..c96d018 100644
@@ -96,13 +96,13 @@ static iomux_v3_cfg_t mbimx51_pads[] = {
 	MX51_PAD_KEY_COL5__UART3_CTS,
 
 	/* TSC2007 IRQ */
-	MX51_PAD_NANDF_D10__GPIO_3_30,
+	MX51_PAD_NANDF_D10__GPIO3_30,
 
 	/* LEDS */
-	MX51_PAD_DISPB2_SER_DIN__GPIO_3_5,
-	MX51_PAD_DISPB2_SER_DIO__GPIO_3_6,
-	MX51_PAD_DISPB2_SER_CLK__GPIO_3_7,
-	MX51_PAD_DISPB2_SER_RS__GPIO_3_8,
+	MX51_PAD_DISPB2_SER_DIN__GPIO3_5,
+	MX51_PAD_DISPB2_SER_DIO__GPIO3_6,
+	MX51_PAD_DISPB2_SER_CLK__GPIO3_7,
+	MX51_PAD_DISPB2_SER_RS__GPIO3_8,
 
 	/* KPP */
 	MX51_PAD_KEY_ROW0__KEY_ROW0,
arch/arm/mach-mx5/eukrea_mbimxsd-baseboard.c +4 -5
index c6c2320..c372a43 100644
@@ -45,14 +45,13 @@
 #include "devices-imx51.h"
 #include "devices.h"
 
-#define MBIMXSD_GPIO_3_31 IOMUX_PAD(0x554, 0x16C, 3, 0x0, 0, \
-				MX51_PAD_CTRL_1 | PAD_CTL_PUS_22K_UP)
-
 static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
 	/* LED */
-	MX51_PAD_NANDF_D10__GPIO_3_30,
+	MX51_PAD_NANDF_D10__GPIO3_30,
 	/* SWITCH */
-	MBIMXSD_GPIO_3_31,
+	_MX51_PAD_NANDF_D9__GPIO3_31 | MUX_PAD_CTRL(PAD_CTL_PUS_22K_UP |
+			PAD_CTL_PKE | PAD_CTL_SRE_FAST |
+			PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
 	/* UART2 */
 	MX51_PAD_UART2_RXD__UART2_RXD,
 	MX51_PAD_UART2_TXD__UART2_TXD,
arch/arm/plat-mxc/include/mach/iomux-mx51.h +1538 -366

1,919 lines not on this page · raw message

arch/arm/plat-mxc/include/mach/iomux-v3.h +2 -0
index 1462a1c..2277b01 100644
@@ -70,6 +70,8 @@ typedef u64 iomux_v3_cfg_t;
 #define MUX_SEL_INPUT_SHIFT	58
 #define MUX_SEL_INPUT_MASK	((iomux_v3_cfg_t)0xf << MUX_SEL_INPUT_SHIFT)
 
+#define MUX_PAD_CTRL(x)		((iomux_v3_cfg_t)(x) << MUX_PAD_CTRL_SHIFT)
+
 #define IOMUX_PAD(_pad_ctrl_ofs, _mux_ctrl_ofs, _mux_mode, _sel_input_ofs, \
 		_sel_input, _pad_ctrl)					\
 	(((iomux_v3_cfg_t)(_mux_ctrl_ofs) << MUX_CTRL_OFS_SHIFT) |	\
Signature · 1 line
1.7.2.3
#3 lore raw

PATCH 1/1 i.MX51: Full iomux support

In reply to Sascha Hauer
Quoted 1 line · Sascha Hauer

Hi,

Hi,

Quoted 8 lines

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present.

I'm seeing a lot of changes in the iomux file and I have a patch [1] setting the SION bit for all gpios configuration so that reading the PSR value is giving usefull results when the gpio is configured as output. I wanted to send it this week but it will obviously conflict with this. Should I test your patchset first and if it's working, wait for its merge or should I send it anyway ? How do you want to deal with this (as long as you're fine with setting the SION bit for all gpios) ?

Thanks,
Arnaud

[1] http://git.rtp-net.org/?p=efika.git;a=blob;f=mx51_gpiolib_out_value.patch;h=62d4db72c1021f8cb756a728390dbab2ca02c44a;hb=HEAD

#4 lore raw

PATCH 1/1 i.MX51: Full iomux support

Hi,

Quoted 1 line · Arnaud Patard (Rtp)

Sascha Hauer <[email protected]> writes:

[...]

Quoted 8 lines
Quoted 7 lines

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present.

Quoted 8 lines

I'm seeing a lot of changes in the iomux file and I have a patch [1] setting the SION bit for all gpios configuration so that reading the PSR value is giving usefull results when the gpio is configured as output. I wanted to send it this week but it will obviously conflict with this. Should I test your patchset first and if it's working, wait for its merge or should I send it anyway ? How do you want to deal with this (as long as you're fine with setting the SION bit for all gpios) ?

I had done the same, but had some trouble with this. E.g. on our board GPIO1_7 is used as a generic GPIO to enable an external clock oscillator for the USBH1 ULPI PHY. When the SION bit for this pad was set, I got strange errors on the USBH1 port (disconnecting low speed devices behind a hub would stall the bus). When I removed the SION bit for that pin everything worked well.

It looks like the SION setting may adversly affect the GPIO functions on the i.MX51.

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
author maintainer
#5 lore raw

PATCH 1/1 i.MX51: Full iomux support

Quoted 29 lines · Lothar Wa?mann

Hi,

Quoted 1 line · Arnaud Patard (Rtp)

Sascha Hauer <[email protected]> writes:

[...]

Quoted 8 lines
Quoted 7 lines

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present.

Quoted 8 lines

I'm seeing a lot of changes in the iomux file and I have a patch [1] setting the SION bit for all gpios configuration so that reading the PSR value is giving usefull results when the gpio is configured as output. I wanted to send it this week but it will obviously conflict with this. Should I test your patchset first and if it's working, wait for its merge or should I send it anyway ? How do you want to deal with this (as long as you're fine with setting the SION bit for all gpios) ?

I had done the same, but had some trouble with this. E.g. on our board GPIO1_7 is used as a generic GPIO to enable an external clock oscillator for the USBH1 ULPI PHY. When the SION bit for this pad was set, I got strange errors on the USBH1 port (disconnecting low speed devices behind a hub would stall the bus). When I removed the SION bit for that pin everything worked well.

Quoted 2 lines

It looks like the SION setting may adversly affect the GPIO functions on the i.MX51.

This seems to suggest that we should leave the SION settings for the gpios up to the board. With a simple bitmask it's easy enough for the boards to customize the pinmux settings.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#6 lore raw

PATCH 1/1 i.MX51: Full iomux support

In reply to Lothar Waßmann
Quoted 21 lines · Lothar Wa?mann

Hi,

Quoted 1 line · Arnaud Patard (Rtp)

Sascha Hauer <[email protected]> writes:

[...]

Quoted 8 lines
Quoted 7 lines

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present.

Quoted 8 lines

I'm seeing a lot of changes in the iomux file and I have a patch [1] setting the SION bit for all gpios configuration so that reading the PSR value is giving usefull results when the gpio is configured as output. I wanted to send it this week but it will obviously conflict with this. Should I test your patchset first and if it's working, wait for its merge or should I send it anyway ? How do you want to deal with this (as long as you're fine with setting the SION bit for all gpios) ?

Quoted 7 lines

I had done the same, but had some trouble with this. E.g. on our board GPIO1_7 is used as a generic GPIO to enable an external clock oscillator for the USBH1 ULPI PHY. When the SION bit for this pad was set, I got strange errors on the USBH1 port (disconnecting low speed devices behind a hub would stall the bus). When I removed the SION bit for that pin everything worked well.

wow. Would be nice to have feedback from fsl. I was fearing of bad effects but I didn't think they could actually break something so badly. After all, the manual doesn't warn about possible side effects of the SION bit iirc. This would mean this will have to be dealt on a board basis. It would be... erm... not really "efficient".

Arnaud

#7 lore raw

PATCH 1/1 i.MX51: Full iomux support

Hi,

Quoted 38 lines

-----Original Message-----
From: Arnaud Patard [mailto:arnaud.patard at rtp-net.org]
Sent: Wednesday, December 15, 2010 9:37 AM
To: Lothar Wa?mann
Cc: Sascha Hauer; linux-arm-kernel at lists.infradead.org; Richard Zhao; Nguyen Dinh-R00091; Jason Wang
Subject: Re: [PATCH] i.MX51: Full iomux support

Quoted 21 lines · Lothar Wa?mann

Hi,

Quoted 1 line · Arnaud Patard (Rtp)

Sascha Hauer <[email protected]> writes:

[...]

Quoted 8 lines
Quoted 7 lines

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present.

Quoted 8 lines

I'm seeing a lot of changes in the iomux file and I have a patch [1] setting the SION bit for all gpios configuration so that reading the PSR value is giving usefull results when the gpio is configured as output. I wanted to send it this week but it will obviously conflict with this. Should I test your patchset first and if it's working, wait for its merge or should I send it anyway ? How do you want to deal with this (as long as you're fine with setting the SION bit for all gpios) ?

Quoted 7 lines

I had done the same, but had some trouble with this. E.g. on our board GPIO1_7 is used as a generic GPIO to enable an external clock oscillator for the USBH1 ULPI PHY. When the SION bit for this pad was set, I got strange errors on the USBH1 port (disconnecting low speed devices behind a hub would stall the bus). When I removed the SION bit for that pin everything worked well.

Quoted 7 lines

wow. Would be nice to have feedback from fsl. I was fearing of bad effects but I didn't think they could actually break something so badly. After all, the manual doesn't warn about possible side effects of the SION bit iirc. This would mean this will have to be dealt on a board basis. It would be... erm... not really "efficient".

Arnaud

You cannot blindly set the SION bit for all GPIO's. I have to dig through my email history for a more technical explanation.

Thanks,
Dinh

#8 lore raw

PATCH 1/1 i.MX51: Full iomux support

In reply to Arnaud Patard (Rtp)

Hi,

Quoted 53 lines

-----Original Message-----
From: Nguyen Dinh-R00091
Sent: Monday, December 27, 2010 11:47 AM
To: 'Arnaud Patard'; Lothar Wa?mann
Cc: Sascha Hauer; linux-arm-kernel at lists.infradead.org; Richard Zhao; Jason Wang
Subject: RE: [PATCH] i.MX51: Full iomux support

Hi,

Quoted 44 lines

-----Original Message-----
From: Arnaud Patard [mailto:arnaud.patard at rtp-net.org]
Sent: Wednesday, December 15, 2010 9:37 AM
To: Lothar Wa?mann
Cc: Sascha Hauer; linux-arm-kernel at lists.infradead.org; Richard Zhao; Nguyen Dinh-R00091; Jason Wang
Subject: Re: [PATCH] i.MX51: Full iomux support

Quoted 21 lines · Lothar Wa?mann

Hi,

Quoted 1 line · Arnaud Patard (Rtp)

Sascha Hauer <[email protected]> writes:

[...]

Quoted 8 lines
Quoted 7 lines

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present.

Quoted 8 lines

I'm seeing a lot of changes in the iomux file and I have a patch [1] setting the SION bit for all gpios configuration so that reading the PSR value is giving usefull results when the gpio is configured as output. I wanted to send it this week but it will obviously conflict with this. Should I test your patchset first and if it's working, wait for its merge or should I send it anyway ? How do you want to deal with this (as long as you're fine with setting the SION bit for all gpios) ?

Quoted 7 lines

I had done the same, but had some trouble with this. E.g. on our board GPIO1_7 is used as a generic GPIO to enable an external clock oscillator for the USBH1 ULPI PHY. When the SION bit for this pad was set, I got strange errors on the USBH1 port (disconnecting low speed devices behind a hub would stall the bus). When I removed the SION bit for that pin everything worked well.

wow. Would be nice to have feedback from fsl. I was fearing of bad effects but I didn't think they could actually break something so badly. After all, the manual doesn't warn about possible side effects of the SION bit iirc. This would mean this will have to be dealt on a board basis. It would be... erm... not really "efficient".

Quoted 7 lines
Quoted 1 line

Arnaud

You cannot blindly set the SION bit for all GPIO's. I have to dig through my email history for a more technical explanation.

Thanks,
Dinh

The SION bit is a "Software Input On" bit. Basically, if you set the GPIO as an output, you cannot set the SION bit.

Dinh

#9 lore raw

PATCH 1/1 i.MX51: Full iomux support

Hi,

Quoted 55 lines · Nguyen Dinh-R00091 writes:
Quoted 55 lines

-----Original Message-----
From: Nguyen Dinh-R00091
Sent: Monday, December 27, 2010 11:47 AM
To: 'Arnaud Patard'; Lothar Wa?mann
Cc: Sascha Hauer; linux-arm-kernel at lists.infradead.org; Richard Zhao; Jason Wang
Subject: RE: [PATCH] i.MX51: Full iomux support

Hi,

Quoted 45 lines

-----Original Message-----
From: Arnaud Patard [mailto:arnaud.patard at rtp-net.org]
Sent: Wednesday, December 15, 2010 9:37 AM
To: Lothar Wa?mann
Cc: Sascha Hauer; linux-arm-kernel at lists.infradead.org; Richard Zhao; Nguyen Dinh-R00091; Jason Wang
Subject: Re: [PATCH] i.MX51: Full iomux support

Quoted 21 lines · Lothar Wa?mann

Hi,

Quoted 1 line · Arnaud Patard (Rtp)

Sascha Hauer <[email protected]> writes:

[...]

Quoted 8 lines
Quoted 7 lines

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present.

Quoted 8 lines

I'm seeing a lot of changes in the iomux file and I have a patch [1] setting the SION bit for all gpios configuration so that reading the PSR value is giving usefull results when the gpio is configured as output. I wanted to send it this week but it will obviously conflict with this. Should I test your patchset first and if it's working, wait for its merge or should I send it anyway ? How do you want to deal with this (as long as you're fine with setting the SION bit for all gpios) ?

Quoted 7 lines

I had done the same, but had some trouble with this. E.g. on our board GPIO1_7 is used as a generic GPIO to enable an external clock oscillator for the USBH1 ULPI PHY. When the SION bit for this pad was set, I got strange errors on the USBH1 port (disconnecting low speed devices behind a hub would stall the bus). When I removed the SION bit for that pin everything worked well.

wow. Would be nice to have feedback from fsl. I was fearing of bad effects but I didn't think they could actually break something so badly. After all, the manual doesn't warn about possible side effects of the SION bit iirc. This would mean this will have to be dealt on a board basis. It would be... erm... not really "efficient".

Arnaud

Quoted 8 lines
Quoted 5 lines

You cannot blindly set the SION bit for all GPIO's. I have to dig through my email history for a more technical explanation.

Thanks,
Dinh

The SION bit is a "Software Input On" bit.

What the heck is a "Software Input On" bit?
What is the exact purpose of this bit?

Quoted 2 lines

Basically, if you set the GPIO as an output, you cannot set the SION bit.

According to my experience, that's not true. The bit can very well be set for a GPIO output with the effect, that you can read back the GPIO state via the PSR register (which in my understanding would be the purpose of the bit).

Maybe you meant: "you 'must not' set the bit SION bit" [for a GPIO output]?
But then why, and what is the bit supposed to be good for?

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
author maintainer
#10 lore raw

PATCH 1/1 i.MX51: Full iomux support

In reply to Arnaud Patard (Rtp)
Quoted 15 lines · Arnaud Patard
Quoted 1 line · Sascha Hauer

Hi,

Hi,

Quoted 8 lines

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present.

Quoted 7 lines

I'm seeing a lot of changes in the iomux file and I have a patch [1] setting the SION bit for all gpios configuration so that reading the PSR value is giving usefull results when the gpio is configured as output. I wanted to send it this week but it will obviously conflict with this. Should I test your patchset first and if it's working, wait for its merge or should I send it anyway ? How do you want to deal with this (as long as you're fine with setting the SION bit for all gpios) ?

I'm fine with setting the SION bit for all gpios, I'm also fine with setting the SION bit everywhere it's available (I tried this during testing and it didn't have bad effects).

Maybe one of the Freescale guys can comment on this. On the i.MX35 we did not need this bit. There were the pinmux registers for configuring the the way from the internal units to the pads and the sel_input registers for the way back.
On i.MX51 there are several pins which do not have a sel_input register associated (I2C) and so setting the SION bit becomes mandatory. On the other hand not all pins have a SION bit. I'm confused...

Anyway, I can add the SION bits to the missing pins once we agree on what we want to do.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#11 lore raw

PATCH 1/1 i.MX51: Full iomux support

Hi,

Quoted 4 lines · Sascha Hauer

On i.MX51 there are several pins which do not have a sel_input register associated (I2C) and so setting the SION bit becomes mandatory. On the other hand not all pins have a SION bit. I'm confused...

sel_input has nothing to do with SION. sel_input is an additional multiplexer that can route one of different pads for a given internal function.
SION (according to the spec) enables the input path of a pad no matter what function is chosen.

Lothar Wa?mann

Signature · 9 lines
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Gesch?ftsf?hrer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info at karo-electronics.de
___________________________________________________________
#12 lore raw

PATCH 1/1 i.MX51: Full iomux support

In reply to Sascha Hauer
Quoted 12 lines · Sascha Hauer

The following series picks up the patch from Lothar Wa?mann replacing the struct pad_desc with a 64bit variable and adds full i.MX51 iomux support based on this patch.
The iomux configurations are taken from the Freescale pinmux tool, so the definitions should be rather complete. Anyway, there are some modes not present in the tool.
I took the padmux settings from the old iomux support where present. This series was tested on the babbage board, but due to the mass of defines they are of course not completely tested, so please test yourself if your board still works.

I had just started implementing an alternative solution :(

MACROS
======

#define _MX51_PAD_DEF(mux, pad) .mux_ctrl_ofs = (mux), .pad_ctrl_ofs = (pad)
#define _MX51_SIG_DEF(sel) .select_input_ofs = (sel)
#define _MX51_MAP_DEF(mux, sel) .mux_mode = (mux), .select_input = (sel)
#define _MX51_CTL_DEF(ctl) .pad_ctrl = (ctl)

/* pad definitions */

...
#define _MX51_PAD_EIM_D25 _MX51_PAD_DEF(0x414, 0x080)
...

/* signal definitions */

...
#define _MX51_SIG_UART3_RXD _MX51_SIG_DEF(0x9f4)
...

/* pad to signal mappings */

...
#define _MX51_MAP_EIM_D25__UART3_RXD _MX51_MAP_DEF(3, 0)
...

/* default pad control settings */

...
#define _MX51_CTL_EIM_D25__UART3_RXD _MX51_CTL_DEF(MX51_UART3_PAD_CTRL)
...

/* external macros */

#define MX51_PAD(pad, sig) \
	{ _MX51_PAD_##pad, _MX51_SIG_##sig, _MX51_MAP_##pad##__##sig, 

_MX51_CTL_##pad##__##sig }

#define MX51_PAD_CTL(pad, sig, ctl) \
	{ _MX51_PAD_##pad, _MX51_SIG_##sig, _MX51_MAP_##pad##__##sig, 

_MX51_CTL_DEF(ctl) }

USAGE
=====

/* using the default pad control value */

static iomux_v3_cfg_t board_pads[] = {
	...
	MX51_PAD(EIM_D25, UART3_RXD),
	...
};

/* specifying a pad control value */

static iomux_v3_cfg_t board_pads[] = {
	...
	MX51_PAD_CTL(EIM_D25, UART3_RXD, PAD_CTL_DSE_HIGH),
	...
};