Patchwork [U-Boot,2/2] orion5x: set GPIO output value before enabling

login
register
mail settings
Submitter Albert ARIBAUD
Date Sept. 4, 2010, 7:12 a.m.
Message ID <1283584346-20384-2-git-send-email-albert.aribaud@free.fr>
Download mbox | patch
Permalink /patch/71840/
State Changes Requested
Delegated to: Albert ARIBAUD
Headers show

Comments

Albert ARIBAUD - Sept. 4, 2010, 7:12 a.m.
GPIO output values from config file were ignored.
Set them, before enabling to avoid glitches.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
---
 arch/arm/cpu/arm926ejs/orion5x/cpu.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

Patch

diff --git a/arch/arm/cpu/arm926ejs/orion5x/cpu.c b/arch/arm/cpu/arm926ejs/orion5x/cpu.c
index 260f88b..d2d7ba5 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/cpu.c
+++ b/arch/arm/cpu/arm926ejs/orion5x/cpu.c
@@ -258,11 +258,14 @@  int arch_misc_init(void)
 	temp = get_cr();
 	set_cr(temp & ~CR_V);
 
-	/* Set CPIOs and MPPs - values provided by board
-	   include file */
+	/* Set MPPs as provided by board config file */
 	writel(ORION5X_MPP0_7, ORION5X_MPP_BASE+0x00);
 	writel(ORION5X_MPP8_15, ORION5X_MPP_BASE+0x04);
 	writel(ORION5X_MPP16_23, ORION5X_MPP_BASE+0x50);
+
+	/* set GPIOs as provided by board config file */
+	/* set values first to avoid glitches on outputs */
+	writel(ORION5X_GPIO_OUT_VALUE, ORION5X_GPIO_BASE+0x0);
 	writel(ORION5X_GPIO_OUT_ENABLE, ORION5X_GPIO_BASE+0x04);
 
 	return 0;