pandora-u-boot.git
2 months agoMerge patch series "airoha: Add initial support AN7581"
Tom Rini [Tue, 1 Apr 2025 14:45:46 +0000 (08:45 -0600)]
Merge patch series "airoha: Add initial support AN7581"

Christian Marangi <ansuelsmth@gmail.com> says:

This little series adds initial support for Airoha AN7581 SoC.

With the help of some backport patch, this use OF_UPSTREAM
directly.

Posting this to have the targer and the very basic driver.

Ethernet, SNAND and eMMC support is already ready downstream
and will be posted shortly after this gets approved.

Having the first driver ready permits to separately push
dedicate series for SNAND, eMMC and Ethrnet as they all depends
on basic support of clock and reset and nothing else.

Link: https://lore.kernel.org/r/20250314185941.27834-1-ansuelsmth@gmail.com
2 months agodt-bindings: clock: add ID for eMMC for EN7581
Christian Marangi [Fri, 14 Mar 2025 18:59:26 +0000 (19:59 +0100)]
dt-bindings: clock: add ID for eMMC for EN7581

Add ID for eMMC for EN7581. This is to control clock selection of eMMC
between 200MHz and 150MHz.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20250113231030.6735-4-ansuelsmth@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
[ upstream commit: 82108ad3285f58f314ad41398f44017c7dbe44de ]

2 months agodt-bindings: clock: drop NUM_CLOCKS define for EN7581
Christian Marangi [Fri, 14 Mar 2025 18:59:25 +0000 (19:59 +0100)]
dt-bindings: clock: drop NUM_CLOCKS define for EN7581

Drop NUM_CLOCKS define for EN7581 dts/upstream/src/include. This is not a binding and
should not be placed here. Value is derived internally in the user
driver.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250113231030.6735-3-ansuelsmth@gmail.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
[ upstream commit: 02d3b7557ce28c373ea1e925ae16ab5988284313 ]

2 months agoarm64: dts: airoha: en7581: Add Clock Controller node
Christian Marangi [Fri, 14 Mar 2025 18:59:24 +0000 (19:59 +0100)]
arm64: dts: airoha: en7581: Add Clock Controller node

Add Clock Controller node for EN7581 SoC to correctly expose supported
clock for any user in the SoC.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20250105150328.15172-1-ansuelsmth@gmail.com
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
[ upstream commit: 7693017580e9be839fa5f27130bb6500f3597595 ]

2 months agoreset: airoha: Add driver for controlling reset line of AN7581
Christian Marangi [Fri, 14 Mar 2025 18:59:23 +0000 (19:59 +0100)]
reset: airoha: Add driver for controlling reset line of AN7581

Add driver for controlling the reset lines of AN7581. This is a detached
version of the clock controller driver present in Linux only used to
control reset lines. Driver gets loaded with the bind of the clock
driver and doesn't require a compatible. This is needed as they share
the same registers.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoclk: airoha: Add support for Airoha AN7581 SoC clock
Christian Marangi [Fri, 14 Mar 2025 18:59:22 +0000 (19:59 +0100)]
clk: airoha: Add support for Airoha AN7581 SoC clock

Add support for Airoha AN7581 SoC clock driver. This mainly needed for
eMMC support to correctly get the current clock applied.

Based on the Linux clk-en7523.c but majorly reworked for U-Boot that
doesn't require CCF subsystem.

Major modification, support for set_rate, realtime get_rate and split
for reset part to a different driver.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoairoha: Add initial support for Airoha AN7581 SoC
Christian Marangi [Fri, 14 Mar 2025 18:59:21 +0000 (19:59 +0100)]
airoha: Add initial support for Airoha AN7581 SoC

Add initial support for Airoha AN7581 SoC. This adds the initial Kconfig
and Makefile entry for the SoC, an U-Boot specific DTSI and initial config
for it. Also add the initial code for CPU and RAM initialization.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoconfigs: am68_sk_r5: Enable AVS config
Udit Kumar [Tue, 18 Mar 2025 18:46:28 +0000 (00:16 +0530)]
configs: am68_sk_r5: Enable AVS config

Enable AVS config

Signed-off-by: Udit Kumar <u-kumar1@ti.com>
2 months agoconfigs: am65x_evm_r5_usbdfu_defconfig: Fix USB DFU boot
Hrushikesh Salunke [Fri, 14 Mar 2025 06:31:13 +0000 (12:01 +0530)]
configs: am65x_evm_r5_usbdfu_defconfig: Fix USB DFU boot

Increase the size of malloc region allocated before relocation, as
current size is insufficient for DFU boot causing it to overflow and
corrupt the stack.

Fixed regulator configs are required by vtt_supply which is used by
"am654_ddrss" driver. Without it during DFU boot DDRSS initialization
is failing. These configs are enabled in "am65x_evm_r5_defconfig" but
are missing from "am65x_evm_r5_usbdfu_defconfig". Fix that by updating
"am65x_evm_r5_usbdfu_defconfig" to include "am65x_evm_r5_defconfig".

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
2 months agovideo: ti: am335x: Fix tilcdc clock names.
Sukrut Bellary [Wed, 12 Mar 2025 06:57:09 +0000 (23:57 -0700)]
video: ti: am335x: Fix tilcdc clock names.

