Commit graph

27663 commits

Author SHA1 Message Date
Svyatoslav Ryhel
13af58edb2 ARM: tegra: dts: fix lock, io-reset and open-drain properties
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-19 10:59:24 +02:00
Svyatoslav Ryhel
6494be8c72 pinctrl: tegra20: fix function naming mismatches
The names used for displaya, displayb and i2c1 do not align with their
corresponding Linux counterparts. This inconsistency can cause pins to be
configured incorrectly, potentially breaking existing functionality.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-19 10:59:24 +02:00
Svyatoslav Ryhel
65e4869a10 pinctrl: tegra: adjust pin state lists
Modify the pin state lists for lock, io-reset, rcv-sel, and e-io-hv
properties by repositioning the default value to the end. This change
addresses conflicts with device tree representations of TEGRA_PIN_DISABLE
and TEGRA_PIN_ENABLE.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-19 10:59:24 +02:00
Svyatoslav Ryhel
8a2846e7ad ARM: tegra: tf700t: upgrade video bindings
Align TF700T bindings with existing upstream device trees. OF_UPSTREAM
migration is possible already but resulting size of binary exceeds maximum
allowed size with full size trees.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-19 10:59:24 +02:00
Svyatoslav Ryhel
1f51562cde ARM: tegra: p1801-t: configure HDMI binding
Bind HDMI for ASUS AiO P1801-t to provide full panel support and improve
usability.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-19 10:59:24 +02:00
Svyatoslav Ryhel
c9fbc404a1 ARM: tegra: endeavoru: upgrade video bindings
Upgrade HTC One X device tree to comply possible upstream Linux device
tree. Once Linux catches up, HTC One X can be switched to OF_UPSTREAM.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-19 10:59:24 +02:00
Svyatoslav Ryhel
578126b369 ARM: tegra: lg_x3: upgrade video bindings
Upgrade LG P895 and P880 device tree bindings according to preliminary
upstream Linux tree. Once Linux catches up, LG X3 can be switched to
OF_UPSTREAM without regressions.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
2025-03-19 10:59:24 +02:00
Tom Rini
8bc3542384 Merge patch series "pxe: Precursor series for supporting read_all() in extlinux / PXE"
Simon Glass <sjg@chromium.org> says:

This series includes some patches related to allowing read_all() to be
used with the extlinux / PXE bootmeths.

These patches were split out from the stb4 series, since it will need to
have additional patches for LWIP, to avoid breaking PXE booting when
LWIP is used.

Link: https://lore.kernel.org/r/20250306002533.2380866-1-sjg@chromium.org
2025-03-18 13:12:51 -06:00
Simon Glass
e2e87b8401 boot: pxe: Refactor label_run_boot() to avoid cmdline
Adjust the remaining call in this function to use the bootm API. This
will allow PXE to work without the command line.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
098407e673 boot: arm: riscv: sandbox: Add a format for the booti file
Arm invented a new format for arm64 and something similar is also used
with RISC-V. Add this to the list of supported formats and provide a way
for the format to be detected on both architectures.

Update the genimg_get_format() function to support this.

Fix up switch() statements which don't currently mention this format.
Booti does not support a ramdisk, so this can be ignored.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
c73da92304 x86: Drop the unnecessary base_ptr argument to zboot_dump()
This value is include the bootm_info, so drop the unnecessary parameter.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
1592ff27d5 bootstd: Correct display of kernel version
The address of the bzImage is not recorded in the bootflow, so we cannot
actually locate the version at present. Handle this case, to avoid
showing invalid data.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
4e36b1739b x86: Move the bootm state for zimage into cmd/
Rather than holding the state in the implementation code, move it to the
command code. The state is now passed to the implementation functions
and can there (with future work) be pass in from bootstd, without going
through the commands.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
00cfb598e7 x86: Rename state to bmi
Use the common name for the struct, in preparation for passing it around
between functions.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
75e85df796 x86: Move x86 zboot state into struct bootm_info
This structure is supposed to handle any type of booting
programmatically, i.e. without needing a command to be executed. Move
the x86-specific members into it and use it instead of
struct zboot_state. Provide a macro so access is possible without adding
lots of #ifdefs to the code.

