pandora-u-boot.git
2 months agoMerge tag 'u-boot-ufs-next-20250318' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 18 Mar 2025 17:03:53 +0000 (11:03 -0600)]
Merge tag 'u-boot-ufs-next-20250318' of https://source.denx.de/u-boot/custodians/u-boot-ufs into next

- initial cleanup and defines sync with Linux v6.12

2 months agoMerge tag 'u-boot-amlogic-20250318' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 18 Mar 2025 17:03:28 +0000 (11:03 -0600)]
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

2 months agoMerge patch series "vepxpress64: disable CRC32 by default and add FVP with TF-A guide"
Tom Rini [Tue, 18 Mar 2025 14:12:40 +0000 (08:12 -0600)]
Merge patch series "vepxpress64: disable CRC32 by default and add FVP with TF-A guide"

Harrison Mutai <harrison.mutai@arm.com> says:

This patch introduces two updates to the vexpress64 project:

- Disable CRC32 by default to prevent aborts in a standard FVP setup.
- Add a guide for running FVP with TF-A, providing a clear starting point for
  users.

Link: https://lore.kernel.org/r/20250304165204.53097-1-harrison.mutai@arm.com
2 months agoMerge patch series "*** Various Improvements for phyCORE-AM62/A SoMs ***"
Tom Rini [Tue, 18 Mar 2025 14:14:13 +0000 (08:14 -0600)]
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
2 months agoconfigs: j784s4-am69: Enable UFS
Udit Kumar [Wed, 5 Mar 2025 06:13:51 +0000 (11:43 +0530)]
configs: j784s4-am69: Enable UFS

J784S4 EVM board has UFS flash, So enable UFS configs

Cc: Neha Francis <n-francis@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
2 months agoufs: core: sync ufshci.h with Linux v6.12
Neil Armstrong [Mon, 30 Dec 2024 10:31:00 +0000 (11:31 +0100)]
ufs: core: sync ufshci.h with Linux v6.12

Sync ufshci.h with the version found in the Linux v6.12
version commit adc218676eef ("Linux 6.12").

It adds new defines, and moves defines to the same place
as the Linux header.

No functional changes intended.

Acked-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Love Kumar <love.kumar@amd.com>
[narmstrong: do not rename CFG_RESULT_CODE_MASK]
Link: https://lore.kernel.org/r/20241230-topic-ufs-cleanup-v2-6-4c6d7994a45d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: core: sync unipro.h with Linux v6.12
Neil Armstrong [Mon, 30 Dec 2024 10:30:59 +0000 (11:30 +0100)]
ufs: core: sync unipro.h with Linux v6.12

Sync unipro.h with the version found in the Linux v6.12
version commit adc218676eef ("Linux 6.12").

It adds new defines, and moves defines to the same place
as the Linux header.

No functional changes intended.

Acked-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Love Kumar <love.kumar@amd.com>
Link: https://lore.kernel.org/r/20241230-topic-ufs-cleanup-v2-5-4c6d7994a45d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: core: move ufshci defines in a separate header
Neil Armstrong [Mon, 30 Dec 2024 10:30:58 +0000 (11:30 +0100)]
ufs: core: move ufshci defines in a separate header

Splitting the header will help synchronizing the defines
again with Linux.

Acked-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Love Kumar <love.kumar@amd.com>
Link: https://lore.kernel.org/r/20241230-topic-ufs-cleanup-v2-4-4c6d7994a45d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: core: cosmetic fixups
Neil Armstrong [Mon, 30 Dec 2024 10:30:57 +0000 (11:30 +0100)]
ufs: core: cosmetic fixups

Fixes some alignment warnings, missing comments on write barrier,
missing parenthesis around macro parameters and a comment typo.

No functional changes intended.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Love Kumar <love.kumar@amd.com>
Link: https://lore.kernel.org/r/20241230-topic-ufs-cleanup-v2-3-4c6d7994a45d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: core: mark unexported functions as static
Neil Armstrong [Mon, 30 Dec 2024 10:30:56 +0000 (11:30 +0100)]
ufs: core: mark unexported functions as static

Mark the remaining local functions as static to avoid build
warnings.

Also drop the EXPORT_SYMBOL of ufshcd_map_desc_id_to_length.

Tested-by: Love Kumar <love.kumar@amd.com>
Link: https://lore.kernel.org/r/20241230-topic-ufs-cleanup-v2-2-4c6d7994a45d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoufs: core: include missing include/ufs.h
Neil Armstrong [Mon, 30 Dec 2024 10:30:55 +0000 (11:30 +0100)]
ufs: core: include missing include/ufs.h

Add missing ufs.h causing build warning on some symbols.

Tested-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Link: https://lore.kernel.org/r/20241230-topic-ufs-cleanup-v2-1-4c6d7994a45d@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoboard: odroid-n2: Update docs for signing
Baltazár Radics [Fri, 10 Jan 2025 11:11:24 +0000 (12:11 +0100)]
board: odroid-n2: Update docs for signing

The previous instructions resulted in a bootloader that wouldn't fit in
an MBR gap. I have updated the docs based on upstream's build process.

