All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] sunxi: A64: enable AXP driver support
@ 2025-05-07  0:53 Andre Przywara
  2025-05-07  0:53 ` [PATCH 1/2] sunxi: A64: enable DRIVEVBUS support for respective boards Andre Przywara
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Andre Przywara @ 2025-05-07  0:53 UTC (permalink / raw)
  To: Jagan Teki, u-boot; +Cc: Sunil Mohan Adapa, Arnaud Ferraris, Jernej Skrabec

Hi,

this series enables the build of the AXP driver in U-Boot proper for all
boards using the Allwinner A64 SoC. So far some static PMIC rail setup
was done by TF-A, but this was rather static (enabling too many) and
increases the code size of the rather limited BL31 build.

Do this for the A64 only first, since this uses RSB consistently, while
the H6 boards are undergoing a transition to use I2C.

Please have a look and test!

Cheers,
Andre

Andre Przywara (2):
  sunxi: A64: enable DRIVEVBUS support for respective boards
  sunxi: A64: enable AXP drivers

 arch/arm/Kconfig                     | 1 +
 arch/arm/mach-sunxi/Kconfig          | 3 +++
 configs/a64-olinuxino-emmc_defconfig | 1 +
 configs/a64-olinuxino_defconfig      | 1 +
 configs/amarula_a64_relic_defconfig  | 1 +
 configs/bananapi_m64_defconfig       | 1 +
 configs/orangepi_win_defconfig       | 1 +
 configs/pinetab_defconfig            | 1 +
 8 files changed, 10 insertions(+)

-- 
2.46.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] sunxi: A64: enable DRIVEVBUS support for respective boards
  2025-05-07  0:53 [PATCH 0/2] sunxi: A64: enable AXP driver support Andre Przywara
@ 2025-05-07  0:53 ` Andre Przywara
  2025-05-07  0:53 ` [PATCH 2/2] sunxi: A64: enable AXP drivers Andre Przywara
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Andre Przywara @ 2025-05-07  0:53 UTC (permalink / raw)
  To: Jagan Teki, u-boot; +Cc: Sunil Mohan Adapa, Arnaud Ferraris, Jernej Skrabec

The X-Powers AXP PMICs contain a special pin that can be used to drive
USB VBUS power, which requires a special AXP (sub-)driver.

Enable that for the 64-bit boards that use this pin, so that they can
enable VBUS power on their own, without relying on the help of TF-A.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 configs/a64-olinuxino-emmc_defconfig | 1 +
 configs/a64-olinuxino_defconfig      | 1 +
 configs/amarula_a64_relic_defconfig  | 1 +
 configs/bananapi_m64_defconfig       | 1 +
 configs/orangepi_win_defconfig       | 1 +
 configs/pinetab_defconfig            | 1 +
 6 files changed, 6 insertions(+)

diff --git a/configs/a64-olinuxino-emmc_defconfig b/configs/a64-olinuxino-emmc_defconfig
index a5989fab1c6..93f9e2eac28 100644
--- a/configs/a64-olinuxino-emmc_defconfig
+++ b/configs/a64-olinuxino-emmc_defconfig
@@ -7,5 +7,6 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_SUN8I_EMAC=y
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
diff --git a/configs/a64-olinuxino_defconfig b/configs/a64-olinuxino_defconfig
index 0b469c25d0d..0b64b8370b4 100644
--- a/configs/a64-olinuxino_defconfig
+++ b/configs/a64-olinuxino_defconfig
@@ -6,5 +6,6 @@ CONFIG_MACH_SUN50I=y
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SUN8I_EMAC=y
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
diff --git a/configs/amarula_a64_relic_defconfig b/configs/amarula_a64_relic_defconfig
index 292af6e372e..8ea23ee4936 100644
--- a/configs/amarula_a64_relic_defconfig
+++ b/configs/amarula_a64_relic_defconfig
@@ -6,6 +6,7 @@ CONFIG_MACH_SUN50I=y
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 # CONFIG_VIDEO_DE2 is not set
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
diff --git a/configs/bananapi_m64_defconfig b/configs/bananapi_m64_defconfig
index d957071cb13..9d23739ffe5 100644
--- a/configs/bananapi_m64_defconfig
+++ b/configs/bananapi_m64_defconfig
@@ -7,6 +7,7 @@ CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_SUN8I_EMAC=y
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
 CONFIG_USB_MUSB_GADGET=y
diff --git a/configs/orangepi_win_defconfig b/configs/orangepi_win_defconfig
index 4ce36cbab34..30c42366d1c 100644
--- a/configs/orangepi_win_defconfig
+++ b/configs/orangepi_win_defconfig
@@ -9,6 +9,7 @@ CONFIG_MTD=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_PHY_REALTEK=y
 CONFIG_SUN8I_EMAC=y
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
 CONFIG_SPI=y
 CONFIG_USB_EHCI_HCD=y
 CONFIG_USB_OHCI_HCD=y
diff --git a/configs/pinetab_defconfig b/configs/pinetab_defconfig
index 0cc24146b39..696357a222c 100644
--- a/configs/pinetab_defconfig
+++ b/configs/pinetab_defconfig
@@ -8,3 +8,4 @@ CONFIG_DRAM_CLK=552
 CONFIG_DRAM_ZQ=3881949
 CONFIG_MMC_SUNXI_SLOT_EXTRA=2
 # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set
+CONFIG_REGULATOR_AXP_DRIVEVBUS=y
-- 
2.46.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] sunxi: A64: enable AXP drivers
  2025-05-07  0:53 [PATCH 0/2] sunxi: A64: enable AXP driver support Andre Przywara
  2025-05-07  0:53 ` [PATCH 1/2] sunxi: A64: enable DRIVEVBUS support for respective boards Andre Przywara
