pandora-u-boot.git
8 weeks agoMerge patch series "Enable UNIT_TEST for all qemu* generic targets"
Tom Rini [Tue, 22 Apr 2025 18:26:44 +0000 (12:26 -0600)]
Merge patch series "Enable UNIT_TEST for all qemu* generic targets"

Jerome Forissier <jerome.forissier@linaro.org> says:

Enable CONFIG_UNIT_TEST in most of the configs/qemu*_defconfig files
to increase test coverage in CI, and fix what needs to be fixed.

Link: https://lore.kernel.org/r/20250416135744.1995084-1-jerome.forissier@linaro.org
8 weeks agoMerge patch series "ut: fix print_guid() and enable UNIT_TEST for qemu_arm64"
Tom Rini [Tue, 22 Apr 2025 18:54:36 +0000 (12:54 -0600)]
Merge patch series "ut: fix print_guid() and enable UNIT_TEST for qemu_arm64"

Jerome Forissier <jerome.forissier@linaro.org> says:

There is a bug in the print_guid() unit test in test/common/print.c when
PARTITION_TYPE_GUID is not enabled but either CMD_EFIDEBUG or EFI are.

The first patch fixes the issue and the second one enables UNIT_TEST in
the qemu_arm64 defconfig so that the unit tests are run in CI (this
platform has CMD_EFIDEBUG so the bug applies).

Link: https://lore.kernel.org/r/20250416074839.1267396-1-jerome.forissier@linaro.org
8 weeks agoqemu-arm64: enable UNIT_TEST
Jerome Forissier [Wed, 16 Apr 2025 07:48:21 +0000 (09:48 +0200)]
qemu-arm64: enable UNIT_TEST

Enable CONFIG_UNIT_TEST in configs/qemu_arm64_defconfig so that the unit
tests are run in CI.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
8 weeks agolib/uuid.c: use unique name for PARTITION_SYSTEM_GUID
Jerome Forissier [Wed, 16 Apr 2025 07:48:20 +0000 (09:48 +0200)]
lib/uuid.c: use unique name for PARTITION_SYSTEM_GUID

The name defined for PARTITION_SYSTEM_GUID in list_guid[] depends on
configuration options. It is "system" if CONFIG_PARTITION_TYPE_GUID is
enabled or "System Partition" if CONFIG_CMD_EFIDEBUG or CONFIG_EFI are
enabled. In addition, the unit test in test/common/print.c is incorrect
because it expects only "system" (or a hex GUID).

Make things more consistent by using a clear and unique name: "EFI
System Partition" whatever the configuration, and update the unit test
accordingly.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
8 weeks agoconfigs: enable CONFIG_UNIT_TEST for all qemu* generic targets
Jerome Forissier [Wed, 16 Apr 2025 13:57:31 +0000 (15:57 +0200)]
configs: enable CONFIG_UNIT_TEST for all qemu* generic targets

The qemu* "generic" targets (i.e. not those emulating a particular
board) are typically used for testing as many features as possible,
especially in CI so it makes sense to have UNIT_TEST enabled for
all of the defconfigs for these targets.

Not enabling UNIT_TEST in qemu-x86_defconfig due to:

    LD      u-boot
  ld.bfd: section .rel.dyn VMA wraps around address space
  ld.bfd: section .start16 LMA [fffff800,fffff86f] overlaps section .rel.dyn LMA [ffffb77c,0002ac93]
  make: *** [Makefile:1824: u-boot] Error 1

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
8 weeks agotest: run some test commands only if HUSH_PARSER is enabled
Jerome Forissier [Wed, 16 Apr 2025 13:57:30 +0000 (15:57 +0200)]
test: run some test commands only if HUSH_PARSER is enabled

Some test commands (such as "false", or the empty string) need
CONFIG_HUSH_PARSER=y. Fix test/cmd/command.c.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
8 weeks agoMerge tag 'i2cfixes-for-2025.07-rc1' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 22 Apr 2025 15:36:13 +0000 (09:36 -0600)]
Merge tag 'i2cfixes-for-2025.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-i2c

i2c updates for v2025.07-rc1

- omap24xx_i2c: Enable Repeated Start functionality
  add Repeated Start functionality for the DM_I2C xfer
  API (omap_i2c_xfer()

  from Aniket Limaye

- mediatek i2c driver
  fixes from Martin
  - add end marker for struct udevice_id mtk_i2c_ids
  - remove duplicate entry in mt_i2c_regs_v1

8 weeks agoMerge tag 'u-boot-socfpga-next-20250422' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 22 Apr 2025 13:59:38 +0000 (07:59 -0600)]
Merge tag 'u-boot-socfpga-next-20250422' of https://source.denx.de/u-boot/custodians/u-boot-socfpga

This pull request contains updates for the SoCFPGA platform, targeting
the 2025.07 release cycle. Highlights include enhancements to Agilex5
support, improvements in DDR error handling, and bridge reset handling
for SoC64 devices.

Key updates:

Agilex5 platform enhancements:
  *   New MMU region mappings and memory layout updates using
      LMB_ARCH_MEM_MAP.
  *   Fixes for bloblist configuration, kernel FIT image generation, and
      VAB flow enablement.
  *   GPIO pin control added for SDIO selection.
  *   Marvell PHY driver enabled in defconfig.

Agilex5 / SoC64 DDR subsystem:
  *   Added ECC debug improvements for IOSSM.
  *   Introduced LPDDR inline ECC support.
  *   Resolved size calculation overflow in memory driver.

SoC64 improvements:
  *   Enhanced mailbox communication with the SDM to reflect various
      boot stage transitions.
  *   Implemented F2S bridge reset support and updated related reset
      manager registers.
  *   Expanded SoC64 CPU info reporting.

General maintenance:
  *   Additional peripherals released from reset for Arria10.
  *   Cleanup of legacy or incorrect Kconfig implications.

This patch set has been tested on Agilex 5 devkit.

Passing all pipeline tests at:
https://source.denx.de/u-boot/custodians/u-boot-socfpga/-/pipelines/25867

8 weeks agoi2c: mediatek: remove duplicate entry in mt_i2c_regs_v1[]
Martin Schiller [Wed, 16 Apr 2025 06:29:19 +0000 (08:29 +0200)]
i2c: mediatek: remove duplicate entry in mt_i2c_regs_v1[]

This removes a duplicate entry in mt_i2c_regs_v1[].

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
8 weeks agoi2c: mediatek: add missing empty entry at end of mkt_i2c_ids[]
Martin Schiller [Wed, 16 Apr 2025 06:29:18 +0000 (08:29 +0200)]
i2c: mediatek: add missing empty entry at end of mkt_i2c_ids[]

This adds the missing empty entry at the end of mtk_i2c_ids[].

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Reviewed-by: Heiko Schocher <hs@denx.de>
8 weeks agodrivers: i2c: Kconfig: Add CONFIG_SYS_I2C_OMAP24XX_REPEATED_START
Aniket Limaye [Tue, 22 Apr 2025 10:19:52 +0000 (15:49 +0530)]
drivers: i2c: Kconfig: Add CONFIG_SYS_I2C_OMAP24XX_REPEATED_START