The commit 211b3d726378 ("arm: dts: am3x: Non-functional changes sync
with v6.3-rc6") changed the tilcdc clock names.
Fix the tilcdc driver to use the new clock names.

Signed-off-by: Sukrut Bellary <sbellary@baylibre.com>
2 months agonet: am65-cpsw: cpsw_mdio: fix typo in error message
Richard Genoud [Tue, 11 Mar 2025 14:14:30 +0000 (15:14 +0100)]
net: am65-cpsw: cpsw_mdio: fix typo in error message

Replace "froced" by "forced"

Signed-off-by: Richard Genoud <richard.genoud@bootlin.com>
2 months agoMerge patch series "Add WDT support for J7200 SOC"
Tom Rini [Mon, 31 Mar 2025 17:06:14 +0000 (11:06 -0600)]
Merge patch series "Add WDT support for J7200 SOC"

Udit Kumar <u-kumar1@ti.com> says:

This enables the ESMs and the associated PMIC.
Programming these bits is a requirement to make the watchdog actually reset the board.

After DT sync nodes bucka1 and main_esm has bootph property added in
pmic nodes.

RFC was sent
https://lore.kernel.org/all/20241126063543.2678052-1-u-kumar1@ti.com/

With current patch boot logs
https://gist.github.com/uditkumarti/adb647f86e6d166ea2d0ac98dceb7a9b

reset: https://gist.github.com/uditkumarti/adb647f86e6d166ea2d0ac98dceb7a9b#file-gistfile1-txt-L2344

Link: https://lore.kernel.org/r/20250314110411.2781732-1-u-kumar1@ti.com
2 months agoconfigs: j7200_evm_r5: Add ESM related configs for J7200
Neha Malcom Francis [Fri, 14 Mar 2025 11:04:11 +0000 (16:34 +0530)]
configs: j7200_evm_r5: Add ESM related configs for J7200

Add CONFIG_ESM_K3 and CONFIG_ESM_PMIC to enable ESM initialization
in J7200.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Aniket Limaye <a-limaye@ti.com>
2 months agoarm: dts: k3-j7200: Add ESM PMIC support for tps659413
Gowtham Tammana [Fri, 14 Mar 2025 11:04:10 +0000 (16:34 +0530)]
arm: dts: k3-j7200: Add ESM PMIC support for tps659413

On J7200 processor board MCU_SAFETY_ERROR signal is routed to PMIC for
ESM error handling. The PMIC resets the board on receipt of the signal.
Enable the support for the board by adding ESM PMIC node.

Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
2 months agospl: return header size to spl_load in os boot
Anshul Dalal [Tue, 11 Mar 2025 09:35:45 +0000 (15:05 +0530)]
spl: return header size to spl_load in os boot

During linux build process the header size is computed including the BSS
whereas it's removed when creating the uncompressed image. Therefore the
size of the uncompressed image on filesystem will be smaller than the
size specified in the header.

This causes issues when loading the kernel image from the SPL (as in
falcon boot) with spl_load since it compares the read file size from the
FS to the header size form the image. Which leads to the following check
in `include/spl_load.h` failing to -EIO when loading kernel image:

  return read < spl_image->size ? -EIO : 0;

Therefore we should return the header size back to spl_load instead of
the file size in falcon boot when not loading a FIT image.

Bug report:
https://lore.kernel.org/u-boot/20250214111656.2358748-1-anshuld@ti.com/

Fixes: 775074165d97 ("spl: Add generic spl_load function")
Reported-by: Anshul Dalal <anshuld@ti.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 months agoconfig: falcon: move CFG_SYS_SPI_* to Kconfig
Anshul Dalal [Tue, 11 Mar 2025 04:44:12 +0000 (10:14 +0530)]
config: falcon: move CFG_SYS_SPI_* to Kconfig

CFG_SYS_SPI_* are used in falcon boot to specify the offsets and size of
the respective payloads. This patch moves them to Kconfig keeping the
values consistent for each of the affected boards.

Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Anshul Dalal <anshuld@ti.com>
2 months agoboard: ti: am62px: rm-cfg: Add support for HC BCDMA
Vishal Mahaveer [Mon, 10 Mar 2025 22:02:56 +0000 (17:02 -0500)]
board: ti: am62px: rm-cfg: Add support for HC BCDMA

The first 4 block copy channels and rings on AM62P support
High Capacity Block Copy. These channels have approximately
3x improvement over the normal Block copy channels when doing
DDR-to-DDR copy.

Currently, during allocation these channels do not have a
separate interface and are allocated with normal BCDMA channels.

Latest TIFS and DM firmware adds support for differentiating these
High Capcity resources. This update is for allocating these new
resource type to different hosts with below mentioned scheme.

---------------------     ---------------   -------------  ----------------
    Resource                   A53_2           MCU_R5          WKUP_R5
---------------------     ---------------   -------------  ----------------
BCDMA HC CHAN [4]      =>   2 (Primary)     1 (Primary)      1 (Primary)
BCDMA HC CHAN RING [4] =>   2 (Primary)     1 (Primary)      1 (Primary)
BCDMA CHAN [4]         =>   18 (Primary)    2 (Primary)      6 (Primary)
BCDMA CHAN RING[4]     =>   18 (Primary)    2 (Primary)      6 (Primary)

Signed-off-by: Sparsh Kumar <sparsh-kumar@ti.com>
Signed-off-by: Sebin Francis <sebin.francis@ti.com>
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
2 months agoconfigs: am64x_evm_a53_defconfig: Enable support for UMS
Hrushikesh Salunke [Mon, 10 Mar 2025 12:08:56 +0000 (17:38 +0530)]
configs: am64x_evm_a53_defconfig: Enable support for UMS

Enable support for USB mass storage class (UMS) via USB0 instance of
USB on AM64x SoC. UMS allows USB host to access U-Boot block device
and enable file transfer.

Example usage of UMS command :
=> mmc list
mmc@fa10000: 0 (eMMC)
mmc@fa00000: 1
=> ums 0 mmc 1
UMS: LUN 0, dev mmc 1, hwpart 0, sector 0x0, count 0x3b72400

Signed-off-by: Hrushikesh Salunke <h-salunke@ti.com>
2 months agoarm: dts: mediatek: disable fan node for mt7987
Weijie Gao [Fri, 7 Mar 2025 03:22:28 +0000 (11:22 +0800)]
arm: dts: mediatek: disable fan node for mt7987

There's no fan in MedisTek's reference design. Disable it for now.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 months agopwm: mediatek: add pwm support for MediaTek MT7987 SoC
Weijie Gao [Fri, 7 Mar 2025 03:22:23 +0000 (11:22 +0800)]
pwm: mediatek: add pwm support for MediaTek MT7987 SoC

This patch adds pwm support for MediaTek MT7987 SoC.

Signed-off-by: Sam Shih <sam.shih@mediatek.com>
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 months agoarm: mediatek: remove wmcpu-reserved@50000000 node from mt7987 dts
Weijie Gao [Fri, 7 Mar 2025 03:22:13 +0000 (11:22 +0800)]
arm: mediatek: remove wmcpu-reserved@50000000 node from mt7987 dts

The reserved-memory node 'wmcpu-reserved@50000000' only applies to
linux kernel and is useless in u-boot.
Remove it in *-u-boot.dtsi to make this memory region usable.

Fixes: 2d6962e0618 (arm: mediatek: add support for MediaTek MT7987 SoC)
Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2 months agotest: use truncate in mk_fs()
Heinrich Schuchardt [Thu, 6 Mar 2025 17:46:59 +0000 (18:46 +0100)]
test: use truncate in mk_fs()

While the dd command actually writes to the block device the truncate
command only updates the metadata (at least on ext4). This is faster and
reduces wear on the block device.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoMerge patch series "Clarify DM_FLAG_PROBE_AFTER_BIND behaviour"
Tom Rini [Sun, 30 Mar 2025 15:10:57 +0000 (09:10 -0600)]
Merge patch series "Clarify DM_FLAG_PROBE_AFTER_BIND behaviour"

Caleb Connolly <caleb.connolly@linaro.org> says:

In Simon's series reworking autoprobe, a discussion came up about
DM_FLAG_PROBE_AFTER_BIND, specifically that it wasn't very clear where
this flag should be used.

This series implements my suggestions made there to clarify the use of
this flag, and fixup the two driver which erroneously apply it to their
driver struct (this does nothing).

Link: https://lore.kernel.org/u-boot/20241120153642.861633-1-sjg@chromium.org/
Link: https://lore.kernel.org/r/20250117-clarify-probe-after-bind-v1-0-273f046ce5dd@linaro.org
2 months agodrivers: remove bogus DM_FLAG_PROBE_AFTER_BIND flags
Caleb Connolly [Fri, 17 Jan 2025 07:28:57 +0000 (08:28 +0100)]
drivers: remove bogus DM_FLAG_PROBE_AFTER_BIND flags

Some drivers set DM_FLAG_PROBE_AFTER_BIND, this does nothing since it's
only every applied on a per-device basis.

Remove the flags.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Michal Simek <michal.simek@amd.com>
2 months agodm: clarify DM_FLAG_PROBE_AFTER_BIND behaviour
Caleb Connolly [Fri, 17 Jan 2025 07:28:56 +0000 (08:28 +0100)]
dm: clarify DM_FLAG_PROBE_AFTER_BIND behaviour

The DM_FLAG_PROBE_AFTER_BIND flag only makes sense on a per-device
basis, however recently added documentation as well as some confused
drivers imply that it might be added to a driver definition, this does
nothing.

Clarify the new documentation and expand on the comment by the
definition to point people in the right direction.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Michal Simek <michal.simek@amd.com>
2 months agoMerge branch 'fixes' of https://source.denx.de/u-boot/custodians/u-boot-tegra into...
Tom Rini [Sun, 30 Mar 2025 14:09:48 +0000 (08:09 -0600)]
Merge branch 'fixes' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next

Ouya and Mocha were added around the same time SPL_HAVE_INIT_STACK was
introduced by Simon and therefore do not include this config option. It
is critical to add it before any defconfig resync, since the SPL_STACK
option will then be removed.

2 months agoconfigs: mocha: add missing SPL_HAVE_INIT_STACK option
Svyatoslav Ryhel [Sat, 29 Mar 2025 15:43:46 +0000 (17:43 +0200)]
configs: mocha: add missing SPL_HAVE_INIT_STACK option

Mocha was added and tested right before this config option was added. Add
it to restore proper booting.

Fixes: d6a53f52 ("spl: Add an SPL_HAVE_INIT_STACK option")
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoconfigs: ouya: add missing SPL_HAVE_INIT_STACK option
Svyatoslav Ryhel [Sat, 29 Mar 2025 15:25:30 +0000 (17:25 +0200)]
configs: ouya: add missing SPL_HAVE_INIT_STACK option

Ouya was added and tested right before this config option was added. Add it
to restore proper booting.

Fixes: d6a53f52 ("spl: Add an SPL_HAVE_INIT_STACK option")
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next
Tom Rini [Sat, 29 Mar 2025 16:39:06 +0000 (10:39 -0600)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

More basic DBSC5 DRAM controller clean ups and improvements.

2 months agoram: renesas: dbsc5: Pass udevice and MODEMR0 to dbsc5_get_board_data()
Marek Vasut [Tue, 25 Mar 2025 22:43:33 +0000 (23:43 +0100)]
ram: renesas: dbsc5: Pass udevice and MODEMR0 to dbsc5_get_board_data()

Pass DBSC5 udevice and MODEMR0 register values to board specific
function dbsc5_get_board_data(). The board specific implementation
of dbsc5_get_board_data() can return struct renesas_dbsc5_board_config
which matches the board based on the content of MODEMR0 or content
of DT accessible via the udevice.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoram: renesas: dbsc5: Factor out dbsc5_wait_dbwait()
Marek Vasut [Tue, 25 Mar 2025 22:43:32 +0000 (23:43 +0100)]
ram: renesas: dbsc5: Factor out dbsc5_wait_dbwait()

Extract wait for completion code from dbsc5_send_dbcmd2() into
new separate function dbsc5_wait_dbwait(). This extracted code
can be used to implement MR register read in the future.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoram: renesas: dbsc5: Improve dbsc5_send_dbcmd2() signature
Marek Vasut [Tue, 25 Mar 2025 22:43:31 +0000 (23:43 +0100)]
ram: renesas: dbsc5: Improve dbsc5_send_dbcmd2() signature

Update dbsc5_send_dbcmd2() such that it takes multiple parameters
instead of one magic register content value. These parameters are
used to form the same resulting register value internally in the
dbsc5_send_dbcmd2() function, but from well defined input constants.
The new input constants are the operation code, channel, rank, and
operation argument. The argument is operation code specific, therefore
it is still a 16-bit magic number, but the rest of the arguments are
now split up. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoram: renesas: dbsc5: Drop space before dbsc5_ddr_setval_all_ch()
Marek Vasut [Tue, 25 Mar 2025 22:43:30 +0000 (23:43 +0100)]
ram: renesas: dbsc5: Drop space before dbsc5_ddr_setval_all_ch()

Remove leading space before dbsc5_ddr_setval_all_ch() , no functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoram: renesas: dbsc5: Clarify MR27/MR28/MR57 register operations
Marek Vasut [Tue, 25 Mar 2025 22:43:29 +0000 (23:43 +0100)]
ram: renesas: dbsc5: Clarify MR27/MR28/MR57 register operations

Rename dbsc5_ddr_register_read() to dbsc5_ddr_register_mr27_mr57_read()
and dbsc5_ddr_register_set() to dbsc5_ddr_register_mr28_set() to make
it clear what those functions really do. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sunxi into...
Tom Rini [Thu, 27 Mar 2025 14:10:06 +0000 (08:10 -0600)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-sunxi into next

Assorted fixes, refactorings and additions that are ready, and shave
off some load from upcoming series'.

Improves MMC performance on D1/T113 (missed clock divider), enables
eMMC access on the H616 family (never worked, many thanks to Jernej for
the fix!), DRAM detection fixes for the H616 (now reportedly stable).

Some patches for the upcoming Allwinner A133 SoC support: a few
refactorings, plus the DM clock and pinctrl driver. The DRAM init
routines work, but need some more polishing, that also holds back the
actual enablement patch, which will hopefully follow for v2025.07 still.

Also some preparatory patches for the Allwinner A523 SoC support, for
now just to improve the FEL save/restore code. There will be more patches
coming up for this, ideally also in the coming cycle still.

Gitlab CI passed, and I booted that briefly on some boards.

2 months agosunxi: update rmr_switch.S source code
Andre Przywara [Sun, 23 Mar 2025 11:35:36 +0000 (11:35 +0000)]
sunxi: update rmr_switch.S source code

Because the Allwinner BootROM always runs in AArch32, even on ARMv8 SoCs,
we need to switch to AArch64 first, but also need to save the CPU state,
when we later may need to return to the BootROM, for continuing with the
FEL USB protocol. This is done in 32-bit code, which we include into the
AArch64 boot assembly file as a series of .word directives, containing
the encoded AArch32 instructions. To be able to change and verify that
code, we also kept an assembly file with the respective 32-bit code, but
just for reference.

As this code is never compiled or assembled - it's just for
documentation - it became stale over time: we didn't really update this
along with the changes we made to the boot code. In particular the FEL
save code was completely missing.

Update that 32-bit assembly file, to match the current version used in
boot0.h, including the FEL save routine. Also update the build
instructions in the comments, to give people an actual chance to
assemble this code.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 months agosunxi: arm64: boot0.h: move fel_stash_addr variable to the front
Andre Przywara [Sun, 23 Mar 2025 11:35:35 +0000 (11:35 +0000)]
sunxi: arm64: boot0.h: move fel_stash_addr variable to the front

To be able to return to the BootROM when booting via the FEL USB
protocol, we need to save the CPU state very early, which we need to do
in the embedded AArch32 code. At the moment the pointer to the buffer for
that state is located *after* the code, which makes the PC relative
code fragile: adding or removing instructions will change the distance
to that pointer variable.
The "new" Allwinner A523 SoC requires more state to be saved (GICv3
system registers), but we must do that *only* on that SoC. Conditional
compilation sounds like the easiest solution, but would mean that the
distance to that pointer would change.

Solve this rather easily by moving the pointer to the *front* of the
code: we load that pointer in the first instructions, so the distance
would always stay the same. Later in the code we won't need PC relative
addressing anymore, so this code can grow or shrink easily, for instance
due to conditional compilation.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 months agosunxi: armv8: fel: move fel_stash variable to the front
Andre Przywara [Sun, 23 Mar 2025 11:35:34 +0000 (11:35 +0000)]
sunxi: armv8: fel: move fel_stash variable to the front

To return a 64-bit Allwinner chip back to the 32-bit BootROM code, we
have some embedded AArch32 code that restores the CPU state, before
branching back to the BootROM. At the moment the pointer to the buffer
with that state is located *after* the code, which makes the PC relative
code fragile: adding or removing instructions will change the distance
to that pointer variable.
The "new" Allwinner A523 SoC requires more state to be restored (GICv3
system registers), but we must do that *only* on that SoC. Conditional
compilation sounds like the easiest solution, but would mean that the
distance to that pointer would change.

Solve this rather easily by moving the pointer to the *front* of the
code: we load that pointer in the first instruction, so the distance
would always stay the same. Later in the code we won't need PC relative
addressing anymore, so this code can grow or shrink easily, for instance
due to conditional compilation.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 months agosunxi: mmc: Improve reset procedure
Jernej Skrabec [Sun, 9 Mar 2025 06:12:41 +0000 (07:12 +0100)]
sunxi: mmc: Improve reset procedure

Cards should always be reset and threshold set. This fixes eMMC on H616.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
[Andre: use macro-defined offsets to fix build on older SoCs]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2 months agosunxi: H616: dram: Improve address wrapping detection
Jernej Skrabec [Sun, 9 Mar 2025 06:31:43 +0000 (07:31 +0100)]
sunxi: H616: dram: Improve address wrapping detection

It turns out that checking just one write is not enough. Due to
unexplained reasons scan procedure detected double the size. By making
16 dword writes and comparisons that never happens.

New procedure is also inverted. Instead of writing two different values
to base address and some offset and then reading both and comparing
values, simplify this by writing pattern at the base address and then
search for this pattern at some offset.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Tested-by: Ryan Walklin <ryan@testtoast.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2 months agosunxi: h616: dram: Rework size detection
Jernej Skrabec [Sun, 9 Mar 2025 06:31:42 +0000 (07:31 +0100)]
sunxi: h616: dram: Rework size detection

Since there is quite a few possible DRAM configurations in terms of bus
width, rank and rows and columns count, size detection algorithm must be
very careful not to test combination which would be bigger than H616 is
actually capable of handling.

Ideally, we should always detect memory aliasing, even for 4 GB memory
size, which is the maximum amount of memory that H616 is capable of
handling. For this reason, we have to configure minimum amount of
supported rows when testing for columns and vice versa. This way test
code will never step out of 4 GB boundary.

While at it, check for 17 rows maximum. This aligns code with BSP DRAM
driver. There is probably no such configuration which would make sense
with 4 GB memory.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Icenowy Zheng <uwu@icenowy.me>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2 months agopinctrl: sunxi: add Allwinner A100/A133 pinctrl description
Andre Przywara [Wed, 25 Oct 2023 23:38:59 +0000 (00:38 +0100)]
pinctrl: sunxi: add Allwinner A100/A133 pinctrl description

The Allwinner A100 SoC has been around for a while, and has now seemingly
been replaced with its close sibling A133.

Add the required mapping between the pinmux group strings and their
respective mux value, as far as used by U-Boot proper. Linux has some
basic (clock and pinctrl) support for a while, so we can build on the
names already used there.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 months agoclk: sunxi: Add support for the A100/A133 CCU
Andre Przywara [Wed, 25 Oct 2023 23:28:44 +0000 (00:28 +0100)]
clk: sunxi: Add support for the A100/A133 CCU

The Allwinner A100 SoC has been around for a while, and has now seemingly
been replaced with its close sibling A133.

Add support for the CCU, as far as used by U-Boot proper. Linux has some
basic (clock and pinctrl) support for a while, so we can already use the
existing binding headers.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 months agospl: reorder SPL_MAX_SIZE defaults for sunxi
Andre Przywara [Thu, 2 Jan 2025 11:06:22 +0000 (11:06 +0000)]
spl: reorder SPL_MAX_SIZE defaults for sunxi

Reorder the Kconfig defaults for the maximum SPL size, to make the
Allwinner specific values more readable and extensible: many older SoCs
need to be limited to 32KB, so make this the last ARCH_SUNXI entry, used
as a fallback unless explicitly overridden before.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 months agosunxi: Kconfig: consolidate SYS_CLK_FREQ selection
Andre Przywara [Fri, 14 Mar 2025 01:01:48 +0000 (01:01 +0000)]
sunxi: Kconfig: consolidate SYS_CLK_FREQ selection

Most Allwinner SoCs (used on 107 out of 172 boards) use a default CPU
frequency of 1008 MHz during the initial setup in the SPL.

Make this the fallback default, in case nothing else is selected, to
simplify the Kconfig stanza and make future additions easier.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 months agosunxi: pmic_bus: Move SPL I2C addresses into Kconfig
Andre Przywara [Tue, 18 Mar 2025 00:39:43 +0000 (00:39 +0000)]
sunxi: pmic_bus: Move SPL I2C addresses into Kconfig

Some of the X-Power AXP PMICs can be ordered with an alternative I2C
address, for instance an AXP717 could be shipped with address 0x34 or
with address 0x35. Similarly the AXP803 lists two possible addresses.
For DM (DT) based drivers this is no problem, but the Allwinner SPL
code relies on exactly one hardcoded address per PMIC so far.

Add a Kconfig variable that holds the I2C address used by the PMIC
accessed in the SPL, and provide the (mostly only one) supported address
as its default, for the PMICs we use. Boards using the other address
can easily set this in their defconfig.
This effectively moves the hardcoding from C code to Kconfig.

That enables to use the AXP717 on some boards with the new Allwinner
A523 chip, which use the other I2C address there.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
2 months agopower: pmic: sunxi: add SPL support for the AXP803
Andre Przywara [Sun, 20 Oct 2024 16:36:19 +0000 (17:36 +0100)]
power: pmic: sunxi: add SPL support for the AXP803

The AXP803 has been around for about a decade now, but so far we didn't
need SPL support, since the DRAM rail was wired up correctly at reset.

Now some boards using the A133 SoC use the (compatible) AXP707 with DDR4
memory, which requires the SPL to set the required 1.1V voltage manually.

Add the descriptions for the DC/DC regulators of the AXP803, and enable
that when CONFIG_AXP803_POWER is enabled.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
2 months agosunxi: sun50i_h6: clock: fix PLL_PERIPH0 rate calculation
Andre Przywara [Wed, 26 Feb 2025 11:37:12 +0000 (11:37 +0000)]
sunxi: sun50i_h6: clock: fix PLL_PERIPH0 rate calculation

On the Allwinner D1/R528/T113-s3 SoCs (NCAT2) the factors encoded in
the PLL register describe the doubled clock rate, as in the other SoCs.

Correct for that by always dividing the calculated rate by 2, except on
the H6, where we need a divisor of 4 (no change here).

This corrects the PERIPH0 clock rate as read by the MMC driver, and
actually doubles the MMC performance on those NCAT2 chips.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reported-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 months agosunxi: mmc: Fix T113-s3 MMC clock divider
Andre Przywara [Wed, 26 Feb 2025 11:37:11 +0000 (11:37 +0000)]
sunxi: mmc: Fix T113-s3 MMC clock divider

On the Allwinner D1/R528/T113-s3 SoCs the MMC clock source selected by
mux value 1 is PLL_PERIPH0(1x), not (2x), as in the other SoCs.
But we have still the hidden divisor of 2 in the MMC mod clock, so
need to explicitly compensate for that on those SoCs.

This leads to the actually programmed clock rate to be double compared
to before, which increases the MMC performance on those SoCs.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reported-by: Kuba Szczodrzyński <kuba@szczodrzynski.pl>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
2 months agosunxi: kconfig : Make CHIP_DIP_SCAN depend on ARCH_SUNXI
Liya Huang [Fri, 31 Jan 2025 01:12:43 +0000 (09:12 +0800)]
sunxi: kconfig : Make CHIP_DIP_SCAN depend on ARCH_SUNXI

The CHIP_DIP_SCAN configuration option
is relevant only to ARCH_SUNXI.
Make CHIP_DIP_SCAN dependent
on ARCH_SUNXI so that it does not show up on other goals.

Signed-off-by: Liya Huang <1425075683@qq.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
2 months agoMerge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into...
Tom Rini [Wed, 26 Mar 2025 20:07:37 +0000 (14:07 -0600)]
Merge branch 'staging' of https://source.denx.de/u-boot/custodians/u-boot-tegra into next

- More Tegra video improvements

2 months agoMerge tag 'efi-next-26032025' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Wed, 26 Mar 2025 20:07:09 +0000 (14:07 -0600)]
Merge tag 'efi-next-26032025' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next

When trying to boot an OS installer or a live image via EFI HTTP the
following happens
- U-Boot downloads the image and mounts it in memory
- The EFI subsystem is invoked and the image is started
- The OS calls ExitBootServices and the memory that holds the mounted
  image might get overwritten

This results in installers complaining that they can't find installer
medium or live images complaining they can't find the root filesystem.

ACPI already deals with it by having NFIT and NVDIMM to provide ramdisks
that need to be preserved by the OS. Linux and device trees have support
for persistent memory devices (pmem).

We can use them and inject a pmem node in the DT to preserve memory across the
entire boot sequence. Linux will just create a block device over the reserved
memory and installers/images can re-discover it.

This is what it looks like from the OS perspective:

nd_pmem namespace0.0: unable to guarantee persistence of writes
pmem0: p1 p2 p3
EXT4-fs (pmem0p3): mounted filesystem f40f64a4-5b41-4828-856e-caaae2c1c2a0 r/w with ordered data mode. Quota mode: disabled.
EXT4-fs (pmem0p3): re-mounted f40f64a4-5b41-4828-856e-caaae2c1c2a0 r/w. Quota mode: disabled.
Adding 45052k swap on /dev/pmem0p2.  Priority:-2 extents:1 across:45052k SS
root@genericarm64:~# mount | grep pmem
/dev/pmem0p3 on / type ext4 (rw,relatime)
/dev/pmem0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)

It's worth noting that Linux behaves differently with reserved memory
(at least on arm64) and that depends on kernel config options.
CONFIG_ZONE_DEVICES and CONFIG_ARM64_PMEM are such options. It boils down to
how the kernel tries to map pages. If devm_memremap_pages() gets called instead
of devm_memremap() mapping the memory fails.

The only safe way is to remove the memory from the EFI memory map,
rather than defining it as /reserved no-map;/ in the DT.

2 months agotest: lmb: fix the lmb_alloc_addr() based test cases
Sughosh Ganu [Wed, 26 Mar 2025 16:53:36 +0000 (22:23 +0530)]
test: lmb: fix the lmb_alloc_addr() based test cases

Commit 56f186a68b3 ("lmb: check if a region can be reserved by
lmb_reserve()") fixed the lmb_reserve() and lmb_alloc_addr() API's for
some corner case scenarios, and also added corresonding test cases for
these corner cases. These tests were checking, among other things, the
lmb_alloc_addr() API. The above commit was applied to the next branch.

Subsequently, there was commit 67be24906fe
("lmb: change the return code on lmb_alloc_addr()") which was first
applied on the master branch, and subsequently got merged to next as
part of the rebase. The second commit changes the return value of the
lmb_alloc_addr() API, which now results in some of the tests added as
part of the first commit to fail. Fix those test cases.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 months agoblkmap: pass information on ISO image to the OS
Sughosh Ganu [Mon, 17 Mar 2025 08:34:02 +0000 (14:04 +0530)]
blkmap: pass information on ISO image to the OS

The EFI HTTP boot puts the ISO installer image at some location in
memory. Information about this image has to be passed on to the OS
kernel, which is done by adding a persistent memory(pmem) node to the
devicetree(DT) that is passed to the OS. The OS kernel then gets
information about the presence of this ISO image and proceeds with the
installation.

In U-Boot, this ISO image gets mounted as a memory mapped blkmap
device slice, with the 'preserve' attribute. Add a helper function
which iterates through all such slices, and invokes a callback. The
callback adds the pmem node to the DT and removes the corresponding
memory region from the EFI memory map. Invoke this helper function as
part of the DT fixup which happens before booting the OS.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoblkmap: add an attribute to preserve the mem mapping
Sughosh Ganu [Mon, 17 Mar 2025 08:34:01 +0000 (14:04 +0530)]
blkmap: add an attribute to preserve the mem mapping

Some blkmap memory mapped devices might have to be relevant even
after U-Boot passes control to the next image as part of the platform
boot. An example of such a mapping would be an OS installer ISO image,
information for which has to be provided to the OS kernel. Use the
'preserve' attribute for such mappings. The code for adding a pmem
node to the device-tree then checks if this attribute is set, and adds
a node only for mappings which have this attribute.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoblkmap: store type of blkmap slice in corresponding structure
Sughosh Ganu [Mon, 17 Mar 2025 08:34:00 +0000 (14:04 +0530)]
blkmap: store type of blkmap slice in corresponding structure

Add information about the type of blkmap slices as an attribute in the
corresponding slice structure. Put information in the blkmap slice
structure to identify if it is associated with a memory or linear
mapped device. Which can then be used to take specific action based on
the type of the blkmap slice.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoefi_loader: remove memory occupied by a ramdisk from EFI memory map
Ilias Apalodimas [Mon, 17 Mar 2025 08:33:59 +0000 (14:03 +0530)]
efi_loader: remove memory occupied by a ramdisk from EFI memory map

ACPI has NFIT and NVDIMM support to provide ramdisks to the OS. Linux
and device trees have support for persistent memory(pmem) devices. The
firmware can then add a pmem node for the region of memory occupied by
the ramdisk when passing the device-tree to the OS.

It's worth noting that for linux to instantiate the /dev/pmemX device,
the memory described in the pmem node has to be omitted from the EFI
memory map we hand over to the OS if ZONE_DEVICES and SPARSEMEM is
enabled. With those enabled the pmem driver ends up calling
devm_memremap_pages() instead of devm_memremap(). The latter works
whether the memory is omitted or marked as reserved, but mapping pages
only works if the memory is omitted.

On top of that, depending on how the kernel is configured, that memory
area must be page aligned or 2MiB aligned. PowerPC is an exception here
and requires 16MiB alignment, but since we don't have EFI support for
it, limit the alignment to 2MiB.

Ensure that the ISO image is 2MiB aligned and remove the region
occupied by the image from the EFI memory map.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoefi_loader: allow for removal of memory from the EFI map
Ilias Apalodimas [Mon, 17 Mar 2025 08:33:58 +0000 (14:03 +0530)]
efi_loader: allow for removal of memory from the EFI map

With upcoming changes supporting pmem nodes, we need to remove the
pmem area from the EFI memory map. Rename efi_add_memory_map_pg() to
efi_update_memory_map(), and allow removing memory from the EFI memory
map.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agofdt: add support for adding pmem nodes
Masahisa Kojima [Mon, 17 Mar 2025 08:33:57 +0000 (14:03 +0530)]
fdt: add support for adding pmem nodes

One of the problems an OS may face, when running in EFI, is that
a mounted ISO, after calling ExitBootServices goes away, if that ISO
is resident in RAM memory as a ramdisk.

ACPI has NFIT and NVDIMM support to provide ramdisks to the OS, but we
don't have anything in place for DTs. Linux and device trees have support
for persistent memory devices. So add a function that can inject a pmem
node in a DT, so we can pass information on the ramdisk the OS.

Signed-off-by: Masahisa Kojima <kojima.masahisa@socionext.com>
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoefi_loader: install device-tree on configuration table on every invocation
Sughosh Ganu [Mon, 17 Mar 2025 08:33:56 +0000 (14:03 +0530)]
efi_loader: install device-tree on configuration table on every invocation

The efi_install_fdt() function is called before booting an EFI binary,
either directly, or through a bootmanager. This function installs a
copy of the device-tree(DT) on the EFI configuration table, which is
passed on to the OS.

The current logic in this function does not install a DT if a
device-tree is already installed as an EFI configuration
table. However, this existing copy of the DT might not be up-to-date,
or it could be a wrong DT for the image that is being booted. Always
install a DT afresh to the configuration table before booting the EFI
binary.

Installing a new DT also involves some additional checks that are
needed to clean up memory associated with the existing DT copy. Check
for an existing copy, and free up that memory.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoefi_loader: remove unused code from copy_fdt()
Sughosh Ganu [Mon, 17 Mar 2025 08:33:55 +0000 (14:03 +0530)]
efi_loader: remove unused code from copy_fdt()

There is logic in the copy_fdt() function which is iterating over the
platform's DRAM banks and setting the fdt_ram_start variable. However,
this variable is not used subsequently in the function. Remove this
superfluous code.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2 months agoMerge tag 'u-boot-imx-next-20250325' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Tue, 25 Mar 2025 14:57:38 +0000 (08:57 -0600)]
Merge tag 'u-boot-imx-next-20250325' 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/25324

- Imply the i.MX thermal driver by default on imx8, imx9, imx8m.
- Add clk_resolve_parent_clk() and fix up iMX clock drivers.

2 months agoMerge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into...
Tom Rini [Tue, 25 Mar 2025 14:57:00 +0000 (08:57 -0600)]
Merge branch 'next' of https://source.denx.de/u-boot/custodians/u-boot-riscv into next

CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/25323

- board: k1: Add reset driver
- board: starfive: Simplify binman config
- Some modifications on DTS and configs

2 months agoimx: imx9: Imply CPU_IMX by default
Adam Ford [Tue, 25 Mar 2025 02:54:48 +0000 (21:54 -0500)]
imx: imx9: Imply CPU_IMX by default

The imx8_cpu driver is a CPU Driver that supports the i.MX9
family to display the CPU type, temperature grade and
current operating temperature.  The older file,
arch/arm/mach-imx/cpu.c, does not support i.MX9, so this config
is enabled in various IMX9 boards.  Instead of having this option
enabled in every IMX9, select this driver by default for the
platform.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoimx: imx8: Imply CPU_IMX by default
Adam Ford [Tue, 25 Mar 2025 02:54:47 +0000 (21:54 -0500)]
imx: imx8: Imply CPU_IMX by default

The imx8_cpu driver is a CPU Driver that supports the i.MX8Q
family. When it is enabled, it acts as an alternative to
arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver
model where cpu.c does not.  Imply this newer driver by default.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoimx: imx8m: Imply CPU_IMX by default
Adam Ford [Tue, 25 Mar 2025 02:54:46 +0000 (21:54 -0500)]
imx: imx8m: Imply CPU_IMX by default

The imx8_cpu driver is a CPU Driver that supports the i.MX8M
family, and when it is enabled, it acts as an alternative to
arch/arm/mach-imx/cpu.c, but the imx8_cpu supports the driver
model where cpu.c does not.  Imply this newer driver by default.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agocpu: imx8_cpu: Print Speed grade if IMX_TMU
Adam Ford [Tue, 25 Mar 2025 02:54:45 +0000 (21:54 -0500)]
cpu: imx8_cpu: Print Speed grade if IMX_TMU

Much of the data that is display by imx8_cpu.c is also displayed from
arch/arm/mach-imx/cpu.c, except the temperature grade and active
temperature are only displayed when SoC is an i.MX9. Since IMX9 now
implies IMX_TMU, change this to check for IMX_TMU in the same way
it's done in mach-imx/cpu.c to enable displaying this information
for any SoC with either of this config enabled.
Since additional text may appear due to this commit, remove
the extra space in the message displaying the temperature
grade.

Before:
CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
Model: Beacon EmbeddedWorks i.MX8MPlus Development kit

After:
CPU:   NXP i.MX8MP Rev1.1 A53 at 1200 MHz
CPU:   Industrial temperature grade (-40C to 105C) at 28C
Model: Beacon EmbeddedWorks i.MX8MPlus Development kit

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoimx: imx8m: Imply IMX_TMU
Adam Ford [Tue, 25 Mar 2025 02:54:44 +0000 (21:54 -0500)]
imx: imx8m: Imply IMX_TMU

If the CPU Information is displayed from imx8_cpu, it displays the
cpu temperature grade and operating temperature if CONFIG_IMX9 is
defined. This behavior is similar to what happens mach-imx/cpu.c,
except that the latter checks for IMX_THERMAL or IMX_TMU.

In preparation to make imx8_cpu act like the previous implementation
for any CPU, make IMX8M imply IMX_TMU so it will be always displayed
unless a user decides to disable it.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agocpu: imx8_cpu: Expand get_imx_type_str list of supported CPUs
Adam Ford [Tue, 25 Mar 2025 02:54:43 +0000 (21:54 -0500)]
cpu: imx8_cpu: Expand get_imx_type_str list of supported CPUs

The imx8_cpu is capable of running on IMX8, IMX8M, and IMX9
families, but the CPU list is limited on the 8M variants.  Expand
this list to show more variants and their respective names.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoimx: imx9: Imply IMX_TMU
Adam Ford [Tue, 25 Mar 2025 02:54:42 +0000 (21:54 -0500)]
imx: imx9: Imply IMX_TMU

If the CPU Information is displayed from imx8_cpu, it displays
the cpu temperature grade and operating temperature if
CONFIG_IMX9 is defined. This behavior is similar to what
happens arch/arm/mach-imx/cpu.c except that the latter
checks for CONFIG_IMX_THERMAL or CONFIG_IMX_TMU.
In preparation to make imx8_cpu act like the previous
implementation for any CPU, make IMX9 imply IMX_TMU, so
it will be always displayed unless a user decides to
disable it.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2 months agoboard: beacon: imx8mp: Fix GIC clock for Overdrive mode
Adam Ford [Mon, 24 Mar 2025 23:27:25 +0000 (18:27 -0500)]
board: beacon: imx8mp: Fix GIC clock for Overdrive mode

There is a config option to run the PMIC at nominal voltages
which is not enabled on the i.MX8MP Beacon kit, so it the PMIC
runs at overdrive voltages.   Unfortuately, the check for this
condition to set the GIC clock parent and rate is backwards from
what it should be, and accidentally sets the GIC clock to nominal
if the PMIC is in overdrive, and sets the GIC clock to overdrive
if the PMIC is in nominal.  Fix this by inverting the logic on the
check.

Fixes: ab53bd43dbde ("arm64: imx: Add support for imx8mp-beacon-kit")
Signed-off-by: Adam Ford <aford173@gmail.com>
2 months agoAdd reset config options for k1
Huan Zhou [Tue, 11 Mar 2025 01:38:51 +0000 (09:38 +0800)]
Add reset config options for k1

Add RESET_SPACEMIT_K1 option in config.

Signed-off-by: Huan Zhou <me@per1cycle.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: k1: add reset controller node in device tree
Huan Zhou [Tue, 11 Mar 2025 01:38:50 +0000 (09:38 +0800)]
riscv: dts: k1: add reset controller node in device tree

Add reset-controller in k1 device tree.

Signed-off-by: Huan Zhou <me@per1cycle.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: reset: k1: Add reset driver
Huan Zhou [Tue, 11 Mar 2025 01:38:49 +0000 (09:38 +0800)]
riscv: reset: k1: Add reset driver

Add spacemit reset driver.

Signed-off-by: Huan Zhou <me@per1cycle.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dt-binding: k1: Add reset driver binding definition
Huan Zhou [Tue, 11 Mar 2025 01:38:48 +0000 (09:38 +0800)]
riscv: dt-binding: k1: Add reset driver binding definition

Add dt-binding for reset driver.

Signed-off-by: Huan Zhou <me@per1cycle.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: starfive: remove duplicate itb entries
Heinrich Schuchardt [Fri, 21 Feb 2025 09:58:56 +0000 (10:58 +0100)]
riscv: dts: starfive: remove duplicate itb entries

As binman already creates nodes based on CONFIG_OF_LIST we don't need to
add extra nodes.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org> # StarFIve VisionFive 2
Reviewed-by: E Shattow <e@freeshell.de>
2 months agoboard: starfive: spl: strip off 'starfive/' prefix
Heinrich Schuchardt [Fri, 21 Feb 2025 09:58:55 +0000 (10:58 +0100)]
board: starfive: spl: strip off 'starfive/' prefix

The configuration descriptions generated by binman contain the vendor
device-tree directory. Instead of adding it to all match strings just strip
it off.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: no default configuration for MULTI_DTB_FIT
Heinrich Schuchardt [Fri, 21 Feb 2025 09:58:54 +0000 (10:58 +0100)]
riscv: dts: no default configuration for MULTI_DTB_FIT

JH7110 boards are currently the only use case for multi DTB FIT images
on RISC-V.

Booting JH7110 systems with a VisionFive 2 device-tree used to kind of
work without causing harm to the hardware. But there is no guarantee
that this will hold true in future. So we should not rely on it.

Before the current patch series booting failed on unsupported boards due
to the lack of a device-tree in the binman generated default configuration
when reaching main U-Boot.

By not setting a default configuration booting will now fail on
unsupported boards already in SPL. This allows SPL to
continue with the next boot source for a possible recovery.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: E Shattow <e@freeshell.de>
2 months agoriscv: dts: add OF_LIST handling to binman.dtsi
Heinrich Schuchardt [Fri, 21 Feb 2025 09:58:53 +0000 (10:58 +0100)]
riscv: dts: add OF_LIST handling to binman.dtsi

Binman can automatically generate device-tree and configuration entries in
the FIT image based on CONFIG_MULTI_DTB_FIT if the binman node includes the
right sub-nodes.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: E Shattow <e@freeshell.de>
2 months agoRISCV: config: Remove CFG_SYS_SDRAM_BASE
Jimmy Ho [Mon, 10 Mar 2025 01:47:48 +0000 (09:47 +0800)]
RISCV: config: Remove CFG_SYS_SDRAM_BASE

Remove CFG_SYS_SDRAM_BASE so that we can get DRAM base
from dt instead of compile time config.
Removing this config helps the u-boot more portable.

Signed-off-by: Jimmy Ho <jimmy.ho@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: cv18xx: Drop unused dummy clocks
Yao Zi [Fri, 7 Mar 2025 17:09:22 +0000 (17:09 +0000)]
riscv: dts: cv18xx: Drop unused dummy clocks

Introduced in commit 5a4e0625ac77 ("riscv: dts: sophgo: Add ethernet
node"), eth_{csrclk,ptpclk} were used as placeholders for ethernet
controller. As the real clock controller has been added, drop them to
clean the devicetree up.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: qemu: imply CONFIG_RNG_RISCV_ZKR
Heinrich Schuchardt [Sun, 2 Mar 2025 08:50:17 +0000 (09:50 +0100)]
riscv: qemu: imply CONFIG_RNG_RISCV_ZKR

The zkr ISA extension can be used to generate random numbers. Since RVA22
zkr is an optional ISA extension. It can be emulated by QEMU. Our RNG
driver detects if the extension is usable during driver binding. Let's
enable it by default on QEMU.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoriscv: dts: spacemit: Update UART compatible for k1
Junhui Liu [Sun, 23 Feb 2025 06:19:26 +0000 (14:19 +0800)]
riscv: dts: spacemit: Update UART compatible for k1

Update UART compatible in k1 dts to "intel,xscale-uart", introduced in
commit 2d84e1519c5b ("serial: ns16550: Add Intel XScale support")
recently, aligning dts with the upstream kernel.

Tested-by: Huan Zhou <me@per1cycle.org>
Signed-off-by: Junhui Liu <junhui.liu@pigmoral.tech>
Reviewed-by: Yixun Lan <dlan@gentoo.org>
2 months agoconfigs: SiFive Unmatched: add 'nvme scan' to preboot
Heinrich Schuchardt [Tue, 12 Nov 2024 10:26:44 +0000 (11:26 +0100)]
configs: SiFive Unmatched: add 'nvme scan' to preboot

Without 'nvme scan' the ESP on the NVMe drive is not found early.
EFI variables cannot be persisted.

    Hit any key to stop autoboot:  0
    Cannot persist EFI variables without system partition
    ** Booting bootflow '<NULL>' with efi_mgr
    Loading Boot0000 'mmc 0' failed
    EFI boot manager: Cannot load any image
    Boot failed (err=-14)
    scanning bus for devices...
    ** Booting bootflow 'nvme#1.blk#1.bootdev.part_1' with efi
    Booting /\EFI\BOOT\BOOTRISCV64.EFI
    error: no suitable video mode found.
    GNU GRUB  version 2.12

With 'nmve scan' booting works as expected.

    Hit any key to stop autoboot:  0
    ** Booting bootflow '<NULL>' with efi_mgr
    Loading Boot0000 'mmc 0' failed
    Loading Boot0001 'nvme 0' failed
    Booting: nvme 1
    error: no suitable video mode found.
    GNU GRUB  version 2.12

Reported by Yuri Zaporozhets <yuriz@vodafonemail.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2 months agoMerge tag 'v2025.04-rc5' into next
Tom Rini [Tue, 25 Mar 2025 02:10:55 +0000 (20:10 -0600)]
Merge tag 'v2025.04-rc5' into next

Prepare v2025.04-rc5

2 months agoPrepare v2025.05-rc5 v2025.04-rc5
Tom Rini [Tue, 25 Mar 2025 02:00:24 +0000 (20:00 -0600)]
Prepare v2025.05-rc5

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoMerge tag 'qcom-next-20250324' of https://gitlab.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 24 Mar 2025 18:38:48 +0000 (12:38 -0600)]
Merge tag 'qcom-next-20250324' of https://gitlab.denx.de/u-boot/custodians/u-boot-snapdragon into next

qcom-next-20230324:

* msm8916 gets proper sysreset and spin-table support
* The first new IPQ platform is added - the IPQ9574. The IPQ series are
  used in routers. The flashing process is also documented
* mach-snapdragon gains the ability to boot with an internal FDT and
  still parse memory from an externally provided one
* SC7280 gets a pinctrl driver and various clock driver improvements.
* Qualcom clock drivers will now actually return an error when
  attempting
  to enable a clock which isn't described.
* Qualcomm pinctrl drivers will now return an error when attempting to
  configure an invalid function mux

2 months agolmb: change the return code on lmb_alloc_addr()
Ilias Apalodimas [Fri, 14 Mar 2025 10:57:02 +0000 (12:57 +0200)]
lmb: change the return code on lmb_alloc_addr()

Ben reports a failure to boot the kernel on hardware that starts its
physical memory from 0x0.
The reason is that lmb_alloc_addr(), which is supposed to reserve a
specific address, takes the address as the first argument, but then also
returns the address for success or failure and treats 0 as a failure.

Since we already know the address change the prototype to return an int.

Reported-by: Ben Schneider <ben@bens.haus>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ben Schneider <ben@bens.haus>
Reviewed-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 months agoarm64: imx8mp: Gracefully handle disabled ENV_IS_IN_SPI_FLASH
Marek Vasut [Wed, 19 Mar 2025 03:28:27 +0000 (04:28 +0100)]
arm64: imx8mp: Gracefully handle disabled ENV_IS_IN_SPI_FLASH

In case ENV_IS_IN_SPI_FLASH is disabled, returning ENVL_SPI_FLASH
leads to failure to find environment driver on start up. Fix this
by testing whether ENV_IS_IN_SPI_FLASH is enabled and if not, then
return ENVL_NOWHERE instead.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: imx: Pass struct udevice into imx_clk_fixed_factor*()
Marek Vasut [Sun, 23 Mar 2025 15:58:53 +0000 (16:58 +0100)]
clk: imx: Pass struct udevice into imx_clk_fixed_factor*()

Pass struct udevice * into imx_clk_fixed_factor*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: clk-fixed-factor: Resolve parent clock by name
Marek Vasut [Sun, 23 Mar 2025 15:58:52 +0000 (16:58 +0100)]
clk: clk-fixed-factor: Resolve parent clock by name

Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: clk-fixed-factor: Use struct udevice instead of struct device
Marek Vasut [Sun, 23 Mar 2025 15:58:51 +0000 (16:58 +0100)]
clk: clk-fixed-factor: Use struct udevice instead of struct device

Use U-Boot specific struct udevice instead of Linux compatibility
struct device in clk-fixed-factor registration.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: clk-divider: Resolve parent clock by name
Marek Vasut [Sun, 23 Mar 2025 15:58:50 +0000 (16:58 +0100)]
clk: clk-divider: Resolve parent clock by name

Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: imx: Pass struct udevice into imx_clk_divider*()
Marek Vasut [Sun, 23 Mar 2025 15:58:49 +0000 (16:58 +0100)]
clk: imx: Pass struct udevice into imx_clk_divider*()

Pass struct udevice * into imx_clk_divider*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: clk-divider: Use struct udevice instead of struct device
Marek Vasut [Sun, 23 Mar 2025 15:58:48 +0000 (16:58 +0100)]
clk: clk-divider: Use struct udevice instead of struct device

Use U-Boot specific struct udevice instead of Linux compatibility
struct device in clk-divider clock registration.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: imx: pllv3: Resolve parent clock by name
Marek Vasut [Sun, 23 Mar 2025 15:58:47 +0000 (16:58 +0100)]
clk: imx: pllv3: Resolve parent clock by name

Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: imx: Pass struct udevice into imx_clk_pllv3*()
Marek Vasut [Sun, 23 Mar 2025 15:58:46 +0000 (16:58 +0100)]
clk: imx: Pass struct udevice into imx_clk_pllv3*()

Pass struct udevice * into imx_clk_pllv3*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: imx: Convert clock-osc-* back to osc_*
Marek Vasut [Sun, 23 Mar 2025 15:58:45 +0000 (16:58 +0100)]
clk: imx: Convert clock-osc-* back to osc_*

Convert clock-osc-24m back to osc_24m and clock-osc-32k back to osc_32k.
These are the clock which match clock tables in Linux. This is now
possible because the clock drivers now resolve clock names based on
clock-names DT property in the CCM DT node.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: imx: Pass struct udevice into imx_clk_composite*()
Marek Vasut [Sun, 23 Mar 2025 15:58:44 +0000 (16:58 +0100)]
clk: imx: Pass struct udevice into imx_clk_composite*()

Pass struct udevice * into imx_clk_composite*() functions, so the
clock core would have access to parent struct udevice *.

Signed-off-by: Marek Vasut <marex@denx.de>
2 months agoclk: clk-composite: Resolve parent clock by name
Marek Vasut [Sun, 23 Mar 2025 15:58:43 +0000 (16:58 +0100)]
clk: clk-composite: Resolve parent clock by name

Use clock-names property which is accessible via parent clock OF node
to look up the parent clock by name instead of depending on unreliable
global clock name to perform look up.

Signed-off-by: Marek Vasut <marex@denx.de>