public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Manuel Dipolt <mdipolt@robart.cc>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] added uart1-3 support for the allwinner h3
Date: Tue, 12 Mar 2019 19:57:29 +0100 (CET)	[thread overview]
Message-ID: <1060645010.1439341.1552417049270.JavaMail.zimbra@robart.cc> (raw)

--- 
arch/arm/include/asm/arch-sunxi/gpio.h | 3 +++ 
arch/arm/mach-sunxi/board.c | 12 ++++++++++++ 
include/configs/sunxi-common.h | 8 +++++--- 
3 files changed, 20 insertions(+), 3 deletions(-) 

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 b74eaf2a0e..5ee14bd7aa 100644 
--- a/arch/arm/mach-sunxi/board.c 
+++ b/arch/arm/mach-sunxi/board.c 
@@ -127,10 +127,22 @@ 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) 
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); 
+#elif CONFIG_CONS_INDEX == 3 && 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); 
+#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 b01d1c3c84..561c799aa9 100644 
--- a/include/configs/sunxi-common.h 
+++ b/include/configs/sunxi-common.h 
@@ -255,11 +255,13 @@ extern int soft_i2c_gpio_scl; 
#else 
#define OF_STDOUT_PATH "/soc at 01c00000/serial at 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 at 01c00000/serial at 01c28400:115200" 
-#elif CONFIG_CONS_INDEX == 3 && defined(CONFIG_MACH_SUN8I) 
+#elif CONFIG_CONS_INDEX == 3 && ( defined(CONFIG_MACH_SUN8I) || defined(CONFIG_MACH_SUN8I_H3) ) 
#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28800:115200" 
-#elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I) 
+#elif CONFIG_CONS_INDEX == 4 && defined(CONFIG_MACH_SUN8I_H3) 
+#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01c28C00:115200" 
+#elif CONFIG_CONS_INDEX == 5 && ( defined(CONFIG_MACH_SUN8I) || defined(CONFIG_MACH_SUN8I_H3) ) 
#define OF_STDOUT_PATH "/soc at 01c00000/serial at 01f02800:115200" 
#else 
#error Unsupported console port nr. Please fix stdout-path in sunxi-common.h. 
-- 
2.11.0 

                 reply	other threads:[~2019-03-12 18:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1060645010.1439341.1552417049270.JavaMail.zimbra@robart.cc \
    --to=mdipolt@robart.cc \
    --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