Fix QCA955x low level GPIO_OE register setup
authorPiotr Dymacz <pepe2k@gmail.com>
Sun, 16 Jul 2017 16:49:54 +0000 (18:49 +0200)
committerPiotr Dymacz <pepe2k@gmail.com>
Sun, 16 Jul 2017 17:14:26 +0000 (19:14 +0200)
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

index eaf11e244b51812c97b3bee048bca522f8c2200a..7199c480f4a49aeb17218a8cae79dd69b2e6fea5 100644 (file)
@@ -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)