Add a Kconfig option to disable sending Stop conditions between multiple
i2c_msgs within a single xfer. Enable this config by default for ARCH_K3
platforms.

Signed-off-by: Aniket Limaye <a-limaye@ti.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
8 weeks agoi2c: omap24xx_i2c: support CONFIG for repeated start in DM_I2C xfer
Aniket Limaye [Tue, 22 Apr 2025 10:19:51 +0000 (15:49 +0530)]
i2c: omap24xx_i2c: support CONFIG for repeated start in DM_I2C xfer

Repeated Start Condition (Sr) can be used to transfer multiple i2c msgs
without sending a Stop condition (P). So far, the driver default was to
always send a Stop condition after every i2c msg.

Add support for a config option (CONFIG_SYS_I2C_OMAP24XX_REPEATED_START)
to disable sending the Stop condition by default. If this config is
enabled, Stop condition will be sent only if explicitly requested in the
msg flags OR if it is the last msg in the transfer.

Consequently, handle the Repeated Start condition (Sr) in the next msg
by not calling the wait_for_bb() check since it will simply timeout in
the absence of a stop condition (BB will be 1 until Stop is programmed)

Signed-off-by: Aniket Limaye <a-limaye@ti.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
8 weeks agoi2c: omap24xx_i2c: Use new function __omap24_i2c_xfer_msg()
Aniket Limaye [Tue, 22 Apr 2025 10:19:50 +0000 (15:49 +0530)]
i2c: omap24xx_i2c: Use new function __omap24_i2c_xfer_msg()

Remove __omap24_i2c_read/write() usage from omap_i2c_xfer() in favour of
the more flexible __omap24_i2c_xfer_msg().
Consequently, these are also no longer needed when DM_I2C is enabled.

New function __omap24_i2c_xfer_msg() will take care of individual read
OR write transfers with a target device. It goes through below sequence:
- Program the provided Target Chip address (OMAP_I2C_SA_REG)
- Program the provided Data len (OMAP_I2C_CNT_REG)
- Program the provided Control register flags (OMAP_I2C_CON_REG)
- Read from or Write to the provided Data buffer (OMAP_I2C_DATA_REG)

For a detailed programming guide, refer to the TRM[0] (12.1.3.4 I2C
Programming Guide).

This patch by itself should be a transparent change. However this is
needed for implementing a proper Repeated Start (Sr) functionality for
i2c_msgs.

Previous implementation for omap_i2c_xfer called __omap24_i2c_read/write
functions, with hardcoded addr=0 and alen=0 for each i2c_msg. Each of
these calls would program the registers always with a Stop bit set, not
allowing for a repeated start between i2c_msgs in the same xfer().

[0]: https://www.ti.com/lit/zip/spruj28 (TRM)

Signed-off-by: Aniket Limaye <a-limaye@ti.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
8 weeks agoi2c: omap24xx_i2c: Remove unused CONFIG_I2C_REPEATED_START
Aniket Limaye [Tue, 22 Apr 2025 10:19:49 +0000 (15:49 +0530)]
i2c: omap24xx_i2c: Remove unused CONFIG_I2C_REPEATED_START

Remove unused piece of code under CONFIG_I2C_REPEATED_START which does
not have any Kconfig entry at all.

Signed-off-by: Aniket Limaye <a-limaye@ti.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
8 weeks agoddr: altera: iossm: Enhance debug information for ECC errors
Tingting Meng [Mon, 7 Apr 2025 02:47:24 +0000 (10:47 +0800)]
ddr: altera: iossm: Enhance debug information for ECC errors

ECC debug information was enhanced to improve the readability of error
messages.

Signed-off-by: Tingting Meng <tingting.meng@altera.com>
8 weeks agoddr: altera: agilex5: LPDDRs in-line ECC support
Tingting Meng [Tue, 15 Apr 2025 06:50:51 +0000 (14:50 +0800)]
ddr: altera: agilex5: LPDDRs in-line ECC support

In-line ECC support was added for LPDDR by reserving the last one-eighth
of the memory space for ECC data. Full memory initialization using the
BIST MEM INIT mailbox command, based on address and size, is required to
correctly generate ECC data and enable proper ECC logic verification.

Signed-off-by: Tingting Meng <tingting.meng@altera.com>
8 weeks agoarm: dts: agilex5: Update CCU configuration
Tingting Meng [Tue, 15 Apr 2025 01:55:35 +0000 (09:55 +0800)]
arm: dts: agilex5: Update CCU configuration

Cache allocation for dirty writes in the CCU system cache was disabled
for performance optimization.

Signed-off-by: Tingting Meng <tingting.meng@altera.com>
8 weeks agoarm: socfpga: socfpga_soc64: Enable LMB_ARCH_MEM_MAP
Tingting Meng [Mon, 10 Mar 2025 07:31:24 +0000 (15:31 +0800)]
arm: socfpga: socfpga_soc64: Enable LMB_ARCH_MEM_MAP

LMB_ARCH_MEM_MAP is enabled, and lmb_arch_add_memory() is introduced to
correctly handle memory reservations for the second and third DDR
memory banks.

Signed-off-by: Tingting Meng <tingting.meng@altera.com>
8 weeks agoarm: socfpga: agilex5: Add MMU mapping region
Tingting Meng [Mon, 10 Mar 2025 07:29:41 +0000 (15:29 +0800)]
arm: socfpga: agilex5: Add MMU mapping region

MMU mapping regions were added for the second and third DDR memory banks.

Signed-off-by: Tingting Meng <tingting.meng@altera.com>
8 weeks agoarm: socfpga: soc64: Update SoC64 CPU info
Alif Zakuan Yuslaimi [Fri, 18 Apr 2025 08:21:17 +0000 (16:21 +0800)]
arm: socfpga: soc64: Update SoC64 CPU info

As of 2025, Altera is now a standalone company prior to
being a subsidiary of Intel Corporation.

Update CPU info printout naming from Intel to Altera.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
8 weeks agoarch: arm: dts: agilex5: Set SDIO_SEL GPIO pin as output
Alif Zakuan Yuslaimi [Wed, 16 Apr 2025 08:42:12 +0000 (01:42 -0700)]
arch: arm: dts: agilex5: Set SDIO_SEL GPIO pin as output

Use GPIO hogging method in device tree to set SDIO_SEL pin (portb3)
direction as output with value 0 after power-on reset.

This is to ensure stable 0V voltage reading from SDIO_SEL GPIO pin
after board init.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@intel.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agoconfigs: agilex5: Restore fixed bloblist
Tingting Meng [Wed, 16 Apr 2025 06:12:05 +0000 (23:12 -0700)]
configs: agilex5: Restore fixed bloblist

CONFIG_BLOBLIST_FIXED and CONFIG_BLOBLIST_ADDR options were
unintentionally removed during recent external updates to the defconfig.
This patch restores the missing entries to ensure proper board
functionality. No new features are introduced.

Fixes: d6a53f523afe ("spl: Add an SPL_HAVE_INIT_STACK option")

Signed-off-by: Tingting Meng <tingting.meng@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agoARM: socfpga: Drop incorrect imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION*
Tom Rini [Sat, 15 Mar 2025 01:29:00 +0000 (19:29 -0600)]
ARM: socfpga: Drop incorrect imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION*

