Commit graph

762 commits

Author SHA1 Message Date
Patrice Chotard
74cd1af112 power: regulator: replace dev_dbg() by dev_err() in regulator_post_bind()
To ease debugging, use dev_err() instead of dev_dbg() for
alerting when regulator has nonunique value.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2024-12-05 07:31:31 +09:00
Patrice Chotard
ccddb0abec power: regulator: replace some debug() by dev_dbg()
Replace some debug() by dev_dbg() when dev variable
is available/valid.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2024-12-05 07:31:21 +09:00
Tim Harvey
d279f5d3a8 imx: power-domain: Convert to use livetree API for fdt access
Convert to using livetree API functions.

Without this if livetree is enabled (OF_LIVE) the imx8m-power-domain
driver will (silently) fail to probe its children leaving you with
no power domain support causing issues with certain devices.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
2024-10-25 09:07:35 -03:00
Tom Rini
63a3dbb7b9 Merge patch series "Add AVS support for J721S2"
Manorit Chawdhry <m-chawdhry@ti.com> says:

This series adds support for Adaptive voltage scaling on J721S2 device [0].

[0]: https://www.ti.com/lit/pdf/spruj28 (Section 5.2.4.1 AVS Support)

AVS Test for J721S2: https://gist.github.com/manorit2001/b2fd9f6764a863294d4aa0755c83c84f
Boot Test results: https://gist.github.com/manorit2001/d44e035552cb19aadeb0d928d5cb5f26

Link: https://lore.kernel.org/r/20241015-b4-upstream-j721s2-avs-v5-0-5c8087387dc5@ti.com
2024-10-21 17:52:40 -06:00
Manorit Chawdhry
48b45f131f power: pmic: tps65941: Add DM_PMIC dependency
This Kconfig depends on DM_PMIC but hadn't be explicitly stated which
could cause config related issues.

Adds the dependency in Kconfig for tps65941.

Fixes: 6b86dd0c1e ("power: pmic: tps65941: Add support for tps65941 family of PMICs")
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Reviewed-by: Aniket Limaye <a-limaye@ti.com>
2024-10-21 17:52:31 -06:00
Tom Rini
c676fc3710 - Add Libre Computer boards into proper libre-computer board directory
- Add new Boards:
  - Libre Computer aml-s905d3-cc
  - Libre Computer aml-a311d-cc
 - Add capsule update to libretech-ac and the new boards since they have an onboard SPI nor flash
 - Fix HDMI support after sync to v6.11 and regulator enable from Marek
 - Fix khadas-vim3 android config for android-mainline kernel
 - Disable meson64 boot targets when configs are not eavailable
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmcM2SEACgkQd9zb2sjI
 SdEIVg/+L13M9cmUalXygG0T0duaOLdg9a65cqGkX6pOPGEE0MGiwsnXOakKijuf
 mIRHGHsiH/n6wGQSztZLiPp5m/g8VXxmrxjgU1nraZV1VaFgXTG0DQwuAGvY1XKh
 tvnejmELtPLP0UwSZFqJGWkTwLntz1vuysO1B2Xt/bUEOkufK9XhoKyjuyUSX2z2
 KKZH9sDf9t3eWgtDxPuFDDL0sw/y610dBxIpYh/gHk24xE2TRM4S2ccVvQ1d+35B
 MtSzZauPsnBFRL5jMSJ0TbI42I9fzlRMjWTXHw3Yi469T07XBpn9oN/mZvufa4/j
 3aJBRlC+miQZ+m0wfE1oL4AvmA/jxZDi5vhmDVZgd0Irzl390uuZnUfgFI3+cN1H
 Dzua+E/+6rx4BvUV2f6JBCAZwBBT80CMxu5MzKARIworkrK5u2eXZbcN6kJ0GjBg
 Um/c+RrUfgDpfoNLoQ3T0oIqOmdItK+LE07hHHe+aM5JlOOhr5e8n3L3pJMeroyQ
 ckJ4mEKA8ly6a72YVxsfc+sa453qH5p3QHXfvlSuP7l4zjm1F5MELRtGHlR8JXUS
 hbWx3P0ZB7ynJvoONXriIoypff8ZGavgQfoRTupCQfPvB5dh7hJTBKGBZABeXY4R
 caYDBmsZ2Nuk8Co0HwBmLq3Bx2dqehG7Mip95R9B4zNH42gPhqk=
 =oq4w
 -----END PGP SIGNATURE-----

Merge tag 'u-boot-amlogic-next-20241014' of https://source.denx.de/u-boot/custodians/u-boot-amlogic

- Add Libre Computer boards into proper libre-computer board directory
- Add new Boards:
 - Libre Computer aml-s905d3-cc
 - Libre Computer aml-a311d-cc
- Add capsule update to libretech-ac and the new boards since they have an onboard SPI nor flash
- Fix HDMI support after sync to v6.11 and regulator enable from Marek
- Fix khadas-vim3 android config for android-mainline kernel
- Disable meson64 boot targets when configs are not eavailable
2024-10-14 08:14:46 -06:00
Neil Armstrong
bfa89c503f power/domain: meson-ee-pwrc: make sure to not enable a domain twice
The upstream Device Tree for GXBB/GXL/G12A was updated with VPU domain
shared between the VPU and HDMI node, causing a double enable.

Simply store the enable state and avoid enabling twice, fixing
HDMI output on all platforms.

Link: https://lore.kernel.org/r/20241009-u-boot-topic-fix-hdmi-v1-2-2479cd90c4ea@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2024-10-14 09:06:16 +02:00
Tom Rini
29e5dbc55c Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
This switches all boards with the Allwinner H616/H618/H313/H700 SoCs over to
use OF_UPSTREAM. We are doing it for this SoC family only since the DTs
between the U-Boot and the kernel repo are exactly identical, whereas other
families have one compatibility fix in U-Boot to allow booting older kernels.
Other will follow if this plays out well.

The biggest chunk otherwise is adding support for an Anbernic game console,
using the H700 SoC. For that we need to enhance the DRAM support code, and
pick two DT commits from the mainline kernel/DT rebasing repo, followed
by the defconfig patch.

On top of that two small fixes for the old Allwinner A80.

Gitlab CI passed, and I booted that briefly on some boards, including an
H616 and an H618 one (with LPDDR4).
2024-10-13 20:25:41 -06:00
Tom Rini
47e544f576 Merge patch series "Tidy up use of 'SPL' and CONFIG_SPL_BUILD"
Simon Glass <sjg@chromium.org> says:

When the SPL build-phase was first created it was designed to solve a
particular problem (the need to init SDRAM so that U-Boot proper could
be loaded). It has since expanded to become an important part of U-Boot,
with three phases now present: TPL, VPL and SPL

Due to this history, the term 'SPL' is used to mean both a particular
phase (the one before U-Boot proper) and all the non-proper phases.
This has become confusing.

For a similar reason CONFIG_SPL_BUILD is set to 'y' for all 'SPL'
phases, not just SPL. So code which can only be compiled for actual SPL,
for example, must use something like this:

   #if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_TPL_BUILD)

In Makefiles we have similar issues. SPL_ has been used as a variable
which expands to either SPL_ or nothing, to chose between options like
CONFIG_BLK and CONFIG_SPL_BLK. When TPL appeared, a new SPL_TPL variable
was created which expanded to 'SPL_', 'TPL_' or nothing. Later it was
updated to support 'VPL_' as well.

This series starts a change in terminology and usage to resolve the
above issues:

- The word 'xPL' is used instead of 'SPL' to mean a non-proper build
- A new CONFIG_XPL_BUILD define indicates that the current build is an
  'xPL' build
- The existing CONFIG_SPL_BUILD is changed to mean SPL; it is not now
  defined for TPL and VPL phases
- The existing SPL_ Makefile variable is renamed to SPL_
- The existing SPL_TPL Makefile variable is renamed to PHASE_

It should be noted that xpl_phase() can generally be used instead of
the above CONFIGs without a code-space or run-time penalty.

This series does not attempt to convert all of U-Boot to use this new
terminology but it makes a start. In particular, renaming spl.h and
common/spl seems like a bridge too far at this point.

The series is fully bisectable. It has also been checked to ensure there
are no code-size changes on any commit.
2024-10-11 12:23:25 -06:00
Simon Glass
5c10c8badf global: Rename SPL_TPL_ to PHASE_
Use PHASE_ as the symbol to select a particular XPL build. This means
that SPL_TPL_ is no-longer set.

