public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Manuel Dipolt <manuel.dipolt@robart.cc>
To: u-boot <u-boot@lists.denx.de>
Cc: jagan <jagan@amarulasolutions.com>
Subject: [PATCH] sunxi: h3: add console support for uart1-3
Date: Thu, 24 Jun 2021 14:39:51 +0200 (CEST)	[thread overview]
Message-ID: <1165740128.2849934.1624538391702.JavaMail.zimbra@robart.cc> (raw)
In-Reply-To: <304591524.2849399.1624537560261.JavaMail.zimbra@robart.cc>

Add uart1-3 console support for the Allwinner H3 SOC 

Signed-off-by: Manuel Dipolt <manuel.dipolt@robart.cc> 
--- 

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(-) 

diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h 
index 40a3f845d0..50010071ae 100644 
--- a/arch/arm/include/asm/arch-sunxi/gpio.h 
+++ b/arch/arm/include/asm/arch-sunxi/gpio.h 
@@ -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 
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c 
index 8e9bb63d9d..31f780d1b5 100644 
--- a/arch/arm/mach-sunxi/board.c 
+++ b/arch/arm/mach-sunxi/board.c 
@@ -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); 
diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h 
index fceb812448..5b7c310fde 100644 
--- a/include/configs/sunxi-common.h 
+++ b/include/configs/sunxi-common.h 
@@ -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 
-- 
2.20.1

           reply	other threads:[~2021-06-24 21:43 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <304591524.2849399.1624537560261.JavaMail.zimbra@robart.cc>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1165740128.2849934.1624538391702.JavaMail.zimbra@robart.cc \
    --to=manuel.dipolt@robart.cc \
    --cc=jagan@amarulasolutions.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox