All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paulk@sys-base.io>
To: Andre Przywara <andre.przywara@arm.com>
Cc: u-boot@lists.denx.de, Tom Rini <trini@konsulko.com>,
	Jagan Teki <jagan@amarulasolutions.com>,
	Chen-Yu Tsai <wens@csie.org>, Icenowy Zheng <icenowy@aosc.xyz>,
	Paul Kocialkowski <contact@paulk.fr>
Subject: Re: [PATCH v2 07/11] sunxi: Add support for UART1 on PG pins for the V3/S3
Date: Wed, 6 Aug 2025 19:18:16 +0200	[thread overview]
Message-ID: <aJOOWHWb-VyWab5c@collins> (raw)
In-Reply-To: <20250806012121.27bdcfeb@minigeek.lan>

[-- Attachment #1: Type: text/plain, Size: 3554 bytes --]

Hi,

Thansk for the review!

Le Wed 06 Aug 25, 01:21, Andre Przywara a écrit :
> On Tue,  5 Aug 2025 19:48:23 +0200
> Paul Kocialkowski <paulk@sys-base.io> wrote:
> 
> Hi,
> 
> > From: Paul Kocialkowski <contact@paulk.fr>
> > 
> > The V3/S3 has extra pins for UART1 on PG pins, which are not present
> > on the V3s. Add support for them and make them the default UART1 pins
> > on the V3. Note that PE pins are also available for UART1 but almost
> > never used since they also provide the CSI I2C lines.
> 
> So the patch itself looks alright, but what is this actually used for?
> This pinmux setting here is really just for the SPL to setup the debug
> UART. Is there any board where UART1 is the supposed debug UART?
> Because if not, we just don't need that here, and if yes, I'd love to
> see the respective defconfig file ;-)

This is the default on the V3 reference design, which uses UART1 on PG pins for
debug and I've seen it in use in all V3/S3 devices I could see, including:
- Olimex S3-OLinuXino
- SL631 action camera
- iT-X3 action camera

The pinecube is the odd one out using UART2 instead. For V3s devices it's a bit
messy and the reference design uses UART2 over PB pins, but the only device we
support (Lichee Pi Zero) uses UART0 on PB pins instead (muxed with TWI1).

So you're right, it's not currently useful for devices in the tree, but I
assumed it could be useful in the future. I also just noticed that there is
already a fallback for sun8i which will direct UART1 to PG pins, on the same
pins that I'm using. So this patch is definitely not necessary then!

I have some work in progress to add support for the devices above, but never
sat down to finish them. I'll definitely submit them eventually!

All the best,

Paul

> Cheers,
> Andre
> 
> > 
> > Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
> > ---
> >  arch/arm/mach-sunxi/board.c | 4 ++++
> >  include/sunxi_gpio.h        | 1 +
> >  2 files changed, 5 insertions(+)
> > 
> > diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
> > index a1a02b0fae50..d1b27b062d6d 100644
> > --- a/arch/arm/mach-sunxi/board.c
> > +++ b/arch/arm/mach-sunxi/board.c
> > @@ -169,6 +169,10 @@ 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_V3)
> > +	sunxi_gpio_set_cfgpin(SUNXI_GPG(6), SUN8I_V3_GPG_UART1);
> > +	sunxi_gpio_set_cfgpin(SUNXI_GPG(7), SUN8I_V3_GPG_UART1);
> > +	sunxi_gpio_set_pull(SUNXI_GPG(7), SUNXI_GPIO_PULL_UP);
> >  #elif CONFIG_CONS_INDEX == 3 && defined(CONFIG_MACH_SUN8I_H3)
> >  	sunxi_gpio_set_cfgpin(SUNXI_GPA(0), SUN8I_H3_GPA_UART2);
> >  	sunxi_gpio_set_cfgpin(SUNXI_GPA(1), SUN8I_H3_GPA_UART2);
> > diff --git a/include/sunxi_gpio.h b/include/sunxi_gpio.h
> > index e166b9758f44..7d142f65ea8a 100644
> > --- a/include/sunxi_gpio.h
> > +++ b/include/sunxi_gpio.h
> > @@ -141,6 +141,7 @@ enum sunxi_gpio_number {
> >  #define SUN8I_GPG_SDC1		2
> >  #define SUN8I_GPG_UART1		2
> >  #define SUN5I_GPG_UART1		4
> > +#define SUN8I_V3_GPG_UART1	2
> >  
> >  #define SUN6I_GPH_PWM		2
> >  #define SUN8I_GPH_PWM		2
> 

-- 
Paul Kocialkowski,

Independent contractor - sys-base - https://www.sys-base.io/
Free software developer - https://www.paulk.fr/

Expert in multimedia, graphics and embedded hardware support with Linux.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2025-08-06 17:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05 17:48 [PATCH v2 00/11] Various V3/S3/V3s fixes and improvements Paul Kocialkowski
2025-08-05 17:48 ` [PATCH v2 01/11] sunxi: Kconfig: Fix default order for V3s DRAM clock Paul Kocialkowski
2025-08-05 17:48 ` [PATCH v2 02/11] sunxi: Split V3 and V3s support with a common option Paul Kocialkowski
2025-08-06  0:21   ` Andre Przywara
2025-08-06 17:24     ` Paul Kocialkowski
2025-08-08  3:48       ` Icenowy Zheng
2025-10-21 14:02       ` Andre Przywara
2025-08-05 17:48 ` [PATCH v2 03/11] sunxi: Disable secure SRAM on sun8i platforms missing it Paul Kocialkowski
2025-08-05 17:48 ` [PATCH v2 04/11] power: axp: Add default voltages for V3/S3 Paul Kocialkowski
2025-08-05 17:48 ` [PATCH v2 05/11] sunxi: Switch V3/V3s device-tree source to OF_UPSTREAM Paul Kocialkowski
2025-08-05 17:48 ` [PATCH v2 06/11] sunxi: Add support for I2C1 on PB pins for the V3/V3s Paul Kocialkowski
2025-08-06  4:30   ` Heiko Schocher
2025-08-07  8:32   ` Paul Kocialkowski
2025-08-05 17:48 ` [PATCH v2 07/11] sunxi: Add support for UART1 on PG pins for the V3/S3 Paul Kocialkowski
     [not found]   ` <20250806012121.27bdcfeb@minigeek.lan>
2025-08-06 17:18     ` Paul Kocialkowski [this message]
2025-08-05 17:48 ` [PATCH v2 08/11] sunxi: pinecube: Enable EMAC and network support Paul Kocialkowski
2025-08-05 17:48 ` [PATCH v2 09/11] sunxi: Add support for the Lichee Pi Zero with Dock Paul Kocialkowski
2025-08-05 17:48 ` [PATCH v2 10/11] net: sun8i-emac: Remove internal PHY config default value Paul Kocialkowski
2025-08-05 17:48 ` [PATCH v2 11/11] net: sun8i-emac: Add support for active-low leds with internal PHY Paul Kocialkowski

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=aJOOWHWb-VyWab5c@collins \
    --to=paulk@sys-base.io \
    --cc=andre.przywara@arm.com \
    --cc=contact@paulk.fr \
    --cc=icenowy@aosc.xyz \
    --cc=jagan@amarulasolutions.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=wens@csie.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.