From 03b346402686e7ba9f271f659e67311be0b61bee Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Sun, 16 Jul 2017 18:49:54 +0200 Subject: [PATCH] Fix QCA955x low level GPIO_OE register setup Both AR933x and QCA955x WiSoC series mark output GPIOs in GPIO_OE register with bit set (and reset for inputs). --- u-boot/cpu/mips/ar7240/qca_gpio_init.S | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/u-boot/cpu/mips/ar7240/qca_gpio_init.S b/u-boot/cpu/mips/ar7240/qca_gpio_init.S index eaf11e2..7199c48 100644 --- a/u-boot/cpu/mips/ar7240/qca_gpio_init.S +++ b/u-boot/cpu/mips/ar7240/qca_gpio_init.S @@ -249,14 +249,30 @@ lowlevel_gpio_init: li t8, QCA_GPIO_OE_REG lw t9, 0(t8) #if defined(_GPIO_MASK_OUT) + #if (SOC_TYPE & QCA_QCA955X_SOC) + or t9, t9, (_GPIO_MASK_OUT | CONFIG_QCA_GPIO_MASK_LSUART_TX) + #else and t9, t9, ~(_GPIO_MASK_OUT | CONFIG_QCA_GPIO_MASK_LSUART_TX) + #endif #else - and t9, t9, ~(CONFIG_QCA_GPIO_MASK_LSUART_TX) + #if (SOC_TYPE & QCA_QCA955X_SOC) + or t9, t9, CONFIG_QCA_GPIO_MASK_LSUART_TX + #else + and t9, t9, ~CONFIG_QCA_GPIO_MASK_LSUART_TX + #endif #endif #if defined(_GPIO_MASK_IN) + #if (SOC_TYPE & QCA_QCA955X_SOC) + and t9, t9, ~(_GPIO_MASK_IN | CONFIG_QCA_GPIO_MASK_LSUART_RX) + #else or t9, t9, (_GPIO_MASK_IN | CONFIG_QCA_GPIO_MASK_LSUART_RX) + #endif #else + #if (SOC_TYPE & QCA_QCA955X_SOC) + and t9, t9, ~CONFIG_QCA_GPIO_MASK_LSUART_RX + #else or t9, t9, CONFIG_QCA_GPIO_MASK_LSUART_RX + #endif #endif sw t9, 0(t8) -- 2.25.1