Update the comment in bootstage to refer to this symbol, instead of
SPL_

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
c46760d596 global: Rename SPL_ to XPL_
Use XPL_ as the symbol to indicate an SPL build. This means that SPL_ is
no-longer set.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
371dc068bb drivers: Use CONFIG_XPL_BUILD instead of CONFIG_SPL_BUILD
Use the new symbol to refer to any 'SPL' build, including TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:48 -06:00
Simon Glass
456bdb70de xpl: Rename spl_phase() to xpl_phase()
Rename this function to indicate that it refers to any xPL phase.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-10-11 11:44:47 -06:00
Joy Zou
a404065479 power: pmic: pca9450: Add missing newline
Add newline character in log info end.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-10 12:17:46 -06:00
Joy Zou
a857e47263 power: pmic/regulator: Support pca9452
Add PCA9452 PMIC/Regulator support.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-10 12:17:46 -06:00
Joy Zou
cd63c4a79a power: regulator: pca9450: Update the BUCK1 voltage range
The pmic could be trimed with updated BUCK1 range, so update the range
for trimed pmic. The default value of Toff_Deb is used to distinguish
the non-trimed and trimed pmic.

Signed-off-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
2024-10-10 12:17:46 -06:00
Andre Przywara
d75fa8c80d sunxi: power: axp809: Fix DCDC4 programming
When trying to set the DCDC4 regulator, the code was accidentally
setting the voltage register for DCDC5 (VCC-DRAM). The higher voltage
doesn't harm the DRAM chips, but upsets the Linux regulator driver: when
it tried to correct that, it tripped over a separate DT bug.
The DCDC5 DT limits are 1.425 and 1.575V, which cannot bet set with the
rail's resolution of 50mV. The kernel driver gave up, and made in turn
the system hang, as the PMIC powers essential devices.

Fix the copy&paste bug by using the correct PMIC voltage register.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-10-10 00:23:41 +01:00
Fabio Estevam
52612185af da9063: Add watchdog support
The DA9063 PMIC is a multi-function device that provides
regulator, watchdog, RTC, and ON key functionalities.

Add support for the DA9063 PMIC watchdog functionality.

Based on the 6.11 kernel drivers/watchdog/da9063_wdt.c driver.

Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Stefan Roese <sr@denx.de>
2024-10-04 09:51:39 -03:00
Marek Vasut
6f52feee28 power: regulator: Drop regulators_enable_boot_on/off()
Both regulators_enable_boot_on/off() are unused and superseded by
regulator uclass regulator_post_probe(). Remove both functions.

Signed-off-by: Marek Vasut <marex@denx.de>
2024-09-30 19:19:07 -06:00
Marek Vasut
ba0faba52a power: regulator: Drop regulator_unset()
This function is never called, drop it.

Signed-off-by: Marek Vasut <marex@denx.de>
2024-09-30 19:19:07 -06:00
Marek Vasut
332e0a0148 power: regulator: Convert regulators_enable_boot_on/off() to regulator_post_probe
Turn regulators_enable_boot_on() and regulators_enable_boot_off() into
empty functions. Implement matching functionality in regulator_post_probe()
instead. The regulator_post_probe() is called for all regulators after they
probe, and regulators that have regulator-always-on or regulator-boot-on DT
properties now always probe due to DM_FLAG_PROBE_AFTER_BIND being set on
such regulators in regulator_post_bind().

Finally, fold regulator_unset() functionality into regulator_autoset().

Signed-off-by: Marek Vasut <marex@denx.de>
2024-09-30 19:19:07 -06:00
Marek Vasut
51c4679d2f power: regulator: Trigger probe of regulators which are always-on or boot-on
In case a regulator DT node contains regulator-always-on or regulator-boot-on
property, make sure the regulator gets correctly configured by U-Boot on start
up. Unconditionally probe such regulator drivers. This is a preparatory patch
for introduction of .regulator_post_probe() which would trigger the regulator
configuration.

Parsing of regulator-always-on and regulator-boot-on DT property has been
moved to regulator_post_bind() as the information is required early, the
rest of the DT parsing has been kept in regulator_pre_probe() to avoid
slowing down the boot process.

