pandora-u-boot.git
6 months agoMerge patch series "Add QOS support for J722S and AM62P"
Tom Rini [Fri, 13 Dec 2024 20:12:01 +0000 (14:12 -0600)]
Merge patch series "Add QOS support for J722S and AM62P"

Jayesh Choudhary <j-choudhary@ti.com> says:

Add QOS support for DSS in TI K3 SoC to route the DSS traffic through
RT queue by setting orderID as 15:
- J722S
- AM62P

Link: https://lore.kernel.org/r/20241126070614.47136-1-j-choudhary@ti.com
6 months agoconfigs: am62p_evm_r5_defconfig: Enable CONFIG_K3_QOS
Jayesh Choudhary [Tue, 26 Nov 2024 07:06:14 +0000 (12:36 +0530)]
configs: am62p_evm_r5_defconfig: Enable CONFIG_K3_QOS

Enable CONFIG_K3_QOS to set QoS registers in R5 boot stage.

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
6 months agoconfigs: j722s_evm_r5_defconfig: Enable CONFIG_K3_QOS
Jayesh Choudhary [Tue, 26 Nov 2024 07:06:13 +0000 (12:36 +0530)]
configs: j722s_evm_r5_defconfig: Enable CONFIG_K3_QOS

Enable CONFIG_K3_QOS to set QoS registers in R5 boot stage.

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
6 months agoarm: mach-k3: am62p: Add QoS support for DSS
Jayesh Choudhary [Tue, 26 Nov 2024 07:06:12 +0000 (12:36 +0530)]
arm: mach-k3: am62p: Add QoS support for DSS

Enable Quality of Service (QoS) blocks for Display SubSystem (DSS), by
servicing the DSS - DDR traffic from the Real-Time (RT) queue. This is
done by setting the DSS DMA orderID to greater than 7.

DDR intensive software applications can overwhelm the DSS's access to
the DDR because of their higher frequency DDR accesses. This can cause
flickering in display with certain applications running parallely if
the DSS traffic is being serviced through non-RT queue.

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
6 months agoarm: mach-k3: j722s: Add QoS support for DSS
Jayesh Choudhary [Tue, 26 Nov 2024 07:06:11 +0000 (12:36 +0530)]
arm: mach-k3: j722s: Add QoS support for DSS

Enable Quality of Service (QoS) blocks for Display SubSystem (DSS), by
servicing the DSS - DDR traffic from the Real-Time (RT) queue. This is
done by setting the DSS DMA orderID to greater than 7.

The C7x and VPAC can overwhelm the DSS's access to the DDR because of
their higher frequency DDR accesses. This can cause flickering in
display with certain edgeAI models running parallely if the DSS traffic
is being serviced through non-RT queue.

Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
6 months agoRevert "Merge patch series "vbe: Series part E""
Tom Rini [Fri, 13 Dec 2024 03:07:26 +0000 (21:07 -0600)]
Revert "Merge patch series "vbe: Series part E""

This reverts commit 1fdf53ace13f745fe8ad4d2d4e79eed98088d555, reversing
changes made to e5aef1bbf11412eebd4c242b46adff5301353c30.

I had missed that this caused too much size growth on rcar3_salvator-x.

Signed-off-by: Tom Rini <trini@konsulko.com>
6 months agoMerge patch series "vbe: Series part E"
Tom Rini [Thu, 12 Dec 2024 22:35:47 +0000 (16:35 -0600)]
Merge patch series "vbe: Series part E"

Simon Glass <sjg@chromium.org> says:

This includes various patches towards implementing the VBE abrec
bootmeth in U-Boot. It mostly focuses on SPL tweaks and adjusting what
fatures are available in VPL.

Link: https://lore.kernel.org/r/20241207172412.1124558-1-sjg@chromium.org
6 months agohash: Plumb crc8 into the hash functions
Simon Glass [Sat, 7 Dec 2024 17:24:12 +0000 (10:24 -0700)]
hash: Plumb crc8 into the hash functions

Add an entry for crc8, with watchdog handling.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agoboot: Imply CRC8 with VBE
Simon Glass [Sat, 7 Dec 2024 17:24:11 +0000 (10:24 -0700)]
boot: Imply CRC8 with VBE

VBE uses a crc8 checksum to verify that the nvdata is valid, so make
sure it is available if VBE is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agolib: Allow crc8 in TPL and VPL
Simon Glass [Sat, 7 Dec 2024 17:24:10 +0000 (10:24 -0700)]
lib: Allow crc8 in TPL and VPL

Provide options to enable the CRC8 feature in TPL and VPL builds.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agoboot: Allow use of FIT in TPL and VPL
Simon Glass [Sat, 7 Dec 2024 17:24:09 +0000 (10:24 -0700)]
boot: Allow use of FIT in TPL and VPL

With VBE we want to use FIT in all phases of the boot. Add Kconfig
options to support this.

Disable the options for sandbox_vpl for now.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agospl: lib: Allow for decompression in any SPL build
Simon Glass [Sat, 7 Dec 2024 17:24:08 +0000 (10:24 -0700)]
spl: lib: Allow for decompression in any SPL build

Add Kconfig symbols and update the Makefile rules so that decompression
can be used in TPL and VPL

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agospl: Add some more debugging to load_simple_fit()
Simon Glass [Sat, 7 Dec 2024 17:24:07 +0000 (10:24 -0700)]
spl: Add some more debugging to load_simple_fit()

Add debugging of image-loading progress. Fix a stale comment in the
function comment while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agospl: Drop a duplicate variable in boot_from_devices()
Simon Glass [Sat, 7 Dec 2024 17:24:06 +0000 (10:24 -0700)]
spl: Drop a duplicate variable in boot_from_devices()

The variable 'ret' is defined twice, which is not intended. This may
have been a local merge error.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 2eefeb6d893 ("spl: Report a loader failure")

6 months agospl: Drop use of uintptr_t
Simon Glass [Sat, 7 Dec 2024 17:24:05 +0000 (10:24 -0700)]
spl: Drop use of uintptr_t

U-Boot uses ulong for addresses. It is confusing to use uintptr_t in a
few places, since it makes people wonder if the types are compatible.
Change the few occurences in SPL to use ulong

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agospl: Support a relocated stack in any XPL phase
Simon Glass [Sat, 7 Dec 2024 17:24:04 +0000 (10:24 -0700)]
spl: Support a relocated stack in any XPL phase

The current check looks only at SPL, but TPL or VPL might have a
different setting. Update the condition.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agospl: Allow serial to be disabled in any XPL phase
Simon Glass [Sat, 7 Dec 2024 17:24:03 +0000 (10:24 -0700)]
spl: Allow serial to be disabled in any XPL phase

The current check looks only at SPL, but TPL or VPL might have a
different setting. Update the condition.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agospl: Report a loader failure
Simon Glass [Sat, 7 Dec 2024 17:24:02 +0000 (10:24 -0700)]
spl: Report a loader failure

If a loader returns an error code it is silently ignored. Show a message
to at least provide some feedback to the user.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agoSupport setting a maximum size for the VPL image
Simon Glass [Sat, 7 Dec 2024 17:24:01 +0000 (10:24 -0700)]
Support setting a maximum size for the VPL image

Add a size limit for VPL, to match those for SPL and TPL

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agomalloc: Provide a simple malloc for VPL
Simon Glass [Sat, 7 Dec 2024 17:24:00 +0000 (10:24 -0700)]
malloc: Provide a simple malloc for VPL

The VPL phase may want to use the smaller malloc() implementation, so
add an option for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agomalloc: Show amount of used space when memory runs out
Simon Glass [Sat, 7 Dec 2024 17:23:59 +0000 (10:23 -0700)]
malloc: Show amount of used space when memory runs out

Show a bit more information when malloc() space is exhausted and
debugging is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agoboot: Respect the load_op in fit_image_load()
Simon Glass [Sat, 7 Dec 2024 17:23:58 +0000 (10:23 -0700)]
boot: Respect the load_op in fit_image_load()

Some code has crept in which ignores this parameter. Fix this and add a
little debugging.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: b1307f884a9 ("fit: Support compression for non-kernel components (e.g. FDT)")

6 months agobootstd: Avoid sprintf() in SPL when creating bootdevs
Simon Glass [Sat, 7 Dec 2024 17:23:57 +0000 (10:23 -0700)]
bootstd: Avoid sprintf() in SPL when creating bootdevs

The name of the bootdev device is not that important, particular in SPL.
Save a little code space by using a simpler name.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agoboot: Allow FIT to fall back from best-match option
Simon Glass [Sat, 7 Dec 2024 17:23:56 +0000 (10:23 -0700)]
boot: Allow FIT to fall back from best-match option

When the best-match feature fails to find something, use the provided
config name as a fallback. The allows SPL to select a suitable config
when best-match is enabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agoimage: Add a prototype for fit_image_get_phase()
Simon Glass [Sat, 7 Dec 2024 17:23:55 +0000 (10:23 -0700)]
image: Add a prototype for fit_image_get_phase()

This function exists but is not exported. Add a prototype so it can be
used elsewhere.

Signed-off-by: Simon Glass <sjg@chromium.org>
6 months agospl: mmc: Avoid size growth in spl_mmc_find_device() debug
Simon Glass [Sat, 7 Dec 2024 17:23:54 +0000 (10:23 -0700)]
spl: mmc: Avoid size growth in spl_mmc_find_device() debug

The for() loop ends up being in the code even if the log_debug() does
nothing. Add a condition to fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
6 months agoclk: Propagate clk_set_rate() if CLK_SET_PARENT_RATE present
Sam Protsenko [Fri, 8 Mar 2024 00:04:32 +0000 (18:04 -0600)]
clk: Propagate clk_set_rate() if CLK_SET_PARENT_RATE present

Sometimes clocks provided to a consumer might not have .set_rate
operation (like gate or mux clocks), but have CLK_SET_PARENT_RATE flag
set. In that case it's usually possible to find a parent up the tree
which is capable of setting the rate (div, pll, etc). Implement a simple
lookup procedure for such cases, to traverse the clock tree until
.set_rate capable parent is found, and use that parent to actually
change the rate. The search will stop once the first .set_rate capable
clock is found, which is usually enough to handle most cases.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
6 months agoMerge tag 'v2025.01-rc4' into next
Tom Rini [Mon, 9 Dec 2024 22:29:47 +0000 (16:29 -0600)]
Merge tag 'v2025.01-rc4' into next

Prepare v2025.01-rc4

6 months agoPrepare v2025.01-rc4 v2025.01-rc4
Tom Rini [Mon, 9 Dec 2024 22:09:28 +0000 (16:09 -0600)]
Prepare v2025.01-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
6 months agoMerge tag 'u-boot-imx-next-20241209' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Mon, 9 Dec 2024 14:46:57 +0000 (08:46 -0600)]
Merge tag 'u-boot-imx-next-20241209' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/23736

- Add support for the NXP i.MX91 EVK board.
- Improve EEPRON suport on i.MX8MP DHCOM board.
- Switch phycore_imx8mm to using environment text files and improve
  environment handling.

