Skip to contentSkip to conversation

sunxi: h3: add console support for uart1-3

PATCH New Manuel Dipolt 1 participant 1 message Jun 24, 2021 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#1 lore raw

PATCH 1/1 sunxi: h3: add console support for uart1-3

In reply to a message not in the archive

Add uart1-3 console support for the Allwinner H3 SOC

---

arch/arm/include/asm/arch-sunxi/gpio.h | 3 +++ arch/arm/mach-sunxi/board.c | 14 ++++++++++++++ include/configs/sunxi-common.h | 5 ++++-

3 files changed, 21 insertions(+), 1 deletion(-) 
arch/arm/include/asm/arch-sunxi/gpio.h +0 -0
index 40a3f845d0..50010071ae 100644 
@@ -148,6 +148,9 @@ enum sunxi_gpio_number { 

#define SUN6I_GPA_SDC2 5
#define SUN6I_GPA_SDC3 4
#define SUN8I_H3_GPA_UART0 2
+#define SUN8I_H3_GPG_UART1 2
+#define SUN8I_H3_GPA_UART2 2
+#define SUN8I_H3_GPA_UART3 3

#define SUN4I_GPB_PWM 2
#define SUN4I_GPB_TWI0 2

arch/arm/mach-sunxi/board.c +0 -0
index 8e9bb63d9d..31f780d1b5 100644 
@@ -127,10 +127,24 @@ static int gpio_init(void) 

sunxi_gpio_set_cfgpin(SUNXI_GPG(3), SUN5I_GPG_UART1); sunxi_gpio_set_cfgpin(SUNXI_GPG(4), SUN5I_GPG_UART1); sunxi_gpio_set_pull(SUNXI_GPG(4), SUNXI_GPIO_PULL_UP); +#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN8I_H3)
+ sunxi_gpio_set_cfgpin(SUNXI_GPG(7), SUN8I_H3_GPG_UART1);
+ sunxi_gpio_set_cfgpin(SUNXI_GPG(6), SUN8I_H3_GPG_UART1);
+ sunxi_gpio_set_pull(SUNXI_GPG(6), SUNXI_GPIO_PULL_UP); #elif CONFIG_CONS_INDEX == 3 && defined(CONFIG_MACH_SUN8I) +#if defined(CONFIG_MACH_SUN8I_H3)
+ sunxi_gpio_set_cfgpin(SUNXI_GPA(1), SUN8I_H3_GPA_UART2);
+ sunxi_gpio_set_cfgpin(SUNXI_GPA(0), SUN8I_H3_GPA_UART2);
+ sunxi_gpio_set_pull(SUNXI_GPA(0), SUNXI_GPIO_PULL_UP); +#else
sunxi_gpio_set_cfgpin(SUNXI_GPB(0), SUN8I_GPB_UART2); sunxi_gpio_set_cfgpin(SUNXI_GPB(1), SUN8I_GPB_UART2); sunxi_gpio_set_pull(SUNXI_GPB(1), SUNXI_GPIO_PULL_UP); +#endif
+#elif CONFIG_CONS_INDEX == 4 && defined(CONFIG_MACH_SUN8I_H3)
+ sunxi_gpio_set_cfgpin(SUNXI_GPA(14), SUN8I_H3_GPA_UART3);
+ sunxi_gpio_set_cfgpin(SUNXI_GPA(13), SUN8I_H3_GPA_UART3);
+ sunxi_gpio_set_pull(SUNXI_GPA(13), SUNXI_GPIO_PULL_UP); #elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I) sunxi_gpio_set_cfgpin(SUNXI_GPL(2), SUN8I_GPL_R_UART); sunxi_gpio_set_cfgpin(SUNXI_GPL(3), SUN8I_GPL_R_UART);

include/configs/sunxi-common.h +0 -0
index fceb812448..5b7c310fde 100644 
@@ -246,10 +246,13 @@ extern int soft_i2c_gpio_scl; 

#else
#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28000:115200" #endif
-#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN5I) +#elif CONFIG_CONS_INDEX == 2 && \
+ (defined(CONFIG_MACH_SUN5I) || \defined(CONFIG_MACH_SUN8I_H3)) #define OF_STDOUT_PATH "/soc@01c00000/serial@01c28400:115200" #elif CONFIG_CONS_INDEX == 3 && defined(CONFIG_MACH_SUN8I) #define OF_STDOUT_PATH "/soc@01c00000/serial@01c28800:115200" +#elif CONFIG_CONS_INDEX == 4 && defined(CONFIG_MACH_SUN8I_H3) +#define OF_STDOUT_PATH "/soc@01c00000/serial@01c28C00:115200" #elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I) #define OF_STDOUT_PATH "/soc@01c00000/serial@01f02800:115200" #else

Signature · 1 line
2.20.1