[U-Boot] [PATCH 1/2] edminiv2.h: fix GPIO output value settings

Wrong output value was harmless as long as orion5x did not use it. Upcoming patch fixes orion5x, thus must fix edminiv2 config as well. Also update comments to clarify edminiv2 GPIO directions and values.
Signed-off-by: Albert Aribaud albert.aribaud@free.fr --- include/configs/edminiv2.h | 20 +++++++++++++------- 1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/include/configs/edminiv2.h b/include/configs/edminiv2.h index ccfc660..586ce06 100644 --- a/include/configs/edminiv2.h +++ b/include/configs/edminiv2.h @@ -52,10 +52,10 @@ #define CONFIG_SYS_HZ 1000
/* - * Board-specific values for Orion5x MPP low level init: + * Board-specific MPP settings for Orion5x: * - MPPs 12 to 15 are SATA LEDs (mode 5) * - Others are GPIO/unused (mode 3 for MPP0, mode 5 for - * MPP16 to MPP19, mode 0 for others + * MPP16 to MPP19, mode 0 for others) */
#define ORION5X_MPP0_7 0x00000003 @@ -63,18 +63,24 @@ #define ORION5X_MPP16_23 0x00005555
/* - * Board-specific values for Orion5x GPIO low level init: + * Board-specific GPIO directions for Orion5x: * - GPIO3 is input (RTC interrupt) - * - GPIO16 is Power LED control (0 = on, 1 = off) + * - GPIO16 is Power LED control (BEWARE: 0 = ON, 1 = OFF) * - GPIO17 is Power LED source select (0 = CPLD, 1 = GPIO16) * - GPIO18 is Power Button status (0 = Released, 1 = Pressed) * - Last GPIO is 26, further bits are supposed to be 0. - * Enable mask has ones for INPUT, 0 for OUTPUT. - * Default is LED ON. + * (Reminder: each enable bit is 1 for INPUT, 0 for OUTPUT) */
#define ORION5X_GPIO_OUT_ENABLE 0x03fcffff -#define ORION5X_GPIO_OUT_VALUE 0x03fcffff + +/* + * Board-specific GPIO output values for Orion5x: + * - GPIO16 (Power LED control) = 0 (on) + * - GPIO17 (is Power LED source) = 1 (GPIO16) + */ + +#define ORION5X_GPIO_OUT_VALUE 0x00020000
/* * NS16550 Configuration

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(-)
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;
participants (1)
-
Albert Aribaud