6 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Mon, 9 Dec 2024 14:46:33 +0000 (08:46 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sh

6 months agoarm64: renesas: Disable AVB1 and AVB2 on R8A779G0 V4H White Hawk board
Marek Vasut [Thu, 28 Nov 2024 04:11:19 +0000 (05:11 +0100)]
arm64: renesas: Disable AVB1 and AVB2 on R8A779G0 V4H White Hawk board

The U-Boot is currently not capable of handling ethernet-phy-ieee802.3-c45
PHYs correctly, and also does not handle MDIO bus wide reset-gpios property.
Until proper C45 PHY support lands in U-Boot, disable AVB1/AVB2 interfaces.
This only disables the two MACs with 88Q2110/88Q2112 100/1000BASE-T1 PHYs
on ethenet sub-board, the main board AVB0 ethernet is unaffected.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
6 months agopinctrl: rzg2l: Drop unnecessary scope
Paul Barker [Wed, 20 Nov 2024 09:48:30 +0000 (09:48 +0000)]
pinctrl: rzg2l: Drop unnecessary scope

In rzg2l_pinconf_set(), there are no new variables defined in the case
statement for PIN_CONFIG_INPUT_ENABLE so no additional scope is needed.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
6 months agopinctrl: rzg2l: Support Ethernet TXC output enable
Paul Barker [Wed, 20 Nov 2024 09:48:29 +0000 (09:48 +0000)]
pinctrl: rzg2l: Support Ethernet TXC output enable

On the RZ/G2L SoC family, the direction of the Ethernet TXC/TX_CLK
signal is selectable to support an Ethernet PHY operating in either MII
or RGMII mode. By default, the signal is configured as an input and MII
mode is supported. The ETH_MODE register can be modified to configure
this signal as an output to support RGMII mode.

As this signal is be default an input, and can optionally be switched to
an output, it maps neatly onto an `output-enable` property in the device
tree.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
6 months agopinctrl: rzg2l: Support 2.5V PVDD for Ethernet interfaces
Paul Barker [Wed, 20 Nov 2024 09:48:28 +0000 (09:48 +0000)]
pinctrl: rzg2l: Support 2.5V PVDD for Ethernet interfaces

The Ethenet interfaces on the Renesas RZ/G2L SoC family can operate at
multiple power supply voltages: 3.3V (default value), 2.5V and 1.8V.

rzg2l_pinconf_set() is extended to support the 2.5V setting, with a
check to ensure this is only used on Ethernet interfaces as it is not
supported on the SD & QSPI interfaces.

While we're modifying rzg2l_pinconf_set(), drop the unnecessary default
value for pwr_reg as it is set in every branch of the following if
condition.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
6 months agonet: ravb: Simplify max-speed handling in ravb_of_to_plat
Paul Barker [Wed, 20 Nov 2024 09:49:39 +0000 (09:49 +0000)]
net: ravb: Simplify max-speed handling in ravb_of_to_plat

We can call dev_read_u32_default() instead of calling fdt_getprop() then
fdt32_to_cpu().

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
6 months agoclk: rzg2l: Ignore enable for core clocks
Paul Barker [Tue, 19 Nov 2024 19:36:26 +0000 (19:36 +0000)]
clk: rzg2l: Ignore enable for core clocks

In the RZ/G2L family, core clocks are always on and can't be disabled.
However, drivers which are shared with other SoCs may call clk_enable()
or clk_enable_bulk() for a clock referenced in the device tree which
happens to be a core clock on the RZ/G2L. To avoid the need for
conditionals in these drivers, simply ignore attempts to enable a core
clock.

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
6 months agoboard: dhelectronics: Sync env variable dh_som_serial_number with SN
Christoph Niedermaier [Fri, 6 Dec 2024 23:04:20 +0000 (00:04 +0100)]
board: dhelectronics: Sync env variable dh_som_serial_number with SN

The env variable "SN" is used to store the serial number on DH electronics
SoMs. New SoMs will use the variable "dh_som_serial_number". To ensure
compatibility, these env variables are synchronized. This is achieved
using callback functions.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Marek Vasut <marex@denx.de>
6 months agolib: hashtable: Prevent recursive calling of callback functions
Christoph Niedermaier [Fri, 6 Dec 2024 23:04:19 +0000 (00:04 +0100)]
lib: hashtable: Prevent recursive calling of callback functions

In case there are two variables which each implement env callback
that performs env_set() on the other variable, the callbacks will
call each other recursively until the stack runs out. Prevent such
a recursion from happening.

Example which triggers this behavior:
static int on_foo(...) { env_set("bar", 0); ... }
static int on_bar(...) { env_set("foo", 0); ... }
U_BOOT_ENV_CALLBACK(foo, on_foo);
U_BOOT_ENV_CALLBACK(bar, on_bar);

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Suggested-by: Marek Vasut <marex@denx.de>
6 months agoarm64: imx8mp: Read values from M24C32-D write-lockable page on DHCOM i.MX8MP
Christoph Niedermaier [Fri, 6 Dec 2024 23:04:18 +0000 (00:04 +0100)]
arm64: imx8mp: Read values from M24C32-D write-lockable page on DHCOM i.MX8MP

The new i.MX8M Plus DHCOM rev.200 is populated with M24C32-D EEPROM
that contains an additional write-lockable page called ID page, which
is populated with a structure containing ethernet MAC addresses, DH
item number and DH serial number.

Because the write-lockable page is not present on rev.100 i.MX8MP DHCOM
SoM, test whether EEPROM ID page exists by setting up the i2c driver.

There may be multiple EEPROMs with an ID page on this platform, always
use the first one. The evaluation of the EEPROM ID page is done in two
steps. First, the content is read and checked. This is done to cache
the content of the EEPROM ID page. Second, the content is extracted
from the EEPROM buffer by requesting it.

For the ethernet MAC address the i.MX8M Plus DHCOM currently supports
parsing address from multiple sources in the following priority order:

1) U-Boot environment 'ethaddr'/'eth1addr' environment variable
2) SoC OTP fuses
3) On-SoM EEPROM

Add support for parsing the content of this new EEPROM ID page and place
it between 2) and 3) on the priority list. The new entry is 2.5) On-SoM
EEPROM write-lockable page.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Marek Vasut <marex@denx.de>
6 months agoarm64: dts: imx8mp: Add aliases for the access to the EEPROM ID page node
Christoph Niedermaier [Fri, 6 Dec 2024 23:04:17 +0000 (00:04 +0100)]
arm64: dts: imx8mp: Add aliases for the access to the EEPROM ID page node

The new i.MX8M Plus DHCOM rev.200 is populated with M24C32-D EEPROM
that contains an additional write-lockable page called ID page. Add
aliases eeprom0wl and eeprom1wl for the access to the EEPROM ID
page node.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Marek Vasut <marex@denx.de>
6 months agoimx: Support i.MX91 11x11 EVK board
Peng Fan [Tue, 3 Dec 2024 15:42:54 +0000 (23:42 +0800)]
imx: Support i.MX91 11x11 EVK board

Add i.MX91 11x11 EVK Board support.
 - Four ddr scripts included w/o inline ecc feature.
 - SDHC/NETWORK/I2C/UART supported
 - PCA9451 supported, default nominal drive mode
 - Documentation added.

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agoarm64: dts: add NXP i.MX91 device tree
Peng Fan [Tue, 3 Dec 2024 15:42:53 +0000 (23:42 +0800)]
arm64: dts: add NXP i.MX91 device tree

Add the i.MX91 device tree from [1]. These files could be synced
to linux upstream after [1] merged to linux source tree.

[1]
https://lore.kernel.org/all/20241120094945.3032663-1-pengfei.li_1@nxp.com/

Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agopinctrl: imx93: support i.MX91
Peng Fan [Tue, 3 Dec 2024 15:42:52 +0000 (23:42 +0800)]
pinctrl: imx93: support i.MX91

Reuse i.MX93 pinctrl driver for i.MX91, because i.MX91 follows same
design as i.MX93 in IOMUXC controller.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agoddr: imx: Add new rates for i.MX91
Ye Li [Tue, 3 Dec 2024 15:42:51 +0000 (23:42 +0800)]
ddr: imx: Add new rates for i.MX91