Signed-off-by: Marek Vasut <marex@denx.de>
2024-09-30 19:19:07 -06:00
Tom Rini
3a0b829efc Prepare v2024.10-rc6
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmb7KpIACgkQFHw5/5Y0
 tyzTaQv+LEFHt9BArtHHbAl8XzKIZ8H7pNSfN93Gv+T1ycnJPYNHnLejU/o54uO2
 hlxj4sWN4Ns1BfI7zjHb4vfpgUZb7Sg0B2tIQW6bm2Lr5Rp5Rwo6n2L+ubgyHCCV
 9SYSKTpoPQTyecVzh3V01YhdG8LWL6rfWD08Wx8zldVyaHajQwOG+VziLgw3aji8
 qVr8x0KUacwe+gsOp+HuBFrnrNFFaBfDDtGW2ywePVDp9yKerAFD55lVX4fDWfPs
 QMsexYGZaNOcL70pj0vl8+Ds/y7mtbPSKWSW2GwPfailNP8SwnETgOhddPeThWER
 nQxuF9kFAF3FoSMNnMy14BFQkoD6GCjOSeCNcVtWLVhxeLFLrO4HdQtTa9dzUE23
 ycGTNjmORsb7Hhm34guyfv/ImAEGTqBfwn2bIPt2f69Z7o0X1JPgGZjXXVtwZ6gL
 DZC8hfT8RkmVjY61fTeYkYY9RC+H1bEMFkXZPTd+pY0D4Z3Twbh+QfLimwHdp/UD
 F/qi6o+g
 =EZYp
 -----END PGP SIGNATURE-----

Merge tag 'v2024.10-rc6' into next

Prepare v2024.10-rc6
2024-09-30 17:48:12 -06:00
Jonas Karlman
7210de40a2 regulator: rk8xx: Use buck variable consistently
The buck variable is zero based, i.e. buck=0 match BUCK1 in datasheet.

Remove any buck + 1 calculation to be more consistent in usage of the
buck variable across the different RK8xx variants in the driver.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2024-09-27 18:20:49 +08:00
Jonas Karlman
5964651381 regulator: rk8xx: Fix buck get and set enabled state on RK806
Wrong POWER_EN reg is used to get and set enabled state for the RK806
buck 4 and 8 regulators, also wrong POWER_SLP_EN0 bit is used for
suspend state for the RK806 buck 1-8 regulators.

Fix this by not adding one to the zero based buck variable.

Fixes: f172575d92 ("power: rk8xx: add support for RK806")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
2024-09-27 18:20:49 +08:00
Jonas Karlman
4386ab9118 power: regulator: Consistently return -ENOSYS when ops is unimplemented
dev_get_driver_ops() may return NULL when the udevice is invalid.

Move the ops check to top of functions to consistently return -ENOSYS
when ops is unimplemented and prevent trying to access uclass plat data,
also add missing NULL checks to suspend ops.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-09-25 08:54:03 -06:00
Jonas Karlman
f417c14d88 power: regulator: Do not call set_suspend_value with -ENODATA
On some boards a PMIC regulator is flagged with regulator-on-in-suspend
and does not define any suspend or max microvolt, e.g. on Radxa ROCK 3A:

  vcc_ddr: DCDC_REG3 {
	regulator-name = "vcc_ddr";
	regulator-always-on;
	regulator-boot-on;
	regulator-initial-mode = <0x2>;

	regulator-state-mem {
		regulator-on-in-suspend;
	};
  };

This result in suspend_uV having the value -ENODATA after probe.

This negative voltage, -ENODATA, gets missinterpreted and result in an
unexpected voltage being set by autoset.

E.g. on Radxa ROCK 3A the vcc_ddr regulator by default have a normal and
suspend voltage value of 0.5v. However, due to this missinterpretation
the suspend voltage end up beind set to 0.5625v instead.

Fix this by skip calling regulator_set_suspend_value() in autoset and
also protect calling set value ops when input value is -ENODATA.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2024-09-25 08:54:03 -06:00
Tom Rini
48038bfb4d Merge branch 'qcom-next' of https://gitlab.denx.de/u-boot/custodians/u-boot-snapdragon into next
Various improvements to Snapdragon support:

* Bumped up the pagetable size to handle newer SoCs with much more RAM
* Made memory map parsing more robust, fixing chainloading on
  SM8550/SM8650
* Populate fdt_addr_r with U-Boot's FDT by default, and set $loadaddr to
  prevent
  crashes with some commands which expect it
* Added initial support for SC7280/QCM6490 and the new RB3 Gen 2 board
* Add debug config fragments to enable debug UART on some SoCs.
* Enable RPMh regulators on SM8550/SM8650
* Map the cmd-db memory explicitly since it may not be in the memory map

