Skip to contentSkip to conversation

mx51evk: Use GPIO API for configuring the IOMUX

PATCH New Fabio Estevam 2 participants 2 messages Oct 25, 2011 – Oct 26, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx51evk: Use GPIO API for configuring the IOMUX

GPIO API provides mxc_request_iomux function for setting the IOMUX mode.

Use this function instead of directly writing to the IOMUX register.

---
 board/freescale/mx51evk/mx51evk.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
board/freescale/mx51evk/mx51evk.c +3 -5
index 73ca513..9cd5b3c 100644
@@ -254,16 +254,14 @@ static void power_init(void)
 	pmic_reg_write(p, REG_MODE_1, val);
 	udelay(200);
 
-	gpio_direction_output(46, 0);
-
-	/* Reset the ethernet controller over GPIO */
-	writel(0x1, IOMUXC_BASE_ADDR + 0x0AC);
-
 	/* Enable VGEN3, VCAM, VAUDIO, VVIDEO, VSD regulators */
 	val = VGEN3EN | VGEN3CONFIG | VCAMEN | VCAMCONFIG |
 		VVIDEOEN | VAUDIOEN  | VSDEN;
 	pmic_reg_write(p, REG_MODE_1, val);
 
+	mxc_request_iomux(MX51_PIN_EIM_A20, IOMUX_CONFIG_ALT1);
+	gpio_direction_output(46, 0);
+
 	udelay(500);
 
 	gpio_set_value(46, 1);
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 mx51evk: Use GPIO API for configuring the IOMUX

Quoted 23 lines · Fabio Estevam

GPIO API provides mxc_request_iomux function for setting the IOMUX mode.

Use this function instead of directly writing to the IOMUX register.

---
 board/freescale/mx51evk/mx51evk.c |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)
board/freescale/mx51evk/mx51evk.c +0 -5
index 73ca513..9cd5b3c 100644
@@ -254,16 +254,14 @@ static void power_init(void)
 	pmic_reg_write(p, REG_MODE_1, val);
 	udelay(200);
 
-	gpio_direction_output(46, 0);
-
-	/* Reset the ethernet controller over GPIO */
-	writel(0x1, IOMUXC_BASE_ADDR + 0x0AC);
-
 	/* Enable VGEN3, VCAM, VAUDIO, VVIDEO, VSD regulators */

board/freescale/mx51evk/mx51evk.c static void power_init(void) · line 267

Quoted 10 lines
board/freescale/mx51evk/mx51evk.c +3 -0
 	val = VGEN3EN | VGEN3CONFIG | VCAMEN | VCAMCONFIG |
 		VVIDEOEN | VAUDIOEN  | VSDEN;
 	pmic_reg_write(p, REG_MODE_1, val);
 
+	mxc_request_iomux(MX51_PIN_EIM_A20, IOMUX_CONFIG_ALT1);
+	gpio_direction_output(46, 0);
+
 	udelay(500);
 
 	gpio_set_value(46, 1);

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

Signature · 5 lines
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================