iMX91 reuses iMX93 controller and PHY, but with lower speed,
so add new DDR rates for i.MX91.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agoclk: imx: clk-fracn-gppll: Add new PLL rate
Ye Li [Tue, 3 Dec 2024 15:42:50 +0000 (23:42 +0800)]
clk: imx: clk-fracn-gppll: Add new PLL rate

Add new rates to integer and frac PLL to support iMX91

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agoclk: imx93: support i.MX91
Peng Fan [Tue, 3 Dec 2024 15:42:49 +0000 (23:42 +0800)]
clk: imx93: support i.MX91

i.MX91 is a derived from i.MX93, and most clocks could be reused from
i.MX93. Also Update imx93-clock.h to sync with linux next.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agoimx: Add iMX91 support
Peng Fan [Tue, 3 Dec 2024 15:42:48 +0000 (23:42 +0800)]
imx: Add iMX91 support

iMX91 is reduced part from iMX93 with part number: i.MX9131/11/01
It removed A55_1, M33, MIPI DSI, LVDS, etc.

i.MX9131:
  - Support 2.4GT/s DDR and HWFFC at 1.2GT/s
i.MX9121:
  - A55 at 800Mhz and DDR at 1600MTS, with low drive mode.
i.MX9111:
  - Support 1.6GT/s DDR and HWFFC at 800MT/s
i.MX9101:
  - Support 800Mhz ARM clock
  - Support 1.6GT/s DDR and HWFFC at 800MT/s
  - No parallel display, eQOS, flexcan

Updated Clock/Container/CPU and etc for i.MX91

Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agoimx93: Update 9x9 part fuses checking
Ye Li [Tue, 3 Dec 2024 15:42:47 +0000 (23:42 +0800)]
imx93: Update 9x9 part fuses checking

According to iMX93 fuse burn plan, all 9x9 parts will have USB2,
ENET1 (FEC), LVDS1, CSI1 and DSI1 disabled. The codes missed ENET1
fuse when detecting 9x9. Although it still can detect 9x9 correctly,
we add the ENET1 fuse to the check to be more accurate.

Fixes: 58da865e27f ("imx9: add i.MX93 variants support")
Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agoimx9: gpio: include types.h header
Peng Fan [Tue, 3 Dec 2024 15:42:46 +0000 (23:42 +0800)]
imx9: gpio: include types.h header

Include types.h header for u32, following Linux Coding Style to include
necessary headers.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agoimx9: trdc: correct DEBUG usage
Peng Fan [Tue, 3 Dec 2024 15:42:45 +0000 (23:42 +0800)]
imx9: trdc: correct DEBUG usage

Replace '#if DEBUG' with '#ifdef DEBUG', otherwise '#define DEBUG 1'
should be used and conflict with '#define DEBUG' in include/log.h

Fixes: 5fda95fb944 ("imx: imx9: Add TRDC driver for TRDC init")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agogpio: imx_rgpio2p: Move 8ulp_data to data section
Peng Fan [Tue, 3 Dec 2024 15:42:44 +0000 (23:42 +0800)]
gpio: imx_rgpio2p: Move 8ulp_data to data section

have_dual_base is set to false, so the 8ulp_data will be put in BSS
section which conflicts with the area of u-boot.dtb which padded just
after u-boot-nodtb.bin. So move 8ulp_data to data section to avoid
its content being corrupted by dtb.

Fixes: 51cfa66f2c4 ("gpio: imx_rgpio2p: support one address")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
6 months agoboard: phytec: phycore_imx8mm: Add RAUC boot logic to environment
Yunus Bas [Tue, 3 Dec 2024 09:42:35 +0000 (10:42 +0100)]
board: phytec: phycore_imx8mm: Add RAUC boot logic to environment

Add RAUC boot logic to the environment.

Signed-off-by: Yunus Bas <y.bas@phytec.de>
6 months agophycore_imx8mm: Move default bootcmd to board env
Yunus Bas [Tue, 3 Dec 2024 09:42:34 +0000 (10:42 +0100)]
phycore_imx8mm: Move default bootcmd to board env

Move the default bootcmd from the defconfig to the board environment.

Signed-off-by: Yunus Bas <y.bas@phytec.de>
6 months agophycore_imx8mm: Switch to using env text files
Yunus Bas [Tue, 3 Dec 2024 09:42:33 +0000 (10:42 +0100)]
phycore_imx8mm: Switch to using env text files

Move the environment into the board directory and convert header to a
txt file. In addition, this patch also applies following changes:

- Change default nfsroot path to /srv/nfs due to compliance with Linux
FHS 3.0.

- Rename specific variables as stated in the bootstd documentation.
Renamed variables:
fdt_addr => fdt_addr_r
fdt_file => fdtfile

Signed-off-by: Yunus Bas <y.bas@phytec.de>
6 months agombedtls: remove MBEDTLS_HAVE_TIME
Ilias Apalodimas [Fri, 6 Dec 2024 10:56:45 +0000 (12:56 +0200)]
mbedtls: remove MBEDTLS_HAVE_TIME

When MbedTLS TLS features were added MBEDTLS_HAVE_TIME was defined as part
of enabling https:// support. However that pointed to the wrong function
which could crash if it received a NULL pointer.

Looking closer that function is not really needed, as it only seems to
increase the RNG entropy by using 4b of the current time and date.
The reason that was enabled is that lwIP was unconditionally requiring it,
although it's configurable and can be turned off.

Since lwIP doesn't use that field anywhere else, make it conditional and
disable it from our config.

Fixes: commit a564f5094f62 ("mbedtls: Enable TLS 1.2 support")
Reported-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
6 months agoarm: qemu: fix update_info declaration
Vincent Stehlé [Fri, 6 Dec 2024 07:58:53 +0000 (08:58 +0100)]
arm: qemu: fix update_info declaration

Add a missing comma in the update_info structure declaration.

This fixes the following build error when building with
EFI_RUNTIME_UPDATE_CAPSULE or EFI_CAPSULE_ON_DISK:

  board/emulation/qemu-arm/qemu-arm.c:52:9: error: request for member ‘images’ in something not a structure or union

Fixes: cccea18813c4 ("efi_loader: add the number of image entries in efi_capsule_update_info")
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Masahisa Kojima <masahisa.kojima@linaro.org>
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>
Cc: Tom Rini <trini@konsulko.com>
6 months agonet: disable MBEDTLS in SPL
Heinrich Schuchardt [Fri, 6 Dec 2024 11:37:09 +0000 (12:37 +0100)]
net: disable MBEDTLS in SPL