The use of both "imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION" and
"imply SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION_TYPE" here is wrong as
those are both part of the same choice statement. Furthermore you cannot
select/imply something from a choice statement, it must be a "default ...
if ..." construct within the choice statement in question.

Signed-off-by: Tom Rini <trini@konsulko.com>
8 weeks agoconfigs: Enable VAB flow for Agilex5 SoCFPGA boards
Naresh Kumar Ravulapalli [Tue, 4 Mar 2025 05:06:44 +0000 (21:06 -0800)]
configs: Enable VAB flow for Agilex5 SoCFPGA boards

Vendor Authorized Boot flow configurations are enabled for boards
based on Agilex5 SoCFPGA. Also, required changes are made to the
SoCFPGA make file for building and linking relevant secure source
code files.

Signed-off-by: Naresh Kumar Ravulapalli <nareshkumar.ravulapalli@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agoarch: arm: dts: Enable kernel itb file generation for Agilex5 SoCFPGA
Naresh Kumar Ravulapalli [Tue, 4 Mar 2025 05:06:43 +0000 (21:06 -0800)]
arch: arm: dts: Enable kernel itb file generation for Agilex5 SoCFPGA

Load and entry addresses are corrected for Agilex5 SoCFPGA board
which would enable to generate the kernel itb file with the right
addresses.

Signed-off-by: Naresh Kumar Ravulapalli <nareshkumar.ravulapalli@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agoconfigs: agilex5: Enable Marvell PHY driver
Alif Zakuan Yuslaimi [Tue, 18 Mar 2025 02:57:46 +0000 (19:57 -0700)]
configs: agilex5: Enable Marvell PHY driver

Enable Marvell Ethernet PHYs support for Agilex5 defconfig

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agoarm: socfpga: spl: Notify SDM on FSBL execution
Alif Zakuan Yuslaimi [Tue, 11 Mar 2025 06:38:52 +0000 (23:38 -0700)]
arm: socfpga: spl: Notify SDM on FSBL execution

Send out "HPS_STAGE_NOTIFY" mailbox command to the
Secure Device Manager (SDM) in SPL to inform SDM on
FSBL execution.

This is necessary for the SDM to recognize that the
FSBL stage has begun its execution and should be
made as early as possible in the FSBL process.

Therefore, the mailbox will initialize and send out
the notification right after the completion of timer
initialization.

Signed-off-by: Mahesh Rao <mahesh.rao@altera.com>
Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agoarm: socfpga: soc64: Enable F2S bridge reset support
Alif Zakuan Yuslaimi [Fri, 4 Apr 2025 02:07:03 +0000 (19:07 -0700)]
arm: socfpga: soc64: Enable F2S bridge reset support

Enable reset support for FPGA2SDRAM bridge for Stratix10, as well as
FPGA2SoC and SoC2FPGA bridges for all SoC64 families.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agoarm: socfpga: soc64: Update reset manager registers for F2S bridge
Alif Zakuan Yuslaimi [Fri, 4 Apr 2025 02:07:02 +0000 (19:07 -0700)]
arm: socfpga: soc64: Update reset manager registers for F2S bridge

Add reset manager registers in preparation for F2S bridge reset
support as well as the mask support to enable/disable the bridges.

Mask value:
BIT0: soc2fpga
BIT1: lwhps2fpga
BIT2: fpga2soc

These bridges are available only in Stratix10:
BIT3: f2sdram0
BIT4: f2sdram1
BIT5: f2sdram2

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agoarm: socfpga: mailbox: Notify SDM on HPS code execution stages
Alif Zakuan Yuslaimi [Tue, 11 Mar 2025 06:38:51 +0000 (23:38 -0700)]
arm: socfpga: mailbox: Notify SDM on HPS code execution stages

Introducing a new mailbox command "HPS_STAGE_NOTIFY" to notify Secure
Device Manager (SDM) on the stage of HPS code execution.

Generally, there are three main code execution stages: First Stage Boot
Loader (FSBL) which is U-Boot SPL, Second Stage Boot Loader (SSBL) which
is U-Boot, and the Operating System (OS) which is Linux.

This enables the user to query the SDM for HPS error details.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agoreset: socfpga: release more A10 peripherals out of reset
Naresh Kumar Ravulapalli [Fri, 14 Mar 2025 17:42:25 +0000 (10:42 -0700)]
reset: socfpga: release more A10 peripherals out of reset

Current implementation releases most peripherals out of reset for
gen5, but A10 has more peripherals than gen5, hence this patch is
required to release the rest of peripherals to support old kernels.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Signed-off-by: Naresh Kumar Ravulapalli <nareshkumar.ravulapalli@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agodrivers: ddr: altera: Fix integer overflow during size calculation
Naresh Kumar Ravulapalli [Fri, 7 Mar 2025 10:28:51 +0000 (02:28 -0800)]
drivers: ddr: altera: Fix integer overflow during size calculation

Data structure, dramaddrw, is defined as u32. Compiler performs
32-bit arithmetic and logic operations on this data structure. Fix
is provided to avoid integer overflow while performing shifting
operations greater than 32-bit.

Signed-off-by: Naresh Kumar Ravulapalli <nareshkumar.ravulapalli@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
8 weeks agofs/squashfs: avoid illegal free() in sqfs_opendir()
Heinrich Schuchardt [Mon, 14 Apr 2025 13:19:24 +0000 (15:19 +0200)]
fs/squashfs: avoid illegal free() in sqfs_opendir()

* Use calloc() to allocate token_list. This avoids an illegal free if
  sqfs_tokenize() fails.
* Do not iterate over token_list if it has not been allocated.

Addresses-Coverity-ID: 510453:  Null pointer dereferences  (FORWARD_NULL)
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
Reviewed-by: Joao Marcos Costa <jmcosta944@gmail.com>
8 weeks agoMerge patch series "fs: exfat: Flush node before put in read() callback"
Tom Rini [Mon, 21 Apr 2025 17:07:22 +0000 (11:07 -0600)]
Merge patch series "fs: exfat: Flush node before put in read() callback"

This series from Marek Vasut <marex@denx.de> includes a number of fixes
to the exFAT filesystem support that he recently added.

Link: https://lore.kernel.org/r/20250413085740.5953-1-marex@denx.de
8 weeks agotest_fs: Test 'mv' command on exfat and fs_generic
Marek Vasut [Sun, 13 Apr 2025 08:55:05 +0000 (10:55 +0200)]
test_fs: Test 'mv' command on exfat and fs_generic

Enable tests for the generic FS interface 'mv' command against
both exfat and fs_generic.

Signed-off-by: Marek Vasut <marex@denx.de>
8 weeks agofs: exfat: Implement trivial 'rename' support
Marek Vasut [Sun, 13 Apr 2025 08:55:04 +0000 (10:55 +0200)]
fs: exfat: Implement trivial 'rename' support

Implement exfat_fs_rename() to rename or move files. This is used
by the 'mv' generic FS interface command. The rename implementation
for other filesystems was added recently and was not part of exfat
porting layer due to merge issue, which made 'mv' command crash,
fix this by adding the missing implementation.