This will allow the struct to be used for all four types of booting
(bootm, bootz, booti and zboot).

Call bootm_init() to init the state, to match other boot methods.

Note that some rationalisation could be performed on this. But this
is tricky since addresses are stored as strings in several places. Also
some strings combine multiple arguments into one. So to keep this task
somewhat manageable, we content ourselves with just getting everything
into the same struct

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
2de073527b x86: Drop duplicate definition of zimage_dump()
This is now defined in bootm.h so drop the duplicate in the x86 code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Simon Glass
95641f4bf9 x86: Rename zboot_run() to zboot_run_args()
Rename this function so we can (later) create a zboot_run() function
which looks the same as bootm_run()

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-03-18 13:12:15 -06:00
Tom Rini
d92c29f89d - odroid-n2: Update docs for signing
- support Amlogic chip_id v1 and v2
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEPVPGJshWBf4d9CyLd9zb2sjISdEFAmfZgvIACgkQd9zb2sjI
 SdEy3hAAz50M4fI5u/Xa19T9Z8E2QW7TrTAQcjm6ylDqEX2sjFgm4Q3pGxMYXGFN
 TAT+vxm6LOxlDWzFb4ZRxpcAyW7Fmc+5w/13ZJJID519jpDnuPSNP3uOJ1fK1D/O
 ksWfFG9PPqYYlGKhtwsSko1E7cb28B7+eFSWGcqC4XYONDNkZO8zzRXmeNLCnkEB
 5MDvWOWHclHM70tzJYTl82kLeY43ijjuHYW5ITA2g6kNqFy6OHAXfyaYl8p0AdoU
 usBJ5HCQLDdqlYP8/qQkTqZKrLRPOQkC4Tx6ezaz/QkO7G3B543h1XIs4xohN30M
 UYAzvtejksYSXn+DKj4Ti7i7Bp+dekA6DeWu7gTulsV770AeiiJB1v1ggPRWYQnp
 zE2B19mpq3IHdSciu3dj6B0PpgNCrRVOhQjbabWx4bamb48w35hd2X7X0bTe0ty0
 hHjVK9OVMjMy8QRvCs2cUs/HE3Eono7gMeT4/6O8T4JarQ85oVGT9Nsr4MeD3jTW
 o9S/KYVeShoMMpVQ1Sc3T8J02OlpTGAeqyP4pCuVgieOXwY9pLi39fCBJoFhqZfK
 A3rBYVjXej5/LxgjPmh6BCL+yhemB/6DGSWIuKVXHg/WtYlgj64sgYn+aCCUY8KI
 +gCA9YQZQdQO+DREg6gQyV5mtBLAF5O3iB87HD+ojPfr81yYOwc=
 =wUK6
 -----END PGP SIGNATURE-----

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

- odroid-n2: Update docs for signing
- support Amlogic chip_id v1 and v2
2025-03-18 11:03:28 -06:00
Tom Rini
c342f27711 Merge patch series "*** Various Improvements for phyCORE-AM62/A SoMs ***"
Wadim Egorov <w.egorov@phytec.de> says:

This patch series syncs the phyCORE-AM62Ax feature-wise with our other
K3-based SoMs by adding SoM overlay handling and capsule updates. It
also introduces support for USBDFU boot and includes various minor fixes.

Link: https://lore.kernel.org/r/20250305045838.3614661-1-w.egorov@phytec.de
2025-03-18 09:04:06 -06:00
Evgeny Bachinin
dedea0d18d arch: arm: meson: support Amlogic chip_id v1 and v2
Patch introduces:
* chip_id API - useful for various things, but used now for
  device_id (did) generation as mentioned in [1] on our private board
  code. Our device_id is calculated by means of permutations of
  chip_id value.
* new SoCs (a1, s4, etc) are usually coming with the support of chip_id
  v2 right away, whereas secure monitors on old SoCs (like axg, g12b,
  g12a, etc) may support only chip_id v1. Chip_id API handles both
  cases