Signed-off-by: Baltazár Radics <baltazar.radics@gmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250110111335.9221-1-baltazar.radics@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
2 months agoarch: arm: meson: support Amlogic chip_id v1 and v2
Evgeny Bachinin [Mon, 10 Feb 2025 17:50:16 +0000 (20:50 +0300)]
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>
2 months agoarm: meson: sm: get rid of SM_CHIP_ID_SIZE
Evgeny Bachinin [Mon, 10 Feb 2025 17:50:15 +0000 (20:50 +0300)]
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>
2 months agoarm: meson: unify type being used for socinfo
Evgeny Bachinin [Mon, 10 Feb 2025 17:50:14 +0000 (20:50 +0300)]
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>
2 months agoconfigs: phycore_am62ax_a53_defconfig: Add SoM overlays to OF_OVERLAY_LIST
Wadim Egorov [Wed, 5 Mar 2025 04:58:38 +0000 (05:58 +0100)]
configs: phycore_am62ax_a53_defconfig: Add SoM overlays to OF_OVERLAY_LIST

Include SoM dt-overlays for DT control so we can include them
into our u-boot FIT image.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoarm: dts: k3-am62a-phycore-som-binman: Add SoM overlays
Wadim Egorov [Wed, 5 Mar 2025 04:58:37 +0000 (05:58 +0100)]
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>
2 months agoboard: phytec: common: Add phyCORE-AM62Ax
Daniel Schultz [Wed, 5 Mar 2025 04:58:36 +0000 (05:58 +0100)]
board: phytec: common: Add phyCORE-AM62Ax

Add the phyCORE-AM62Ax to our common board directory to
enable our SOM detection for this product.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoboard: phytec: common: k3: Make configure_capsule_updates() static
Wadim Egorov [Wed, 5 Mar 2025 04:58:35 +0000 (05:58 +0100)]
board: phytec: common: k3: Make configure_capsule_updates() static

This function is only used in the board.c file. Make it static.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoarch: arm: dts: k3-am625-phyboard-lyra: Add missing boot phase tag
Wadim Egorov [Wed, 5 Mar 2025 04:58:34 +0000 (05:58 +0100)]
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>
2 months agoarch: arm: dts: k3-am62a7-phyboard-lyra: Add missing boot phase tag
Wadim Egorov [Wed, 5 Mar 2025 04:58:33 +0000 (05:58 +0100)]
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>
2 months agoboard: phytec: phycore_am62ax: Add Network/SPI/DFU env variables
Wadim Egorov [Wed, 5 Mar 2025 04:58:32 +0000 (05:58 +0100)]
board: phytec: phycore_am62ax: Add Network/SPI/DFU env variables

Include the boot logic to boot via Network, from a OSPI/QSPI
NOR flash or via USB DFU.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoboard: phytec: phycore_am62x: Use custom k3_dfu.env fragment
Wadim Egorov [Wed, 5 Mar 2025 04:58:31 +0000 (05:58 +0100)]
board: phytec: phycore_am62x: Use custom k3_dfu.env fragment

TI's k3_dfu.env includes redundant dfu_alt_info_* data, some of which
is incompatible with our board configuration. Replace it with a custom
variant that better aligns with our setup, ensuring correct offsets and
eliminating unnecessary entries.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoconfigs: Add phycore_am62ax_r5_usbdfu_defconfig
Wadim Egorov [Wed, 5 Mar 2025 04:58:30 +0000 (05:58 +0100)]
configs: Add phycore_am62ax_r5_usbdfu_defconfig

This config includes the phycore_am62ax_r5_defconfig file as well as
the am62x_r5_usbdfu.config fragment. We need another defconfig
because the AM62Ax has not enough internal SRAM to support all boot
sources. The normal phycore_am62ax_r5_defconfig should allow to boot
from MMC and OSPI while this new defconfig allows to boot from USB.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agodoc: phytec: k3: Add a common part for Environment and EFI Capsules
Wadim Egorov [Wed, 5 Mar 2025 04:58:29 +0000 (05:58 +0100)]
doc: phytec: k3: Add a common part for Environment and EFI Capsules

Provide a common part for our K3 based boards including general details
about environment handling and EFI capsule updates.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoconfigs: phycore_am62ax_a53_defconfig: Enable capsule update
Wadim Egorov [Wed, 5 Mar 2025 04:58:28 +0000 (05:58 +0100)]
configs: phycore_am62ax_a53_defconfig: Enable capsule update

Enable raw & on disk capsule updates and provide configs required
for updating MTD devices. Also resync after savedefconfig.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoinclude: configs: phycore-am62ax: Define capsule FW names
Wadim Egorov [Wed, 5 Mar 2025 04:58:27 +0000 (05:58 +0100)]
include: configs: phycore-am62ax: Define capsule FW names

Define firmware names for phycore-am62ax capsules.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2 months agoarm: dts: k3-am62a-phycore-som-binman: Provide capsule nodes
Wadim Egorov [Wed, 5 Mar 2025 04:58:26 +0000 (05:58 +0100)]
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>
2 months agovepxress64: add guide for running FVP with TF-A
Harrison Mutai [Tue, 4 Mar 2025 16:52:02 +0000 (16:52 +0000)]
vepxress64: add guide for running FVP with TF-A