Fixes: b86a651b646c ("fs: exfat: Add U-Boot porting layer")
Signed-off-by: Marek Vasut <marex@denx.de>
8 weeks agotest_fs: Add test -e test
Marek Vasut [Sun, 13 Apr 2025 08:55:03 +0000 (10:55 +0200)]
test_fs: Add test -e test

Add test for the 'test -e' command to check for existence of files.
This exercises struct fstype_info .exists callback.

Signed-off-by: Marek Vasut <marex@denx.de>
8 weeks agofs: exfat: Fix exfat_fs_exists() return value
Marek Vasut [Sun, 13 Apr 2025 08:55:02 +0000 (10:55 +0200)]
fs: exfat: Fix exfat_fs_exists() return value

The exfat_fs_exists() should return 0 in case the path does not exist,
and 1 in case the path does exist. Fix the inverted return value. This
fixes 'test -e' command with exfat.

Fixes: b86a651b646c ("fs: exfat: Add U-Boot porting layer")
Signed-off-by: Marek Vasut <marex@denx.de>
8 weeks agofs: exfat: Rework exfat_fs_readdir() to behave like exfat_fs_ls()
Marek Vasut [Sun, 13 Apr 2025 08:55:01 +0000 (10:55 +0200)]
fs: exfat: Rework exfat_fs_readdir() to behave like exfat_fs_ls()

The exfat_fs_readdir() depends on state created in exfat_fs_opendir(),
but that state may be disrupted by fs_close() called by the FS layer
in fs_opendir(), because exfat porting layer unmounts the filesystem
in ->close() callback.

To avoid this disruption, avoid creating state in exfat_fs_opendir(),
cache only the directory name to list there, and rework exfat_fs_readdir()
to work in a similar way to exfat_fs_ls(). That is, make exfat_fs_readdir()
open the directory, look up specific entry, extract its properties to be
reported to FS layer, and close the directory. This is slow, but avoids
the disruption. The slowness does not affect regular 'ls' command, which
uses exfat_fs_ls() fast path.

Fixes: b86a651b646c ("fs: exfat: Add U-Boot porting layer")
Signed-off-by: Marek Vasut <marex@denx.de>
8 weeks agofs: exfat: Inhibit "impossible" print on write to bogus file
Marek Vasut [Sun, 13 Apr 2025 08:55:00 +0000 (10:55 +0200)]
fs: exfat: Inhibit "impossible" print on write to bogus file

Write into a bogus file, like '/.', triggers an "impossible"
print from the exfat core code. That should not be printed
in U-Boot, because U-Boot prints its own error message sooner.
Inhibit this error message.

The following command triggers the bogus print:
"
=> save host 0:0 1000008 /. 0x10
"

Fixes: b86a651b646c ("fs: exfat: Add U-Boot porting layer")
Signed-off-by: Marek Vasut <marex@denx.de>
8 weeks agofs: exfat: Flush node before put in read() callback
Marek Vasut [Sun, 13 Apr 2025 08:54:59 +0000 (10:54 +0200)]
fs: exfat: Flush node before put in read() callback

Make sure the node is never dirty before being released, flush
the node first using exfat_flush_node() and only then release
the node using exfat_put_node(). This now matches the behavior
of exfat_fs_write() too.

Fixes: b86a651b646c ("fs: exfat: Add U-Boot porting layer")
Signed-off-by: Marek Vasut <marex@denx.de>
8 weeks agoRevert "net: phy: Add the Airoha EN8811H PHY driver"
Tom Rini [Mon, 21 Apr 2025 16:10:57 +0000 (10:10 -0600)]
Revert "net: phy: Add the Airoha EN8811H PHY driver"

This was applied prematurely by me as I missed the feedback provided at
the time.

This reverts commit c9c8df2c377e512553f2e9ad5d19c4b85efbf07d.

Signed-off-by: Tom Rini <trini@konsulko.com>
8 weeks agoMerge tag 'u-boot-at91-2025.07-b' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Mon, 21 Apr 2025 14:24:54 +0000 (08:24 -0600)]
Merge tag 'u-boot-at91-2025.07-b' of https://source.denx.de/u-boot/custodians/u-boot-at91

Second set of u-boot-at91 features for the 2025.07 cycle:

This feature set includes the addition of sam9x60 usb gadget, and a fix
for sama5d2 SPL.

8 weeks agoMerge tag 'rpi-2025.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-raspbe...
Tom Rini [Mon, 21 Apr 2025 13:28:50 +0000 (07:28 -0600)]
Merge tag 'rpi-2025.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-raspberrypi

Updates for RPi for 2025.07:

- copy over uart clock-frequency in DT
- always set fdt_addr with firmware-provided FDT address
- Set bootm_size to 512MB
- Drop fdt_high and initrd_high
- Update environment to support booti and large initrd

2 months agoMerge tag 'efi-2025-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Sun, 20 Apr 2025 13:52:47 +0000 (07:52 -0600)]
Merge tag 'efi-2025-07-rc1-2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2025-07-rc1-2

Documentation:

* dt_qemu: correct dumpdtb description
* release_cycle: Use variable substitution for next version

UEFI:

* cmd: simplify eficonfig_init()
* efi_selftest: check executing in EL2
* efi_selftest: use do_bootefi_exec()

Others:

* riscv: dts: jh7110: add bootph-pre-ram for &pllclk
* mips: malta: set MIPS_RELOCATION_TABLE_SIZE=0xc000

2 months agomips: malta: set MIPS_RELOCATION_TABLE_SIZE=0xc000
Heinrich Schuchardt [Sun, 3 Nov 2024 19:01:13 +0000 (20:01 +0100)]
mips: malta: set MIPS_RELOCATION_TABLE_SIZE=0xc000

MIPS_RELOCATION_TABLE_SIZE=0x8000 is too small to enable UNIT_TEST.
Increase it by 50 % (16 KiB).

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoriscv: dts: jh7110: add bootph-pre-ram for &pllclk
Heinrich Schuchardt [Sun, 30 Mar 2025 16:24:21 +0000 (18:24 +0200)]
riscv: dts: jh7110: add bootph-pre-ram for &pllclk