@ 2025-05-07  0:53 ` Andre Przywara
  2025-08-11 15:53 ` [PATCH 0/2] sunxi: A64: enable AXP driver support Jernej Škrabec
  2025-08-28  8:39 ` Peter Robinson
  3 siblings, 0 replies; 5+ messages in thread
From: Andre Przywara @ 2025-05-07  0:53 UTC (permalink / raw)
  To: Jagan Teki, u-boot; +Cc: Sunil Mohan Adapa, Arnaud Ferraris, Jernej Skrabec

So far the 64-bit SoCs were relying on Trusted-Firmware to do the PMIC
setup, which was quite static: enabling most rails, regardless of
whether they are needed or not.

We have a fully DM compliant AXP regulator driver for a while, so that
U-Boot proper can do its own PMIC setup, based on the actual need
(typically for USB, Ethernet, HDMI).

Enable that driver by default for all A64 boards, along with the RSB
driver.

The goal is to allow dropping the ill-fated regulator setup code from
TF-A, so that this can become smaller, and we only enable rails that are
really needed.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 arch/arm/Kconfig            | 1 +
 arch/arm/mach-sunxi/Kconfig | 3 +++
 2 files changed, 4 insertions(+)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index fedfdb21457..6b59ff5be32 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1190,6 +1190,7 @@ config ARCH_SUNXI
 	select DM_SPI_FLASH if SPI && MTD
 	select DM_KEYBOARD
 	select DM_SERIAL
+	select DM_PMIC
 	select MMU_PGPROT if ARM64
 	select OF_BOARD_SETUP
 	select OF_CONTROL
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index fce817c9d40..c3718126cec 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -435,6 +435,9 @@ config MACH_SUN50I
 	select FIT
 	select SPL_LOAD_FIT if SPL
 	select SUNXI_A64_TIMER_ERRATUM
+	imply SYS_I2C_SUN8I_RSB
+	imply REGULATOR_AXP
+	imply PMIC_AXP
 
 config MACH_SUN50I_H5
 	bool "sun50i (Allwinner H5)"
-- 
2.46.3


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] sunxi: A64: enable AXP driver support
  2025-05-07  0:53 [PATCH 0/2] sunxi: A64: enable AXP driver support Andre Przywara
  2025-05-07  0:53 ` [PATCH 1/2] sunxi: A64: enable DRIVEVBUS support for respective boards Andre Przywara
  2025-05-07  0:53 ` [PATCH 2/2] sunxi: A64: enable AXP drivers Andre Przywara
@ 2025-08-11 15:53 ` Jernej Škrabec
  2025-08-28  8:39 ` Peter Robinson
  3 siblings, 0 replies; 5+ messages in thread
From: Jernej Škrabec @ 2025-08-11 15:53 UTC (permalink / raw)
  To: Jagan Teki, u-boot, Andre Przywara; +Cc: Sunil Mohan Adapa, Arnaud Ferraris

Dne sreda, 7. maj 2025 ob 02:53:23 Srednjeevropski poletni čas je Andre Przywara napisal(a):
> Hi,
> 
> this series enables the build of the AXP driver in U-Boot proper for all
> boards using the Allwinner A64 SoC. So far some static PMIC rail setup
> was done by TF-A, but this was rather static (enabling too many) and
> increases the code size of the rather limited BL31 build.
> 
> Do this for the A64 only first, since this uses RSB consistently, while
> the H6 boards are undergoing a transition to use I2C.

What is status of this? Unfortunatelly I don't have time to test currently,
but it would be nice to have this in.

Best regards,
Jernej

> 
> Please have a look and test!
> 
> Cheers,
> Andre
> 
> Andre Przywara (2):
>   sunxi: A64: enable DRIVEVBUS support for respective boards
>   sunxi: A64: enable AXP drivers
> 
>  arch/arm/Kconfig                     | 1 +
>  arch/arm/mach-sunxi/Kconfig          | 3 +++
>  configs/a64-olinuxino-emmc_defconfig | 1 +
>  configs/a64-olinuxino_defconfig      | 1 +
>  configs/amarula_a64_relic_defconfig  | 1 +
>  configs/bananapi_m64_defconfig       | 1 +
>  configs/orangepi_win_defconfig       | 1 +
>  configs/pinetab_defconfig            | 1 +
>  8 files changed, 10 insertions(+)
> 
> 





^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] sunxi: A64: enable AXP driver support
  2025-05-07  0:53 [PATCH 0/2] sunxi: A64: enable AXP driver support Andre Przywara
                   ` (2 preceding siblings ...)
  2025-08-11 15:53 ` [PATCH 0/2] sunxi: A64: enable AXP driver support Jernej Škrabec
@ 2025-08-28  8:39 ` Peter Robinson
  3 siblings, 0 replies; 5+ messages in thread