Add documentation on how to run FVP with U-Boot and TF-A. This helps
users configure and run U-Boot correctly on Arm models.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agovepxress64: disable CRC32 by default to prevent aborts
Harrison Mutai [Tue, 4 Mar 2025 16:52:01 +0000 (16:52 +0000)]
vepxress64: disable CRC32 by default to prevent aborts

On fast models, the CRC32 feature is disabled by default. When enabled
in U-Boot, it leads to synchronous aborts due to unrecognized
instructions. This change ensures CRC32 is disabled by default to
maintain compatibility.

Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
2 months agosandbox_vpl: Enable missing TPL_DM_I2C symbol
Tom Rini [Tue, 4 Mar 2025 20:32:35 +0000 (14:32 -0600)]
sandbox_vpl: Enable missing TPL_DM_I2C symbol

Currently this platform implicity builds CONFIG_TPL_DM_I2C support
without setting the symbol. Add it for clarity.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoserial: Add missing TPL_SYS_NS16550_SERIAL symbol
Tom Rini [Tue, 4 Mar 2025 20:24:36 +0000 (14:24 -0600)]
serial: Add missing TPL_SYS_NS16550_SERIAL symbol

On PowerPC platforms with TPL enabled and SPL_SYS_NS16550_SERIAL
enabled, today this builds under TPL as well due to how $(XPL_) is
defined. Add the TPL_SYS_NS16550_SERIAL itself for consistency and
clarity.

Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agoboard: beagle: Add support for BeagleY-AI
Robert Nelson [Mon, 3 Mar 2025 19:15:15 +0000 (13:15 -0600)]
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>
2 months agoMerge patch series "lmb: miscellaneous fixes and improvements"
Tom Rini [Tue, 18 Mar 2025 01:39:36 +0000 (19:39 -0600)]
Merge patch series "lmb: miscellaneous fixes and improvements"

Sughosh Ganu <sughosh.ganu@linaro.org> says:

The patch series contains some fixes and improvements in the lmb
code, along with addition of corresponding test cases for the changes
made.

The lmb_reserve() function currently does not check if the requested
reservation would overlap with existing reserved regions. While some
scenarios are being handled, some corner cases still exist. These are
being handled by patch 1, along with adding test cases for these
scenarios.

Patch 2 is handling the case of reserving a new region of memory, but
that region overlaps with an existing region. The current code only
handles one particular scenario, but prints a message for the other
scenario of an encompassing overlap and returns back. The patch
handles the encompassing overlap.

Patch 3 is an improvement whereby we allow coalescing a newly reserved
region with an existing region. The current code exits this check
prematurely.

Patch 4 is removing a now superfluous check for overlapping regions
with flag other than LMB_NONE. This now gets handled at an earlier
point in lmb_reserve().

Patch 5 is clubbing the functionality to check if two regions are
adjacent, or overlap, allowing some code re-use.

Patch 6 is optimising the lmb_alloc() function by having it call
_lmb_alloc_base() directly.

Link: https://lore.kernel.org/r/20250303133231.405279-1-sughosh.ganu@linaro.org
2 months agolmb: optimise the lmb allocation functions
Sughosh Ganu [Mon, 3 Mar 2025 13:32:31 +0000 (19:02 +0530)]
lmb: optimise the lmb allocation functions

The actual logic to allocate a region of memory is in the
_lmb_alloc_base() function. The lmb_alloc() API function calls
lmb_alloc_base(), which then calls _lmb_alloc_base() to do the
allocation. Instead, call the _lmb_alloc_base() directly from both the
allocation API's, and move the error message to the _lmb_alloc_base().

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 months agolmb: use a common function to check if regions overlap or are adjacent
Sughosh Ganu [Mon, 3 Mar 2025 13:32:30 +0000 (19:02 +0530)]
lmb: use a common function to check if regions overlap or are adjacent

The functions to check if the two said regions are adjacent or overlap
are pretty similar in nature. Club the functionality into a single
function lmb_regions_check() and return the appropriate return value
to signify this aspect.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 months agolmb: remove superfluous address overlap check from lmb_add_region_flags()
Sughosh Ganu [Mon, 3 Mar 2025 13:32:29 +0000 (19:02 +0530)]
lmb: remove superfluous address overlap check from lmb_add_region_flags()

U-Boot allows re-use of already reserved memory through the
lmb_reserve() and lmb_alloc_addr() API's. This memory re-use is
allowed only when the flag of the existing reserved region and that of
the requested region is LMB_NONE. A check was put in the
lmb_add_region_flags() in commit 8b8b35a4f5e to handle the scenario
where an already reserved region was re-requested with region flag
other than LMB_NONE -- the function then returns -EEXIST in such a
scenario.

The lmb_reserve() function now does a check for a reservation request
with existing reserved regions, and returns -EEXIST in case of an
overlap but when the flag check fails. Remove this now redundant check
from lmb_add_region_flags().

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
2 months agolmb: check for a region's coalescing with all existing regions
Sughosh Ganu [Mon, 3 Mar 2025 13:32:28 +0000 (19:02 +0530)]
lmb: check for a region's coalescing with all existing regions