Building SPL fails with MBEDTLS enabled.
Currently we don't need it there.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
6 months agortc: CONFIGS_RTC_PL031 must depend on CONFIGS_DM_RTC
Heinrich Schuchardt [Thu, 5 Dec 2024 20:36:19 +0000 (21:36 +0100)]
rtc: CONFIGS_RTC_PL031 must depend on CONFIGS_DM_RTC

Building qemu_arm64_defconfig with CONFIGS_DM_RTC=n and CONFIGS_RTC_PL031=y
leads to a build failure.

Adjust the vexpress64 configuration to avoid circular dependency.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
6 months agolmb: prohibit allocations above ram_top even from same bank
Sughosh Ganu [Mon, 2 Dec 2024 07:06:24 +0000 (12:36 +0530)]
lmb: prohibit allocations above ram_top even from same bank

There are platforms which set the value of ram_top based on certain
restrictions that the platform might have in accessing memory above
ram_top, even when the memory region is in the same DRAM bank. So,
even though the LMB allocator works as expected, when trying to
allocate memory above ram_top, prohibit this by marking all memory
above ram_top as reserved, even if the said memory region is from the
same bank.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Tested-by: Andreas Schwab <schwab@suse.de>
6 months agoconfigs: Resync with savedefconfig
Tom Rini [Fri, 6 Dec 2024 23:40:50 +0000 (17:40 -0600)]
configs: Resync with savedefconfig

Resync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
6 months agoMerge patch series "board: ti: k3-am65: covert last board to OF_UPSTREAM"
Tom Rini [Fri, 6 Dec 2024 22:39:26 +0000 (16:39 -0600)]
Merge patch series "board: ti: k3-am65: covert last board to OF_UPSTREAM"

Bryan Brattlof <bb@ti.com> says:

Hello Everyone!

This small series converts TI's AM65x reference board to use
CONFIG_OF_UPSTREAM and removes the unused device tree files from
arch/arm/dts.

Because it's the last board using a AM65x without enabling OF_UPSTREAM
it allows us to also remove all the SoC FDT files as well and keep a
single version of the SoC's DT files in the dts/upstream directory going
forward.

Link: https://lore.kernel.org/r/20241121-am65x-v1-0-fe87aff1b5fc@ti.com
6 months agoarm: dts: k3-am65: remove unsused am65x SoC fdt files
Bryan Brattlof [Thu, 21 Nov 2024 21:17:51 +0000 (15:17 -0600)]
arm: dts: k3-am65: remove unsused am65x SoC fdt files

With all boards using TI's AM65x having enabled CONFIG_OF_UPSTREAM
cleanup the unused SoC fdt files.

Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoarm: dts: k3-am654: cleanup unused board files
Bryan Brattlof [Thu, 21 Nov 2024 21:17:50 +0000 (15:17 -0600)]
arm: dts: k3-am654: cleanup unused board files

With the reference board now using CONFIG_OF_UPSTREAM these board files
are unused. Remove them

Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoboard: ti: am65x: migrate to OF_UPSTREAM
Bryan Brattlof [Thu, 21 Nov 2024 21:17:49 +0000 (15:17 -0600)]
board: ti: am65x: migrate to OF_UPSTREAM

Rather than rely on manual updates from the arch/arm/dts directory,
enable CONFIG_OF_UPSTREAM to receive automatic device tree updates for
the am65x reference board.

Signed-off-by: Bryan Brattlof <bb@ti.com>
6 months agoMerge patch series "PLL Sequencing update"
Tom Rini [Fri, 6 Dec 2024 22:38:50 +0000 (16:38 -0600)]
Merge patch series "PLL Sequencing update"

Manorit Chawdhry <m-chawdhry@ti.com> says:

It has done a re-write of the full driver and the commits aren't split
to keep the bisectability intact.

Boot Logs: https://gist.github.com/manorit2001/1eaba109d722715a233244da693133d3

Link: https://lore.kernel.org/r/20241121-b4-upstream-pll-fix-v1-0-904f618897a7@ti.com
6 months agoclk: ti: clk-k3-pll: Add additional robustness steps to the PLL sequence
Manorit Chawdhry [Thu, 21 Nov 2024 12:02:53 +0000 (17:32 +0530)]
clk: ti: clk-k3-pll: Add additional robustness steps to the PLL sequence

Based on the recommendation from HW team make modifications to
the sequence for more robustness.

- Unlock the PLL registers
- Enable external bypass
- Disable the PLL
- Program pllm and pllf
- Program Ref divider
- Enable other PLL controls like DSM_EN, DAC_EN,etc
- Enable calibration if available
- Enable PLL
- Wait for PLL lock and Calibration lock
- Remove external bypass

Re-write the full sequence from scratch as the previous sequence was way
off and keep it in a single commit for bisectability.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoclk: ti: clk-k3-pll: Change variable name reg to base
Manorit Chawdhry [Thu, 21 Nov 2024 12:02:52 +0000 (17:32 +0530)]
clk: ti: clk-k3-pll: Change variable name reg to base

base is more appropriate for the usage as the variable stores the base
address and seems more accurate w.r.t reg. Change reg to base.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoarm: dts: k3-*-r5: Remove clocks from mcu_timer0
Manorit Chawdhry [Thu, 21 Nov 2024 12:02:51 +0000 (17:32 +0530)]
arm: dts: k3-*-r5: Remove clocks from mcu_timer0

Updated PLL driver sequencing requires us to use udelay in the PLL
driver as there is no poll bit to get the status of operations.
tick-timer(mcu_timer0/main_timer0) setting up the clocks for itself is
something that won't work as the PLL driver will be using udelay and
PLLs are configured during clock probe which would end up in a recursive
probe.

tick-timer being used by K3 devices are configured by ROM and we really
don't need to configure any of the clocks.

Remove the clock dependency from R5 stage as we don't need to setup
clocks for it.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoenv: Switch the callback static list to Kconfig
Christoph Niedermaier [Wed, 20 Nov 2024 16:01:35 +0000 (17:01 +0100)]
env: Switch the callback static list to Kconfig

Switch the callback static list from the board configuration variable
CFG_ENV_CALLBACK_LIST_STATIC to Kconfig CONFIG_ENV_CALLBACK_LIST_STATIC.

Signed-off-by: Christoph Niedermaier <cniedermaier@dh-electronics.com>
Reviewed-by: Marek Vasut <marex@denx.de>
6 months agoram: k3-ddrss: drop debug() in timing-sensitive sequence
Théo Lebrun [Fri, 15 Nov 2024 09:43:15 +0000 (10:43 +0100)]
ram: k3-ddrss: drop debug() in timing-sensitive sequence