Since commit f98cd471f06b ("clk: clk-composite: Resolve parent clock by
name") the StarFive VisionFive 2 board fails to boot.

Before that patch the SPL debug UART showed warnings like:

    clk_register: failed to get pll0_out device (parent of perh_root)
    clk_register: failed to get pll0_out device (parent of qspi_ref_src)
    clk_register: failed to get pll0_out device (parent of usb_125m)
    clk_register: failed to get pll0_out device (parent of gmac_src)
    clk_register: failed to get pll0_out device (parent of gmac1_gtxclk)
    clk_register: failed to get pll0_out device (parent of gmac0_gtxclk)

The &pllclk clock needs to be enabled early.

Fixes: f98cd471f06b ("clk: clk-composite: Resolve parent clock by name")
Suggested-by: Marek Vasut <marex@denx.de>
Tested-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agodoc: dt_qemu: correct dumpdtb description
Heinrich Schuchardt [Wed, 16 Apr 2025 06:44:29 +0000 (08:44 +0200)]
doc: dt_qemu: correct dumpdtb description

Use only a single -machine parameter.

Describe that the same invocation of qemu-system-<arch> has to be
used for dumping the device-tree as will be used when executing U-Boot.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoefi_selftest: use do_bootefi_exec()
Heinrich Schuchardt [Fri, 11 Apr 2025 05:36:45 +0000 (07:36 +0200)]
efi_selftest: use do_bootefi_exec()

The EFI selftest should match executing a real EFI binary
as closely as possible.

Use do_bootefi_exec() to enter the EFI selftest.

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoefi_selftest: check executing in EL2
Heinrich Schuchardt [Fri, 11 Apr 2025 05:32:56 +0000 (07:32 +0200)]
efi_selftest: check executing in EL2

UEFI binaries should be executed in EL2 or EL1 even if U-Boot is started
in EL3. Provide a unit test.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agodoc: release_cycle: Use variable substitution for next version
Tom Rini [Tue, 8 Apr 2025 13:54:21 +0000 (07:54 -0600)]
doc: release_cycle: Use variable substitution for next version

To avoid the problem fixed in commit 57a95d522ca8 ("doc: release_cycle:
fix next release version") moving forward, make use of the variable
substitution feature of rST. This adds a next_ver variable and
references it in all of the places where I had been listing the version
being worked on.

Suggested-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Tested-by: Quentin Schulz <quentin.schulz@cherry.de>
2 months agocmd: simplify eficonfig_init()
Heinrich Schuchardt [Mon, 10 Mar 2025 06:13:43 +0000 (07:13 +0100)]
cmd: simplify eficonfig_init()

As the system table already has pointers to the Simple Text Input and
Output Protocols we can directly use these instead of calling
OpenProtocol.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2 months agoRevert "power-domain: Add refcounting"
Wadim Egorov [Thu, 17 Apr 2025 11:53:11 +0000 (13:53 +0200)]
Revert "power-domain: Add refcounting"

Unfortunately this change breaks boot on K3 platform.
U-Boot will hang after:

  U-Boot SPL 2025.04-01050-ga40fc5afaec0 (Apr 14 2025 - 07:31:32 +0000)
  SYSFW ABI: 3.1 (firmware rev 0x0009 '9.2.7--v09.02.07 (Kool Koala)')

This reverts commit 197376fbf300e92afa0a1583815d9c9eb52d613a as
suggested in [1].

[1] https://lists.denx.de/pipermail/u-boot/2025-April/587032.html

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Miquel Raynal <miquel.raynal@bootlin.com>
2 months agoARM: dts: at91: sama5d2: Pass bootph-all to the PIT timer
Fabio Estevam [Thu, 3 Apr 2025 15:10:50 +0000 (12:10 -0300)]
ARM: dts: at91: sama5d2: Pass bootph-all to the PIT timer

The PIT timer needs to be available early in the SPL phase,
otherwise SPL fails to boot and only prints:

Could not initialize timer (err -96)

Fix this problem by passing 'bootph-all' to the sama5d2 PIT node.

Signed-off-by: Fabio Estevam <festevam@denx.de>
2 months agoARM: dts: at91: sam9x60-curiosity: Enable USB gadget node
Zixun LI [Mon, 31 Mar 2025 16:26:09 +0000 (18:26 +0200)]
ARM: dts: at91: sam9x60-curiosity: Enable USB gadget node

Enable USB gadget usb0 node support.

Signed-off-by: Zixun LI <admin@hifiphile.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agoARM: dts: sam9x60: Add USB gadget DT node
Zixun LI [Mon, 31 Mar 2025 16:26:08 +0000 (18:26 +0200)]
ARM: dts: sam9x60: Add USB gadget DT node

Add the USB gadget DT node for the sam9x60 SoC's.

Signed-off-by: Zixun LI <admin@hifiphile.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
2 months agoconfigs: am65x_evm_a53: convert to a standard boot flow
Bryan Brattlof [Fri, 11 Apr 2025 22:48:39 +0000 (17:48 -0500)]
configs: am65x_evm_a53: convert to a standard boot flow

Rather than maintaining custom hush scripting to boot the SDK, migrate
to a 'standard boot' method which simplifies maintenance and enables
multiple distributions to use this evaluation module.

Signed-off-by: Bryan Brattlof <bb@ti.com>
2 months agoarm: mach-k3: am62px: Fix MCU_CLKOUT0 parent clock mux
Parth Pancholi [Tue, 8 Apr 2025 16:12:11 +0000 (18:12 +0200)]
arm: mach-k3: am62px: Fix MCU_CLKOUT0 parent clock mux

CU_CLKOUT0 can be driven by two input clocks: a 25 MHz and a 50 MHz source.
Currently, the 25 MHz option is not selectable due to an incorrect mux
configuration where the 50 MHz clock is duplicated in the parent list.

This patch fixes the mux setup, allowing proper selection of the 25 MHz
clock source for MCU_CLKOUT0.

Similar configuration is already correctly implemented in AM62 clock
data for 'hsdiv4_16fft_main_2_hsdivout1_clk10', where MCU_CLKOUT0
parent switching behaves as expected.

Link: http://downloads.ti.com/tisci/esd/latest/5_soc_doc/am62px/clocks.html#clocks-for-board0-device
Signed-off-by: Parth Pancholi <parth.pancholi@toradex.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
2 months agoMerge tag 'xilinx-for-v2025.07-rc1' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 17 Apr 2025 13:52:02 +0000 (07:52 -0600)]
Merge tag 'xilinx-for-v2025.07-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze

AMD/Xilinx/FPGA changes for v2025.07-rc1

AMD/Xilinx:
- Synchronize enums around tcm_mode
- Access bootmode registers via firmware interface
- Setup default values for DEBUG_UART
- Fix dfu alt buffer clearing
- Convert loadpdi command to fpga
- Fix board detection code
- Minor defconfig updates

Versal:
- Wire multi_boot register

Versal Gen 2:
- Enable missing drivers
- Wire i2c FRU decoding at start
- Wire saving variables to different locations
- Disable default DEBUG_UART
- Wire USB/UFS boot and fix access via firmware interface
- Minor fixes

ZynqMP/Kria:
- Enable mkfwumdata
- Topic board update
- Enhance binman configurations
- Kria usb update

BuR:
- Add multiple Zynq based boards

cadence_ospi:
- Enable device reset

fpga:
- Add support for loading bitstream for Altera SoCs

2 months agoMerge patch series "airoha: add support spi/mmc/ethernet"
Tom Rini [Wed, 16 Apr 2025 22:52:28 +0000 (16:52 -0600)]
Merge patch series "airoha: add support spi/mmc/ethernet"

Christian Marangi <ansuelsmth@gmail.com> says:

This is continuation of the initial patchset for airoha
support.

Some are trivial fix for spi.
A new concept to setup SPI from detected NAND.

Sadly DTS node still need to be merged upstream so we
are currently adding them to u-boot dtsi and it's planned
to be dropped once they are accepted in upstream kernel.

Link: https://lore.kernel.org/r/20250407200208.25594-1-ansuelsmth@gmail.com
2 months agoconfigs: airoha: an7581_evb: Enable Airoha SNFI SPI config
Christian Marangi [Mon, 7 Apr 2025 20:01:58 +0000 (22:01 +0200)]
configs: airoha: an7581_evb: Enable Airoha SNFI SPI config

Enable Airoha SNFI SPI config to enable support for SNAND flash.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoarm: dts: an7581: Add SNAND node
Christian Marangi [Mon, 7 Apr 2025 20:01:57 +0000 (22:01 +0200)]
arm: dts: an7581: Add SNAND node

Add SNAND node to Airoha AN7581 EVB DTS to enable support for attached
SNAND flash.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agospi: airoha: Add Airoha SPI NAND driver
Christian Marangi [Mon, 7 Apr 2025 20:01:56 +0000 (22:01 +0200)]
spi: airoha: Add Airoha SPI NAND driver

Add Airoha SPI NAND driver to permit usage of attached SNAND on the
Airoha AN7581 SoC. While SPI controller supports DMA transation, due to
U-Boot limitation we currently limit it to single command in Manual
mode.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agospinand: call SPI setup_for_spinand if supported
Christian Marangi [Mon, 7 Apr 2025 20:01:55 +0000 (22:01 +0200)]
spinand: call SPI setup_for_spinand if supported

Call SPI setup_for_spinand() if supported and defined to configure the
SPI slave for the attached NAND. This is needed to configure the SPI
with the NAND page size and spare size for correct configuration of the
device.

Call it as soon as the NAND is detected to correctly handle SPI
controller with select_op_variant detection.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agospi: Introduce setup_for_spinand()
Christian Marangi [Mon, 7 Apr 2025 20:01:54 +0000 (22:01 +0200)]
spi: Introduce setup_for_spinand()

A common device attached to SPI are SPI NAND and some device might
require to have info on the attached NAND to know the flash page size
and spare size.

To support this, introduce setup_for_spinand() that pass the attached
spinand info from manufacturer.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
[trini: Switch to forward declaration of struct spinand_info]
Signed-off-by: Tom Rini <trini@konsulko.com>
2 months agospi: drop unneeded spi.h header include from spinand.h
Christian Marangi [Mon, 7 Apr 2025 20:01:53 +0000 (22:01 +0200)]
spi: drop unneeded spi.h header include from spinand.h

Drop unneeded spi.h header include from spinand.h, nothing included by
spi.h is actually used in this header and .c should correctly included
spi.h if actually needed.

Replace spi.h with linux/bitops.h as this is what is actually required
for spinand.h

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoregmap: Add regmap_set/clear_bits shorthands
Christian Marangi [Mon, 7 Apr 2025 20:01:52 +0000 (22:01 +0200)]
regmap: Add regmap_set/clear_bits shorthands

Port Linux kernel regmap_set/clear_bits shorthands to set and clear bits
in a regmap. These are handy if only specific bits needs to be applied
or cleared and makes it easier to port regmap based driver from kernel
upstream.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoairoha: Add eMMC config to defconfig
Christian Marangi [Mon, 7 Apr 2025 20:01:51 +0000 (22:01 +0200)]
airoha: Add eMMC config to defconfig

Enable Mediatek MMC driver in Airoha AN7581 EVB defconfig to add support
for it in default images.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoarch: arm: dts: an7581: Add eMMC nodes
Christian Marangi [Mon, 7 Apr 2025 20:01:50 +0000 (22:01 +0200)]
arch: arm: dts: an7581: Add eMMC nodes

Add eMMC nodes with the fixed regulator and fixed clock. It's also
needed to assign the clock and set it to 200MHz as it's set to 150Mhz by
default.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agommc: mediatek: permit to also build for Airoha arch
Christian Marangi [Mon, 7 Apr 2025 20:01:49 +0000 (22:01 +0200)]
mmc: mediatek: permit to also build for Airoha arch

Airoha new SoC implement the same Mediatek driver for MMC. Permit to
also build for Airoha arch.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoarch: arm: dts: an7581: Add Ethernet nodes
Christian Marangi [Mon, 7 Apr 2025 20:01:48 +0000 (22:01 +0200)]
arch: arm: dts: an7581: Add Ethernet nodes

Add Ethrnet nodes for Airoha AN7581 EVB board.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoairoha: Add Ethernet config to defconfig
Christian Marangi [Mon, 7 Apr 2025 20:01:47 +0000 (22:01 +0200)]
airoha: Add Ethernet config to defconfig

Add Ethrnet config to defconfig to enable Ethernet support.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agonet: airoha: Add Airoha Ethernet driver
Christian Marangi [Mon, 7 Apr 2025 20:01:46 +0000 (22:01 +0200)]
net: airoha: Add Airoha Ethernet driver

Add airoha Ethernet driver for Airoha AN7581 SoC. This is a majorly
rewritten and simplified version of the Linux airoha_eth.c driver.

It's has been modified to support a single RX/TX ring to reflect U-Boot
implementation with recv and send API.

The struct and the define are kept as similar as possible to upstream
one to not diverge too much.

The AN7581 SoC include an Ethernet Switch based on the Mediatek MT753x
but doesn't require any modification aside from setting the CPU port and
applying the Flood configuration hence it can be handled entirely in the
Ethernet driver.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agoarch: arm: dts: an7581: add Chip SCU node
Christian Marangi [Mon, 7 Apr 2025 20:01:45 +0000 (22:01 +0200)]
arch: arm: dts: an7581: add Chip SCU node

Add pending Chip SCU node for clock node.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2 months agonet: phy: Add the Airoha EN8811H PHY driver
Lucien.Jheng [Sun, 6 Apr 2025 13:02:44 +0000 (21:02 +0800)]
net: phy: Add the Airoha EN8811H PHY driver

Add the driver for the Airoha EN8811H 2.5 Gigabit PHY. The PHY supports
100/1000/2500 Mbps with auto negotiation only.

The driver uses two firmware files, for which updated versions are added to
linux-firmware already.

Based on the Linux upstream 8811 driver code(air_en8811h.c),
I have modified the relevant process to align with the U-Boot boot sequence.
and have validated this on Banana Pi BPI-R3 Mini.

The MD32 FW is currently stored in eMMC partition 1 on Banana Pi BPI-R3 Mini,
and it is loaded from there.

Signed-off-by: Lucien.Jheng <lucienzx159@gmail.com>
2 months agoMerge tag 'u-boot-marvell-20250516' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 16 Apr 2025 14:12:30 +0000 (08:12 -0600)]
Merge tag 'u-boot-marvell-20250516' of https://source.denx.de/u-boot/custodians/u-boot-marvell

