pandora-u-boot.git
6 weeks agonet: ti: am65-cpsw-nuss: invoke phy_config() in driver's .start callback
Siddharth Vadapalli [Wed, 16 Apr 2025 12:56:43 +0000 (18:26 +0530)]
net: ti: am65-cpsw-nuss: invoke phy_config() in driver's .start callback

Currently, the phy_config() API is invoked by the driver only once since it
has been probed. While this works in general, it doesn't allow the driver
to bring the PHY back to its default reset state. As a result, the driver
might not be able to recover the PHY from a bad state. To address this,
move phy_config() into the driver's start callback (am65_cpsw_start()).

Apart from providing the means to recover the PHY in the event of failure,
the implementation is in line with the idea of "reset and configure" that
is already followed by am65_cpsw_start() when it comes to programming the
CPSW MAC.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
6 weeks agoMerge patch series "Apple RTKit improvements"
Tom Rini [Mon, 28 Apr 2025 19:17:20 +0000 (13:17 -0600)]
Merge patch series "Apple RTKit improvements"

Mark Kettenis <kettenis@openbsd.org> says:

This is a collection of improvements for the Apple RTKit code
that we have been carrying downstream for some time now.

Link: https://lore.kernel.org/r/20250420115808.94272-1-kettenis@openbsd.org
6 weeks agoarm: apple: rtkit: Support allocating OSLog out of SRAM in helper
Hector Martin [Sun, 20 Apr 2025 11:58:08 +0000 (13:58 +0200)]
arm: apple: rtkit: Support allocating OSLog out of SRAM in helper

The new OSLog region in MTP (firmware 13.3+) persists on handoff to
Linux. To avoid having to come up with some weird DART handoff or DAPF
tricks, let's just steal some of the coprocessor's dedicated SRAM. This
keeps it happy and Linux doesn't need any special handoff then.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
6 weeks agoarm: apple: rtkit: Add endpoint field to buffers
Hector Martin [Sun, 20 Apr 2025 11:58:07 +0000 (13:58 +0200)]
arm: apple: rtkit: Add endpoint field to buffers

To be used for special-case oslog support in rtkit-helper.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
6 weeks agoarm: apple: rtkit: Add OSLog buffer support
Hector Martin [Sun, 20 Apr 2025 11:58:06 +0000 (13:58 +0200)]
arm: apple: rtkit: Add OSLog buffer support

This will work for u-boot itself, but needs a special workaround in the
MTP driver for Linux handoff to work.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
6 weeks agoarm: apple: rtkit: Add a generic RTKit helper driver
Hector Martin [Sun, 20 Apr 2025 11:58:05 +0000 (13:58 +0200)]
arm: apple: rtkit: Add a generic RTKit helper driver

This driver handles the MTP ASC coprocessor, which does not need any
special handling on the RTKit side and communicates out-of-band.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
6 weeks agoarm: apple: rtkit: Add default buffer handlers
Hector Martin [Sun, 20 Apr 2025 11:58:04 +0000 (13:58 +0200)]
arm: apple: rtkit: Add default buffer handlers

For devices without specific buffer methods, just assume we can give
them raw memory pointers when they request a buffer.

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
6 weeks agoarm: apple: rtkit: Add support for AP power & syslogs
Hector Martin [Sun, 20 Apr 2025 11:58:03 +0000 (13:58 +0200)]
arm: apple: rtkit: Add support for AP power & syslogs

This is required for MTP to work properly

Signed-off-by: Hector Martin <marcan@marcan.st>
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
6 weeks agoMerge tag 'u-boot-imx-master-20250428' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Mon, 28 Apr 2025 16:19:29 +0000 (10:19 -0600)]
Merge tag 'u-boot-imx-master-20250428' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

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

- Fix power-domain ref counting regression.
- Fix i.MX8MP USB clock regression.
- Fix i.MX8MM osc_32k regression in SPL.
- Finish converting clock-osc-24 back to osc_24 on i.MX.
- Several imx8mp capricorn updates.
- Update Stefano Babic's email address.
- Fix fsl_qspi bug by moving AHB read buffer config after LUT.
- Fix verdin imx95 sku 0089 pid4.

6 weeks agoMerge patch series "bloblist: fix the overriding of fdt from bloblist"
Tom Rini [Mon, 28 Apr 2025 16:13:42 +0000 (10:13 -0600)]
Merge patch series "bloblist: fix the overriding of fdt from bloblist"

This series from Raymond Mao <raymond.mao@linaro.org> fixes some cases
of passing the device tree to U-Boot via standard passage and then
ensures that we set the environment variable of the device tree
correctly in this case.