* meson_sm_get_serial() is described via chip_id API.

Links:
[1] https://lore.kernel.org/linux-arm-kernel/202311242104.RjBPI3uI-lkp@intel.com/T/#m630fbeea6a6e7d531290b5c0af205af4fb979757

Signed-off-by: Viacheslav Bocharov <adeep@lexina.in>
Co-developed-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Signed-off-by: Evgeny Bachinin <EABachinin@salutedevices.com>
Link: https://lore.kernel.org/r/20250210-meson_chip_id_all_vers-v1-3-b98f8b6880b8@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-03-18 15:27:25 +01:00
Evgeny Bachinin
e6d57a5a48 arm: meson: sm: get rid of SM_CHIP_ID_SIZE
SM_CHIP_ID_SIZE is used nowhere. Moreover, it specifies wrong
chip_id size: Amlogic chip_id v1 and v2 is always 16 bytes long.

Signed-off-by: Evgeny Bachinin <EABachinin@salutedevices.com>
Link: https://lore.kernel.org/r/20250210-meson_chip_id_all_vers-v1-2-b98f8b6880b8@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-03-18 15:27:25 +01:00
Evgeny Bachinin
4ea3c0ac21 arm: meson: unify type being used for socinfo
socinfo_ API uses u32 type, hence let's use it everywhere
for consistency.

Signed-off-by: Evgeny Bachinin <EABachinin@salutedevices.com>
Link: https://lore.kernel.org/r/20250210-meson_chip_id_all_vers-v1-1-b98f8b6880b8@salutedevices.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2025-03-18 15:27:25 +01:00
Wadim Egorov
71582e7fa8 arm: dts: k3-am62a-phycore-som-binman: Add SoM overlays
Include SoM dt-overlays that handle variants of our SoMs into
u-boot's FIT image.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2025-03-18 08:12:53 -06:00
Wadim Egorov
61b907e937 arch: arm: dts: k3-am625-phyboard-lyra: Add missing boot phase tag
Add the bootph-all tag to usb0_phy_ctrl node to ensure it is
properly initialized during the boot process. This fixes the
following issue:

  dwc3-am62 dwc3-usb@f900000: unable to get ti,syscon-phy-pll-refclk regmap

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2025-03-18 08:12:53 -06:00
Wadim Egorov
fcf09a76e2 arch: arm: dts: k3-am62a7-phyboard-lyra: Add missing boot phase tag
Add the bootph-all tag to usb0_phy_ctrl node to ensure it is
properly initialized during the boot process. This fixes the
following issue:

  dwc3-am62 dwc3-usb@f900000: unable to get ti,syscon-phy-pll-refclk regmap

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2025-03-18 08:12:53 -06:00
Wadim Egorov
fc70ff633e arm: dts: k3-am62a-phycore-som-binman: Provide capsule nodes
Fill in phycore-am62ax capsule GUID properties of the base
binman capsule nodes.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2025-03-18 08:12:52 -06:00
Robert Nelson
b27c94958b board: beagle: Add support for BeagleY-AI
Basic board support for BeagleY-AI. Information on this
board can be found at https://beagleboard.org/beagley-ai

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Andrew Davis <afd@ti.com>
2025-03-18 07:23:29 -06:00
Caleb Connolly
dcb6a5e765
mach-snapdragon: always select SYSRESET_PSCI for ARCH_SNAPDRAGON
Since removing reset_cpu() in mach-snapdragon, all Qualcomm platforms
now depend on CONFIG_SYSRESET and will fail to build without it.

Move the dependency from qcom_defconfig to kconfig so that we use
SYSRESET for all platforms.

Fixes: 61a1a1b8ca ("mach-snapdragon: use PSCI sysreset driver")
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-03-18 11:55:14 +00:00
Tom Rini
6a5917fba1 Merge branch 'next' of git://source.denx.de/u-boot-usb into next
- Add USB support on Starfive JH7110
2025-03-17 10:18:59 -06:00
Tom Rini
4101b56d0b Merge branch 'nand-next' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash into next
CI: https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/25178