CI: https://dev.azure.com/sr0718/u-boot/_build/results?buildId=390&view=results

- mvebu_espressobin_ultra-88f3720_defconfig: disable SATA
- helios4: enable ddr odt0 on write for both chip-select
- clearfog,helios4: disable sdhci sdma
- mvebu/bubt: Correct usage of IS_ENABLED() macro
- mvebu: Correct SYS_MMCSD_RAW_MODE_U_BOOT_USE_SECTOR usage

2 months agoboard/BuR/zynq: initial commit
Bernhard Messerklinger [Fri, 4 Apr 2025 07:28:00 +0000 (09:28 +0200)]
board/BuR/zynq: initial commit

This commit adds support for the brcp1, brsmarc2, brcp150 and brcp170
boards. This boards are based on the Xilinx Zynq SoC.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20250404072819.69642-5-bernhard.messerklinger@br-automation.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoboard/BuR/common: split br_resetc_bmode function
Bernhard Messerklinger [Fri, 4 Apr 2025 07:27:59 +0000 (09:27 +0200)]
board/BuR/common: split br_resetc_bmode function

Split br_resetc_bmode function to add support for reading of reset
reason in board code with br_resetc_bmode_get.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Link: https://lore.kernel.org/r/20250404072819.69642-4-bernhard.messerklinger@br-automation.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoboard/BuR/common: add parameter for reset controller I2C bus selection
Bernhard Messerklinger [Fri, 4 Apr 2025 07:27:58 +0000 (09:27 +0200)]
board/BuR/common: add parameter for reset controller I2C bus selection