CI: https://source.denx.de/u-boot/custodians/u-boot-snapdragon/-/pipelines/22255
2024-09-09 10:52:55 -06:00
Neil Armstrong
3e36ada42e
regulator: qcom-rpmh-regulator: add support for PM8550 & related regulators
Add the PM8550 & related regulators found on the SM8550 and SM8650 platforms.
The tables are imported from the Linux driver.

Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-09-06 10:47:46 +02:00
John Keeping
a5d990854f regulator: fixed: fix regulator-fixed-clock
For regulator-fixed-clock, the device's private data is never set so in
fixed_clock_regulator_set_enable() is null and the function cannot
complete successfully.

Rename the _plat structure to _priv to better represent its role and set
this as the private data.  As shown by the set_enable() function and by
using the same .of_to_plat hook as regulator-fixed, the platform data is
regulator_common_plat so also set .plat_auto correctly.

Finally, set up the private data by adding a .probe function to look up
the clock and set the member variable.

Fixes: f3b5100aff ("regulator: fixed: add possibility to enable by clock")
Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-09-05 21:06:17 -06:00
Keerthy
07c12525bb power: regulator: tps6287x: Add driver for TPS6287x step down convertors
Add driver for TPS6287x step down convertors

Data sheet: https://www.ti.com/lit/ds/slvsgc5a/slvsgc5a.pdf

Signed-off-by: Keerthy <j-keerthy@ti.com>
2024-09-05 21:06:17 -06:00
Simon Glass
986ef77061 i2c: Remove I2C_SET_BUS()
This is very old, predating even the legacy I2C support, so drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heiko Schocher <hs@denx.de>
2024-08-13 06:14:55 +02:00
Caleb Connolly
426d35d24f
power: regulator: qcom-rpmh-regulator: add build infra
Add Kconfig and Makefile entries for this driver now that it can build
for U-Boot.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:13 +02:00
Caleb Connolly
b501a65cd8
power: regulator: qcom-rpmh-regulator: adjust probe for U-Boot
Refactor initialization to use U-Boot's driver model and API.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:12 +02:00
Caleb Connolly
a330dec3af
power: regulator: qcom-rpmh-regulator: port ops to U-Boot
Port over the regulator ops to U-Boot's regulator API. Add back the
pmic5 mode map using U-Boot dm_regulator_mode API and adjust the
pmic5_pldo and pmic5_pldo_lv definitions. No functional changes.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:12 +02:00
Caleb Connolly
be1f1b7b28
power: regulator: qcom-rpmh-regulator: remove unused regulators
Initially just include the few regulators needed for the RB5 board.
Others can be added back as-needed.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:12 +02:00
Caleb Connolly
e651b4f1f6
power: regulator: qcom-rpmh-regulator: adjust structs for U-Boot
Switch to our linear_range helpers and remove unused/unsupported
linux-isms.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:12 +02:00
Caleb Connolly
21c7b74a56
power: regulator: qcom-rpmh-regulator: port over lineage_range helpers
Import struct linear_range() and builder macro from Linux regulator
core.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:12 +02:00
Caleb Connolly
13bed6c903
power: regulator: qcom-rpmh-regulator: adjust headers for U-Boot
Remove unused/unsupported Linux headers and add necessary U-Boot ones.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:12 +02:00
Caleb Connolly
7d264b5a4c
power: regulator: import qcom-rpmh-regulator from Linux
Import the driver from Linux 6.10-rc6.

Acked-by: Sumit Garg <sumit.garg@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-07-26 01:28:12 +02:00
Tom Rini
b0ee3fe642 arm: ti: Remove omap4 platform support
There are no longer any OMAP4 platforms in U-Boot, remove the related
functionality.

Signed-off-by: Tom Rini <trini@konsulko.com>
2024-07-23 10:37:48 -06:00
Marek Vasut
43262e78b1 drivers: power: Remove duplicate newlines
Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2024-07-22 10:53:05 -06:00
Tom Rini
dce89b3bfc Merge tag 'u-boot-rockchip-20240718' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
- Add boards:
  rk3328: Radxa ROCK Pi E v3;
  rk3588s: FriendlyElec NanoPi R6C/S;
- Remove board: Theobroma Systems RK3368 Lion;
- Add rk3588 pcie support;
- Misc updates for board and config;

CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/2163
2024-07-18 07:49:14 -06:00
Quentin Schulz
c580cb4b8b power: rk8xx: fix display name for RK808
Commit 2ce40542e0 ("power: rk8xx: properly print all supported PMICs
name") fixed all PMICs name that were broken but broke the only one that
was not broken already: RK808. This one is a special case because the ID
registers are marked as reserved and always return 0, so the variant
cannot be derived the same way it is done for other PMICs from Rockchip.

Fixes: 2ce40542e0 ("power: rk8xx: properly print all supported PMICs name")
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
2024-07-17 12:25:52 +08:00
Andre Przywara
f5a7532676 power: pmic: sunxi: use generic AXP SPL driver for AXP305
The generic AXP SPL driver implementation can cover all regulators we
need for the AXP305.

Add the descriptions for four of the six DC/DC regulators of the AXP305,
and enable that when CONFIG_AXP305_POWER is enabled. We won't need DCDC2
and DCDC3, but by using the position in the array for the index we keep
the code cleaner.
Also remove the old driver, and switch the Makefile to include the new,
generic driver.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-07-15 18:11:37 +01:00
Andre Przywara
670c0324a1 power: pmic: sunxi: use generic AXP SPL driver for AXP313
The generic AXP SPL driver implementation can cover all regulators we
need for the AXP313.

Add the descriptions for the three DC/DC regulators of the AXP313, and
enable that when CONFIG_AXP313_POWER is enabled. Also remove the old
driver, and switch the Makefile to include the new, generic version.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-07-15 18:11:14 +01:00
Andre Przywara
51bee9b5a3 power: pmic: sunxi: add AXP717 SPL support
On boards using the AXP717 PMIC, the DRAM rail is often not setup
correctly at reset time, so we have to program the PMIC very early in
the SPL, before running the DRAM initialisation.

Using the new generic AXP SPL driver, add the Kconfig options and
platform bits needed to support an AXP717 PMIC chip in I2C mode.
This allows to set up the correct voltage for the DRAM chips and the
CPU cores.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Ryan Walklin <ryan@testtoast.com>
2024-07-15 18:11:13 +01:00
Andre Przywara
5e8af84721 power: pmic: sunxi: introduce generic SPL AXP DC/DC driver
So far we had a separate driver file for each AXP PMIC chip that we need
to support in the SPL. The code in there was largely similar, but
differed in many details.

Based on the idea of the DM AXP driver, introduce a data structure to
describe each regulator in a compact way. This is a simplified version
of the struct used in the DM driver, as we don't need to support the full
voltage range and not every regulator in the SPL.
For now we only support the DC/DC buck converters, since that's what we
need the SPL to configure, mostly. Also we get rid of the regulator name,
and hardcode the regulator number by its position in the array (first is
DCDC1, second is DCDC2, etc). We also drop support for the value table,
we ideally won't need that for the subset of regulators required.
At the end each regulator is described by a 10 bytes struct, so we avoid
blowing up the SPL footprint, but still can use generic code.

Each chip is supposed to be described separately, and protected by
ifdef's, to only build in the regulators needed for a particular board.
We also describe the bits to help identifying the AXP chip, and the
shutdown details in that section.

Add a generic driver, that exports axp_set_dcdc<x>() functions to set up
the buck converters. For now this just contains the bits for the (new)
AXP717, but it's not wired up anywhere yet.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-07-15 18:11:13 +01:00
Andre Przywara
75d28bd090 power: pmic: sunxi: only build AXP drivers for SPL
The axp<xxx>.c drivers are only used for the SPL, for U-Boot proper we
have a separate, DM compliant driver.
Mask the build instructions with CONFIG_SPL_BUILD, to avoid them being
build for U-Boot proper as well.

The AXP221 driver defines axp_get_sid(), which is used in the U-Boot
proper cpuinfo() code, and some old LCD code directly calls axp_set_eldo(),
so we keep that driver outside the new guards. This will be fixed properly
later.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2024-07-15 18:07:37 +01:00
Andre Przywara
c30277f0d9 power: regulator: add AXP717 support
The X-Powers AXP717 is a PMIC with four buck converters and a number
of LDOs, one of which is actually fixed (so not modelled here).

Add the compatible string and the respective regulator ranges to allow
drivers to adjust voltages.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Ryan Walklin <ryan@testtoast.com>
2024-07-15 00:17:27 +01:00