The lmb_add_region_flags() first checks if the new region to be added
can be coalesced with existing regions. The check stops if the two
regions are adjecent but their flags do not match. However, it is
possible that the newly added region might be adjacent with the next
existing region and with matching flags. Check for this possibility by
not breaking out of the loop.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agolmb: handle scenario of encompassing overlap
Sughosh Ganu [Mon, 3 Mar 2025 13:32:27 +0000 (19:02 +0530)]
lmb: handle scenario of encompassing overlap

The lmb_fix_over_lap_regions() function is called if the added region
overlaps with an existing region. The function then fixes the overlap
and removes the redundant region. However, it makes certain
assumptions. One assumption is that the overlap would not encompass
the existing region. Another assumption is that the overlap only
occurs between two regions -- the scenario of the added region
overlapping multiple existing regions is not being handled. Handle
these cases by instead calling lmb_resize_regions(). Also remove the
now superfluous lmb_fix_over_lap_regions().

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agolmb: check if a region can be reserved by lmb_reserve()
Sughosh Ganu [Mon, 3 Mar 2025 13:32:26 +0000 (19:02 +0530)]
lmb: check if a region can be reserved by lmb_reserve()

The logic used in lmb_alloc() takes into consideration the existing
reserved regions, and ensures that the allocated region does not
overlap with any existing allocated regions. The lmb_reserve()
function is not doing any such checks -- the requested region might
overlap with an existing region. This also shows up with
lmb_alloc_addr() as this function ends up calling lmb_reserve().

Add a function which checks if the region requested is overlapping
with an existing reserved region, and allow for the reservation to
happen only if both the regions have LMB_NONE flag, which allows
re-requesting of the region. In any other scenario of an overlap, have
lmb_reserve() return -EEXIST, implying that the requested region is
already reserved.

Add corresponding test cases which check for overlapping reservation
requests made through lmb_reserve() and lmb_alloc_addr(). And while
here, fix some of the comments in the test function being touched.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoMerge branch 'next' of git://source.denx.de/u-boot-usb into next
Tom Rini [Mon, 17 Mar 2025 16:18:59 +0000 (10:18 -0600)]
Merge branch 'next' of git://source.denx.de/u-boot-usb into next

- Add USB support on Starfive JH7110

2 months agoMerge branch 'nand-next' of https://source.denx.de/u-boot/custodians/u-boot-nand...
Tom Rini [Mon, 17 Mar 2025 16:18:18 +0000 (10:18 -0600)]
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.

3 months agoconfigs: starfive: Add visionfive2 cadence USB configuration
Minda Chen [Thu, 6 Mar 2025 06:20:31 +0000 (14:20 +0800)]
configs: starfive: Add visionfive2 cadence USB configuration

Add cadence USB confiuration.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Tested-by: E Shattow <lucent@gmail.com>
3 months agospl: starfive: visionfive2: Disable USB overcurrent pin by default.
Minda Chen [Thu, 6 Mar 2025 06:20:30 +0000 (14:20 +0800)]
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>
3 months agousb: cdns: starfive: Add cdns USB driver
Minda Chen [Thu, 6 Mar 2025 06:20:29 +0000 (14:20 +0800)]
usb: cdns: starfive: Add cdns USB driver

Add Starfive cdns USB3 wrapper driver.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: E Shattow <lucent@gmail.com>
3 months agousb: cdns: starfive: Get dr mode from wrapper device dts node
Minda Chen [Thu, 6 Mar 2025 06:20:28 +0000 (14:20 +0800)]
usb: cdns: starfive: Get dr mode from wrapper device dts node

Cdns core driver also get dr mode from wrapper devcie dts node
to make it is same with Starfive cdns USB Linux kernel driver,
Starfive 7110 OF_UPSTREAM is enabled

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Marek Vasut <marex@denx.de>
3 months agophy: starfive: Add Starfive JH7110 PCIe 2.0 PHY driver
Minda Chen [Thu, 6 Mar 2025 06:20:27 +0000 (14:20 +0800)]
phy: starfive: Add Starfive JH7110 PCIe 2.0 PHY driver

Add Starfive JH7110 PCIe 2.0 PHY driver, which is generic
PHY driver and can be used as USB 3.0 driver.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Tested-by: E Shattow <lucent@gmail.com>
3 months agophy: starfive: Add Starfive JH7110 USB 2.0 PHY driver
Minda Chen [Thu, 6 Mar 2025 06:20:26 +0000 (14:20 +0800)]
phy: starfive: Add Starfive JH7110 USB 2.0 PHY driver

Add Starfive JH7110 USB 2.0 PHY driver, which is generic
PHY driver.

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Tested-by: E Shattow <lucent@gmail.com>
3 months agousb: cdns3: Set USB PHY mode in cdns3_drd_update_mode()
Minda Chen [Thu, 6 Mar 2025 06:20:25 +0000 (14:20 +0800)]
usb: cdns3: Set USB PHY mode in cdns3_drd_update_mode()

USB PHY maybe need to set PHY mode in different USB
dr mode. So translate USB PHY mode to generic PHY mode
and call generic_phy_set_mode().