Normally B&R reset controllers are located at I2C bus 0. This patch adds
the possibility to change this bus number with the kconfig option
BR_RESETC_I2CBUS.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Link: https://lore.kernel.org/r/20250404072819.69642-3-bernhard.messerklinger@br-automation.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoboard/BuR/common: use strlcpy instead of strncpy
Bernhard Messerklinger [Fri, 4 Apr 2025 07:27:57 +0000 (09:27 +0200)]
board/BuR/common: use strlcpy instead of strncpy

Now strlcpy is used to copy the defip string to the corresponding
environment variable. This preserves memory for the NULL termination.

Signed-off-by: Bernhard Messerklinger <bernhard.messerklinger@br-automation.com>
Link: https://lore.kernel.org/r/20250404072819.69642-2-bernhard.messerklinger@br-automation.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoboard: amd: Read an eeprom after relocation
Padmarao Begari [Wed, 9 Apr 2025 16:26:39 +0000 (21:56 +0530)]
board: amd: Read an eeprom after relocation

Read an eeprom after relocation which also shows information from
eeprom wired via nvmem aliases.

When DTB reselection is enabled eeprom is read before relocation
too but information is not showed. The issue about two i2c reads
in this case will be address separately.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250409162639.588487-3-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoarm64: versal2: Remove dtb reselect and multi dtb
Padmarao Begari [Wed, 9 Apr 2025 16:26:38 +0000 (21:56 +0530)]
arm64: versal2: Remove dtb reselect and multi dtb

Presently the multi dtb's are not using on versal Gen 2
platform, so remove CONFIG_DTB_RESELECT and CONFIG_MULTI_DTB_FIT
from defconfig.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250409162639.588487-2-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoboard: xilinx: Store board info data in data section
Padmarao Begari [Wed, 9 Apr 2025 16:25:53 +0000 (21:55 +0530)]
board: xilinx: Store board info data in data section

Line 171 in README is describing that before relocation no code
should use global variable because global variables are placed
to BSS section which is initialized to 0 after relocation.

In the case of ZynqMP, where DTB reselection is enabled, the EEPROM
is read again after relocation. This prevents the issue from being
observed. However, in Versal Gen 2, where DTB reselection is also
enabled, the EEPROM is not read after relocation because it is not
yet wired in board_init(). This leads to a situation where the code
accesses an incorrect memory location, because none is really
checking the board_info is valid or not. To fix, move the board_info
into the data section and also check whether it is valid or not.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250409162553.588285-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoamd: versal2: Add support for saving env based on bootmode
Venkatesh Yadav Abbarapu [Fri, 11 Apr 2025 15:46:12 +0000 (21:16 +0530)]
amd: versal2: Add support for saving env based on bootmode

Enable saving variables to MMC(FAT) and SPI based on primary
bootmode. If bootmode is JTAG, dont save env anywhere(NOWHERE).

Enable ENV_FAT_DEVICE_AND_PART="0:auto" for Versal Gen 2 platform.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250411154612.107136-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoarm64: versal2: Update the number of DRAM banks to 36
Venkatesh Yadav Abbarapu [Thu, 10 Apr 2025 09:25:28 +0000 (14:55 +0530)]
arm64: versal2: Update the number of DRAM banks to 36

HBM stands for high bandwidth memory and is a type of memory interface used
in 3D-stacked DRAM (dynamic random access memory) in some AMD GPUs (aka
graphics cards), as well as the server, high-performance computing (HPC)
and networking and client space. High Bandwidth Memory(HBM) has total 16
channels, one channel is divided into two pseudo channels which makes its
32 banks each with some amount of memory.
And then we have DDR_LOW PS low, DDR_HIGH0 PS high, DDR_HIGH1 PS very high
and pretty much there should be also place for PL DDR. So maximum number of
memory banks will be 36, updating the CONFIG_NR_DRAM_BANKS to 36.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20250410092528.3713904-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoarm64: versal2: Add usb distro boot command
Venkatesh Yadav Abbarapu [Thu, 10 Apr 2025 08:30:55 +0000 (10:30 +0200)]
arm64: versal2: Add usb distro boot command

Adding support for the usb distro boot command.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/121b6879efde0b83d3933852442895631c4cb24f.1744273853.git.michal.simek@amd.com
2 months agoarm64: versal2: Add ufs distro boot command
Venkatesh Yadav Abbarapu [Thu, 10 Apr 2025 08:30:54 +0000 (10:30 +0200)]
arm64: versal2: Add ufs distro boot command

Adding support for the ufs distro boot command.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c0e6737ae4119963afc8ea19b49b998a013d06c4.1744273853.git.michal.simek@amd.com
2 months agoarm64: zynqmp: Start usb automatically via preboot on Kria
Venkatesh Yadav Abbarapu [Thu, 10 Apr 2025 08:14:04 +0000 (10:14 +0200)]
arm64: zynqmp: Start usb automatically via preboot on Kria

U-Boot configures the USB config object which enables power for
the IP, without this the linux usb driver won't work.
So add "usb start" as part of preboot command.

Fixes: dd4a82201694 ("arm64: zynqmp: Introduce kria SOM defconfig")
Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/180c9776b03d57d8218d161924363906ef354394.1744272843.git.michal.simek@amd.com
2 months agoxilinx: Free memory when variable is saved in boot_targets_setup()
Michal Simek [Thu, 10 Apr 2025 07:38:51 +0000 (09:38 +0200)]
xilinx: Free memory when variable is saved in boot_targets_setup()

When boot_targets variable is saved there is no reason to keep string in
malloc area that's why free it. This change is already done in ZynqMP code.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/fa10fc22193a1a23258466056b3d02f7496fccfe.1744270729.git.michal.simek@amd.com
2 months agoxilinx: Remove UARTLITE from defconfigs
Michal Simek [Thu, 10 Apr 2025 07:38:20 +0000 (09:38 +0200)]
xilinx: Remove UARTLITE from defconfigs

Remove uartlite serial driver from defconfigs because is not tested or used
on ARM based platform as console.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/86b100692101089dd8d9a8eed45461e8855384bc.1744270698.git.michal.simek@amd.com
2 months agoamd: versal2: Enable NVMEM framework
Michal Simek [Thu, 10 Apr 2025 07:37:28 +0000 (09:37 +0200)]
amd: versal2: Enable NVMEM framework

