Commit Graph

98169 Commits

Author SHA1 Message Date
Alif Zakuan Yuslaimi
58ef50ff9a drivers: clk: agilex5: Set PLL to asynchronous mode
PLL frequency would overshoot from the original target in
synchronous mode during low VCC voltage condition.

To resolve this issue, PLL is set to run on asynchronous mode
instead of enabling synchronous mode in the clock driver.

Signed-off-by: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:41 -06:00
Alif Zakuan Yuslaimi
9e7986e061 drivers: clk: agilex5: Replace status polling with wait_for_bit_le32()
Replace cm_wait_for_fsm() function with wait_for_bit_le32() function
which supports accurate timeout.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:37 -06:00
Alif Zakuan Yuslaimi
746f5b8ddb drivers: clk: agilex5: Configure intosc as boot_clk source
Some customers prefer to minimize the use of external oscillators,
especially when using the FPGA first configuration mode.

By enabling the configuration of the HPS internal oscillator as
the boot_clk source instead of the default external oscillator,
(HPS_OSC_CLK) in non-secure boot scenarios, this allows them
to eliminate the need for an additional oscillator device and
a dedicated HPS pin, simplifying board layout and routing.

Signed-off-by: Tingting Meng <tingting.meng@altera.com>
Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:35 -06:00
Alif Zakuan Yuslaimi
6d07e1980c arm: socfpga: misc: Exclude Agilex5 from clock manager base address retrieval
Agilex5 retrieves its clock manager address via probing its own clock
driver model during SPL initialization.

Therefore, excluding Agilex5 from calling generic clock driver in misc
driver.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2025-02-25 10:53:32 -06:00
Tien Fong Chee
35638172f9 arm: socfpga: agilex5: Add new driver model for system manager in Agilex5
Initial creation of new system manager driver.

Add supports for the SOCFPGA System Manager Register block which
aggregates different peripheral function into one area.
On 64 bit ARM parts, the system manager only can be accessed during
EL3 mode, this driver model provide user the high level access
to system register and abstract user from low level access.

The base address of system manager can be retrieved
using DT framework through the System Manager driver.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Signed-off-by: Boon Khai Ng <boon.khai.ng@altera.com>
2025-02-25 10:53:31 -06:00
Alif Zakuan Yuslaimi
cbb6b57d3e arch: arm: dts: agilex5: Enable I2C3
Enable i2c3 node in Agilex5 device tree

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
2025-02-25 10:53:30 -06:00
Tom Rini
3ecda19009 Merge tag 'v2025.04-rc3' into next
Prepare v2025.04-rc3
2025-02-24 17:15:14 -06:00
Tom Rini
dc0ee458f1 Prepare v2025.04-rc3
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-24 16:53:59 -06:00
Marek Vasut
dbb9e136b8 mmc: Fix size calculation for sector addressed MMC version 4
For eMMC v4 and newer that is smaller than 2 GiB, the JEDEC JESD84-B51
section 6.2.4 Configure partitions indicates that EXT_CSD SEC_COUNT
should not be used to determine device size, and instead device size
should be calculated from C_SIZE and C_SIZE_MULT.

This is not exactly accurate, the 2 GiB limit is not a hard line,
there are eMMC devices which are smaller than 2 GiB and still
require device size to be determined from EXT_CSD SEC_COUNT. The
hard line is instead OCR HCS bit, which indicates whether the device
is byte or sector addressed, the former applies to most devices
below 2 GiB, and the later applies mostly to devices above 2 GiB.

However, there are a couple of devices which are smaller than 2 GiB
and still set the OCR HCS bit to indicate they are sector addressed,
and therefore the size calculation for those devices should also
use EXT_CSD SEC_COUNT . Use mmc->high_capacity flag to discern the
devices instead of arbitrary 2 GiB limit. The mmc->high_capacity flag
reflects the OCR HCS bit state.

Fixes: 639b7827d1 ("mmc: fix the condition for MMC version 4")
Signed-off-by: Marek Vasut <marex@denx.de>
2025-02-24 14:16:28 -06:00
Tom Rini
523a56cc54 Revert "Merge patch series "Add preload_check_sign tool""
This reverts commit c8750efe02, reversing
changes made to 8c6cf8aeea.

Unfortunately these changes do not build on macOS hosts.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-24 10:32:04 -06:00
Joao Marcos Costa
59fd62d71c fs/squashfs: fix potential integer overflows
The length of buffers used to read inode tables, directory tables, and
reading a file are calculated as: number of blocks * block size, and
such plain multiplication is prone to overflowing (thus unsafe).