Those debug() calls might be useful, but beware. They can cause the DDR
controller to hang if we do not run the sequence quickly enough.

They usually are not an issue with upstream U-Boot and the default DDR
config, but they have become troublesome with custom DDR configs.

Drop those debug() statements that shouldn't be present in
time-sensitive code, to avoid anyone else falling into the trap.

Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
6 months agoMerge patch series "led: update LED boot/activity to new property implementation"
Tom Rini [Fri, 6 Dec 2024 19:00:52 +0000 (13:00 -0600)]
Merge patch series "led: update LED boot/activity to new property implementation"

Christian Marangi <ansuelsmth@gmail.com> says:

This series is split in 2 part.

While adapting the LED boot and activity code to the new property
accepted by Rob in dt-schema repository, a big BUG was discovered.

The reason wasn't clear at start and took me some days to figure it
out.

This was triggered by adding a new phandle in the test.dts to
introduce test for the new OPs.

This single addition caused the sandbox CI test to fail in the
dm_test_ofnode_phandle_ot test.

This doesn't make sense as reverting the change made the CI test
to correctly finish. Also moving the uboot node down
after the first phandle (in test.dts the gpio one) also made
the CI test to correctly finish.

A little bit of searching and debugging made me realize the
parse phandle OPs didn't support other.dts at all and they
were still referencing phandle index from test.dts.
(more info in the related commit)

In short the test was broken all along and was working by
pure luck. The first 4 patch address and fix the problem for good.

The other 4 patch expand and address the property change for
LED boot/activity.

Posting in a single series as changes are trivial and just
to speedup review process. (and also because the second
part depends on the first)

All CI tested with azure pipeline.

Link: https://lore.kernel.org/r/20241110115054.2555-1-ansuelsmth@gmail.com
6 months agotest: dm: Update test for LED activity and boot
Christian Marangi [Sun, 10 Nov 2024 11:50:27 +0000 (12:50 +0100)]
test: dm: Update test for LED activity and boot

Update test for LED activity and boot to follow new implementation with
property set to the LED node phandle.

Also update a copy-paste error in the function name for the activity
tests and actually enable the test with the DM_TEST macro.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 months agoled: update LED boot/activity to new property implementation
Christian Marangi [Sun, 10 Nov 2024 11:50:26 +0000 (12:50 +0100)]
led: update LED boot/activity to new property implementation

Update LED boot/activity to reference by phandle instead of label and
add to period property the "-ms" suffix.
This is a followup request by dt-schema maintainers that required LED
node to be referenced by a phandle to the node instead of indirectly by
the LED label and for timevalue to have a suffix.

While at it generalize the LED node label parsing since the logic is
common for generic LED bind and LED activity/boot.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
6 months agotest: dm: Add test for ofnode options phandle helper
Christian Marangi [Sun, 10 Nov 2024 11:50:25 +0000 (12:50 +0100)]
test: dm: Add test for ofnode options phandle helper

Add test for ofnode options phandle helper and add new property in the
sandbox test dts.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 months agodm: core: implement phandle ofnode_options helper
Christian Marangi [Sun, 10 Nov 2024 11:50:24 +0000 (12:50 +0100)]
dm: core: implement phandle ofnode_options helper

Implement ofnode_options phandle helper to get an ofnode from a phandle
option in /options/u-boot.

This helper can be useful since new DT yaml usually require to link a
phandle of a node instead of referencing it by name or other indirect
way.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 months agotest: dm: Expand dm_test_ofnode_phandle(_ot) with new ofnode/tree_parse_phandle
Christian Marangi [Sun, 10 Nov 2024 11:50:23 +0000 (12:50 +0100)]
test: dm: Expand dm_test_ofnode_phandle(_ot) with new ofnode/tree_parse_phandle

Expand dm_test_ofnode_phandle(_ot) with new ofnode/tree_parse_phandle() op.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 months agodm: core: implement ofnode/tree_parse_phandle() helper
Christian Marangi [Sun, 10 Nov 2024 11:50:22 +0000 (12:50 +0100)]
dm: core: implement ofnode/tree_parse_phandle() helper

Implement ofnode/tree_parse_phandle() helper as an equivalent of
of_parse_phandle to handle simple single value phandle.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 months agotest: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot
Christian Marangi [Sun, 10 Nov 2024 11:50:21 +0000 (12:50 +0100)]
test: dm: fix broken dm_test_ofnode_phandle_ot and get_by_phandle_ot

Fix broken dm_test_ofnode_phandle_ot test. They never actually worked
and were passing test by pure luck by having the same phandle index of
test.dts that coincicentally had #gpio-cells in the same index node.

It was sufficient to add a phandle to test.dts to make the test fail.

To correctly test these feature, make use oif the new OPs oftree to
parse phandle.

For consistency with the dm_test_ofnode_phandle, rework the test and
other.dts to use the same property with the other- prefix to every
node.

Also fix dm_test_ofnode_get_by_phandle_ot by making it more robust and
renaming the phandle property to other-phandle.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 months agodm: core: implement oftree variant of parse_phandle OPs
Christian Marangi [Sun, 10 Nov 2024 11:50:20 +0000 (12:50 +0100)]
dm: core: implement oftree variant of parse_phandle OPs

Implement oftree variant of parse_phandle OPs.

There is currently a very hidden and laten BUG with parse_phandle OPs
that doesn't permit the support of multiple DTS in a system. One usage
example if sandbox with the usage of other.dts

The BUG is only present on live scenario where of_... OPs are used and
it's not present when fdt... OPs are used.

This is caused by an assumption made in __of_parse_phandle_with_args,
with the of_find_node_by_phandle call that pass the first arg as NULL.

This makes of_find_node_by_phandle use the default root node of the
system and doesn't permit the usage of alternative tree. This is correct
for normal system and also for the linux kernel where it's assumed a
single device tree.

It's problematic if other device tree needs to be used.

To fix this, introduce __of_root_parse_phandle_with_args to define a
root device tree for of_find_node_by_phandle.

Introduce all the variant OPs for this and in ofnode, the oftree OPs
following how it's done for other OPs with similar task.