Signed-off-by: Minda Chen <minda.chen@starfivetech.com>
Reviewed-by: Marek Vasut <marex@denx.de>
3 months agomtd: rawnand: meson: always use OOB bytes during write
Arseniy Krasnov [Sun, 22 Dec 2024 21:23:29 +0000 (00:23 +0300)]
mtd: rawnand: meson: always use OOB bytes during write

If 'oob_required' is not set by the caller (for example 'oobbuf' is NULL),
then driver doesn't copy OOB data from 'oob_poi' to special controller
structures, so zeroes will be written as OOB. But, generic raw NAND logic
in 'nand_base.c' already handles case when OOB is not required to write by
filling 'oob_poi' with 0xFF's. So let's remove 'oob_required' check to
always read 'oob_poi' data for OOB.

Kernel driver (drivers/mtd/nand/raw/meson_nand.c) works in the same way,
so need to keep same behaviour here.

Fixes: c2e8c4d09a7a ("mtd: rawnand: Meson NAND controller support")
Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
3 months agoMerge tag 'dm-pull-15mar25' of git://git.denx.de/u-boot-dm into next
Tom Rini [Sat, 15 Mar 2025 14:19:31 +0000 (08:19 -0600)]
Merge tag 'dm-pull-15mar25' of git://git.denx.de/u-boot-dm into next

Sync up on test renames

3 months agotest: Make net tests depend on CONFIG_CMD_NET
Simon Glass [Sun, 9 Feb 2025 16:07:19 +0000 (09:07 -0700)]
test: Make net tests depend on CONFIG_CMD_NET

This fails on samus_tpl as there is no 'net' command.

   => net list
   Unknown command 'net' - try 'help' !

Fix it by adding a condition for the test.

Add a blank line to keep pylint happy.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agotest/py: Show info about module-loading
Simon Glass [Sun, 9 Feb 2025 16:07:18 +0000 (09:07 -0700)]
test/py: Show info about module-loading

It is sometimes tricky to figure out what modules test.py is loading
when it starts up. The result can be a silent failure with no clue as to
what when wrong.

Add a section which lists the modules loaded as well as those not
found.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agotest/py: Drop assigning ubman to cons
Simon Glass [Sun, 9 Feb 2025 16:07:17 +0000 (09:07 -0700)]
test/py: Drop assigning ubman to cons

Now that we have a shorter name, we don't need this sort of thing. Just
use ubman instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
3 months agotest/py: Drop importing utils as util
Simon Glass [Sun, 9 Feb 2025 16:07:16 +0000 (09:07 -0700)]
test/py: Drop importing utils as util

Now that we have a shorter name, we don't need this sort of thing.
Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android
3 months agotest/py: Drop u_boot_ prefix on test files
Simon Glass [Sun, 9 Feb 2025 16:07:15 +0000 (09:07 -0700)]
test/py: Drop u_boot_ prefix on test files

We know this is U-Boot so the prefix serves no purpose other than to
make things longer and harder to read. Drop it and rename the files.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # test_android / test_dfu
3 months agotest/py: Shorten u_boot_console
Simon Glass [Sun, 9 Feb 2025 16:07:14 +0000 (09:07 -0700)]
test/py: Shorten u_boot_console

This fixture name is quite long and results in lots of verbose code.
We know this is U-Boot so the 'u_boot_' part is not necessary.

But it is also a bit of a misnomer, since it provides access to all the
information available to tests. It is not just the console.

It would be too confusing to use con as it would be confused with
config and it is probably too short.

So shorten it to 'ubman'.

Signed-off-by: Simon Glass <sjg@chromium.org>
Link: https://lore.kernel.org/u-boot/CAFLszTgPa4aT_J9h9pqeTtLCVn4x2JvLWRcWRD8NaN3uoSAtyA@mail.gmail.com/
3 months agoconfigs: nand2_defconfig: Enable configs for nand boot
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:27 +0000 (00:18 +0800)]
configs: nand2_defconfig: Enable configs for nand boot

Enable configs for nand boot.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: Kconfig: Add SYS_NAND_PAGE_SIZE dependency
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:32 +0000 (00:18 +0800)]
drivers: mtd: nand: Kconfig: Add SYS_NAND_PAGE_SIZE dependency

Add SYS_NAND_PAGE_SIZE dependency for cadence NAND.
This config is needed as the SPL driver will use this parameter
to read uboot-proper image in NAND during booting.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: Enabled Kconfig and Makefile for Cadence-SPL
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:30 +0000 (00:18 +0800)]
drivers: mtd: nand: Enabled Kconfig and Makefile for Cadence-SPL

Enable the Kconfig and Makefile for the Cadence-Nand
SPL support in agilex5 family device.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: spl: Add support for nand SPL load image
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:29 +0000 (00:18 +0800)]
drivers: mtd: nand: spl: Add support for nand SPL load image

Add support for spl nand to load binary image from NAND
to RAM. Leverage the existing nand_spl_load_image from nand_spl_loaders.c

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: base: Add support for Hardware ECC for check bad block
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:28 +0000 (00:18 +0800)]
drivers: mtd: nand: base: Add support for Hardware ECC for check bad block

