27785 Commits

Author SHA1 Message Date
Tom Rini
6d159cf272 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
2025-04-28 13:17:20 -06:00
Hector Martin
4a55e7f031 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>
2025-04-28 13:16:45 -06:00
Hector Martin
fe593cc8ed 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>
2025-04-28 13:16:45 -06:00
Hector Martin
082789a4f7 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>
2025-04-28 13:16:45 -06:00
Hector Martin
7bac7f5f01 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>
2025-04-28 13:16:45 -06:00
Hector Martin
89cb15788a 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>
2025-04-28 13:16:45 -06:00
Hector Martin
72bc04b874 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>
2025-04-28 13:16:45 -06:00
Tom Rini
962d9635d4 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.
2025-04-28 12:45:45 -06:00
Tom Rini
d2eef3a4a7 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.
2025-04-28 12:45:45 -06:00
Andre Przywara
85e9882a17 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
3389c57297 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
90b74b3f51 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
5721a3c47a 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
c626eff09a 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
a8c232c430 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
0527f30672 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
0453a1d9bb 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
1d26da5a6a 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
5a9014a8ea 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>
2025-04-28 12:45:44 -06:00
Andre Przywara
d8aea14306 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>
2025-04-28 12:45:44 -06:00
Samuel Holland
0e71b2ee15 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>
2025-04-28 12:45:43 -06:00
Andre Przywara
16cfccda4d 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>
2025-04-28 12:45:43 -06:00
Jernej Skrabec
923ad56374 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>
2025-04-28 12:45:43 -06:00
Jernej Skrabec
7a087f5ddd 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>
2025-04-28 12:45:32 -06:00
Jernej Skrabec
236c0d8124 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>
2025-04-28 12:44:31 -06:00
Tom Rini
6f4bd8edb8 - 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.
 -----BEGIN PGP SIGNATURE-----
 
 iQJQBAABCgA6FiEEXyrViUccKBz9c35Jysd4L3sz/6YFAmgPeeAcHHBhdHJpY2Uu
 Y2hvdGFyZEBmb3NzLnN0LmNvbQAKCRDKx3gvezP/pp38D/4zPK3xf8fbH2VZWWqu
 eDkuEku6a/wDe2BAb6ru0bTJDRG0a4DpDYKtqiaT6f9xIZwkq2WmjG5X2sYQ4bCm
 nEPYVmUgQjjEP71pBBSswCkmUFTrr+pJm/qJ3scb+LbfBeb5piCrmIcQE4oiTYZ7
 pZx2b4Ys4+1/eJw7NTY8ir+9fcKmfp5wUyk766JoIjsjYKTpibJtxsbKyFPDXMde
 Q/99HCcEx85D3vSfAZo3/+yDJvJDXRQ/u1TYpLoVexSN1t7A9LiDEDDJgL8M5Fsk
 PoWVdMn3l+/GLB3RWKOVsafxnaVLanxU3JwARtWSuPJUhru0SdjSHrunNb6TuYwF
 62GJhOGlOMvfakUPTC7mNuV9V9FCV7tZP/j3pXnyYsl14yptHkBAhVCvBd415tHy
 pG7gNDjT92Aq1ug2ibwTD/NUUAsIBjvbU+CTAZQJeWbBK2WweyxRfaat9kEcTnKf
 48lhzUxvEYgcFu/9VXillOBRaYmxlnhjAokJne8frSp7sJ6sBIl1rAMOZ7HSvEJz
 Hv4EOBVlGIw/C4QHSDAqaeXKTZkceblDvTw8yRhOjTUiLezb5AjGdzJAzxZCJqui
 nKcwPAgNJbHejl5/our2DPPac799WweBr5n5tQmQ6kdufQyggAcTEb+LF7f2HPMc
 +V1avabIoLwDalTj5PiA6i4jDA==
 =ttnT
 -----END PGP SIGNATURE-----

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.
2025-04-28 08:22:48 -06:00
Fabio Estevam
a08c252c80 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>
2025-04-28 10:41:45 -03:00
Miquel Raynal
9086b64ca0 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>
2025-04-28 10:41:19 -03:00
Jernej Skrabec
2bee17dcaa 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>
2025-04-26 12:01:26 +01:00
Patrick Delaunay
f54300f0bf 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>
2025-04-25 16:00:23 +02:00
Patrick Delaunay
63e1a62fce 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>
2025-04-25 16:00:23 +02:00
Patrick Delaunay
6c66779549 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>
2025-04-25 16:00:23 +02:00
Patrice Chotard
c3bf98f73d 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>
2025-04-25 16:00:23 +02:00
Patrice Chotard
d6c679cc77 arm: stm32mp: fix package IDs for stm32mp25
Fix package IDs for stm32mp25.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
2025-04-25 16:00:23 +02:00
Patrick Delaunay
d1c0e6ac1c 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>
2025-04-25 16:00:23 +02:00
Patrice Chotard
5ded6bac6c 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>
2025-04-25 16:00:23 +02:00
Patrice Chotard
2662d1728d 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>
2025-04-25 16:00:23 +02:00
Patrice Chotard
c65b402267 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>
2025-04-25 16:00:23 +02:00
Patrick Delaunay
0272e50b55 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>
2025-04-25 16:00:22 +02:00
Patrice Chotard
6ec23e9cc2 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>
2025-04-25 16:00:22 +02:00
Patrick Delaunay
f9fc248995 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>
2025-04-25 16:00:22 +02:00
Patrick Delaunay
26b8430186 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.
2025-04-25 16:00:22 +02:00
Patrice Chotard
3cacb0dc87 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>
2025-04-25 16:00:22 +02:00
Lionel Debieve
63272cc474 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>
2025-04-25 16:00:22 +02:00
Lionel Debieve
f63a30f1c0 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>
2025-04-25 16:00:22 +02:00
Lionel Debieve
ad3cdc677d 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>
2025-04-25 16:00:22 +02:00
Patrice Chotard
35f90f76f4 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>
2025-04-25 16:00:22 +02:00
Patrice Chotard
aaddc8986a 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>
2025-04-25 16:00:22 +02:00
Patrice Chotard
a893f01f95 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>
2025-04-25 16:00:22 +02:00
Patrice Chotard
ae5f4e2c6c 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>
2025-04-25 16:00:22 +02:00