public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andre Przywara <andre.przywara@arm.com>
To: u-boot@lists.denx.de
Subject: [PATCH] sunxi: support boot console on uart1 for sun8i
Date: Sat, 13 Feb 2021 17:40:10 +0000	[thread overview]
Message-ID: <20210213174010.6d69e3cc@slackpad.fritz.box> (raw)
In-Reply-To: <20210212140823.284274-1-tobleminer@gmail.com>

On Fri, 12 Feb 2021 15:08:23 +0100
Tobias Schramm <tobleminer@gmail.com> wrote:

Hi Tobias,

> From: Tobias Schramm <t.schramm@manjaro.org>
> 
> This commit adds support for using uart1 as boot console on sun8i.

Which particular SoC or board is this triggered by?

From the SoCs listed as belonging to the MACH_SUN8I "family", I don't
see the R40 and V3s having UART1 muxed on PortG, only A23, A33, H3, H5,
and A83T have.
So can you restrict the conditions?

...

> 
> Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
> ---
>  arch/arm/include/asm/arch-sunxi/gpio.h | 1 +
>  arch/arm/mach-sunxi/board.c            | 4 ++++
>  include/configs/sunxi-common.h         | 2 ++
>  3 files changed, 7 insertions(+)
> 
> diff --git a/arch/arm/include/asm/arch-sunxi/gpio.h b/arch/arm/include/asm/arch-sunxi/gpio.h
> index de77bf638e..2969a530ae 100644
> --- a/arch/arm/include/asm/arch-sunxi/gpio.h
> +++ b/arch/arm/include/asm/arch-sunxi/gpio.h
> @@ -190,6 +190,7 @@ enum sunxi_gpio_number {
>  #define SUN5I_GPG_SDC1		2
>  #define SUN6I_GPG_SDC1		2
>  #define SUN8I_GPG_SDC1		2
> +#define SUN8I_GPG_UART1		2
>  #define SUN6I_GPG_TWI3		2
>  #define SUN5I_GPG_UART1		4
>  
> diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
> index ae6bc656d9..febec0ae03 100644
> --- a/arch/arm/mach-sunxi/board.c
> +++ b/arch/arm/mach-sunxi/board.c
> @@ -144,6 +144,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 == 2 && defined(CONFIG_MACH_SUN8I)
> +	sunxi_gpio_set_cfgpin(SUNXI_GPG(6), SUN8I_GPG_UART1);
> +	sunxi_gpio_set_cfgpin(SUNXI_GPG(7), SUN8I_GPG_UART1);
> +	sunxi_gpio_set_pull(SUNXI_GPL(7), SUNXI_GPIO_PULL_UP);

This should be SUNXI_GPG(7).

>  #else
>  #error Unsupported console port number. Please fix pin mux settings in board.c
>  #endif
> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
> index 000f386470..19f0026888 100644
> --- a/include/configs/sunxi-common.h
> +++ b/include/configs/sunxi-common.h
> @@ -251,6 +251,8 @@ extern int soft_i2c_gpio_scl;
>  #define OF_STDOUT_PATH		"/soc at 01c00000/serial at 01c28800:115200"
>  #elif CONFIG_CONS_INDEX == 5 && defined(CONFIG_MACH_SUN8I)
>  #define OF_STDOUT_PATH		"/soc at 01c00000/serial at 01f02800:115200"
> +#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUN8I)
> +#define OF_STDOUT_PATH		"/soc at 01c00000/serial at 01c28400:115200"

The leading zeroes in there make me suspicious that this has been
broken for a while.
And also it looks like all(?) board DTs have a stdout-path
property already anyway.
So I'd recommend to leave this out, I will probably send a patch to
remove this altogether.

Cheers,
Andre

>  #else
>  #error Unsupported console port nr. Please fix stdout-path in sunxi-common.h.
>  #endif

  reply	other threads:[~2021-02-13 17:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-12 14:08 [PATCH] sunxi: support boot console on uart1 for sun8i Tobias Schramm
2021-02-13 17:40 ` Andre Przywara [this message]
2021-02-13 18:45   ` Tobias Schramm
2021-02-14  0:14     ` Andre Przywara

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=20210213174010.6d69e3cc@slackpad.fritz.box \
    --to=andre.przywara@arm.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