Leverage linux code to support hardware ECC interface
to verify nand bad block.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: nand: Enabled Kconfig and Makefile for cdns-nand
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:26 +0000 (00:18 +0800)]
drivers: nand: Enabled Kconfig and Makefile for cdns-nand

Enable the Kconfig and Makefile for the
Cadence NAND driver for the agilex5 family device.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: cadence: Use bounce buffer
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:25 +0000 (00:18 +0800)]
drivers: mtd: nand: cadence: Use bounce buffer

Enable nand to use bounce buffer. In bounce buffer,
read/write buf will use cadence->buf which has been allocated
using malloc. This will align the memory and avoid memory to be
allocated in different addresses.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: cadence: Poll for desc complete status
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:24 +0000 (00:18 +0800)]
drivers: mtd: nand: cadence: Poll for desc complete status

Poll for thread complete status to ensure the
descriptor processing is complete. If complete then can ensure
controller already update the descriptor status.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: cadence: Flush & invalidate dma descriptor
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:23 +0000 (00:18 +0800)]
drivers: mtd: nand: cadence: Flush & invalidate dma descriptor

Ensure ddr memory is updated with the data from dcache.
This would help to ensure cdma always reading the latest dma descriptor
from ddr memory.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: cadence: Support cmd SET_FEATURES & GET_FEATURES
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:22 +0000 (00:18 +0800)]
drivers: mtd: nand: cadence: Support cmd SET_FEATURES & GET_FEATURES

Support NAND_CMD_SET_FEATURES & NAND_CMD_GET_FEATURES.
These commands is one of the basic commands of NAND. The parameters get
from these commands will be used to set timing mode
of NAND data interface.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: cadence: Add support for NAND_CMD_RESET
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:21 +0000 (00:18 +0800)]
drivers: mtd: nand: cadence: Add support for NAND_CMD_RESET

Support nand reset command for Cadence Nand Driver.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: cadence: Add support for NAND_CMD_PARAM
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:20 +0000 (00:18 +0800)]
drivers: mtd: nand: cadence: Add support for NAND_CMD_PARAM

Add support for reading param page of NAND device.
These paramaters are unique and used for identification purpose.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: cadence: Add support for readid command
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:19 +0000 (00:18 +0800)]
drivers: mtd: nand: cadence: Add support for readid command

Add support for readid command in Cadence NAND driver.
The id is unique and used for flash identification.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: cadence: Add support for read status command
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:18 +0000 (00:18 +0800)]
drivers: mtd: nand: cadence: Add support for read status command

Add support for read status command
in Cadence NAND driver. This status bit is important to check
whether the flash is write-protected.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agodrivers: mtd: nand: Add driver for Cadence Nand
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:17 +0000 (00:18 +0800)]
drivers: mtd: nand: Add driver for Cadence Nand

Enable driver for Cadence NAND for the family
device agilex5. This driver is leveraged from the path
/drivers/mtd/nand/raw/cadence-nand-controller.c from the
stable version 6.11.2.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agoarm: dts: agilex5: Enabled cdns-nand dts setting
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:16 +0000 (00:18 +0800)]
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>
3 months agodt: nand: add cadence nand dt-bindings
Dinesh Maniyam [Wed, 26 Feb 2025 16:18:15 +0000 (00:18 +0800)]
dt: nand: add cadence nand dt-bindings

The Cadence NAND is a configurable mtd raw block which
supports multiple options for chipsets, clocking and reset structure, and
feature list.

Signed-off-by: Dinesh Maniyam <dinesh.maniyam@intel.com>
3 months agoMerge patch series "Enable USB MSC Boot for AM62, AM62A and AM62P"
Tom Rini [Fri, 14 Mar 2025 18:28:13 +0000 (12:28 -0600)]
Merge patch series "Enable USB MSC Boot for AM62, AM62A and AM62P"

Siddharth Vadapalli <s-vadapalli@ti.com> says:

This series adds config fragment for enabling USB MSC boot and USB
Storage devices which are applicable to AM62, AM62A and AM62P SoCs.

Series has been tested on AM62A7-SK, AM625-SK and AM62P5-SK for USB MSC
boot where the bootloaders were generated in the following manner:
1. AM62A7-SK (AM62A SoC):
- tiboot3.bin
=> am62ax_evm_r5_defconfig + am62x_r5_usbmsc.config
- tispl.bin and u-boot.img
=> am62ax_evm_a53_defconfig + am62x_a53_usbmsc.config
2. AM625-SK (AM62 SoC):
- tiboot3.bin
=> am62x_evm_r5_defconfig + am62x_r5_usbmsc.config
- tispl.bin and u-boot.img
=> am62x_evm_a53_defconfig + am62x_a53_usbmsc.config
3. AM62P5-SK (AM62P SoC):
- tiboot3.bin
=> am62px_evm_r5_defconfig + am62x_r5_usbmsc.config
- tispl.bin and u-boot.img
=> am62px_evm_a53_defconfig + am62x_a53_usbmsc.config

The images were flashed to a USB Flash Drive and were connected to the
Type-C interface on each of the boards which supports USB MSC Boot.