Link: https://lore.kernel.org/r/20250331224011.2734284-1-raymond.mao@linaro.org
6 weeks agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi
Tom Rini [Mon, 28 Apr 2025 15:34:32 +0000 (09:34 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-sunxi

We have improvements to the reliability of H6 and H616 DRAM
initialisation, hopefully avoiding those occasional size misdetections
many people reported before.
Also there is some modernisation of the USB PHY code, to use DT provided
regulators and GPIOs, instead of relying on this being badly duplicated
in Kconfig. This also happens to fix broken USB operations for older
boards (using the A20 SoCs, for instance), which were clashing over
grabbing some GPIOs, leading to a driver bailout.  There is also some
rework of the H6/H616 SPL clock code, to prepare it for being reused by
the upcoming Allwinner A523 support. This drops the usage of C structs
to model MMIO register frames, and replaces them by using an addition of
the base address with a macro defined offset.  Also in preparation for
A523 there is one fix and one addition for the FEL code, to prepare for
the GICv3 interrupt controller that the new SoC uses. And since this is
a simple fix, and was ready, there is also the watchdog driver for that
new SoC. Finally tossing in an easy fix to some H616 defconfig files to
enable eMMC.

I also use the opportunity to enable proper page table protection
(observing read-only and no-execute attributes), support for which the
arm64 port recently gained. I didn't spot any issues on my arm64 board
tests, but it can be easily disabled or backed out again in case any
issues arise.

Full support for the two new SoC series (A133 and A523) we are working
on is not quite ready yet, but might follow still a bit later if
progress permits.

CI passed, and boot-tested on at least one board with a H616, H6, A64,
H3, A20, T113s.

6 weeks agosunxi: clock: H6: remove struct sunxi_prcm_reg
Andre Przywara [Sun, 26 Jan 2025 00:04:41 +0000 (00:04 +0000)]
sunxi: clock: H6: remove struct sunxi_prcm_reg

With the SPL clock code and the DRAM init routine we converted all users
of the H6 class "struct sunxi_prcm_reg" over to use #define'd register
offsets now.

Drop the whole definition of this struct now, since it's not needed
anymore, for all H6 and H616 boards.
This removes the entire fragile and questionable definition, and allows
new SoCs to share the code more easily.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: H6/H616: dram: remove usage of struct sunxi_prcm_reg
Andre Przywara [Sat, 25 Jan 2025 23:49:27 +0000 (23:49 +0000)]
sunxi: H6/H616: dram: remove usage of struct sunxi_prcm_reg

The Allwinner H6 and H616 DRAM initialisation code uses a complex C
struct, modelling the PRCM clock register frame. For those SoCs, this
struct contains 20 registers, but the DRAM code only uses two of them.

Since we want to get rid of this struct, drop the usage of the struct in
the H6 and H616 DRAM code, by using #define'd register names and their
offset, and then adding those names to the base pointer.

This removes one more user of the PRCM clock register struct.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: clock: H6: drop usage of struct sunxi_prcm_reg
Andre Przywara [Fri, 24 Jan 2025 22:49:40 +0000 (22:49 +0000)]
sunxi: clock: H6: drop usage of struct sunxi_prcm_reg

U-Boot drivers often revert to using C structures for modelling hardware
register frames. This creates some problems:
- A "struct" is a C language construct to group several variables
  together. The details of the layout of this struct are partly subject
  to the compiler's discretion (padding and alignment).
- The "packed" attribute would force a certain layout, but we are not
  using it.
- The actual source of information from the data sheet is the register
  offset. Here we create an artificial struct, carefully tuning the
  layout (with a lot of reserved members) to match that offset. To help
  with correctness, we put the desired information as a *comment*,
  though this is purely for the human reader, and has no effect on the
  generated layout. This sounds all very backwards.
- Using a struct suggests we can assign a pointer and then access the
  register content via the members. But this is not the case, instead
  every MMIO register access must go through specific accessor functions,
  to meet the ordering and access size guarantees the hardware requires.
- We share those structs in code shared across multiple SoC families,
  though most SoCs define their own version of the struct. Members must
  match in their name, across every SoC, otherwise compilation will fail.
  We work around this with even more #ifdefs in the shared code.
- Some SoCs have an *almost* identical layout, but differ in a few
  registers. This requires hard to maintain #ifdef's in the struct
  definition.
- Some of the register frames are huge: the H6 CCU device defines 127
  registers. We use 15 of them. Still the whole frame would need to be
  described, which is very tedious, but for no reason.
- Adding a new SoC often forces people to decide whether to share an
  existing struct, or to create a new copy. For some cases (say like 80%
  similarity) this works out badly either way.

The Linux kernel heavily frowns upon those register structs, and instead
uses a much simpler solution: #define REG_NAME  <offset>
This easily maps to the actual information from the data sheet, and can
much simpler be shared across multiple SoCs, as it allows to have all
SoC versions visible, so we can use C "if" statements instead of #ifdef's.
Also it requires to just define the registers we need, and we can use
alternative locations for some registers much more easily.

Drop the usage of "struct sunxi_prcm_reg" in the H6 SPL clock code, by
defining the respective register names and their offsets, then adding
them to the base pointer.
We cannot drop the struct definition quite yet, as it's also used in
other drivers, still.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: clock: H6: remove struct sunxi_ccm_reg
Andre Przywara [Fri, 24 Jan 2025 23:43:52 +0000 (23:43 +0000)]
sunxi: clock: H6: remove struct sunxi_ccm_reg

With the SPL clock code, the MMC driver, and the DRAM init routine we
converted all users of the H6 class "struct sunxi_ccm_reg" over to use
 #define'd register offsets now.

Drop the whole definition of this struct now, since it's not needed
anymore, for all H6 and H616 boards.
This removes the entire fragile and questionable definition, and allows
new SoCs to share the code more easily.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: H6: dram: remove usage of struct sunxi_ccm_reg
Andre Przywara [Sat, 25 Jan 2025 17:56:14 +0000 (17:56 +0000)]
sunxi: H6: dram: remove usage of struct sunxi_ccm_reg

The Allwinner H6 DRAM initialisation code uses a complex C struct,
modelling the clock device's register frame. For this SoC, the struct
contains 127 registers, but the DRAM code only uses four of them.

Since we want to get rid of this struct, drop the usage of the struct in
the H6 DRAM code, by using #define'd register names and their offset, and
then adding those names to the base pointer.

This removes one more user of the clock register struct.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: H616: dram: remove usage of struct sunxi_ccm_reg
Andre Przywara [Fri, 24 Jan 2025 23:43:22 +0000 (23:43 +0000)]
sunxi: H616: dram: remove usage of struct sunxi_ccm_reg

The Allwinner H616 DRAM initialisation code uses a complex C struct,
modelling the clock device's register frame. For this SoC, the struct
contains 127 registers, but the DRAM code only uses four of them.

Since we want to get rid of this struct, drop the usage of the struct in
the H616 DRAM code, by using #define'd register names and their offset,
and then adding those names to the base pointer.

This removes one more user of the clock register struct.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: mmc: remove usage of struct sunxi_ccm_reg
Andre Przywara [Fri, 24 Jan 2025 23:42:46 +0000 (23:42 +0000)]
sunxi: mmc: remove usage of struct sunxi_ccm_reg

The Allwinner MMC code uses a complex C struct, modelling the clock
device's register frame. We rely on sharing the member names across all
Allwinner SoCs, which is fragile.

Drop the usage of the struct in the MMC code, by using #define'd
register names and their offset, and then adding those names to the base
pointer. This requires to define those offsets for all SoCs, but since we
only use between four and six clock registers in the MMC code, this is
easily done.

This removes one common user of the clock register struct.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: clock: H6: drop usage of struct sunxi_ccm_reg
Andre Przywara [Fri, 24 Jan 2025 22:49:07 +0000 (22:49 +0000)]
sunxi: clock: H6: drop usage of struct sunxi_ccm_reg

U-Boot drivers often revert to using C structures for modelling hardware
register frames. This creates some problems:
- A "struct" is a C language construct to group several variables
  together. The details of the layout of this struct are partly subject
  to the compiler's discretion (padding and alignment).
- The "packed" attribute would force a certain layout, but we are not
  using it.
- The actual source of information from the data sheet is the register
  offset. Here we create an artificial struct, carefully tuning the
  layout (with a lot of reserved members) to match that offset. To help
  with correctness, we put the desired information as a *comment*,
  though this is purely for the human reader, and has no effect on the
  generated layout. This sounds all very backwards.
- Using a struct suggests we can assign a pointer and then access the
  register content via the members. But this is not the case, instead
  every MMIO register access must go through specific accessor functions,
  to meet the ordering and access size guarantees the hardware requires.
- We share those structs in code shared across multiple SoC families,
  though most SoCs define their own version of the struct. Members must
  match in their name, across every SoC, otherwise compilation will fail.
  We work around this with even more #ifdefs in the shared code.
- Some SoCs have an *almost* identical layout, but differ in a few
  registers. This requires hard to maintain #ifdef's in the struct
  definition.
- Some of the register frames are huge: the H6 CCU device defines 127
  registers. We use 15 of them. Still the whole frame would need to be
  described, which is very tedious, but for no reason.
- Adding a new SoC often forces people to decide whether to share an
  existing struct, or to create a new copy. For some cases (say like 80%
  similarity) this works out badly either way.

The Linux kernel heavily frowns upon those register structs, and instead
uses a much simpler solution: #define REG_NAME <offset>
This easily maps to the actual information from the data sheet, and can
much simpler be shared across multiple SoCs, as it allows to have all
SoC versions visible, so we can use C "if" statements instead of #ifdef's.
Also it requires to just define the registers we need, and we can use
alternative locations for some registers much more easily.

Drop the usage of "struct sunxi_ccm_reg" in the H6 SPL clock code, by
defining the respective register names and their offsets, then adding
them to the base pointer.
We cannot drop the struct definition quite yet, as it's also used in
other drivers, still.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: armv8: FEL: save and restore SP_IRQ
Andre Przywara [Mon, 10 Feb 2025 00:25:29 +0000 (00:25 +0000)]
sunxi: armv8: FEL: save and restore SP_IRQ

Thanks for Jernej's JTAG debugging effort, it turns out that the BROM
expects SP_IRQ to be saved and restored, when we want to enter back into
FEL after the SPL's AArch64 stint.
Save and restore SP_IRQ as part of the FEL state handling. The banked
MRS/MSR access to SP_IRQ, without actually being in IRQ mode, was
introduced with the ARMv7 virtualisation extensions. The Arm Cortex-A8
cores used in the A10/A13s or older F1C100s SoCs would not support that,
but this code here is purely in the ARMv8/AArch64 code path, so it's
safe to use unconditionally.

Reported-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agosunxi: armv8: FEL: save and restore GICv3 registers
Andre Przywara [Sun, 5 Jan 2025 21:51:59 +0000 (21:51 +0000)]
sunxi: armv8: FEL: save and restore GICv3 registers

To be able to return to the BootROM FEL USB debug code, we must restore
the core's state as accurately as possible after the SPL has been run.
Since the BootROM runs in AArch32, but the SPL uses AArch64, this requires
a core reset, which clears the core's state.
So far we were saving and restoring the required registers like SCTLR
and VBAR, but could ignore the interrupt controller's state (GICC), since
that lives in MMIO registers, unaffected by a core reset.
Newer Allwinner SoCs now feature a GICv3 interrupt controller, which keeps
some GIC state in architected system registers, and those are cleared
when we switch back to AArch32.

To enable FEL operation on the Allwinner A523 SoC,
Add AArch32 assembly code to save and restore the ICC_PMR and ICC_IGRPEN1
system registers. The other GICv3 sysregs are either not relevant for the
BROM operation, or haven't been changed from their reset defaults by the
BROM anyway.

This enables FEL operation on the Allwinner A523 family of SoCs.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agowatchdog: sunxi: add A523 support
Andre Przywara [Thu, 12 Sep 2024 23:15:22 +0000 (00:15 +0100)]
watchdog: sunxi: add A523 support

The Allwinner A523 SoC moved the watchdog into a separate MMIO frame,
and also shifted the registers a bit: the control, config, and mode
register are located four bytes earlier.

Add the new compatible string, and connect it to the new struct
describing the new register layout.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Stefan Roese <sr@denx.de>
6 weeks agosunxi: Kconfig: Remove obsolete USBx_* pin symbols
Andre Przywara [Tue, 31 Oct 2023 06:39:54 +0000 (01:39 -0500)]
sunxi: Kconfig: Remove obsolete USBx_* pin symbols

Now that the USB PHY driver uses the device tree to get the VBUS detect
and USB ID GPIOs, these Kconfig symbols are unused. Remove them from
their Kconfig definition, and also from all defconfig files.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agophy: sun4i-usb: Determine USB OTG detection pin from devicetree
Andre Przywara [Sun, 30 Mar 2025 16:13:50 +0000 (17:13 +0100)]
phy: sun4i-usb: Determine USB OTG detection pin from devicetree

So far Allwinner boards controlled the USB OTG ID detection via the
respective GPIO pin specified in Kconfig, as a string. All boards should
have the same GPIO already specified in the devicetree, in the
usb0_id_det-gpios property.

Convert the usage of the Kconfig configured GPIO over to query that
information from the devicetree, then use the existing DM GPIO
infrastructure to request the GPIO.
Only PHY0 supports USB-OTG, so limit the GPIO request to that PHY, to
avoid claiming it multiple times.

This removes the need to name that GPIO in the defconfig file.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agophy: sun4i-usb: Determine VBUS detection pin from devicetree
Andre Przywara [Sun, 30 Mar 2025 16:13:23 +0000 (17:13 +0100)]
phy: sun4i-usb: Determine VBUS detection pin from devicetree

So far Allwinner boards controlled the USB VBUS detection via the
respective GPIO pin specified in Kconfig, as a string. All boards should
have the same GPIO already specified in the devicetree, in the
usb0_vbus_det-gpios property.

Convert the usage of the Kconfig configured GPIO over to query that
information from the devicetree, then use the existing DM GPIO
infrastructure to request the GPIO.
Only PHY0 supports USB-OTG, so limit the GPIO request to that PHY, to
avoid claiming it multiple times.

This removes the need to name that GPIO in the defconfig file.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agogpio: axp: Remove virtual VBUS enable GPIO
Samuel Holland [Tue, 31 Oct 2023 06:39:55 +0000 (01:39 -0500)]
gpio: axp: Remove virtual VBUS enable GPIO

Now that this functionality is modeled using the device tree and
regulator uclass, the named GPIO is not referenced anywhere. Remove
it, along with the rest of the support for AXP virtual GPIOs.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agosunxi: Remove obsolete USBx_VBUS_PIN Kconfig symbols
Samuel Holland [Tue, 31 Oct 2023 06:39:54 +0000 (01:39 -0500)]
sunxi: Remove obsolete USBx_VBUS_PIN Kconfig symbols

Now that the USB PHY driver uses the device tree to get VBUS supply
regulators, these Kconfig symbols are unused. Remove them.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agophy: sun4i-usb: Control supplies via the regulator uclass
Samuel Holland [Tue, 31 Oct 2023 06:39:53 +0000 (01:39 -0500)]
phy: sun4i-usb: Control supplies via the regulator uclass

The device tree binding for the PHY provides VBUS supplies as regulator
references. Now that all boards have the appropriate regulator uclass
drivers enabled, the PHY driver can switch to using them. This replaces
direct GPIO usage, which in some cases needed a special DM-incompatible
"virtual" GPIO from the PMIC.

The following boards provided a value for CONFIG_USB0_VBUS_PIN, but are
missing the "usb0_vbus-supply" property in their device tree. None of
them have the MUSB controller enabled in host or OTG mode, so they
should see no impact:
 - Ainol_AW1_defconfig / sun7i-a20-ainol-aw1
 - Ampe_A76_defconfig / sun5i-a13-ampe-a76
 - CHIP_pro_defconfig / sun5i-gr8-chip-pro
 - Cubieboard4_defconfig / sun9i-a80-cubieboard4
 - Merrii_A80_Optimus_defconfig / sun9i-a80-optimus
 - Sunchip_CX-A99_defconfig / sun9i-a80-cx-a99
 - Yones_Toptech_BD1078_defconfig / sun7i-a20-yones-toptech-bd1078
 - Yones_Toptech_BS1078_V2_defconfig /
   sun6i-a31s-yones-toptech-bs1078-v2
 - iNet_3F_defconfig / sun4i-a10-inet-3f
 - iNet_3W_defconfig / sun4i-a10-inet-3w
 - iNet_86VS_defconfig / sun5i-a13-inet-86vs
 - iNet_D978_rev2_defconfig / sun8i-a33-inet-d978-rev2
 - icnova-a20-swac_defconfig / sun7i-a20-icnova-swac
 - sun8i_a23_evb_defconfig / sun8i-a23-evb

Similarly, the following boards set CONFIG_USB1_VBUS_PIN, but do not
have "usb1_vbus-supply" in their device tree. Neither of them have USB
enabled at all, so again there should be no impact:
 - Cubieboard4_defconfig / sun9i-a80-cubieboard4 (also for USB3)
 - sun8i_a23_evb_defconfig / sun8i-a23-evb

The following boards use a different pin for USB1 VBUS between their
defconfig and their device tree. Depending on which is correct, they
may be broken:
 - Linksprite_pcDuino3_Nano_defconfig (PH11) /
   sun7i-a20-pcduino3-nano (PD2)
 - icnova-a20-swac_defconfig (PG10) / sun7i-a20-icnova-swac (PH6)

Finally, this board has conflicting pins given for its USB2 VBUS:
 - Lamobo_R1_defconfig (PH3) / sun7i-a20-lamobo-r1 (PH12)

Signed-off-by: Samuel Holland <samuel@sholland.org>
[Andre: use regulator_set_enable_if_allowed()]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agosunxi: Enable PMIC drivevbus regulator support for USB supplies
Samuel Holland [Tue, 31 Oct 2023 06:39:52 +0000 (01:39 -0500)]
sunxi: Enable PMIC drivevbus regulator support for USB supplies

On many boards, the USB ports are powered by the PMIC's "drivevbus"
regulator. In preparation for switching the USB PHY driver to use the
regulator uclass instead of a virtual GPIO pin, ensure these boards
have AXP PMIC regulator support enabled.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agopower: regulator: Add a driver for the AXP PMIC drivevbus
Samuel Holland [Tue, 31 Oct 2023 06:39:51 +0000 (01:39 -0500)]
power: regulator: Add a driver for the AXP PMIC drivevbus

AXP PMICs have a pin which can either report the USB VBUS state, or
driving a regulator that supplies USB VBUS. Add a regulator driver for
controlling this pin. The selection between input and output is done via
the x-powers,drive-vbus-en pin on the PMIC (parent) node.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agosunxi: enable MMU_PGPROT proper page table protection
Andre Przywara [Mon, 7 Apr 2025 22:52:35 +0000 (23:52 +0100)]
sunxi: enable MMU_PGPROT proper page table protection

Select the new MMU_PGPROT Kconfig symbol for all Allwinner board builds,
to use a write-protected .rodata, non-executable .data and .rodata
sections, and non-writable .text sections.

This might trigger runtime exceptions in misbehaving drivers, which
should then be fixed.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agosunxi: h616: defconfigs: enable eMMC
Andre Przywara [Thu, 27 Mar 2025 21:21:02 +0000 (21:21 +0000)]
sunxi: h616: defconfigs: enable eMMC

Now that eMMC is working properly on H616 devices, it became apparent
that some boards were missing the right defconfig bits to enable eMMC
access.

Add the eMMC device number to the Tanix TX1 and the X96 Mate defconfig,
also the eMMC boot option to the TX1. Oddly enough the X96 Mate had
just this bit already.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
6 weeks agosunxi: h6/h616: Reuse common DRAM infrastructure
Jernej Skrabec [Fri, 11 Apr 2025 16:14:39 +0000 (18:14 +0200)]
sunxi: h6/h616: Reuse common DRAM infrastructure

H616 rank and size detection code is superior to the H6. Nevertheless,
they are structurally the same. Split functions from H616 into new file
and reuse them in H6 DRAM driver too. This should also fix some bugs for
H6 too, like incorrect DRAM size detection.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
[Andre: back out panic if test fails to allow 2^11 columns]
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: h6: dram: split dram_para struct
Jernej Skrabec [Fri, 11 Apr 2025 16:14:38 +0000 (18:14 +0200)]
sunxi: h6: dram: split dram_para struct

This change is same as in commit 78aa00c38e86 ("sunxi: H616: dram: split
struct dram_para"), but for H6. This is needed in order to extract
common code between H6 and H616 later.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
6 weeks agosunxi: H6: DRAM: Constify function parameters
Jernej Skrabec [Fri, 11 Apr 2025 16:14:37 +0000 (18:14 +0200)]
sunxi: H6: DRAM: Constify function parameters

Constify parameters for two reasons:
- Allow more compile time optimizations
- It will allow later sharing of common code with H616 (when it will be
  rearranged some more)

Commit does same kind of changes as commit 457e2cd665bd ("sunxi: H616:
dram: const-ify DRAM function parameters")

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
7 weeks agoenv: point fdt address to the fdt in a bloblist
Raymond Mao [Mon, 31 Mar 2025 22:40:10 +0000 (15:40 -0700)]
env: point fdt address to the fdt in a bloblist

Point fdt_addr to the fdt embedded in the bloblist since fdt_addr
is a default address for bootefi, bootm and booti to look for the
device tree when launching the kernel.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
7 weeks agobloblist: fix the overriding of fdt from bloblist
Raymond Mao [Mon, 31 Mar 2025 22:40:09 +0000 (15:40 -0700)]
bloblist: fix the overriding of fdt from bloblist

When a bloblist is valid and contains fdt, it explicitly means
a previous boot stage is passing transfer list compliant with
Firmware Handoff specification, thus the fdt from bloblist should
not be overridden with the ones from board or env variables.

Fixes: 70fe23859437 ("fdt: Allow the devicetree to come from a bloblist")
Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
7 weeks agoMerge tag 'u-boot-stm32-20250428' of https://source.denx.de/u-boot/custodians/u-boot-stm
Tom Rini [Mon, 28 Apr 2025 14:22:48 +0000 (08:22 -0600)]
Merge tag 'u-boot-stm32-20250428' of https://source.denx.de/u-boot/custodians/u-boot-stm

CI: https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/25970
- Add OF_UPSTREAM flag support for STi, STM32 MCU and MPU platforms.
- Add ETZPC as system bus for STM32MP1 platforms
- Add RIFSC as sytem bus for STM32MP2 platforms
- Update STM32MP2 board/machine support:
  - update cmd_stm32key.
  - update cmd_stm32prog.
  - update STM32MP25 configs.
  - add leds and buttons support.
  - add boot_mode support (USB/PXE/MMC/NOR/NAND).
  - add bootcmd support.
  - enable MMC support.

7 weeks agosiemens: imx8qxp: remove unused config file
Heiko Schocher [Mon, 28 Apr 2025 05:28:57 +0000 (07:28 +0200)]
siemens: imx8qxp: remove unused config file

include/configs/giedi.h is not longer used after siemens imx8qxp
cleanup series, so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>
7 weeks agoarm: imx8qxp: capricorn: move env offset settings
Heiko Schocher [Mon, 28 Apr 2025 05:28:56 +0000 (07:28 +0200)]
arm: imx8qxp: capricorn: move env offset settings

move the ENV_OFFSET settings from common config settings file
configs/imx8qxp_capricorn.config to defconfig file for the
cxg3 board, as other imx8qxp based boards from siemens has
the environment on other offsets.

Signed-off-by: Heiko Schocher <hs@denx.de>
7 weeks agosiemens: capricorn: defconfig updates
Walter Schweizer [Mon, 28 Apr 2025 05:28:55 +0000 (07:28 +0200)]
siemens: capricorn: defconfig updates

add ahab command as secure boot is used on this boards,
and enable watchdog, so U-Boot triggers it.

Signed-off-by: Walter Schweizer <walter.schweizer@siemens.com>
for respelling commit subject and  message:
Signed-off-by: Heiko Schocher <hs@denx.de>
7 weeks agosiemens: capricorn: enable text based default environment
Walter Schweizer [Mon, 28 Apr 2025 05:28:54 +0000 (07:28 +0200)]
siemens: capricorn: enable text based default environment

enable text based default U-Boot Environment by enabling
CONFIG_ENV_SOURCE_FILE

and adding default environment file:

board/siemens/capricorn/capricorn_cxg3.env

Signed-off-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Walter Schweizer <walter.schweizer@siemens.com>
7 weeks agoimx8qxp: capricorn defconfig: collect common Kconfig options
Heiko Schocher [Mon, 28 Apr 2025 05:28:53 +0000 (07:28 +0200)]
imx8qxp: capricorn defconfig: collect common Kconfig options

Siemens have some defconfigs for different hardware versions,
all based on mainline cxg3 board. For easier updating the
downstream defconfigs, move common settings into new file.

configs/imx8qxp_capricorn.config

Signed-off-by: Heiko Schocher <hs@denx.de>
Signed-off-by: Walter Schweizer <walter.schweizer@siemens.com>
7 weeks agoclk: imx: Pass CCM udevice into clk_register_composite()
Marek Vasut [Sun, 27 Apr 2025 15:39:34 +0000 (17:39 +0200)]
clk: imx: Pass CCM udevice into clk_register_composite()

Pass the clock controller udevice into clk_register_composite(),
so it can be passed further to any registered composite clocks
and used for look up of parent clock referenced in DT "clocks"
and "clock-names" properties by phandle and name pair.

Use the clock controller udevice in imx8m_clk_mux_set_parent()
to perform accurate look up of parent clock referenced in the
CCM driver by name. If the clock name that is being looked up
matches one of the names listed in the clock controller DT node
"clock-names" array property, then the offset of the name is
looked up in the "clocks" DT property and the phandle at that
offset is resolved to the parent clock udevice. The test to
determine whether a particular driver instance registered with
clock uclass matches the parent clock is done by comparing the
OF nodes of the clock registered with clock uclass and parent
clock resolved from the phandle.

Example:

drivers/clk/imx/clk-imx8mm.c:
static const char * const imx8mm_a53_sels[] = {"osc_24m", "arm_pll_out", ...
                                      _____________|
arch/arm/dts/imx8mm.dtsi:            |
clk: clock-controller@30380000 {     v
        clock-names = "osc_32k", "osc_24m", ...
                           |
   v
        clocks = <&osc_32k>, <&osc_24m>, ...
};          _______________________|
...        |
/ {        v
        osc_24m: clock-osc-24m {
                compatible = "fixed-clock";
...
};

Signed-off-by: Marek Vasut <marex@denx.de>
Reported-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Tested-by: Fabio Estevam <festevam@gmail.com>
Tested-by: Adam Ford <aford173@gmail.com> # imx8mp-beacon
7 weeks agoarm64: dts: imx8mm: Make osc_32k available in SPL
Fabio Estevam [Fri, 25 Apr 2025 17:39:01 +0000 (14:39 -0300)]
arm64: dts: imx8mm: Make osc_32k available in SPL

Since commit b4734c9c333b ("clk: imx: Convert clock-osc-* back to osc_*")
SPL takes a long time to load U-Boot proper on an imx8mm-evk board.

The reason for the long delay is because the osc_32k clock is not available
in the SPL phase.

Fix this problem by passing the 'bootph-all' and 'bootph-pre-ram'
properties to make the osc_32k clock available in SPL.

This also aligns with imx8mn and imx8mp-u-boot.dtsi files.

Fixes: b4734c9c333b ("clk: imx: Convert clock-osc-* back to osc_*")
Suggested-by: Marek Vasut <marex@denx.de>
Signed-off-by: Fabio Estevam <festevam@denx.de>
Reviewed-by: Adam Ford <aford173@gmail.com>
7 weeks agoimx: power-domain: Enable refcounting on imx8mp
Miquel Raynal [Fri, 25 Apr 2025 06:49:33 +0000 (08:49 +0200)]
imx: power-domain: Enable refcounting on imx8mp

Prevent enabling/disabling multiple times the same power domain to avoid
breakages due to the same power domains being referenced several times
by different device nodes.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
7 weeks agopower-domain: Add support for refcounting (again)
Miquel Raynal [Fri, 25 Apr 2025 06:49:32 +0000 (08:49 +0200)]
power-domain: Add support for refcounting (again)

It is very surprising that such an uclass, specifically designed to
handle resources that may be shared by different devices, is not keeping
the count of the number of times a power domain has been
enabled/disabled to avoid shutting it down unexpectedly or disabling it
several times.

Doing this causes troubles on eg. i.MX8MP because disabling power
domains can be done in recursive loops were the same power domain
disabled up to 4 times in a row. PGCs seem to have tight FSM internal
timings to respect and it is easy to produce a race condition that puts
the power domains in an unstable state, leading to ADB400 errors and
later crashes in Linux.

Some drivers implement their own mechanism for that, but it is probably
best to add this feature in the uclass and share the common code across
drivers. In order to avoid breaking existing drivers, refcounting is
only enabled if the number of subdomains a device node supports is
explicitly set in the probe function. ->xlate() callbacks will return
the power domain ID which is then being used as the array index to reach
the correct refcounter.

As we do not want to break existing users while stile getting
interesting error codes, the implementation is split between:
- a low-level helper reporting error codes if the requested transition
  could not be operated,
- a higher-level helper ignoring the "non error" codes, like EALREADY and
  EBUSY.

CI tests using power domains are slightly updated to make sure the count
of on/off calls is even and the results match what we *now* expect. They
are also extended to test the low-level functions.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
7 weeks agoboard: starfive: visionfive2: Order board detection logic to match config
E Shattow [Sun, 27 Apr 2025 06:02:52 +0000 (23:02 -0700)]
board: starfive: visionfive2: Order board detection logic to match config

Fixup previous merge resolution of this series. Intent is to ease code
readability and logic to match ordering in CONFIG_OF_LIST

- Remove "starfive/" string math
- Remove redundant local cache of calls to get_*_from_eeprom()
- Match name before EEPROM product_id in board_fit_config_name_match()
- Remove single-consumer FDTFILE_* defines
- Do not set fdtfile for visionfive-2-* when unknown model revision

Fixes: 5a0a93a76848 ("Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv")

Signed-off-by: E Shattow <e@freeshell.de>
7 weeks agosunxi: H6: Remove useless DRAM timings parameter
Jernej Skrabec [Fri, 11 Apr 2025 16:14:36 +0000 (18:14 +0200)]
sunxi: H6: Remove useless DRAM timings parameter

This is just cosmetic fix for later easier rework.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
7 weeks agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Fri, 25 Apr 2025 19:13:17 +0000 (13:13 -0600)]
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv

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

- riscv: lib: Simplify FDT retrieving process
- board: k1: pinctrl: Add pinctrl support for bananapi-f3
- binman: riscv: Fix binman_sym functionality
- board: starfive: visionfive2: Reorder board detection logic
- board: starfive: Add DeepComputing FML13V01 support

7 weeks agoMerge tag 'efi-2025-07-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Fri, 25 Apr 2025 19:11:40 +0000 (13:11 -0600)]
Merge tag 'efi-2025-07-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2025-07-rc1-3

Documentation:

* add documentation for the DeepComputing FML13V01
* fix typos

UEFI:

* build with HII configuration protocol
* print image load address in StartImage

Boards:

* qemu-riscv raise CONFIG_NR_DRAM_BANKS
* add support for the DeepComputing FML13V01 board via
  starfive_visionfive2_defconfig
* add UNIT_TESTS to big-endian Malta boards

7 weeks agoconfigs: add UNIT_TESTS to big-endian Malta boards
Heinrich Schuchardt [Tue, 22 Apr 2025 18:55:10 +0000 (20:55 +0200)]
configs: add UNIT_TESTS to big-endian Malta boards

We currently only run the unit tests on low-endian boards.
We should run them on big-endian, too.

Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agodoc: jh7110: describe debug UART
Heinrich Schuchardt [Thu, 24 Apr 2025 12:13:15 +0000 (14:13 +0200)]
doc: jh7110: describe debug UART

Provide the settings for using the debug UART in SPL.

Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agodoc: starfive: use jh7110_common.rst
Heinrich Schuchardt [Thu, 24 Apr 2025 12:13:14 +0000 (14:13 +0200)]
doc: starfive: use jh7110_common.rst

To avoid duplicate maintenance just include jh7110_common.rst to describe
the usage of the different boot sources.

Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agodoc: starfive: use consistent formatting
Heinrich Schuchardt [Thu, 24 Apr 2025 12:13:13 +0000 (14:13 +0200)]
doc: starfive: use consistent formatting

Always use ---- for the H2 level.

Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agodoc: add DeepComputing FML13V01 documentation
Heinrich Schuchardt [Thu, 24 Apr 2025 12:13:12 +0000 (14:13 +0200)]
doc: add DeepComputing FML13V01 documentation

Describe building U-Boot for the board and booting.

Carve out common information for JH7110 boards into an include.

Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agoboard: starfive: spl: support DeepComputing FML13V01
Heinrich Schuchardt [Thu, 24 Apr 2025 12:13:11 +0000 (14:13 +0200)]
board: starfive: spl: support DeepComputing FML13V01

On the DeepComputing Framework motherboard (FML13V01) choose the matching
FIT configuration.

Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agoboard: starfive: DeepComputing FML13V01 fdt selection
Heinrich Schuchardt [Thu, 24 Apr 2025 12:13:10 +0000 (14:13 +0200)]
board: starfive: DeepComputing FML13V01 fdt selection

We support all JH7110 boards with starfive_visionfive2_defconfig.
The relevant device-tree is selected at runtime based on EEPROM data.

Support setting $fdtfile to the file name of the DeepComputing Framework
motherboard (FML13V01) device-tree.

Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agoriscv: dts: jh7110: add DeepComputing FML13V01 device-tree
Heinrich Schuchardt [Thu, 24 Apr 2025 12:13:09 +0000 (14:13 +0200)]
riscv: dts: jh7110: add DeepComputing FML13V01 device-tree

Add the u-boot device-tree include needed to support the
DeepComputing Framework motherboard (FML13V01).

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agoconfigs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig
Heinrich Schuchardt [Thu, 24 Apr 2025 12:13:08 +0000 (14:13 +0200)]
configs: add jh7110-deepcomputing-fml13v01 to VF2 defconfig

The DeepComputing Framework motherboard is a JH7110 device support by the
upstream kernel. Add its device-tree to the list of device-trees to be
included into the starfive_visionfive_defconfig.

Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Matthias Brugger <mbrugger@suse.com>
Reviewed-by: E Shattow <e@freeshell.de>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agoconfigs: qemu-riscv raise CONFIG_NR_DRAM_BANKS
Heinrich Schuchardt [Thu, 3 Apr 2025 14:28:16 +0000 (16:28 +0200)]
configs: qemu-riscv raise CONFIG_NR_DRAM_BANKS

The number of memory banks in QEMU is not bounded by 1.

In this example we have two banks:

    qemu-system-riscv64 \
    -machine virt \
    -nographic \
    -m 8192 \
    -smp 8,sockets=2,cores=4,threads=1 \
    -numa node,cpus=0-3,mem=4096 \
    -numa node,cpus=4-7,mem=4096 \
    -kernel u-boot

As we will see RISC-V NUMA systems using U-Boot
we should be able to emulate these.

Use the default value defined in /Kconfig as 4.

Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 weeks agodoc: fix typo 'to'
Aristo Chen [Thu, 24 Apr 2025 09:14:16 +0000 (17:14 +0800)]
doc: fix typo 'to'

Fix typo from "to" to "do"

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
7 weeks agodoc: fix typo commnad
Aristo Chen [Wed, 23 Apr 2025 06:52:13 +0000 (14:52 +0800)]
doc: fix typo commnad

fix typo from "commnad" to "command"

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
7 weeks agodoc: arch: arm64: fix typos
Aristo Chen [Tue, 22 Apr 2025 03:07:06 +0000 (11:07 +0800)]
doc: arch: arm64: fix typos

Fix typo from "recommened" to "recommended"

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
7 weeks agodoc: remove duplicated "commands"
Aristo Chen [Sun, 20 Apr 2025 14:39:41 +0000 (22:39 +0800)]
doc: remove duplicated "commands"

The "commands" are duplicated, so remove one of them

Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
7 weeks agoefi_loader: print image load address in StartImage
Heinrich Schuchardt [Thu, 2 Jan 2025 18:11:33 +0000 (19:11 +0100)]
efi_loader: print image load address in StartImage

When starting image add the image load address to the debug output.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 weeks agoefi_loader: build with HII configuration protocol
Heinrich Schuchardt [Thu, 2 Jan 2025 18:11:31 +0000 (19:11 +0100)]
efi_loader: build with HII configuration protocol

Without the HII configuration protocol the debug version of the UEFI shell
cannot be used.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 weeks agoconfigs: stm32mp25: enable DISTRO_DEFAULT and BOOTCOMMAND
Patrice Chotard [Fri, 25 Apr 2025 08:21:34 +0000 (10:21 +0200)]
configs: stm32mp25: enable DISTRO_DEFAULT and BOOTCOMMAND

Enable DISTRO_DEFAULT and BOOTCOMMAND flags for stm32mp25

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Cover-letter:
arm: stm32mp: STM32MP25 machine update

This series is updating STM32MP25 machine/board support:
  _ update cmd_stm32key.
  _ update cmd_stm32prog.
  _ update STM32MP25 configs.
  _ add leds and buttons support.
  _ add boot_mode support (USB/PXE/MMC/NOR/NAND).
  _ add bootcmd support.
  _ enable MMC support.

Currently, it misses clock,reset and regulator support for STM32MP25
which will be added in a next step due to dependencies with OP-TEE.
For example, due to OP-TEE dependencies, all MMC support is ready
but not functional.

END

Series-version: 2

Series-changes: 2
  - Enable DISTRO_DEFAULT and BOOTCOMMAND flags

7 weeks agoarm: stm32mp: stm32prog: add support rootfs-a for OTA
Patrick Delaunay [Thu, 16 Jan 2025 09:54:34 +0000 (10:54 +0100)]
arm: stm32mp: stm32prog: add support rootfs-a for OTA

Add support of "rootfs-a" name to allow support of A/B mechanism for OTA
on rootfs.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoarm: stm32mp: stm32prog: PTA BSEC is not supported on closed device
Patrick Delaunay [Wed, 20 Mar 2024 14:56:42 +0000 (15:56 +0100)]
arm: stm32mp: stm32prog: PTA BSEC is not supported on closed device

On closed device the PTA BSEC is never supported and the current check if
PTA BSEC is supported cause a OP-TEE error:

  E/TC tee_ta_open_session

This patch removed this warning on closed device, because the check is
skipped.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoarm: stm32mp: add helper function stm32mp_is_closed()
Patrick Delaunay [Wed, 20 Mar 2024 14:51:08 +0000 (15:51 +0100)]
arm: stm32mp: add helper function stm32mp_is_closed()

Add the helper function stm32mp_is_closed() to check the "closed" state in
product life cycle, when product secrets have  been provisioned into the
device, by "secure secret provisioning" tools (SSP) for example.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoarm: stm32mp: cmd_stm32key: update command for stm32mp25x
Patrice Chotard [Fri, 10 Dec 2021 10:05:16 +0000 (11:05 +0100)]
arm: stm32mp: cmd_stm32key: update command for stm32mp25x

Update key table for stm32mp25 platform.

Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com>
Signed-off-by: Thomas Bourgoin <thomas.bourgoin@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoarm: stm32mp: fix package IDs for stm32mp25
Patrice Chotard [Thu, 4 Jul 2024 13:54:35 +0000 (15:54 +0200)]
arm: stm32mp: fix package IDs for stm32mp25

Fix package IDs for stm32mp25.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoarm: stm32mp: implement new STM32MP25 revision ID system
Patrick Delaunay [Tue, 19 Mar 2024 19:14:27 +0000 (20:14 +0100)]
arm: stm32mp: implement new STM32MP25 revision ID system

The STM32MP25 revision ID are now defined with the OTP102, this patch
implements this new system.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
7 weeks agoarm: stm32mp: disable console for UART serial boot
Patrice Chotard [Thu, 3 Apr 2025 13:04:35 +0000 (15:04 +0200)]
arm: stm32mp: disable console for UART serial boot

For UART serial boot, the console need to be deactivated to avoid issue
with tools STM32CubeProgrammer.

This patch adds also the missing dependency for CMD_STM32PROG_SERIAL,
to allow the silent and disable console. This avoid to add is on
board level for STM32MP15 (with TARGET_ST_STM32MP15X or
TARGET_ST_STM32MP13X)

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoarm: stm32mp: increase EARLY_TLB_SIZE to 0x10000
Patrice Chotard [Tue, 1 Apr 2025 16:14:18 +0000 (18:14 +0200)]
arm: stm32mp: increase EARLY_TLB_SIZE to 0x10000

Depending on Soc (STM32MP25 vs STM32MP21), the memory map can be
different and it generates a different TLB page table configuration/size.

Increase EARLY_TLB_SIZE to 0x10000 to fix following error message
and panic:

"Insufficient RAM for page table: 0xb000 > 0xa000. Please increase the
size in get_page_table_size()"

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoARM: dts: stm32: add sdmmc1 fixed clock for stm32mp257f-ev1-u-boot
Patrice Chotard [Fri, 4 Apr 2025 16:20:32 +0000 (18:20 +0200)]
ARM: dts: stm32: add sdmmc1 fixed clock for stm32mp257f-ev1-u-boot

Add sdmmc1 temporary fixed clock for stm32mp257f-ev1-u-boot

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoconfigs: stm32mp25: add PXE boot support
Patrice Chotard [Tue, 1 Apr 2025 16:11:39 +0000 (18:11 +0200)]
configs: stm32mp25: add PXE boot support

Configure the required configuration to allow PXE boot,
without autoload support by default.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoconfigs: stm32mp25: add USB host boot support
Patrice Chotard [Tue, 1 Apr 2025 16:12:51 +0000 (18:12 +0200)]
configs: stm32mp25: add USB host boot support

Add support for booting from USB pen drive, since USB host
port is available on the STM32MP2.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoboard: st: stm32mp2: change bootcmd for ST boards
Patrick Delaunay [Fri, 21 Oct 2022 15:37:28 +0000 (17:37 +0200)]
board: st: stm32mp2: change bootcmd for ST boards

For nor0 boot for the STMicroelectronics boards, the bootfs
is found in SD-Card = mmc0 for nor0 boot.

Introduce a new file configuration file stm32mp25_st_common.h
to manage this specific behavior for the STMicroelectronics
boards; change the boot order for nor0 boot and don't use
the default DISTRO order define in BOOT_TARGET_DEVICES:
mmc1, ubifs, mmc0, mmc2.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice CHOTARD <patrice.chotard@foss.st.com>
7 weeks agoconfigs: stm32mp25: add support of NAND and NOR boot
Patrice Chotard [Tue, 1 Apr 2025 16:08:44 +0000 (18:08 +0200)]
configs: stm32mp25: add support of NAND and NOR boot

Add support of UBI boot and activate the needed
configuration for U-Boot environment in UBI volume for
NAND or in a MTD partition for NOR device, SPI Flash:
ENV_OFFSET, ENV_OFFSET_REDUND, ENV_SECT_SIZE is
aligned with the default MTD partition on NOR device
of the STMicroelectronics boards.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoboard: st: stm32mp2: add user button support
Patrick Delaunay [Wed, 27 Jul 2022 08:38:11 +0000 (10:38 +0200)]
board: st: stm32mp2: add user button support

Handle user button 2 to force boot with STM32CubeProgrammer.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoboard: st: stm32mp2: add led support
Patrick Delaunay [Tue, 26 Jul 2022 17:26:16 +0000 (19:26 +0200)]
board: st: stm32mp2: add led support

Add led support, force default state on U-Boot initialization and put on
the Linux heartbeat led = "blue-led" during U-Boot execution.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoARM: dts: stm32: add "u-boot,mmc-env-partition" for stm32mp257f-ev1-u-boot
Patrice Chotard [Wed, 23 Apr 2025 07:45:02 +0000 (09:45 +0200)]
ARM: dts: stm32: add "u-boot,mmc-env-partition" for stm32mp257f-ev1-u-boot

Add "u-boot,mmc-env-partition" property for stm32mp257f-ev1-u-boot.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoboard: st: stm32mp2: add mmc_get_env_dev()
Patrice Chotard [Tue, 22 Apr 2025 15:33:42 +0000 (17:33 +0200)]
board: st: stm32mp2: add mmc_get_env_dev()

Use the boot instance to select the correct mmc device identifier,
this patch only to save the environment on eMMC = MMC(1) on
STMicroelectronics boards.

Set the CONFIG_SYS_MMC_ENV_DEV to -1 to select the mmc boot instance
by default.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoboard: st: stm32mp2: add env_get_location()
Patrice Chotard [Tue, 1 Apr 2025 16:08:44 +0000 (18:08 +0200)]
board: st: stm32mp2: add env_get_location()

In case of several environment location support, env_get_location
is needed to select the correct location depending of the boot
device .

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoarm: stm32mp: add boot_mode support for STM32MP25
Patrick Delaunay [Mon, 30 May 2022 17:20:45 +0000 (19:20 +0200)]
arm: stm32mp: add boot_mode support for STM32MP25

Add support of all the boot mode supported by STM32MP25x family
with information provided by TF-A in backup register

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoconfigs: stm32mp25: add bootcmd for stm32mp25 platform
Patrice Chotard [Tue, 1 Apr 2025 15:43:54 +0000 (17:43 +0200)]
configs: stm32mp25: add bootcmd for stm32mp25 platform

Handle boot for the 3 instance of MMC and call the command stm32prog
for serial boot on USB or on UART as it is done for other STM32MP platform.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoconfigs: stm32mp25: add MMC support
Patrice Chotard [Fri, 4 Apr 2025 06:53:11 +0000 (08:53 +0200)]
configs: stm32mp25: add MMC support

Enable MMC related flags support for stm32mp25

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoARM: stm32mp: add RIFSC system bus driver for STM32MP25
Patrick Delaunay [Tue, 1 Apr 2025 13:14:13 +0000 (15:14 +0200)]
ARM: stm32mp: add RIFSC system bus driver for STM32MP25

This driver is checking the access rights of the different
peripherals connected to the RIFSC bus. If access is denied,
the associated device is not binded.

Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Cover-letter:
Enable OF_UPSTREAM for STM32 and STi platforms
This series is enabling OF_UPSTREAM flag for STM32 MCU's, MPU's and
STi platforms.
For some boards, some defconfig and DT update are needed to keep the
same functional level.

The major impact concerns MPU's platform with introduction of STM32
System Bus.
END

Series-version: 2

Series-changes: 2
  - Replace LOG_CATEGORY UCLASS_SIMPLE_BUS by UCLASS_NOP in both
    /arch/arm/mach-stm32mp/stm32mp2/rifsc.c and
    /arch/arm/mach-stm32mp/stm32mp1/etzpc.c.
  - Update board/st/stm32mp1/MAINTAINERS.
  - Fix DSI clock ssetting.

7 weeks agoARM: dts: stm32: convert stm32mp2 board to OF_UPSTREAM
Patrice Chotard [Tue, 1 Apr 2025 13:14:12 +0000 (15:14 +0200)]
ARM: dts: stm32: convert stm32mp2 board to OF_UPSTREAM

Enable OF_UPSTREAM flag for STM32MP2 platforms.
Add fixed-clock ck_flexgen_08 and ck_icn_ls_mcu until STM32MP25
clock driver will be available.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
7 weeks agostm32mp: fdt: remove ETZPC peripheral cleanup
Lionel Debieve [Tue, 1 Apr 2025 13:14:11 +0000 (15:14 +0200)]
stm32mp: fdt: remove ETZPC peripheral cleanup

Due to feature domains management, there is no more
need to maintain the fdt cleanup.

Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
7 weeks agoARM: dts: stm32: add ETZPC as a system bus for STM32MP1x boards
Lionel Debieve [Tue, 1 Apr 2025 13:14:10 +0000 (15:14 +0200)]
ARM: dts: stm32: add ETZPC as a system bus for STM32MP1x boards

The STM32 System Bus is an internal bus on which devices are connected.
ETZPC is a peripheral overseeing the firewall bus that configures
and control access to the peripherals connected on it.

For more information on which peripheral is securable, please read
the STM32MP13 or STM32MP15 reference manual.

Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com>
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
7 weeks agoARM: stm32mp: add ETZPC system bus driver for STM32MP1
Lionel Debieve [Tue, 1 Apr 2025 13:14:09 +0000 (15:14 +0200)]
ARM: stm32mp: add ETZPC system bus driver for STM32MP1

This driver is checking the access rights of the different
peripherals connected to the ETZPC bus. If access is denied,
the associated device is not bound.

Signed-off-by: Lionel Debieve <lionel.debieve@foss.st.com>
Signed-off-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
7 weeks agoclk: stm32mp1: fix DSI clock setting
Patrice Chotard [Tue, 1 Apr 2025 13:14:08 +0000 (15:14 +0200)]
clk: stm32mp1: fix DSI clock setting

DSI is the peripheral clock, while DSI_K is an internal kernel clock.
Even though they get the same register and same bit set to be gated,
resulting in the same behavior.

Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
7 weeks agoconfigs: stm32: introduce stm32mp15-odyssey_defconfig
Patrice Chotard [Tue, 1 Apr 2025 13:14:07 +0000 (15:14 +0200)]
configs: stm32: introduce stm32mp15-odyssey_defconfig

U-Boot DT for stm32mp157c-odyssey is richer than the kernel DT one.
None of the stm32mp157c-odyssey's contributors answered to my request
to update kernel DT and i didn't have this board to test.
The simpler is to add a dedicated stm32mp15-odyssey_defconfig with
OF_UPSTREAM flag unset.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
7 weeks agoARM: dts: stm32: convert stm32mp15 board to OF_UPSTREAM
Patrice Chotard [Tue, 1 Apr 2025 13:14:06 +0000 (15:14 +0200)]
ARM: dts: stm32: convert stm32mp15 board to OF_UPSTREAM

Enable OF_UPSTREAM flag for STM32MP15 platforms, except for
stm32mp15-odyssey,see following patch :

"configs: stm32: introduce stm32mp15-odyssey_defconfig"

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
7 weeks agoARM: dts: stm32: convert stm32mp13 board to OF_UPSTREAM
Patrice Chotard [Tue, 1 Apr 2025 13:14:05 +0000 (15:14 +0200)]
ARM: dts: stm32: convert stm32mp13 board to OF_UPSTREAM

Enable OF_UPSTREAM flag for STM32MP13 platforms.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
7 weeks agoARM: dts: stm32: convert stm23f4 boards to OF_UPSTREAM
Patrice Chotard [Tue, 1 Apr 2025 13:14:04 +0000 (15:14 +0200)]
ARM: dts: stm32: convert stm23f4 boards to OF_UPSTREAM

Enable OF_UPSTREAM flag for STM32MPF4 platforms.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
7 weeks agoARM: dts: stm32: convert stm23f7 boards to OF_UPSTREAM
Patrice Chotard [Tue, 1 Apr 2025 13:14:03 +0000 (15:14 +0200)]
ARM: dts: stm32: convert stm23f7 boards to OF_UPSTREAM

Enable OF_UPSTREAM flag for STM32F7 platforms.

Use upstream device tree for DSI and LTDC nodes,
As now in upstream DT, in panel@0 node, power-supply property is
present, which is a fixed-regulator, add DM_REGULATOR_FIXED flag
for stm32f769-disco boards.

Set also DEFAULT_FDT_FILE in defconfigs and use it in stm32f746-disco.h
to indicate which FDT file to load (All STM32F7 boards are using this
file).

If something is missing, it must be added in upstream device tree
in linux kernel ("px_clk" for DSI by example).

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>