From e4806339275b69f9ef16b83d9ce9d063b55da022 Mon Sep 17 00:00:00 2001 From: Chen-Yu Tsai Date: Tue, 29 Nov 2016 15:20:07 +0800 Subject: [PATCH] uart0-helloworld: Add support for R40 The R40 is the same as the A20 for all intents and purposes of uart0-helloworld. Add R40's SOC ID. Signed-off-by: Chen-Yu Tsai --- uart0-helloworld-sdboot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uart0-helloworld-sdboot.c b/uart0-helloworld-sdboot.c index c9cde01..d60720c 100644 --- a/uart0-helloworld-sdboot.c +++ b/uart0-helloworld-sdboot.c @@ -256,6 +256,7 @@ void soc_detection_init(void) #define soc_is_a64() (soc_id == 0x1689) #define soc_is_h3() (soc_id == 0x1680) #define soc_is_h5() (soc_id == 0x1718) +#define soc_is_r40() (soc_id == 0x1701) /* A10s and A13 share the same ID, so we need a little more effort on those */ @@ -303,7 +304,7 @@ void clock_init_uart(void) void gpio_init(void) { - if (soc_is_a10() || soc_is_a20()) { + if (soc_is_a10() || soc_is_a20() || soc_is_r40()) { sunxi_gpio_set_cfgpin(SUNXI_GPB(22), SUN4I_GPB_UART0); sunxi_gpio_set_cfgpin(SUNXI_GPB(23), SUN4I_GPB_UART0); sunxi_gpio_set_pull(SUNXI_GPB(23), SUNXI_GPIO_PULL_UP); @@ -446,6 +447,8 @@ int main(void) uart0_puts("Allwinner H3!\n"); else if (soc_is_h5()) uart0_puts("Allwinner H5!\n"); + else if (soc_is_r40()) + uart0_puts("Allwinner R40!\n"); else uart0_puts("unknown Allwinner SoC!\n");