Logs corresponding to this series:
1. AM62A7-SK:
https://gist.github.com/Siddharth-Vadapalli-at-TI/3518cba3edc57bf52d06a7df932928ca
2. AM625-SK:
https://gist.github.com/Siddharth-Vadapalli-at-TI/098568be7b482436d27fdc8adae15ce4
3. AM62P5-SK:
https://gist.github.com/Siddharth-Vadapalli-at-TI/50e29073033668e7d904a785bfbc9c0b

The following device-tree changes were made across all of the boards:
https://gist.github.com/Siddharth-Vadapalli-at-TI/2afb913838c1d4005bc059910c09ab4b

Link: https://lore.kernel.org/r/20250301080049.965438-1-s-vadapalli@ti.com
3 months agoconfigs: am62x_a53: introduce fragment for USB MSC boot
Siddharth Vadapalli [Sat, 1 Mar 2025 08:00:49 +0000 (13:30 +0530)]
configs: am62x_a53: introduce fragment for USB MSC boot

Introduce the config fragment for enabling USB MSC boot. USB MSC boot
involves fetching the next stage of the bootloader from a USB Mass Storage
device such as a USB Flash Drive with the USB controller on the SoC acting
as the USB Host.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
3 months agoconfigs: am62x_r5: introduce fragment for USB MSC boot
Siddharth Vadapalli [Sat, 1 Mar 2025 08:00:48 +0000 (13:30 +0530)]
configs: am62x_r5: introduce fragment for USB MSC boot

Introduce the config fragment for enabling USB MSC boot. USB MSC boot
involves fetching the next stage of the bootloader from a USB Mass Storage
device such as a USB Flash Drive with the USB controller on the SoC acting
as the USB Host.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
3 months agocommon: console: Delete obsolete VIDCONSOLE_AS_{LCD, NAME} options
Dragan Simic [Sun, 2 Mar 2025 14:52:57 +0000 (15:52 +0100)]
common: console: Delete obsolete VIDCONSOLE_AS_{LCD, NAME} options

The configuration options CONFIG_VIDCONSOLE_AS_LCD and CONFIG_VIDCONSOLE_AS_
NAME have been marked as obsolete and scheduled for deletion in late 2020.

That's already long overdue and the last remaining consumers of these options
have already migrated to using "vidconsole" in their "stdout" and "stderr"
environment variables, so let's delete these two configuration options.

Signed-off-by: Dragan Simic <dsimic@manjaro.org>
Acked-by: Soeren Moch <smoch@web.de> # tbs2910
3 months agoarm: dts: npcm7xx: correct the timer node
Jim Liu [Tue, 25 Feb 2025 01:45:05 +0000 (09:45 +0800)]
arm: dts: npcm7xx: correct the timer node

Correct the timer node of dts

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
3 months agoMerge tag 'mmu-next-14032025' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 14 Mar 2025 15:31:36 +0000 (09:31 -0600)]
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

3 months agoarm64: Enable RW, RX and RO mappings for the relocated binary
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:43 +0000 (15:54 +0200)]
arm64: Enable RW, RX and RO mappings for the relocated binary

Now that we have everything in place switch the page permissions for
.rodata, .text and .data just after we relocate everything in top of the
RAM.

Unfortunately we can't enable this by default, since we have examples of
U-Boot crashing due to invalid access. This usually happens because code
defines const variables that it later writes. So hide it behind a Kconfig
option until we sort it out.

It's worth noting that EFI runtime services are not covered by this
patch on purpose. Since the OS can call SetVirtualAddressMap which can
relocate runtime services, we need to set them to RX initially but remap
them as RWX right before ExitBootServices.

Link: https://lore.kernel.org/u-boot/20250129-rockchip-pinctrl-const-v1-0-450ccdadfa7e@cherry.de/
Link: https://lore.kernel.org/u-boot/20250130133646.2177194-1-andre.przywara@arm.com/
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agotreewide: Add a function to change page permissions
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:42 +0000 (15:54 +0200)]
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>
3 months agoarm64: mmu_change_region_attr() add an option not to break PTEs
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:41 +0000 (15:54 +0200)]
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>
3 months agoarm: Prepare linker scripts for memory permissions
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:40 +0000 (15:54 +0200)]
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>
3 months agodoc: update meminfo with arch specific information
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:39 +0000 (15:54 +0200)]
doc: update meminfo with arch specific information

Since we added support in meminfo to dump live page tables, describe
the only working architecture for now (aarch64) and add links to public
documentation for further reading.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
3 months agomeminfo: add memory details for armv8
Ilias Apalodimas [Thu, 20 Feb 2025 13:54:38 +0000 (15:54 +0200)]
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>
3 months agoMerge tag 'u-boot-imx-next-20250313' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Thu, 13 Mar 2025 22:45:19 +0000 (16:45 -0600)]
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.

3 months agoARM: dts: imx: Drop bogus regulator extras on DH i.MX6 DHCOM DRC02
Marek Vasut [Tue, 11 Mar 2025 01:34:18 +0000 (02:34 +0100)]
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>
3 months agoKconfig: Introduce CONFIG_WERROR
Paul Barker [Fri, 28 Feb 2025 10:04:33 +0000 (10:04 +0000)]
Kconfig: Introduce CONFIG_WERROR