From: Peter Robinson @ 2025-08-28  8:39 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Jagan Teki, u-boot, Sunil Mohan Adapa, Arnaud Ferraris,
	Jernej Skrabec

On Wed, 7 May 2025 at 02:32, Andre Przywara <andre.przywara@arm.com> wrote:
>
> Hi,
>
> this series enables the build of the AXP driver in U-Boot proper for all
> boards using the Allwinner A64 SoC. So far some static PMIC rail setup
> was done by TF-A, but this was rather static (enabling too many) and
> increases the code size of the rather limited BL31 build.
>
> Do this for the A64 only first, since this uses RSB consistently, while
> the H6 boards are undergoing a transition to use I2C.
>
> Please have a look and test!

For the series:
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Tested-by: Peter Robinson <pbrobinson@gmail.com>

Tested on a Pine64+, I enabled CMD_PMIC and CMD_REGULATOR and could
see all the expected details as well as in the output in 'dm tree' and
it boots and runs as expected with Fedora 43.

Peter

> Cheers,
> Andre
>
> Andre Przywara (2):
>   sunxi: A64: enable DRIVEVBUS support for respective boards
>   sunxi: A64: enable AXP drivers
>
>  arch/arm/Kconfig                     | 1 +
>  arch/arm/mach-sunxi/Kconfig          | 3 +++
>  configs/a64-olinuxino-emmc_defconfig | 1 +
>  configs/a64-olinuxino_defconfig      | 1 +
>  configs/amarula_a64_relic_defconfig  | 1 +
>  configs/bananapi_m64_defconfig       | 1 +
>  configs/orangepi_win_defconfig       | 1 +
>  configs/pinetab_defconfig            | 1 +
>  8 files changed, 10 insertions(+)
>
> --
> 2.46.3
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-08-28  8:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07  0:53 [PATCH 0/2] sunxi: A64: enable AXP driver support Andre Przywara
2025-05-07  0:53 ` [PATCH 1/2] sunxi: A64: enable DRIVEVBUS support for respective boards Andre Przywara
2025-05-07  0:53 ` [PATCH 2/2] sunxi: A64: enable AXP drivers Andre Przywara
2025-08-11 15:53 ` [PATCH 0/2] sunxi: A64: enable AXP driver support Jernej Škrabec
2025-08-28  8:39 ` Peter Robinson

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.