This merge request add support for cadence raw nand driver for agilex
board and add a fix to meson driver.
2025-03-17 10:18:18 -06:00
Tom Rini
3e806c41aa Pull request efi-2025-04-rc5
UEFI:
 
 * Export _start symbol from crt0_*_efi stubs
 * Move .dynamic out of .text in EFI
 * scripts/Makefile.lib: Preserve the .dynstr section as well
 
 Documentation:
 
 * net: miiphybb: Convert documentation to rst
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAmfX39kACgkQhO4vgnE3
 U0vo6xAAgr67Fq0wnNAllOa0UnL92pPWqJ/pCiTsG2aqs764KRTj0YPqruhZGCCR
 NnC83CFMK4SI2MEJ+/BlR+b42798gS8mKRsaKKFTIDW/VBmuqmNVH7BXA4IhhVc9
 /msBqFYRNjhWM4M8gkyn98nEfUKC0jtnmJJDzCf2KnlCD9jqgV7/IqsvzhfOxSfY
 Xwf0ceZ5LbutGG0wF/8pc50sQw6Q6W+cPiBWN0GN1Ld9m8KyJbbpHwtT1U97SQmq
 18zwDgQe/asRdVml22gcvU3X4KJhnUbKmcMHukVtzSpg5ZtTMsBc0M7BIjAfr81+
 pzyAqYVyQgxaru9SGFUK33X+ah2azYb9NOQOAoIp31WY8kAfHF+3FM80jB6lae/x
 sUD0B6hVnVi5qZaIi3vr0yBM21a0irIxJiJ2MkaOSE8YcBOP+QX5wlsgwWaXrj5d
 F5rQ3pp8dBxMw5NBnmKwOJIUxcDXq/rW1PBoy3w3phhZp0Ob+DPz6pxSYqDeREHU
 bmS4hc/KAG/6Ai5wmGq6mnumfG0HkGWmvQTaA+FywLWrh41pTwdztL4Z4/yRFqfv
 caeGZaG78W2ObNb9jVRpZyNu6fufpAehh43aBqW77IfkT/nmhJC4+GSwP1E8EeZ9
 v2OMer0Kf1meH+4JADV6p77SErKSxEclX7PrXn/jp74yPffxvVM=
 =33pH
 -----END PGP SIGNATURE-----

Merge tag 'efi-2025-04-rc5' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2025-04-rc5

CI:

* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/25196

UEFI:

* Export _start symbol from crt0_*_efi stubs
* Move .dynamic out of .text in EFI
* scripts/Makefile.lib: Preserve the .dynstr section as well

Documentation:

* net: miiphybb: Convert documentation to rst
2025-03-17 08:00:40 -06:00
Sam Day
61a1a1b8ca
mach-snapdragon: use PSCI sysreset driver
Drop the `board_reset` function from mach-snapdragon board code, and
instead use the standard PSCI sysreset driver.

Signed-off-by: Sam Day <me@samcday.com>
Link: https://lore.kernel.org/r/20250125-msm8916-sysreset-v1-1-62073932ff0e@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-03-17 13:38:19 +00:00
Sam Day
773a46b18b
mach-snapdragon: handle platforms without PSCI support
Most MSM8916 devices shipped without PSCI support. The history is quite
nuanced (a good overview can be found in [1]), but the end result is
that the upstream DTs for this SoC pretend that PSCI exists, and it's
expected that the bootloader handles the case where it doesn't. This is
codified by the de-facto bootloader for MSM8916 devices, lk2nd [2].

So we handle it here by deleting the /psci node if we detect the absence
of PSCI. We need to do this early to ensure sysreset works correctly,
since the PSCI firmware driver is PRE_RELOC and binds the PSCI sysreset
driver.

Additionally, show_psci_version is updated to check that PSCI exists.
Currently this banner outputs "PSCI: 65535.65535" on devices without
PSCI support, which isn't very useful :)

[1]: https://github.com/msm8916-mainline/linux/issues/388
[2]: https://github.com/msm8916-mainline/lk2nd/blob/8183ea2/lk2nd/smp/spin-table/spin-table.c#L237