Add a new config option under "General setup" to enable the -Werror flag
when building U-Boot. This is useful during development to help catch
mistakes.

This is based on a similar config option added to the Linux kernel by
Linus in 2021 - see Linux commit 3fe617ccafd6 ("Enable '-Werror' by
default for all kernel builds"). The modification of KBUILD_CFLAGS is
done in Makefile.extrawarn, matching where it was moved in the kernel by
Linux commit e88ca24319e4 ("kbuild: consolidate warning flags in
scripts/Makefile.extrawarn").

Signed-off-by: Paul Barker <paul.barker.ct@bp.renesas.com>
3 months agolib: rsa: add NULL check for 'algo' in
Anton Moryakov [Tue, 25 Feb 2025 13:53:27 +0000 (16:53 +0300)]
lib: rsa: add NULL check for 'algo' in

- Check return value of fdt_getprop for NULL.
- Return -EFAULT if 'algo' property is missing.
- Prevent NULL pointer dereference in strcmp."

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
3 months agomemory: ti-gpmc: Alloc per driver private struct
Vignesh Raghavendra [Wed, 5 Mar 2025 08:41:30 +0000 (14:11 +0530)]
memory: ti-gpmc: Alloc per driver private struct

Driver uses dev_get_priv() but never allocates it in its
declaration leading to various crashes. Fix this by explicitly
allocating the storage.

Fixes: 9b0b5648d6e4 ("memory: Add TI GPMC driver")
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
3 months agoboard: ti: j784s4: Update Resource Management configs
Vaishnav Achath [Fri, 28 Feb 2025 05:42:22 +0000 (11:12 +0530)]
board: ti: j784s4: Update Resource Management configs

Update rm-cfg.yaml and tifs-rm-cfg.yaml to account for the
changes added in the K3 Resource Partitioning Tool v1.18

The change enables resource sharing between A72_2 and MAIN_0_R5_0
for the BCDMA CSI RX and TX channels, J784S4 supports upto 12
CSI cameras and 16 channels would not be enough for all such use
cases for RTOS and Linux, thus sharing of resources in needed. Resource
sharing between A72 and R5 for BCDMA CSI channels allow Linux to use 32
channels at a time.

Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
[n-francis@ti.com: rebased and sent on behalf]
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Udit Kumar <u-kumar1@ti.com>
3 months agocmd: Drop last reference to CMD_REISERFS
Tom Rini [Thu, 27 Feb 2025 20:50:48 +0000 (14:50 -0600)]
cmd: Drop last reference to CMD_REISERFS

While the code was removed in commit 3766a249a3c0 ("fs: drop reiserfs")
this reference in the Makefile was missed. Remove it now.

Fixes: 3766a249a3c0 ("fs: drop reiserfs")
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agomach-k3: common_fdt: create a reserved memory node
Bryan Brattlof [Thu, 27 Feb 2025 17:14:41 +0000 (11:14 -0600)]
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>
3 months agotest: event: Correct usage of IS_ENABLED() macro in test/common/event.c
Tom Rini [Wed, 26 Feb 2025 20:31:09 +0000 (14:31 -0600)]
test: event: Correct usage of IS_ENABLED() macro in test/common/event.c

This file was using IS_ENABLED() to test for CONFIG flags but omitted
the CONFIG_ prefix and so did not work as expected.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agotools: add HOSTCFLAGS from openssl pkg-config
Raymond Mao [Wed, 26 Feb 2025 14:19:51 +0000 (06:19 -0800)]
tools: add HOSTCFLAGS from openssl pkg-config

HOSTCFLAGS of some tools components (image-host, rsa-sign and
ecdsa-libcrypto) depend on the directory where openssl is installed.
Add them via pkg-config.
This fixes a potential build failure in tools when openssl in installed
in varied directories.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
3 months agoDockerfile: Add missing 'rm -rf /tmp/coreboot-24.08'
Tom Rini [Wed, 12 Feb 2025 22:24:15 +0000 (16:24 -0600)]
Dockerfile: Add missing 'rm -rf /tmp/coreboot-24.08'

We had missed removing the coreboot directory once done, fix this.

Signed-off-by: Tom Rini <trini@konsulko.com>
3 months agomailbox: add i.MX Messaging Unit (MU) driver
Peng Fan [Tue, 4 Mar 2025 06:57:40 +0000 (14:57 +0800)]
mailbox: add i.MX Messaging Unit (MU) driver

This patch provides a driver for i.MX Messaging Unit (MU) using the
commom mailbox framework.

This is ported from Linux (v6.12.8) driver
drivers/mailbox/imx-mailbox.c. Its commit SHA is:
39d7d6177f0c ("mailbox: imx: use device name in interrupt name")

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Alice Guo <alice.guo@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
3 months agoARM: dts: imx: Drop bogus regulator extras on DH i.MX6 DHCOM DRC02
Marek Vasut [Tue, 11 Mar 2025 01:34:18 +0000 (02:34 +0100)]
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>
3 months agoimx8m: soc: cope with existing optee node
Vincent Stehlé [Mon, 10 Mar 2025 12:36:21 +0000 (13:36 +0100)]
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>