Replace it by __builtin_mul_overflow, i.e. safe math.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
2025-02-24 08:49:04 -06:00
Tom Rini
5061eab96a Merge branch 'picasso' of https://source.denx.de/u-boot/custodians/u-boot-tegra
Branch contains bringup of Acer Iconia Tab A500 (codename picasso), a
Tegra 2 Android device with decent Linux kernel support. Ondevice tests
and U-Boot test suit all passed.
2025-02-22 08:42:01 -06:00
Simon Glass
7520827be3 buildman: Update tests for newer filelock module
Recent versions of this module call time.perf_counter() so add a patch
for this also.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
2025-02-21 14:11:05 -06:00
Tom Rini
c8750efe02 Merge patch series "Add preload_check_sign tool"
Paul HENRYS <paul.henrys_ext@softathome.com> says:

This serie of patches adds a new tool to authenticate files signed
with a preload header.
This tool is also used in the tests to actually verify the
authenticity of the file signed with such a preload header.

Link: https://lore.kernel.org/r/20250212093126.3722186-1-paul.henrys_ext@softathome.com
2025-02-21 11:37:27 -06:00
Tom Rini
8c6cf8aeea Merge branch 'fix-issues-and-update-pylint-version' into next
This merges a set of patches from myself and Simon Glass to resolve
various problems that the current version of pylint will report with our
codebase. After the problems are fixed, we update to the now current
version which is 3.3.4.
2025-02-21 11:36:37 -06:00
Udit Kumar
13654f5426 remoteproc: k3-dsp: Flush D cache after loading firmware
Memory region used by remote cores was set to non-cached region but
commit 7c9c6e1925 ("arm: mach-k3: Merge initial memory maps") makes
all memory region as cached, unified across K3 devices.

This causes inconsistency while booting remote cores on devices, due to
cache incoherency between remote core and boot code.

So to make this operation coherent, cache the address and len while
loading ELF program headers to memory and flush that region in the next
cycle of load.

Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
2025-02-21 11:36:37 -06:00
Weijie Gao
c36945065f arm: mediatek: remove CONFIG_MT8512
Defining CONFIG_MT8512 is unnecessary as now board for mediatek
target can be changed in config.
Use CONFIG_TARGET_MT8512 to replace CONFIG_MT8512.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2025-02-21 11:36:37 -06:00
Weijie Gao
f777cb8815 arm: mediatek: build u-boot-mtk.bin only if needed
Not all MediaTek platforms needs u-boot-mtk.bin.

This patch will let u-boot generates u-boot-mtk.bin only if
CONFIG_MTK_BROM_HEADER_INFO is not empty.

Signed-off-by: Weijie Gao <weijie.gao@mediatek.com>
2025-02-21 11:36:37 -06:00
Paul HENRYS
a9842ac634 binman: Authenticate the image when testing the preload signature
Use preload_check_sign to authenticate the generated image when testing the
preload signature in testPreLoad().

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-21 08:34:21 -06:00
Paul HENRYS
a95db5a998 configs: Enable the pre-load signature in tools-only_defconfig
pre-load related config options are enabled to have support of it in host
tools.