Signed-off-by: Sam Day <me@samcday.com>
Link: https://lore.kernel.org/r/20250127-qcom-handle-absent-psci-v1-1-e762f2db938c@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-03-17 13:38:18 +00:00
Sam Day
11ff5a57e2
mach-snapdragon: support parsing memory info from external FDT
qcom_parse_memory is updated to return a -ENODATA error if the passed
FDT does not contain a /memory node, or that node is incomplete (size=0)

board_fdt_blob_setup first tries to call qcom_parse_memory with the
internal FDT (if present+valid). If that fails, it tries again with the
external FDT (again, if present+valid).

When booting with an internal FDT from upstream, it's likely that this
change results in a slight performance hit, since virtually all upstream
qcom DTs lack a fully specified memory node. The impact should be
negligible, though.

qcom_parse_memory was given a detailed docstring adapted from Caleb's
original commit message that introduced the function.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Sam Day <me@samcday.com>
Link: https://lore.kernel.org/r/20250123-qcom-parse-memory-updates-v3-1-c5332b81ea9f@samcday.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-03-17 13:38:18 +00:00
Varadarajan Narayanan
25edbbf7fd
dts: ipq9574-rdp433-u-boot: add override dtsi
Add initial support for the IPQ9574 MMC based RDP platforms.
Define memory layout statically.

Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Varadarajan Narayanan <quic_varada@quicinc.com>
Link: https://lore.kernel.org/r/20250226064505.1178054-3-quic_varada@quicinc.com
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2025-03-17 13:38:16 +00:00
Sam Edwards
214a87757a arm: riscv: efi: Export _start symbol from crt0_*_efi stubs
While the _start label is only intended for use locally to populate the
(hand-written) PE header, the linker script includes ENTRY(_start) which
designates it as the entry point in the output ELF, resulting in linker
warnings under some linkers (e.g. LLVM's lld) due to _start not being a
globally-visible symbol. Since  ELF is only an intermediary build
format, and the aforementioned PE header correctly points to _start, the
ENTRY(_start) directive could easily be removed to silence this warning.

However, since some developers who are debugging EFI by analyzing the
intermediary ELF may appreciate having correct entry-point information,
this patch instead promotes the _start labels to global symbols,
silencing the linker warning and making the intermediary ELF reflect the
true entry point.

This patch doesn't affect the final output binaries in any way.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
2025-03-17 09:22:03 +01:00
Minda Chen
05aa34cef9 spl: starfive: visionfive2: Disable USB overcurrent pin by default.
For some JH7110 boards, USB host overcurent pin is not reserved,
To make USB host work, overcurrent pin must be disabled. So set the
pin default disabled in spl stage.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Tested-by: E Shattow <lucent@gmail.com>
2025-03-17 01:55:19 +01:00
Marek Vasut
15111aeb9c arm64: dts: renesas: Make OTP available in SPL on R8A779G0 V4H
The DBSC5 DRAM controller driver needs access to OTP fuses to discern
Renesas R-Car V4H-3, V4H-5 and V4H-7 SoC variants based on OTP fuse
programming. Make OTP block DT node available in U-Boot SPL DT so the
DBSC5 driver can determine its base address and read out the OTP fuses.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-03-16 14:56:16 +01:00
Dinesh Maniyam
efb9cae1f1 arm: dts: agilex5: Enabled cdns-nand dts setting
Enable cdns-nand dts setting for the socfpga_agilex5
family device.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
2025-03-15 10:35:00 +01:00
Jim Liu
ef254ccf37 arm: dts: npcm7xx: correct the timer node
Correct the timer node of dts

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
2025-03-14 12:26:55 -06:00
Tom Rini
973c366ce6 Up to now we configure the entire memory space for U-Boot as RWX.
For modern architectures and security requirements, it's better to
 map the memory properly.
 This pull request adds basics support for mapping the U-Boot binary with
 proper (RO, RW, RW^X) memory permissions on aarch64 right after we
 relocate U-Boot in the top of DRAM.
 It's worrth noting that the linker script annotations are only added for
 the aarch64 architecture. We can, in the future, try to unify the linker --
 at least for the architectures that have enough in common and expand this
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEgWII69YpahbL5iK5gS8AYozs+qIFAmfUFksACgkQgS8AYozs
 +qLa0hAAg/wmSJhOfzYw+7fMsQebtWMcY7dEa88u3I5QyUQfYFujXuVj+Y5PbguR
 o6DsO26HVRwzo/+YSdVih+GTS1C0BVGVdNE5HZmM1ju4lzgnsZHLuiNx7859Uq0H
 8PWpGb7okB9m22YBOqbXaj5o7QFryU6AU5gEBJYCV6aRxXv5Ha4VoQsdrOkj9eVN
 8QHm5m7EKApYPmjDRul1TNlFNUjhmDNkcEij4pmpNAOl92zbyn4r62c6/u3jYov7
 P9eFt9CLnkCm8k86e+ciXUvykSNxhNGSvCUMLwDJA3oqizBJPfvYF5yyHW0LeCi+
 pXYtxQ9igGfh+AYeEn4vxYcLqIf1Iqr78QKg/De3Vok6e7+UJBOspxCUS/gxjvAi
 Yn1/n31KzaP9hAJKcZ+NTAKOhgyENnDIZ/qSTMhEDwXbiWmn36hGJlnZZE610TbR
 zxgeYChCbcI7eXq/wCJDPNVP51xMh/MZUGup3rREp/0YG5Cl1dMJ1WjcX1O0W1u3
 WKv8MZ6XP5fKTR8dUr+H4V3tcJ6VGuMQ1oHH9xZ/dar4RMboFPMZeFFIzhBIOQT4
 rcQfjmORrQ/ES6Inv+7QgjpZScJ8E+8yFEW1o9y+7tOf+CL8Jq+l0OW9NdNcRRox
 MxrgAIRkdAiKQj2qvLqV2RGhc/OSa/U75cLbVEcTjcJ+ya/0wfg=
 =AKxY
 -----END PGP SIGNATURE-----

Merge tag 'mmu-next-14032025' of https://source.denx.de/u-boot/custodians/u-boot-tpm into next

Up to now we configure the entire memory space for U-Boot as RWX.
For modern architectures and security requirements, it's better to
map the memory properly.
This pull request adds basics support for mapping the U-Boot binary with
proper (RO, RW, RW^X) memory permissions on aarch64 right after we
relocate U-Boot in the top of DRAM.
It's worrth noting that the linker script annotations are only added for
the aarch64 architecture. We can, in the future, try to unify the linker --
at least for the architectures that have enough in common and expand this
2025-03-14 09:31:36 -06:00
Ilias Apalodimas
ec1c6cfb1c treewide: Add a function to change page permissions
For armv8 we are adding proper page permissions for the relocated U-Boot
binary. Add a weak function that can be used across architectures to change
the page permissions

Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-S905X-CC
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-14 13:37:54 +02:00
Ilias Apalodimas
ff0a979fc3 arm64: mmu_change_region_attr() add an option not to break PTEs
The ARM ARM (Rev L.a) on section 8.17.1 describes the cases where
break-before-make is required when changing live page tables.
Since we can use a function to tweak block and page permissions,
where BBM is not required split the existing mmu_change_region_attr()
into two functions and create one that doesn't require BBM. Subsequent
patches will use the new function to map the U-Boot binary with proper
page permissions.
While at it add function descriptions in their header files.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-14 13:37:54 +02:00
Ilias Apalodimas
1c7d0c411c arm: Prepare linker scripts for memory permissions
Upcoming patches are switching the memory mappings to RW, RO, RX
after the U-Boot binary and its data are relocated. Add
annotations in the linker scripts to and mark text, data, rodata
sections and align them to a page boundary.

It's worth noting that .efi_runtime memory permissions are left
untouched for now. There's two problems with EFI currently.

The first problem is that we bundle data, rodata and text in a single
.efi_runtime section which also must be close to .text for now.
As a result we also dont change the permissions for anything contained
in CPUDIR/start.o. In order to fix that we have to decoule .text_rest,
.text and .efi_runtime and have the runtime services on their own
section with proper memory permission annotations (efi_rodata etc).

The efi runtime regions (.efi_runtime_rel) can be relocated by the OS when
the latter is calling SetVirtualAddressMap. Which means we have to
configure those pages as RX for U-Boot but convert them to RWX just before
ExitBootServices. It also needs extra code in efi_tuntime relocation
code since R_AARCH64_NONE are emitted as well if we page align the
section.

Due to the above ignore EFI for now and fix it later once we have the
rest in place.

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on AML-S905X-CC
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-14 13:30:12 +02:00
Ilias Apalodimas
e34ecf9d5e meminfo: add memory details for armv8
Upcoming patches are mapping memory with RO, RW^X etc permsissions.
Fix the meminfo command to display them properly

Acked-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Caleb Connolly <caleb.connolly@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2025-03-14 13:30:12 +02:00
Tom Rini
bbfabe2901 Merge tag 'u-boot-imx-next-20250313' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next
CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/25142

- Support Toradex i.MX6 Apalis/Colibri v1.2 SoM.
- Guard tee.bin inclusion on imx9,
- Remove unneeded regulator entry on DH i.MX6 DHCOM DRC02 devicetree.
- Add i.MX mailbox driver
- Convert ESDHCI_QUIRK_BROKEN_TIMEOUT_VALUE to Kconfig.
- Cope with existing optee node on imx8m.
2025-03-13 16:45:19 -06:00
Marek Vasut
15d6518c94 ARM: dts: imx: Drop bogus regulator extras on DH i.MX6 DHCOM DRC02
The regulator extras should be placed in the USB H1 regulator node,
the /regulator-usb-h1-vbus. They are already present there in the
upstream DT, so delete this bogus node entirely.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-13 15:22:48 -06:00
Bryan Brattlof
096aa229a9 mach-k3: common_fdt: create a reserved memory node
Some device trees may not have a reserved-memory node. Rather than
exiting early we should create a new reserved-memory node along with
the memory carveout for the firmware we (U-Boot) have placed.

Signed-off-by: Bryan Brattlof <bb@ti.com>
Acked-by: Andrew Davis <afd@ti.com>
2025-03-13 14:22:57 -06:00
Marek Vasut
a1cd1ac79a ARM: dts: imx: Drop bogus regulator extras on DH i.MX6 DHCOM DRC02
The regulator extras should be placed in the USB H1 regulator node,
the /regulator-usb-h1-vbus. They are already present there in the
upstream DT, so delete this bogus node entirely.

Signed-off-by: Marek Vasut <marex@denx.de>
2025-03-13 15:15:50 -03:00
Vincent Stehlé
048fabc21b imx8m: soc: cope with existing optee node
On i.MX8M SoCs, the /firmware/optee Devicetree node is created just before
booting the OS when OP-TEE is found running. If the node already exists,
this results in an error, which prevents the OS to boot:

  Could not create optee node.
  ERROR: system-specific fdt fixup failed: FDT_ERR_EXISTS
   - must RESET the board to recover.

  failed to process device tree

On the i.MX8M systems where CONFIG_OF_SYSTEM_SETUP is defined, the
ft_add_optee_node() function is called before booting the OS. It will
create the OP-TEE Devicetree node and populate it with reserved memory
informations gathered at runtime.

On on most i.MX8M systems the Devicetree is built with an optee node if
CONFIG_OPTEE is defined. This node is indeed necessary for commands and
drivers communicating with OP-TEE, even before attempting OS boot.

The aforementioned issue can happen on the Compulab IOT-GATE-iMX8, which is
the only in-tree i.MX8M system where both CONFIG_OPTEE and
CONFIG_OF_SYSTEM_SETUP are defined (see the imx8mm-cl-iot-gate*
defconfigs).

Deal with an existing optee node gracefully at runtime to fix this issue.

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>

Cc: Stefano Babic <sbabic@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Tim Harvey <tharvey@gateworks.com>
2025-03-13 15:15:50 -03:00