Enable NVMEM framework to be able to for example read MAC address from
eeprom. For more information please look at commit 5db5b7e2a336 ("xilinx:
Enable NVMEM framework for all platforms").

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/b6714165aee393528812ddbfc3cd18a3bbcf202e.1744270647.git.michal.simek@amd.com
2 months agoamd: versal2: Enable SMBIOS command
Michal Simek [Thu, 10 Apr 2025 07:35:36 +0000 (09:35 +0200)]
amd: versal2: Enable SMBIOS command

Enabel SMBIOS command as was done by commit aa815e6c7603 ("xilinx: Enable
SMBIOS command") for our other platforms.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/c1e236003c6ec250dbcc5178c873c171fffccd29.1744270535.git.michal.simek@amd.com
2 months agoarm64: zynqmp: Use CONFIG_SPL_FS_LOAD_PAYLOAD_NAME in binman
Michal Simek [Mon, 7 Apr 2025 15:17:30 +0000 (17:17 +0200)]
arm64: zynqmp: Use CONFIG_SPL_FS_LOAD_PAYLOAD_NAME in binman

u-boot.itb name is coming via CONFIG_SPL_FS_LOAD_PAYLOAD_NAME and it's
change will affect SD boot mode that's why start to use it.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/0f037e62e2d8486c0f68f204b45705be9e996ba7.1744039048.git.michal.simek@amd.com
2 months agoconfigs: versal: Fix initial stack pointer
Padmarao Begari [Mon, 7 Apr 2025 13:45:44 +0000 (19:15 +0530)]
configs: versal: Fix initial stack pointer

The mini u-boot is getting exception because of an initial
stack pointer address is used at near the top of memory,
and while executing u-boot is assigned pre-malloc and
global_data memory after initial stack pointer and updated
the stack pointer. Serial driver is used pre-malloc area
for serial operations before relocation. But pre-malloc area
is cleared while doing BSS at relocation time. The u-boot is
called board_init() function and doing printf, relocation serial
driver is not initialized yet, so it is using before relocation
serial operations but it is cleared by BSS and got the exception.
To fix, change an initial stack pointer address from near the
top of memory to near the relocation memory.

Fixes: 685874939a5e ("configs: versal: update initial stack pointer")
Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250407134544.3951763-1-padmarao.begari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoxilinx: versal: remove versal loadpdi command
Prasad Kummari [Thu, 27 Mar 2025 10:52:00 +0000 (16:22 +0530)]
xilinx: versal: remove versal loadpdi command

The source code for the versal loadpdi command and the
CONFIG_CMD_VERSAL configuration has been removed. It now utilizes
the fpga load <dev> <address> <length> command to load secure &
non-secure pdi images.

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Link: https://lore.kernel.org/r/20250327105200.1262615-4-prasad.kummari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoarm64: versal2: Add PL bit stream load support
Prasad Kummari [Thu, 27 Mar 2025 10:51:59 +0000 (16:21 +0530)]
arm64: versal2: Add PL bit stream load support

Add support for loading the secure & non-secure pdi images and PL
bitstream on the Versal Gen2 platform. The FPGA driver is enabled
to load the bitstream in PDI format on the AMD Versal Gen2 device.
PDI is the new programmable device image format for Versal Gen2,
and the bitstream for the Versal Gen2 platform is generated exclusively
in this format.

With the enhanced SMC format in TF-A ensuring transparent payload
forwarding for Versal Gen2, the u-boot driver must now handle the
word swapping of PDI address that was previously done in TF-A for
this API. The source code for the Versal2 loadpdi command and the
CONFIG_CMD_VERSAL2 configuration has been removed. It now utilizes
the fpga load <dev> <address> <length> command to load secure &
non-secure pdi images.

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Link: https://lore.kernel.org/r/20250327105200.1262615-3-prasad.kummari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoarm64: versal-net: Add PL bit stream load support
Prasad Kummari [Thu, 27 Mar 2025 10:51:58 +0000 (16:21 +0530)]
arm64: versal-net: Add PL bit stream load support

Add support for loading the secure & non-secure pdi images and
PL bitstream on the Versal NET platform. The FPGA driver is enabled
to load the bitstream in PDI format on the AMD Versal NET device.
PDI is the new programmable device image format for Versal NET,
and the bitstream for the Versal NET platform is generated exclusively
in this format.

The source code for the versalnet loadpdi command and the
CONFIG_CMD_VERSAL_NET configuration has been removed. It now utilizes
the fpga load <dev> <address> <length> command to load secure &
non-secure pdi images.

Signed-off-by: Prasad Kummari <prasad.kummari@amd.com>
Link: https://lore.kernel.org/r/20250327105200.1262615-2-prasad.kummari@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agodrivers: fpga: Follow mainline to pass compatible flags to fpga_load
Muhammad Hazim Izzat Zamri [Fri, 14 Mar 2025 02:19:53 +0000 (19:19 -0700)]
drivers: fpga: Follow mainline to pass compatible flags to fpga_load

Introducing additional flag to check whether an FPGA driver is able to
load a particular FPGA bitstream image.

Generally, flag variable is used to enable or disable certain features,
specify additional parameters (such as error handling), or modify how
the function operates.

Hence, in this function flags is an integer that can be used to pass
configuration options to the fpga_load function. Here, it's
initialized to 0, meaning no special options are enabled, but it could
modify the flags to influence the function's behavior.

Signed-off-by: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
Link: https://lore.kernel.org/r/20250314021953.18379-3-muhammad.hazim.izzat.zamri@altera.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agodrivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA
Muhammad Hazim Izzat Zamri [Fri, 14 Mar 2025 02:19:52 +0000 (19:19 -0700)]
drivers: fpga: Add FPGA configuration during bootm for Intel SOCFPGA

Enabling the capability to automatically perform FPGA configuration
when booting Linux FIT image via bootm command. The FPGA
configuration bitstream shall be packed within the FIT image.

The FPGA data (full or partial) is checked by the SDM hardware,
for Intel SDM Mailbox based devices. Hence always return full
bitstream.

Second function is to enable the HPS to FPGA bridges when FPGA load
is completed successfully. This is to ensure the FPGA is accessible
by the HPS.

Signed-off-by: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
Link: https://lore.kernel.org/r/20250314021953.18379-2-muhammad.hazim.izzat.zamri@altera.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2 months agoarm64: zynqmp: fix dfu alt buffer clearing
Vincent Stehlé [Mon, 7 Apr 2025 17:05:29 +0000 (19:05 +0200)]
arm64: zynqmp: fix dfu alt buffer clearing

The set_dfu_alt_info() function calls the ALLOC_CACHE_ALIGN_BUFFER()
macro to declare a `buf' variable pointer into an array allocated on the
stack. It then calls the memset() function to clear the useable portion
of the array using the idiomatic expression `sizeof(buf)'.

While this would indeed work fine for an array, in the present case we
end up clearing only the size of a pointer.
Fix this by specifying the explicit size `DFU_ALT_BUF_LEN' instead.

Fixes: b86f43de0be0 ("xilinx: zynqmp: Add support for runtime dfu_alt_info setup")
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Michal Simek <michal.simek@amd.com>
Cc: Tom Rini <trini@konsulko.com>
Acked-by: Padmarao Begari <padmarao.begari@amd.com>
Link: https://lore.kernel.org/r/20250407170529.893307-6-vincent.stehle@arm.com