'CONFIG_FIT_SIGNATURE=y' is being automatically removed since it is
selected by CONFIG_IMAGE_PRE_LOAD_SIG.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-21 08:34:21 -06:00
Paul HENRYS
7dd0bf5279 tools: Add preload_check_sign to authenticate images with a pre-load
preload_check_sign is added so that it can be used to authenticate images
signed with the pre-load signature supported by binman and U-Boot.
It could also be used to test the signature in binman tests signing
images with the pre-load.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-21 08:34:21 -06:00
Paul HENRYS
6ce674c254 boot: Add support of the pre-load signature for host tools
Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-21 08:34:21 -06:00
Paul HENRYS
a85a67a160 image: Add an inline declaration of unmap_sysmem()
Add an empty inline declaration when compiling tools for a host where
unmap_sysmem() is not defined.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-21 08:34:21 -06:00
Paul HENRYS
7771843786 rsa: Add rsa_verify_openssl() to use openssl for host builds
rsa_verify_openssl() is used in lib/rsa/rsa-verify.c to authenticate data
when building host tools.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
2025-02-21 08:34:21 -06:00
Tom Rini
b902386072 CI: Update to pylint 3.3.4
With all of the reported warnings now fixed, update to current pylint
version.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-21 08:24:40 -06:00
Simon Glass
6e628c221e tools: Fix pylint 3.3.4 errors
This newer pylint produces errors about variables possibly being used
before being set. Adjust the code to pass these checks.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Tom Rini <trini@konsulko.com>
2025-02-21 08:24:37 -06:00
Tom Rini
8e233cca9d tools/patman: Don't call a non-existent suite
With a newer pylint we get a warning that gitutil.RunTests does not
exist, so remove the line.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-21 08:24:33 -06:00
Tom Rini
a21f6efaf5 tools: binman: ti_board_cfg: Fix pylint error over 'br'
With a newer pylint, we get a warning that 'br' could be used before
assignment. Fix this by declaring br first as an empty bytearray.

Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-21 08:24:31 -06:00
Tom Rini
c128ec4647 binman: Switch to setuptools
With the distutils module having been removed with Python 3.12, switch
to using setuptools instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-21 08:24:27 -06:00
Tom Rini
2fc363c700 dtoc: Switch to setuptools
With the distutils module having been removed with Python 3.12, switch
to using setuptools instead.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-21 08:24:08 -06:00
Tom Rini
ea9131d904 test/py: Have test_usb.py raise an Exception with unsupported filesystems
With a newer pylint we get a warning about how offset could be used
before assigned. This is because when the underlying filesystem wasn't
one that is supported we would have runtime test failures. Address this
by raise'ing an Exception if fs is not supported.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-21 08:24:05 -06:00
Tom Rini
203d3a9fc7 test/py: Rework how test_ums.py handles (not) having write enabled
With a newer pylint version we get a warning about how mounted_test_fn
could be used before assignment. Evaluating the code, this can't happen
because we check for "not have_writable_fs_partition" and return before
moving to the part of the tests which use mounted_test_fn. However, we
should instead have this written so that we only try this part of the
test if have_writable_fs_partition is set, and this also fixes the
warning. As part of this we also move test_f and mounted_test_fn to the
section of code that already only does this if
have_writable_fs_partition is set.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-21 08:24:02 -06:00
Tom Rini
3e335ddca6 test/py: Rework test_spi.py to assert we found output
When running a newer version of pylint it will complain that page_size
may be used before being assignment. Looking deeper what is going on is
that we could run in to the case where the regex we run for any of the
flash information fails but since we don't have a result, we don't check
it either. In the case of the rest of the numerical values we then have
some assignment (multiplying by some value) and so pylint doesn't
complain. Rework things to assert that each regex has a result and so
failure will stop the test and we won't have any use before assignment.

Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-21 08:23:59 -06:00
Tom Rini
7fa38ae6c7 Merge patch series "FIT Image Boot Fixes for am57xx_hs_evm"
Anurag Dutta <a-dutta@ti.com> says:

The u-boot is unable to load the FIT image due to incorrect
boot arguments in case of am57_hs evm as can be seen in [1].
This series introduces multiple changes pertaining to several
environment variables and overlays that are responsible for
successful [2] loading of kernel image.

Test links:
[1] https://gist.github.com/anuragdutta731/7bbf0df73dd1e3327765f1807d337445
[2] https://gist.github.com/anuragdutta731/5244174c9b9556fd89132c8d72ae2d8b

Link: https://lore.kernel.org/r/20250211094931.20817-1-a-dutta@ti.com
2025-02-20 19:12:08 -06:00
Sinthu Raja
b165582b3f include: configs: omap5: Add support for FDT overlay
As AM57x uses overlays for display and camera interfaces, add support to
load DT overlay files to MMC boot.

Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Signed-off-by: Anurag Dutta <a-dutta@ti.com>
2025-02-20 19:12:08 -06:00
Sinthu Raja
e2aebbaa40 configs: omap5: Enable custom mmc boot to distroboot for AM57x
TI AM57x boards use a custom (though family common to TI boards) mechanism
for booting Linux. Add support to enable custom MMC boot as a default
option along with the distroboot approach.

