[PATCH v2 06/10] gpio: a733: add initial support
Yixun Lan
dlan at gentoo.org
Mon Dec 1 11:37:00 CET 2025
Hi Tom,
On 18:01 Sun 30 Nov , Tom Rini wrote:
> On Sun, Nov 30, 2025 at 09:45:15PM +0000, Yixun Lan wrote:
>
> > In A733 SoC, the GPIO IP block has changed its arrangement, so initial
> > GPIO base address and bank size need to be adjusted.
> >
> > Introduce new SUNXI_NEW2_PINCTRL in order to reuse the driver in future.
> >
> > There is no PA bank exist in A733, but introducing a virtual one as offset
> > 0x80, and with the bank size 0x80, it will iterate other bank correctly
> > starting from PB as offset 0x100.
> >
> > Signed-off-by: Yixun Lan <dlan at gentoo.org>
>
> So, looking at:
>
> commit 452369cd0c636123321d021298b4bc35a34f4941
> Author: Andre Przywara <andre.przywara at arm.com>
> Date: Tue Sep 6 12:12:50 2022 +0100
>
> pinctrl: sunxi: add new D1 pinctrl support
>
> For the first time since at least the Allwinner A10 SoCs, the D1 (and
> related cores) use a new pincontroller MMIO register layout, so we
> cannot use our hardcoded, fixed offsets anymore.
> Ideally this would all be handled by devicetree and DM drivers, but for
> the DT-less SPL we still need the legacy interfaces.
>
> Add a new Kconfig symbol to differenciate between the two generations of
> pincontrollers, and just use that to just switch some basic symbols.
> The rest is already abstracted enough, so works out of the box.
>
> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
> Reviewed-by: Sam Edwards <CFSworks at gmail.com>
> Tested-by: Sam Edwards <CFSworks at gmail.com>
> Tested-by: Samuel Holland <samuel at sholland.org>
>
> Is there some way to abstract things so that again, non-SPL has a single
> driver, and for SPL we can just hard-code a few things?
>
I think we've already went this way..
And after second thought, we probably could squash A733 into exist
SUNXI_NEW_PINCTRL Kconfig option, with different register offset,
e.g. in file include/sunxi_gpio.h, we can do something like:
#ifdef CONFIG_SUNXI_NEW_PINCTRL
#if defined(CONFIG_MACH_SUN60I_A733)
#define SUNXI_PINCTRL_BANK_SIZE 0x80
#else
#define SUNXI_PINCTRL_BANK_SIZE 0x30
#endif
#define SUNXI_GPIO_DISABLE 0xf
#endif
similar with file drivers/gpio/sunxi_gpio.c
Andre, please let me know if you like this way or not
--
Yixun Lan (dlan)
More information about the U-Boot
mailing list