[PATCH v2 0/6] power: pmic: sunxi: consolidate AXP SPL drivers

Andre Przywara andre.przywara at arm.com
Fri Jul 12 18:53:46 CEST 2024


Hi,

v2 of this series merges the AXP717 support patches in, as they didn't
make it into the tree yet. As there is little point in creating a
separate AXP717 SPL driver file, just to delete it again two patches
later, this series skips the separate file altogether. I put in the
related AXP717 U-Boot proper driver here. The code itself is mostly
unchanged from v1, it's just a rebase and re-arrangement of the patches.

=========================
This is the first series in an attempt to clean up the X-Powers AXP PMIC
drivers used by the SPL for sunxi boards. So far we have a separate
driver file for each AXP variant, but the code was largely the same,
just differing by the regulator ranges.

This adds a new generic driver, which reads the regulator description
from an array of structs. This is similar to how the DM AXP driver used
for U-Boot proper works, but is simplified, since we won't need the full
feature set for the SPL, and we want to keep the code size small.

To help bisect-ability, and to simplify review, each of the simpler AXP
drivers covered by this approach is handled in a separate patch.

We just add the AXP717 support first, then convert over the AXP313 and
AXP305.
The other AXP SPL drivers are more complex, and support more regulators,
but my hunch is that we really just need the DC/DC converters in the
SPL. However I need to prove and test this, so I will convert the other
AXP chips later.

Please have a look and comment whether the approach in general is a good
idea.

Cheers,
Andre

Changelog v1 .. v2:
- rebase against latest master
- merge originally separate AXP717 SPL driver into patch 4/6
- include AXP717 U-Boot proper support patch
- drop AXP707 support for now

Andre Przywara (6):
  power: regulator: add AXP717 support
  power: pmic: sunxi: only build AXP drivers for SPL
  power: pmic: sunxi: introduce generic SPL AXP DC/DC driver
  power: pmic: sunxi: add AXP717 SPL support
  power: pmic: sunxi: use generic AXP SPL driver for AXP313
  power: pmic: sunxi: use generic AXP SPL driver for AXP305

 arch/arm/mach-sunxi/pmic_bus.c          |   3 +
 board/sunxi/board.c                     |   2 +-
 drivers/power/Kconfig                   |  17 ++-
 drivers/power/Makefile                  |   7 +-
 drivers/power/axp305.c                  |  82 -----------
 drivers/power/axp313.c                  | 133 ------------------
 drivers/power/axp_spl.c                 | 173 ++++++++++++++++++++++++
 drivers/power/pmic/axp.c                |   1 +
 drivers/power/regulator/axp_regulator.c |  28 ++++
 include/axp_pmic.h                      |   1 +
 10 files changed, 225 insertions(+), 222 deletions(-)
 delete mode 100644 drivers/power/axp305.c
 delete mode 100644 drivers/power/axp313.c
 create mode 100644 drivers/power/axp_spl.c

-- 
2.25.1



More information about the U-Boot mailing list