Also, add supporting mmc boot environment variables which shall be used for
custom MMC boot

Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Signed-off-by: Anurag Dutta <a-dutta@ti.com>
2025-02-20 19:12:07 -06:00
Sinthu Raja
ed5754354b include: configs: Override get_fit_config to get FIT config for AM57x
Kernel commit 837833a724 ("environment: ti: Add get_fit_config command
to get FIT config string") introduced "get_fit_config" in ti_armv7_common.h
to mangle the fdtfile name when used to select a config node from the OE
made FIT image. However, the ti_armv7_common.h is common for both K3 and
AM57xx platforms. AM57xx platforms' fdtfile name does not have '/' and
"conf-" prefix so the setexpr command fails and boot hangs.

Override the get_fit_config in AM57x specific config header to get the
correct FIT config name.

Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
Signed-off-by: Anurag Dutta <a-dutta@ti.com>
2025-02-20 19:12:07 -06:00
Tom Rini
35a58863b1 Merge patch series "configs: phycore_am64x_a53_defconfig: Enable ENV_IS_IN_SPI_FLASH"
This series improves SPI flash support for some phytec am6x configs.

Link: https://lore.kernel.org/r/20250210152548.1263498-1-d.schultz@phytec.de
2025-02-20 16:13:28 -06:00
Daniel Schultz
552c062901 board: Phytec: phycore_am62x: Increase size for Image in SPI
Increase the maximum Image size from 23 MB to 26 MB by moving the
initramfs start address up. This gives us a bigger ranger to
provide kernel images which are not stripped down too much.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2025-02-20 16:13:20 -06:00
Daniel Schultz
c78c13fba5 board: Phytec: phycore_am64x: Increase size for Image in SPI
Increase the maximum Image size from 23 MB to 26 MB by moving the
initramfs start address up. This gives us a bigger ranger to
provide kernel images which are not stripped down too much.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2025-02-20 16:13:20 -06:00
Daniel Schultz
69694a1f79 configs: phycore_am62x_a53_defconfig: Enable ENV_IS_IN_SPI_FLASH
Enable ENV_IS_IN_SPI_FLASH to read the environment from the SPI
flash when booting from it. The oftree, kernel and ramdisk sizes
are located in this environment and therefore required to boot
an initramfs.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2025-02-20 16:13:20 -06:00
Daniel Schultz
28afc81a61 configs: phycore_am64x_a53_defconfig: Enable ENV_IS_IN_SPI_FLASH
Enable ENV_IS_IN_SPI_FLASH to read the environment from the SPI
flash when booting from it. The oftree, kernel and ramdisk sizes
are located in this environment and therefore required to boot
an initramfs.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2025-02-20 16:13:20 -06:00
Tom Rini
c304658617 Merge patch series "AM62,AM62-LP,AM62A,AM62P,J722S: USB DFU and UMS"
Siddharth Vadapalli <s-vadapalli@ti.com> says:

This series enables USB DFU and USB Mass Storage functionality for
AM62, AM62-LP, AM62A, AM62P and J722S SoCs.

Link: https://lore.kernel.org/r/20250210112239.2639009-1-s-vadapalli@ti.com
2025-02-20 16:08:19 -06:00
Siddharth Vadapalli
b64241da1d configs: am62x_a53_usbdfu: enable USB MASS Storage command
The USB0 instance of USB on AM62 SoC when configured to operate in the
Gadget mode of operation can be used to mount an MMC/SD card on the USB
Host. Hence, enable support for the USB Mass Storage (ums) command.

Since this config fragment corresponds to USB DFU functionality which
configures the USB Controller in Gadget mode of operation, other SoCs
which include this fragment for DFU functionality can make use of the
USB MASS Storage functionality as well.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
2025-02-20 16:07:25 -06:00
Siddharth Vadapalli
646f23e5a6 configs: j722s_evm_a53_defconfig: enable USB DFU support
The USB0 instance of USB on J722S SoC is a Designware USB Controller with
the same glue layer (wrapper) as AM62 SoC. In order to support USB DFU boot
and USB DFU flash with USB0, enable the corresponding glue layer driver.

While at it, sync with savedefconfig.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
2025-02-20 16:07:25 -06:00
Siddharth Vadapalli
c89229e032 board: ti: j722s: env: include environment for DFU
Include the TI K3 DFU environment to support DFU Boot and DFU Flash.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
2025-02-20 16:07:25 -06:00
Siddharth Vadapalli
df72441344 configs: am62px_evm_a53_defconfig: enable USB DFU support
The config fragment "am62x_a53_usbdfu.config" which adds USB DFU support
for AM62x SoC is applicable to the AM62Px SoC as well. Hence, include it
in "am62px_evm_a53_defconfig" in order to enable support for USB DFU
flash and boot. Remove those configs from "am62px_evm_a53_defconfig" which
are present in the "am62x_a53_usbdfu.config" config fragment that is being
included.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
2025-02-20 16:07:25 -06:00
Siddharth Vadapalli
8d1c65fce8 configs: am62x_r5_usbdfu: extend for AM62Px
Disable configs which are not required for USB DFU functionality, in
order to allow reusing this fragment for AM62Px SoC.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
2025-02-20 16:07:25 -06:00
Siddharth Vadapalli
e301693045 board: ti: am62px: env: include environment for DFU Boot
Include the TI K3 DFU environment to support DFU Boot and DFU Flash.
Also add "usb" to the list of "boot_targets". While at it, add a newline
at the end of the file.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Roger Quadros <rogerq@kernel.org>
2025-02-20 16:07:25 -06:00
Siddharth Vadapalli
83202c8335 configs: am62ax_evm_a53_defconfig: enable USB DFU support
The config fragment "am62x_a53_usbdfu.config" which adds USB DFU support
for AM62x SoC is applicable to the AM62Ax SoC as well. Hence, include it
in "am62ax_evm_a53_defconfig" in order to enable support for USB DFU flash
and boot.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
2025-02-20 16:07:25 -06:00