For FDT scenario, ofnode_from_fdtdec_phandle_args is reworked to accept
a new variable, node and noffset_to_ofnode is used instead of
offset_to_ofnode. This is required to support multiple FDB blob to
calculate the correct of_offset of the ofnode.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
6 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-pmic
Tom Rini [Thu, 5 Dec 2024 14:11:35 +0000 (08:11 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-pmic

CI: https://source.denx.de/u-boot/custodians/u-boot-pmic/-/pipelines/23718

- Correct a few debug/error print calls

6 months agoMerge tag 'efi-master-05122024' of https://source.denx.de/u-boot/custodians/u-boot-tpm
Tom Rini [Thu, 5 Dec 2024 14:10:51 +0000 (08:10 -0600)]
Merge tag 'efi-master-05122024' of https://source.denx.de/u-boot/custodians/u-boot-tpm

CI: https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/23719

Two fixes for the EFI subsystem coming via the TPM tree as agreed by Heinrich

The LMB patch fixes a failure in SystemReady testing. Nothing bad happens
without the patch in the device operation, but the return values are wrong
and SCT tests fail for MemoryAllocationServicesTest category.

The second is a shielding the device against mistakes in the definition of
struct fields needed by the capsule update mechanism. Instead of crashing,
print a humna readable message of what's wrong.

6 months agolmb: Fix the allocation of overlapping memory areas with !LMB_NONE
Ilias Apalodimas [Mon, 2 Dec 2024 14:42:45 +0000 (16:42 +0200)]
lmb: Fix the allocation of overlapping memory areas with !LMB_NONE

At the moment the LMB allocator will return 'success' immediately on two
consecutive allocations if the second one is smaller and the flags match
without resizing the reserved area.

This is problematic for two reasons, first of all the new updated
allocation won't update the size and we end up holding more memory than
needed, but most importantly it breaks the EFI SCT tests since EFI
now allocates via LMB.

More specifically when EFI requests a specific address twice with the
EFI_ALLOCATE_ADDRESS flag set, the first allocation will succeed and
update the EFI memory map. Due to the LMB behavior the second allocation
will also succeed but the address ranges are already in the EFI memory
map due the first allocation. EFI will then fail to update the memory map,
returning EFI_OUT_OF_RESOURCES instead of EFI_NOT_FOUND which break EFI
conformance.

So let's remove the fast check with is problematic anyway and leave LMB
resize and calculate address properly. LMB will now
- try to resize the reservations for LMB_NONE
- return -1 if the memory is not LMB_NONE and already reserved

The LMB code needs some cleanup in that part, but since we are close to
2025.01 do the easy fix and plan to refactor it later.
Also update the dm tests with the new behavior.

Fixes: commit 22f2c9ed9f53 ("efi: memory: use the lmb API's for allocating and freeing memory")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agoefi_loader: Check for a valid fw_name before auto generating GUIDs
Ilias Apalodimas [Tue, 3 Dec 2024 16:13:37 +0000 (18:13 +0200)]
efi_loader: Check for a valid fw_name before auto generating GUIDs

The gen_v5_guid() is a void and does no error checking with pointers
being available etc. Instead it expects all things to be in place to
generate GUIDs. If a board capsule definition is buggy and does not
define the firmware names when enabling capsule updates, the board will
crash trying to bring up the EFI subsystem.

Check for a valid firmware name before generating GUIDs.

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agopower: regulator: replace dev_dbg() by dev_err() in regulator_post_bind()
Patrice Chotard [Tue, 3 Dec 2024 10:06:11 +0000 (11:06 +0100)]
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>
6 months agopower: regulator: replace some debug() by dev_dbg()
Patrice Chotard [Tue, 3 Dec 2024 10:06:10 +0000 (11:06 +0100)]
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>
6 months agoMerge patch series "Add OPP_LOW support for J7200"
Tom Rini [Wed, 4 Dec 2024 20:30:25 +0000 (14:30 -0600)]
Merge patch series "Add OPP_LOW support for J7200"

Aniket Limaye <a-limaye@ti.com> says:

This series adds OPP_LOW spec data in k3_avs driver and enables a config
option to select the OPP_LOW performance point.

J7200 SOC supports OPP_LOW and OPP_NOM as two Operating Performance
Points as per (7.5 Operating Performance Points) section in the
Datasheet [0].
- A72SS/MSMC at 2 GHz/1GHz operation must use OPP_NOM.
- A72SS/MSMC at 1 GHz/500 MHz operation can use OPP_NOM or OPP_LOW
  voltage (though OPP_LOW voltage is recommended to reduce power
  consumption).

The actual OPP voltage for the device is read from the efuse and
updated in k3_avs_probe().

The default j7200 devicetree and k3_avs driver set OPP_NOM spec
frequency and voltage.

In the board init file, if K3_OPP_LOW config is enabled, Check if
OPP_LOW AVS voltage read from efuse is valid and update frequency (A72
and MSMC) and voltage (VDD_CPU) as per the OPP_LOW spec.

[0]: https://www.ti.com/lit/gpn/dra821u  (J7200 Datasheet)

Test logs:
https://gist.github.com/aniket-l/328ad93ed60c2419ed7be9f85e6b6075
- With series applied on master and CONFIG_K3_OPP_LOW enabled in
  j7200_evm_r5_defconfig
- Logs shown with and without efuse register programmed for OPP_0
  (Errors out if OPP_0 not found, programs OPP_LOW spec if found)
- Voltage update verified using 'i2c md 0x4c 0xe' in u-boot
- Frequency update verified using 'k3conf clock dump' in linux

Link: https://lore.kernel.org/r/20241119003617.1871183-1-a-limaye@ti.com
6 months agoconfigs: j7200_evm_r5_defconfig: Define K3_OPP_LOW
Reid Tonking [Tue, 19 Nov 2024 00:32:59 +0000 (06:02 +0530)]
configs: j7200_evm_r5_defconfig: Define K3_OPP_LOW

Define new CONFIG_K3_OPP_LOW under arm/mach-k3/r5/Kconfig and add
default value to j7200_evm_r5_defconfig

Signed-off-by: Reid Tonking <reidt@ti.com>
Signed-off-by: Aniket Limaye <a-limaye@ti.com>
6 months agoarm: mach-k3: j721e-init.c: Add support for CONFIG_K3_OPP_LOW
Aniket Limaye [Tue, 19 Nov 2024 00:32:58 +0000 (06:02 +0530)]
arm: mach-k3: j721e-init.c: Add support for CONFIG_K3_OPP_LOW

The default j7200 devicetree and k3_avs driver set 2GHz/1GHz frequency
for A72/MSMC clks and the OPP_NOM voltage.

J7200 SOCs may support OPP_LOW Operating Performance Point:
1GHz/500MHz clks for A72/MSMC and OPP_LOW AVS voltage read from efuse.

Hence, add a config check in board_init_f() to select OPP_LOW specs:
- Check if OPP_LOW AVS voltage read from efuse is valid.
- Use the device IDs and clock IDs (TISCI docs [0]) to find the A72 and
  MSMC clock frequencies in the devicetree.
- Fixup the clock frequencies in devicetree as per OPP_LOW spec.

k3_avs driver programs the OPP_LOW AVS voltage for VDD_CPU through
k3_avs_notify_freq() callback from clk_k3.

[0]: https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j7200/clocks.html

Signed-off-by: Aniket Limaye <a-limaye@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agomisc: k3_avs: Check validity of efuse voltage data
Reid Tonking [Tue, 19 Nov 2024 00:32:57 +0000 (06:02 +0530)]
misc: k3_avs: Check validity of efuse voltage data

k3_avs driver checks opp_ids when probing and overwrites the voltage
values in vd_data for the respective board. The new k3_avs_check_opp()
can be called from board files to check the efuse data and returns 0 if
valid.

Also add the same check in k3_avs_program_voltage() to error out if
the efuse data was not valid.

Signed-off-by: Reid Tonking <reidt@ti.com>
Signed-off-by: Aniket Limaye <a-limaye@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agomisc: k3_avs: Add OPP_LOW voltage and frequency to vd_data
Reid Tonking [Tue, 19 Nov 2024 00:32:56 +0000 (06:02 +0530)]
misc: k3_avs: Add OPP_LOW voltage and frequency to vd_data

J7200 SOC supports OPP_LOW and OPP_NOM as two Operating Performance
Points as per (7.5 Operating Performance Points) section in the
Datasheet [0].
- A72SS/MSMC at 2 GHz/1GHz operation must use OPP_NOM.
- A72SS/MSMC at 1 GHz/500 MHz operation can use OPP_NOM or OPP_LOW
  voltage (though OPP_LOW voltage is recommended to reduce power
  consumption).

Add OPP_LOW frequency->voltage entry to vd_data.

The actual OPP voltage for the device is read from the efuse and
updated in k3_avs_probe().
OPP_NOM corresponds to OPP_1 and OPP_LOW to OPP_0 efuse register
fields, as described in the Datasheet [0]
The register offsets and fields are described in the TRM (5.2.6.1.5
WKUP_VTM_VD_OPPVID_j Register) [1].

[0]: https://www.ti.com/lit/gpn/dra821u (J7200 Datasheet)
[1]: https://www.ti.com/lit/pdf/spruiu1 (J7200 TRM)

Signed-off-by: Reid Tonking <reidt@ti.com>
Signed-off-by: Aniket Limaye <a-limaye@ti.com>
6 months agoarm: dts: k3-j7200-r5-common: Add msmc clk to a72 node
Reid Tonking [Tue, 19 Nov 2024 00:32:55 +0000 (06:02 +0530)]
arm: dts: k3-j7200-r5-common: Add msmc clk to a72 node

The j7200 SOC has a single DDR controller and hence no need for
configuring the MSMC interleaver. Hence we do not have an explicit node
for MSMC in j7200 DT, unlike j721s2/j784s4.

Also, MSMC clk id is described under A72SS0_CORE0 Device in TISCI
documentation [0].

Considering the above, define the MSMC clk in the a72 node.

[0]: https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j7200/clocks.html#clocks-for-a72ss0-core0-device

Signed-off-by: Reid Tonking <reidt@ti.com>
Signed-off-by: Aniket Limaye <a-limaye@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoMerge patch series "Enable AVS support for AM68, AM69 and J784S4"
Tom Rini [Wed, 4 Dec 2024 20:29:11 +0000 (14:29 -0600)]
Merge patch series "Enable AVS support for AM68, AM69 and J784S4"

Neha Malcom Francis <n-francis@ti.com> says:

This series adds AVS support for AM68 SK, AM69 SK and J784S4 EVM.

Boot logs:
https://gist.github.com/nehamalcom/db5dbf98357ebac46f648c24ad1a17e2

Link: https://lore.kernel.org/r/20241118105714.1973573-1-n-francis@ti.com
6 months agoconfigs: am68_sk_r5: Add AVS Configs
Udit Kumar [Mon, 18 Nov 2024 10:57:14 +0000 (16:27 +0530)]
configs: am68_sk_r5: Add AVS Configs

Add AVS and PMIC regulator configs

Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoconfigs: j784s4_evm_r5_defconfig: Enable AVS
Neha Malcom Francis [Mon, 18 Nov 2024 10:57:13 +0000 (16:27 +0530)]
configs: j784s4_evm_r5_defconfig: Enable AVS

Enable AVS support on J784S4 along with regulator.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoarch: arm: mach-k3: j784s4_init: Probe AVS driver
Neha Malcom Francis [Mon, 18 Nov 2024 10:57:12 +0000 (16:27 +0530)]
arch: arm: mach-k3: j784s4_init: Probe AVS driver

Probe the AVS driver to set the AVS voltage.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoarm: dts: k3-am68-sk-r5-base-board: Add VTM node to R5 stage
Neha Malcom Francis [Mon, 18 Nov 2024 10:57:11 +0000 (16:27 +0530)]
arm: dts: k3-am68-sk-r5-base-board: Add VTM node to R5 stage

Add the VTM node to the R5 boot stage so that AVS is correctly
configured for AM68 SK.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoarm: dts: k3-j784s4-r5: Add VTM node to R5 stage
Neha Malcom Francis [Mon, 18 Nov 2024 10:57:10 +0000 (16:27 +0530)]
arm: dts: k3-j784s4-r5: Add VTM node to R5 stage

Add VTM node to R5 boot stage so that AVS gets correctly configured for
J784S4 EVM and AM69 SK.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoarm: dts: k3-am68: Enable OSPI boot
Udit Kumar [Tue, 19 Nov 2024 09:47:23 +0000 (15:17 +0530)]
arm: dts: k3-am68: Enable OSPI boot

Enable OSPI node to allow OSPI boot on AM68

Signed-off-by: Udit Kumar <u-kumar1@ti.com>
6 months agodm: gpio: Return error when pull up/down is requested but set_flags ops is not implme...
Zixun LI [Mon, 21 Oct 2024 15:04:51 +0000 (17:04 +0200)]
dm: gpio: Return error when pull up/down is requested but set_flags ops is not implmentated

Currently in _dm_gpio_set_flags() when set_flags ops is not implemented
direction_output()/_input() is used, but pull up/down is not supported by
these ops.

Signed-off-by: Zixun LI <admin@hifiphile.com>