diff options
author | Philipp Tomsich <philipp.tomsich@theobroma-systems.com> | 2016-04-06 14:36:56 +0200 |
---|---|---|
committer | Klaus Goger <klaus.goger@theobroma-systems.com> | 2016-09-18 13:45:14 +0200 |
commit | 6ed4d8a8686a0e8da9806a42dc90f1f0b7a0c160 (patch) | |
tree | e20624244712e2302a2eae6d83e31a8cd1267bb6 | |
parent | 4f105e8cf0dd6a2469701d3d66f664ad30a8f010 (diff) |
sunxi: Support UART4 on A80 (sun9i) as system console
* arch/arm/cpu/armv7/sunxi/board.c (gpio_init): Configure UART4
pins and function for CONFIG_CONS_INDEX == 5 (UART4) on
CONFIG_MACH_SUN9I
* include/configs/sunxi-common.h: Define CONFIG_SYS_NS16550_COM5
and CONFIG_SYS_NS16550_COM6 for CONFIG_MACH_SUN9I to refer to
UART4 and UART5, respectively. Define OF_STDOUT_PATH for
CONFIG_CONS_INDEX == 5 (UART4) on CONFIG_MACH_SUN9I
* arch/arm/include/asm/arch-sunxi/gpio.h (SUN9I_GPG_UART4): Define.
Validated against A80-Q7 module.
-rw-r--r-- | arch/arm/cpu/armv7/sunxi/board.c | 4 | ||||
-rw-r--r-- | arch/arm/include/asm/arch-sunxi/gpio.h | 1 | ||||
-rw-r--r-- | include/configs/sunxi-common.h | 7 |
3 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv7/sunxi/board.c b/arch/arm/cpu/armv7/sunxi/board.c index 84cdc3ec78..1bc71af863 100644 --- a/arch/arm/cpu/armv7/sunxi/board.c +++ b/arch/arm/cpu/armv7/sunxi/board.c @@ -96,6 +96,10 @@ static int gpio_init(void) sunxi_gpio_set_cfgpin(SUNXI_GPL(2), SUN8I_GPL_R_UART); sunxi_gpio_set_cfgpin(SUNXI_GPL(3), SUN8I_GPL_R_UART); sunxi_gpio_set_pull(SUNXI_GPL(3), SUNXI_GPIO_PULL_UP); +#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN9I) + sunxi_gpio_set_cfgpin(SUNXI_GPG(12), SUN9I_GPG_UART4); + sunxi_gpio_set_cfgpin(SUNXI_GPG(13), SUN9I_GPG_UART4); + sunxi_gpio_set_pull(SUNXI_GPG(13), SUNXI_GPIO_PULL_UP); #else #error Unsupported console port number. Please fix pin mux settings in board.c #endif diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h index 649f6cd840..98c00d84aa 100644 --- a/arch/arm/include/asm/arch-sunxi/gpio.h +++ b/arch/arm/include/asm/arch-sunxi/gpio.h @@ -181,6 +181,7 @@ enum sunxi_gpio_number { #define SUN8I_GPG_SDC1 2 #define SUN6I_GPG_TWI3 2 #define SUN5I_GPG_UART1 4 +#define SUN9I_GPG_UART4 2 #define SUN4I_GPH_SDC1 5 #define SUN6I_GPH_TWI0 2 diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index a3994e1a6a..5498ac6dcf 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -50,8 +50,13 @@ # define CONFIG_SYS_NS16550_COM2 SUNXI_UART1_BASE # define CONFIG_SYS_NS16550_COM3 SUNXI_UART2_BASE # define CONFIG_SYS_NS16550_COM4 SUNXI_UART3_BASE +#if defined(CONFIG_MACH_SUN9I) +# define CONFIG_SYS_NS16550_COM5 SUNXI_UART4_BASE +# define CONFIG_SYS_NS16550_COM6 SUNXI_UART5_BASE +#else # define CONFIG_SYS_NS16550_COM5 SUNXI_R_UART_BASE #endif +#endif /* CPU */ #define CONFIG_DISPLAY_CPUINFO @@ -264,6 +269,8 @@ extern int soft_i2c_gpio_scl; #define OF_STDOUT_PATH "/soc@01c00000/serial@01c28800:115200" #elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I) #define OF_STDOUT_PATH "/soc@01c00000/serial@01f02800:115200" +#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN9I) +#define OF_STDOUT_PATH "/soc/serial@07001000:115200" #else #error Unsupported console port nr. Please fix stdout-path in sunxi-common.h. #endif |