pandora-u-boot.git
3 months agobuildman: Update tests for newer filelock module
Simon Glass [Tue, 4 Feb 2025 23:33:53 +0000 (16:33 -0700)]
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>
3 months agoMerge patch series "Add preload_check_sign tool"
Tom Rini [Fri, 21 Feb 2025 14:34:34 +0000 (08:34 -0600)]
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
3 months agoMerge branch 'fix-issues-and-update-pylint-version' into next
Tom Rini [Fri, 21 Feb 2025 14:24:49 +0000 (08:24 -0600)]
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.

3 months agoremoteproc: k3-dsp: Flush D cache after loading firmware
Udit Kumar [Thu, 13 Feb 2025 09:23:22 +0000 (14:53 +0530)]
remoteproc: k3-dsp: Flush D cache after loading firmware

Memory region used by remote cores was set to non-cached region but
commit 7c9c6e192580 ("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>
3 months agoarm: mediatek: remove CONFIG_MT8512
Weijie Gao [Thu, 13 Feb 2025 09:11:18 +0000 (17:11 +0800)]
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>
3 months agoarm: mediatek: build u-boot-mtk.bin only if needed
Weijie Gao [Thu, 13 Feb 2025 09:00:34 +0000 (17:00 +0800)]
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>
3 months agobinman: Authenticate the image when testing the preload signature
Paul HENRYS [Wed, 12 Feb 2025 09:31:26 +0000 (10:31 +0100)]
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>
3 months agoconfigs: Enable the pre-load signature in tools-only_defconfig
Paul HENRYS [Wed, 12 Feb 2025 09:31:25 +0000 (10:31 +0100)]
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>
3 months agotools: Add preload_check_sign to authenticate images with a pre-load
Paul HENRYS [Wed, 12 Feb 2025 09:31:24 +0000 (10:31 +0100)]
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>
3 months agoboot: Add support of the pre-load signature for host tools
Paul HENRYS [Wed, 12 Feb 2025 09:31:23 +0000 (10:31 +0100)]
boot: Add support of the pre-load signature for host tools

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
3 months agoimage: Add an inline declaration of unmap_sysmem()
Paul HENRYS [Wed, 12 Feb 2025 09:31:22 +0000 (10:31 +0100)]
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>
3 months agorsa: Add rsa_verify_openssl() to use openssl for host builds
Paul HENRYS [Wed, 12 Feb 2025 09:31:21 +0000 (10:31 +0100)]
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>
3 months agoCI: Update to pylint 3.3.4
Tom Rini [Thu, 20 Feb 2025 21:22:39 +0000 (15:22 -0600)]
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>
3 months agotools: Fix pylint 3.3.4 errors
Simon Glass [Wed, 19 Feb 2025 15:11:16 +0000 (08:11 -0700)]
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>
3 months agotools/patman: Don't call a non-existent suite
Tom Rini [Wed, 12 Feb 2025 22:23:17 +0000 (16:23 -0600)]
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>
3 months agotools: binman: ti_board_cfg: Fix pylint error over 'br'
Tom Rini [Wed, 12 Feb 2025 22:23:33 +0000 (16:23 -0600)]
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>
3 months agobinman: Switch to setuptools
Tom Rini [Wed, 12 Feb 2025 22:23:39 +0000 (16:23 -0600)]
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>
3 months agodtoc: Switch to setuptools
Tom Rini [Wed, 12 Feb 2025 22:23:46 +0000 (16:23 -0600)]
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>
3 months agotest/py: Have test_usb.py raise an Exception with unsupported filesystems
Tom Rini [Wed, 12 Feb 2025 22:23:54 +0000 (16:23 -0600)]
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>
3 months agotest/py: Rework how test_ums.py handles (not) having write enabled
Tom Rini [Wed, 12 Feb 2025 22:24:00 +0000 (16:24 -0600)]
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>
3 months agotest/py: Rework test_spi.py to assert we found output
Tom Rini [Wed, 12 Feb 2025 22:24:07 +0000 (16:24 -0600)]
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>
3 months agoMerge patch series "FIT Image Boot Fixes for am57xx_hs_evm"
Tom Rini [Thu, 20 Feb 2025 22:14:53 +0000 (16:14 -0600)]
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
3 months agoinclude: configs: omap5: Add support for FDT overlay
Sinthu Raja [Tue, 11 Feb 2025 09:49:31 +0000 (15:19 +0530)]
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>
3 months agoconfigs: omap5: Enable custom mmc boot to distroboot for AM57x
Sinthu Raja [Tue, 11 Feb 2025 09:49:30 +0000 (15:19 +0530)]
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>
3 months agoinclude: configs: Override get_fit_config to get FIT config for AM57x
Sinthu Raja [Tue, 11 Feb 2025 09:49:29 +0000 (15:19 +0530)]
include: configs: Override get_fit_config to get FIT config for AM57x

Kernel commit 837833a724b7 ("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>
3 months agoMerge patch series "configs: phycore_am64x_a53_defconfig: Enable ENV_IS_IN_SPI_FLASH"
Tom Rini [Thu, 20 Feb 2025 22:13:28 +0000 (16:13 -0600)]
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
3 months agoboard: Phytec: phycore_am62x: Increase size for Image in SPI
Daniel Schultz [Mon, 10 Feb 2025 15:25:48 +0000 (07:25 -0800)]
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>
3 months agoboard: Phytec: phycore_am64x: Increase size for Image in SPI
Daniel Schultz [Mon, 10 Feb 2025 15:25:47 +0000 (07:25 -0800)]
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>
3 months agoconfigs: phycore_am62x_a53_defconfig: Enable ENV_IS_IN_SPI_FLASH
Daniel Schultz [Mon, 10 Feb 2025 15:25:46 +0000 (07:25 -0800)]
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>
3 months agoconfigs: phycore_am64x_a53_defconfig: Enable ENV_IS_IN_SPI_FLASH
Daniel Schultz [Mon, 10 Feb 2025 15:25:45 +0000 (07:25 -0800)]
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>
3 months agoMerge patch series "AM62,AM62-LP,AM62A,AM62P,J722S: USB DFU and UMS"
Tom Rini [Thu, 20 Feb 2025 22:08:19 +0000 (16:08 -0600)]
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
3 months agoconfigs: am62x_a53_usbdfu: enable USB MASS Storage command
Siddharth Vadapalli [Mon, 10 Feb 2025 11:22:30 +0000 (16:52 +0530)]
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>
3 months agoconfigs: j722s_evm_a53_defconfig: enable USB DFU support
Siddharth Vadapalli [Mon, 10 Feb 2025 11:22:29 +0000 (16:52 +0530)]
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>
3 months agoboard: ti: j722s: env: include environment for DFU
Siddharth Vadapalli [Mon, 10 Feb 2025 11:22:28 +0000 (16:52 +0530)]
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>
3 months agoconfigs: am62px_evm_a53_defconfig: enable USB DFU support
Siddharth Vadapalli [Mon, 10 Feb 2025 11:22:27 +0000 (16:52 +0530)]
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>
3 months agoconfigs: am62x_r5_usbdfu: extend for AM62Px
Siddharth Vadapalli [Mon, 10 Feb 2025 11:22:26 +0000 (16:52 +0530)]
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>
3 months agoboard: ti: am62px: env: include environment for DFU Boot
Siddharth Vadapalli [Mon, 10 Feb 2025 11:22:25 +0000 (16:52 +0530)]
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>
3 months agoconfigs: am62ax_evm_a53_defconfig: enable USB DFU support
Siddharth Vadapalli [Mon, 10 Feb 2025 11:22:24 +0000 (16:52 +0530)]
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>
4 months agoMerge patch series "bloblist: refactor xferlist and bloblist"
Tom Rini [Thu, 20 Feb 2025 00:49:47 +0000 (18:49 -0600)]
Merge patch series "bloblist: refactor xferlist and bloblist"

Tom Rini <trini@konsulko.com> says:

This small series separates "bloblist" and "standard passage" to allow
for these similar concepts to explore solutions to problems without
introduces breaking changes to the other.

Link: https://lore.kernel.org/r/20250220000223.1044376-1-raymond.mao@linaro.org
4 months agobloblist: kconfig for mandatory incoming standard passage
Raymond Mao [Thu, 20 Feb 2025 00:02:20 +0000 (16:02 -0800)]
bloblist: kconfig for mandatory incoming standard passage

In previous commit, incoming standard passage is used by default
when initializing the bloblist, so explicitly BLOBLIST_PASSAGE is
no more needed.
Rename it as BLOBLIST_PASSAGE_MANDATORY to determine the behaviors
when an incoming transfer list does not exist or is invalid.
When it is selected, incoming standard passage is mandatory and
U-Boot will report an error when a valid incoming transfer list is
missing.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
4 months agobloblist: refactor xferlist and bloblist
Raymond Mao [Thu, 20 Feb 2025 00:02:19 +0000 (16:02 -0800)]
bloblist: refactor xferlist and bloblist

Refactor the xferlist to remove the relocating when bloblist passed
from the boot args.
Refactor bloblist init to use incoming standard passage by default
if a valid transfer list exists in the boot args.
For bloblist relocation, use the actual total size if it has a smaller
BLOBLIST_SIZE_RELOC.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Suggested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
4 months agogpio: pca953x: support pcal6408 and pcal6416
Emanuele Ghidoli [Tue, 11 Feb 2025 21:06:00 +0000 (22:06 +0100)]
gpio: pca953x: support pcal6408 and pcal6416

Add support to NXP GPIO expanders pcal6408, documented at [1], and
pcal6416, documented at [2].

[1] https://www.nxp.com/docs/en/data-sheet/PCAL6408A.pdf
[2] https://www.nxp.com/docs/en/data-sheet/PCAL6416A.pdf

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
4 months agonet: designware: Add npcm8xx sgmii pcs support
Jim Liu [Tue, 11 Feb 2025 02:02:01 +0000 (10:02 +0800)]
net: designware: Add npcm8xx sgmii pcs support

The PCS exists only in GMAC1 and relates to SGMII interface and
is used to control the SGMII PHY.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
[trini: Adjust slightly for white space and to move 'start' to within if
        block]

4 months agoboard: verdin-am62: add dram_init_banksize
Stefan Eichenberger [Mon, 10 Feb 2025 07:27:47 +0000 (08:27 +0100)]
board: verdin-am62: add dram_init_banksize

Add the dram_init_banksize function to the board file to properly set
DRAM memory sizes during boot.

The commit bc07851897bd ("board: ti: Pull redundant DDR functions to a
common location and Fixup DDR size when ECC is enabled") relocated the
dram_init_banksize function from architecture specific initialization to
the TI board initialization code. As a result, boards relying on the
previous setup now require this function to be defined within their
board file to handle DRAM sizing correctly.

Without this function defined the following error appears during boot:
    ERROR: Failed to allocate 0x1000 bytes below 0x0.

Fixes: bc07851897bd ("board: ti: Pull redundant DDR functions to a common location and Fixup DDR size when ECC is enabled")
Signed-off-by: Stefan Eichenberger <stefan.eichenberger@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
4 months agoboard: nuvoton: use an event to replace last_stage_init()
Michael Chang [Mon, 10 Feb 2025 02:37:10 +0000 (10:37 +0800)]
board: nuvoton: use an event to replace last_stage_init()

Add a new event which handles this function refer to commit
("91caa3bb89b1 event: Use an event to replace last_stage_init()")

Signed-off-by: Michael Chang <zhang971090220@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agotools: Fix potential null-deref with result of strtok_r
Maks Mishin [Sun, 9 Feb 2025 15:46:21 +0000 (18:46 +0300)]
tools: Fix potential null-deref with result of strtok_r

Return value of a function 'strtok_r' is dereferenced at kwbimage.c:1655
without checking for NULL, but it is usually checked for this function.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
4 months agou-boot-initial-env: Add missing dependencies
Tom Rini [Sun, 9 Feb 2025 14:34:09 +0000 (08:34 -0600)]
u-boot-initial-env: Add missing dependencies

When performing a build consisting of only a defconfig target and then
this tool, we were missing two dependencies. Add them.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoMerge tag 'u-boot-at91-2025.07-a' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 18 Feb 2025 13:59:59 +0000 (07:59 -0600)]
Merge tag 'u-boot-at91-2025.07-a' of https://source.denx.de/u-boot/custodians/u-boot-at91 into next

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

This feature set includes improvements on the atmel-quadspi driver, a
fix for the nand driver, and improvements on the pinctrl driver to be
able to use the Linux DT (also sync on the DT side as well).

4 months agou_boot_pylib: Move gitutil into the library
Simon Glass [Sun, 9 Feb 2025 21:26:00 +0000 (14:26 -0700)]
u_boot_pylib: Move gitutil into the library

Move this file into U-Boot's Python library, so that it is no-longer
part of patman.

This makes a start on:

https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agospi: soft_spi: Add support for SPI_3WIRE
Hironori KIKUCHI [Fri, 31 Jan 2025 01:38:41 +0000 (10:38 +0900)]
spi: soft_spi: Add support for SPI_3WIRE

When 3-wire mode is claimed on the bus, use the MOSI (output) pin to
receive data. In this mode, since the transfer can only be either TX
or RX, return -EINVAL if both are required at the same time.

Signed-off-by: Hironori KIKUCHI <kikuchan98@gmail.com>
4 months agoMerge patch series "Rework requirements.txt files"
Tom Rini [Fri, 14 Feb 2025 23:11:37 +0000 (17:11 -0600)]
Merge patch series "Rework requirements.txt files"

Tom Rini <trini@konsulko.com> says:

A challenge we've run in to is making it easier for more people to use
various python tools that we include in the tree. Part of the problem is
that when we have a requirements.txt file, aside from the doc one we
share with the kernel, I created it using "pip freeze". And while this
might have been a best (or at least OK) practice at the time, that's no
longer the case and is why our files have so many things in them. What
this series does is create multiple files, one per project/tool and then
has CI install them as needed. There's a few places here where this
means that we update the requirements as well, but we keep a few big
things where they are currently. This is because updating them
introduces problems of their own and delaing with that would best be a
follow up series. I've put this through GitLab and Azure to make sure
everything is still going fine on both platforms.

Link: https://lore.kernel.org/r/20250205000743.949790-1-trini@konsulko.com
4 months agoDockerfile: Update for having more requirements.txt files
Tom Rini [Tue, 4 Feb 2025 23:12:09 +0000 (17:12 -0600)]
Dockerfile: Update for having more requirements.txt files

Now that we have more requirements.txt files we need to grab all of them
for creating our cache. Also, we do longer should install
python3-pyelftools on the host as it's not used.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agopython: Recreate test/py and tools/buildman requirements.txt files
Tom Rini [Tue, 4 Feb 2025 23:12:08 +0000 (17:12 -0600)]
python: Recreate test/py and tools/buildman requirements.txt files

Use the "pipreqs" tool to re-create these files, with a few manual
corrections. We still need to include pytest-xdist which the tool does
not detect. We also for now don't upgrade most of the required tools as
that creates problems with various tests, which should be resolved
independently.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoCI: Invoke pip once rather than multiple times
Tom Rini [Tue, 4 Feb 2025 23:12:07 +0000 (17:12 -0600)]
CI: Invoke pip once rather than multiple times

We can invoke pip once to install the various requirements.txt files
that we need rather than invoking the tool multiple times.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoCI: Consistently install our requirements.txt files
Tom Rini [Tue, 4 Feb 2025 23:12:06 +0000 (17:12 -0600)]
CI: Consistently install our requirements.txt files

We should install all of our requirements.txt files after starting the
virtualenv rather than ad-hoc throughout each test.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoCI: Be consistent in creating and starting our virtualenv
Tom Rini [Tue, 4 Feb 2025 23:12:05 +0000 (17:12 -0600)]
CI: Be consistent in creating and starting our virtualenv

Before we invoke pip we should always have first created and started our
virtualenv. This was done most of the time, but not always.

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agopython: Create requirements.txt files for each "project"
Tom Rini [Tue, 4 Feb 2025 23:12:04 +0000 (17:12 -0600)]
python: Create requirements.txt files for each "project"

Rather than have a requirements.txt file that's shared between multiple
python projects within U-Boot, create one for each using "pipreqs".

Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoboard: ti: am62px: tifs-rm-cfg/rm-cfg: Update DMA resource sharing for CPSW
Siddharth Vadapalli [Wed, 5 Feb 2025 13:14:40 +0000 (18:44 +0530)]
board: ti: am62px: tifs-rm-cfg/rm-cfg: Update DMA resource sharing for CPSW

The CPSW3G instance of CPSW on AM62PX SoC provides Ethernet functionality.
Currently, Ethernet is supported on Linux which runs on the A53 core on the
SoC, by allocating all of the DMA resources associated with CPSW to A53_2.

In order to enable use-cases where the Ethernet traffic is sent from or
consumed by various CPU cores on the SoC simultaneously, while at the
same time, maintaining backward compatibility with the existing use-case
of A53 being the sole entity that exchanges traffic with CPSW via DMA,
update the DMA resource sharing scheme on AM62PX SoC to the following:

---------------      --------------   -------------  ----------------
   Resource              WKUP_R5         MCU_R5            A53_2
---------------      --------------   -------------  ----------------
TX Channels [8]  =>    4 (Primary)     4 (Primary)     8 (Secondary)
TX Rings   [64]  =>   32 (Primary)    32 (Primary)    64 (Secondary)
RX Channels [1]  =>    1 (Primary)     0               1 (Secondary)
RX Flows   [16]  =>    6 (Primary)    10 (Primary)    16 (Secondary)

In the absence of primary owners of resources (existing use-case
where A53 owns all of the CPSW DMA resources), the secondary owner
can claim all of the resources as its own. For shared use-cases,
the resources that are not claimed by the primary are communicated
to the secondary owner allowing it to claim them. This ensures that
Linux on A53_2 can continue claiming all DMA resources associated
with CPSW in the absence of primary owners, while at the same time
providing users the flexibility to share CPSW DMA resources across
various CPU cores listed above if needed.

While Linux has been mentioned as the Operating System running
on A53, there is no dependency between the Operating System
running on A53 and its ability to claim the CPSW DMA resources
listed above.

Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
4 months agoMerge patch series "Introduce K3 remoteproc driver for M4 subsystem"
Tom Rini [Fri, 14 Feb 2025 19:17:47 +0000 (13:17 -0600)]
Merge patch series "Introduce K3 remoteproc driver for M4 subsystem"

Judith Mendez <jm@ti.com> says:

Some K3 devices like am62x and am64x have a M4 processor in the MCU
voltage domain. This patch series introduces remoteproc M4 driver which
will be used to load firmware into and start the M4 remote core.

This series also adds support for R5F cores on am64x SoCs in patch 2 and
sets up environment to load FW in remote cores in patch 3,4,5.

This patch series also enables remoteproc drivers by default as per what
remoteproc sybsystem is supported per SoC, thus all remoteproc options
are now deleted in configs/* since they are no longer required.

This patch series was tested on am64x EVM, am62x SK, am62ax SK,
am62px SK boards.

Any additional tested by's are welcome since I was not able to
test any additional boards.

Tested by running the following commands in u-boot prompt:

=> setenv dorprocboot 1
=> run boot_rprocs

Link: https://lore.kernel.org/r/20250210202944.1071931-1-jm@ti.com
4 months agoconfigs: am6*/j7*: Remove remoteproc configs
Judith Mendez [Mon, 10 Feb 2025 20:29:44 +0000 (14:29 -0600)]
configs: am6*/j7*: Remove remoteproc configs

Now that remoteproc configs are enabled by default in Kconfig
files, remove these configs which are no longer needed to be
defined here in configs/.

Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoarm: mach-k3: Enable remoteproc drivers by default for K3 ARCH
Judith Mendez [Mon, 10 Feb 2025 20:29:43 +0000 (14:29 -0600)]
arm: mach-k3: Enable remoteproc drivers by default for K3 ARCH

Add remoteproc config options to enable remoteproc drivers by
default as per what remotproc subsystem is supported on each
SoC.

Signed-off-by: Judith Mendez <jm@ti.com>
4 months agocmd: Enable CMD remoteproc by default for K3 ARCH
Judith Mendez [Mon, 10 Feb 2025 20:29:42 +0000 (14:29 -0600)]
cmd: Enable CMD remoteproc by default for K3 ARCH

Enable CMD_REMOTEPROC by default if building for K3 ARCH so
that it does not have to be defined in each board defconfig
file.

Signed-off-by: Judith Mendez <jm@ti.com>
4 months agospl: Enable SPL remoteproc by default for K3 ARCH
Judith Mendez [Mon, 10 Feb 2025 20:29:41 +0000 (14:29 -0600)]
spl: Enable SPL remoteproc by default for K3 ARCH

If building for v7R and K3 architecture, enable SPL
remoteproc so that it does not have to be defined in each
board defconfig file.

Signed-off-by: Judith Mendez <jm@ti.com>
4 months agoremoteproc: Enable ARM64 remoteproc driver by default for K3 ARCH
Judith Mendez [Mon, 10 Feb 2025 20:29:40 +0000 (14:29 -0600)]
remoteproc: Enable ARM64 remoteproc driver by default for K3 ARCH

If SYS_K3_SPL_ATF is enabled, for K3 ARCH enable the
remoteproc ARM64 driver by default so that it does not
have to be defined in each board defconfig file.

Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoboard: ti: am62px: Add remoteproc specific env support
Hari Nagalla [Mon, 10 Feb 2025 20:29:39 +0000 (14:29 -0600)]
board: ti: am62px: Add remoteproc specific env support

Add remoteproc specific env support for am62px device. If the
remoteproc CMD is defined, include the K3 remoteproc environment.
Also define rproc_fw_binaries which holds a list of remoteproc FW
binaries for u-boot loading of remote cores.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoboard: ti: am62x: Add remoteproc specific env support
Hari Nagalla [Mon, 10 Feb 2025 20:29:38 +0000 (14:29 -0600)]
board: ti: am62x: Add remoteproc specific env support

Add remoteproc specific env support for am62x device. If the
remoteproc CMD is defined, include the K3 remoteproc environment.
Also define rproc_fw_binaries which holds a list of remoteproc FW
binaries for u-boot loading of remote cores.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoboard: ti: am64x: Add remoteproc specific env support
Hari Nagalla [Mon, 10 Feb 2025 20:29:37 +0000 (14:29 -0600)]
board: ti: am64x: Add remoteproc specific env support

Add remoteproc specific env support for am64x device. If the
remoteproc CMD is defined, include the K3 remoteproc environment.
Also define rproc_fw_binaries which holds a list of remoteproc FW
binaries for u-boot loading of remote cores.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoremoteproc: k3-r5: Add support for R5F cores on AM64x SoCs
Hari Nagalla [Mon, 10 Feb 2025 20:29:36 +0000 (14:29 -0600)]
remoteproc: k3-r5: Add support for R5F cores on AM64x SoCs

AM64x SoCs have two R5F clusters in the main power domain.
Extend support for R5F remote proc driver on AM64x with compatible
strings.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Judith Mendez <jm@ti.com>
Reviewed-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoremoteproc: k3-m4: Introduce K3 remote proc driver for M4 subsystem
Hari Nagalla [Mon, 10 Feb 2025 20:29:35 +0000 (14:29 -0600)]
remoteproc: k3-m4: Introduce K3 remote proc driver for M4 subsystem

Some K3 devices like AM64, AM62 devices have a M4 processor in MCU
voltage domain.

Add a remote proc driver to support this subsystem to be able to load
and boot the M4 core.

Signed-off-by: Hari Nagalla <hnagalla@ti.com>
[Ryan: Fix implicitly include warning]
Signed-off-by: Ryan Eatmon <reatmon@ti.com>
[Judith: Cleanup driver, fix warnings, remove lreset logic]
Signed-off-by: Judith Mendez <jm@ti.com>
Tested-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Andrew Davis <afd@ti.com>
4 months agoKconfig: Move CONFIG_BOOTCOUNT_ALTBOOTCMD to Kconfig
Tomas Peterka [Fri, 31 Jan 2025 10:08:44 +0000 (11:08 +0100)]
Kconfig: Move CONFIG_BOOTCOUNT_ALTBOOTCMD to Kconfig

Add CONFIG_BOOTCOUNT_ALTBOOTCMD so the developer is able to add
custom altbootcmd via Kconfig when they enable BOOTCOUNT. With this now
in Kconfig, we need to move it from environment files / config.h files
and in to the defconfig file.

This was done by generating u-boot-initial-env for all platforms before
the Kconfig change, to extract altbootcmd values and then again after to
compare the result.

[trini: Perform migration to defconfigs, reword commit message]
Signed-off-by: Tom Rini <trini@konsulko.com>
4 months agoMerge patch series "test: Complete the suite migration"
Tom Rini [Thu, 13 Feb 2025 15:52:16 +0000 (09:52 -0600)]
Merge patch series "test: Complete the suite migration"

Simon Glass <sjg@chromium.org> says:

This series completes the removal of test commands for suites. With this
it is possible to declare a suite (including init and uninit functions)
without needing to write a command.

It also adds timing for test suites, so we can keep track of how long
things take.

Link: https://lore.kernel.org/all/20250207183121.117663-1-sjg@chromium.org/
4 months agomtd: nand: raw: atmel: Fix pulse read timing for certain NAND flashes
Alexander Dahl [Mon, 15 Apr 2024 07:57:55 +0000 (09:57 +0200)]
mtd: nand: raw: atmel: Fix pulse read timing for certain NAND flashes

From reading the S34ML02G1 and the SAM9X60 datasheets again, it seems
like we have to wait tREA after rising RE# before sampling the data.
Thus pulse time must be at least tREA.

Without this fix we got PMECC errors when reading, after switching to
ONFI timing mode 3 on SAM9X60 SoC with S34ML02G1 raw NAND flash chip.

The approach to set timings used before worked on sam9g20 and sama5d2
with the same flash (S34ML02G1), probably because those have a slower
mck clock rate and thus the resolution of the timings setup is not as
tight as with sam9x60.

The approach to fix the issue was carried over from at91bootstrap, and
has been successfully tested in at91bootstrap, U-Boot and Linux.

Link: https://github.com/linux4sam/at91bootstrap/issues/174
Cc: Li Bin <bin.li@microchip.com>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
4 months agoARM: dts: at91: Align pinctrl node with Linux Devicetree
Manikandan Muralidharan [Mon, 10 Feb 2025 06:51:43 +0000 (12:21 +0530)]
ARM: dts: at91: Align pinctrl node with Linux Devicetree

The GPIO banks are added as sub nodes or child nodes under the
pinctrl node (as per Linux ABI) and the reg property which points
to an array of controllers physical base address is removed
to align with the Linux devicetree.

Signed-off-by: Charan Pedumuru <charan.pedumuru@microchip.com>
Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
4 months agopinctrl: at91: Add support to align with Linux Devicetree
Manikandan Muralidharan [Mon, 10 Feb 2025 06:51:42 +0000 (12:21 +0530)]
pinctrl: at91: Add support to align with Linux Devicetree

U-Boot pinctrl driver expects a reg property explicitly unlike linux.
To align the DT of U-boot with the Linux, reg property is also arrvied
from child GPIO bank nodes when configured under the pinctrl node.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
4 months agopinctrl: at91: Bind GPIO driver to the pinctrl DT node
Manikandan Muralidharan [Mon, 10 Feb 2025 06:51:41 +0000 (12:21 +0530)]
pinctrl: at91: Bind GPIO driver to the pinctrl DT node

In Linux DT,the pinctrl node acts as parent nodes with all other
gpio banks as child nodes and a single driver in Linux handles both
pinctrl settings and gpio requests.Current U-Boot DT maintains both
pinctrl and gpio nodes as separate nodes and offers two different class
of U-Boot drivers: UCLASS_PINCTRL which handles pin functions and
UCLASS_GPIO which handles gpio requests. In order to align the DT
of U-Boot with the DT of Linux, a hook is been added in the pinctrl
driver to bind the gpio driver with the pinctrl driver so that
when adding gpio nodes as subnodes to pinctrl node (as per the Linux ABI),
the corresponding APIs will be redirected and handled by valid
drivers attached to the pinctrl driver.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
4 months agoARM: dts: at91: sam9x60: Add missing pinctrl node properties
Manikandan Muralidharan [Mon, 10 Feb 2025 06:51:40 +0000 (12:21 +0530)]
ARM: dts: at91: sam9x60: Add missing pinctrl node properties

Add the missing properties for the pinctrl node and for its
corresponding GPIO bank nodes to align with the Linux DT.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
4 months agoARM: dts: at91: sam9x60: Move pinmux node to board DTS
Manikandan Muralidharan [Mon, 10 Feb 2025 06:51:39 +0000 (12:21 +0530)]
ARM: dts: at91: sam9x60: Move pinmux node to board DTS

Move pinmux nodes defined under the pinctrl node from sam9x60 SoC
DT to its board specific DTS files.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
4 months agoARM: dts: at91: sam9x60: Define pinctrl node with its label
Balamanikandan Gunasundar [Mon, 10 Feb 2025 06:51:38 +0000 (12:21 +0530)]
ARM: dts: at91: sam9x60: Define pinctrl node with its label

Define the pinctrl nodes with its label to align with the Linux DT.
Without this change the pinmux nodes are grouped under an additional
'pinctrl' child node which is not identified by the pinctrl driver
when the GPIO banks are made as child nodes of pinctrl node.

Signed-off-by: Balamanikandan Gunasundar <balamanikandan.gunasundar@microchip.com>
Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
4 months agoARM: dts: at91: sam9x60: Add AIC node
Manikandan Muralidharan [Mon, 10 Feb 2025 06:51:37 +0000 (12:21 +0530)]
ARM: dts: at91: sam9x60: Add AIC node

Add Advanced Interrupt Controller node and define it as interrupt
parent in sam9x60 SoC DT.

Signed-off-by: Manikandan Muralidharan <manikandan.m@microchip.com>
Reviewed-by: Eugen Hristev <eugen.hristev@linaro.org>
4 months agospi: atmel-quadspi: Improve probe debugging
Alexander Dahl [Thu, 23 Jan 2025 12:12:15 +0000 (13:12 +0100)]
spi: atmel-quadspi: Improve probe debugging

Report spi clk speed and make use of `log_ret()`.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
4 months agospi: atmel-quadspi: Add support for classic SPI mode
Alexander Dahl [Thu, 23 Jan 2025 12:12:14 +0000 (13:12 +0100)]
spi: atmel-quadspi: Add support for classic SPI mode

The qspi controller on sama5d2 and sam9x60 supports "classic" SPI mode
without spi-mem enhancements and accelerations, very similar to the old
SPI controller on sam9g20 or the modern flexcom controllers of the same
SoC family.

Register interface differs somewhat, especially because only one
hardware controlled CS line is supported.  Some fields are missing, some
are in different registers, but in principal it works similar.  So code
is very much inspired by the old atmel-spi driver.

Tested on sam9x60 with a non-mainline driver to configure an FPGA.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
4 months agospi: atmel-quadspi: Allow setting SMM to classic SPI mode
Alexander Dahl [Thu, 23 Jan 2025 12:12:13 +0000 (13:12 +0100)]
spi: atmel-quadspi: Allow setting SMM to classic SPI mode

Switching between Serial Memory Mode (SMM) and (classic) SPI mode is a
preparation for implementing .xfer() in the future.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
4 months agospi: atmel-quadspi: Remove default mode setting at probe time
Alexander Dahl [Thu, 23 Jan 2025 12:12:12 +0000 (13:12 +0100)]
spi: atmel-quadspi: Remove default mode setting at probe time

The Serial Memory Mode (SMM) is enabled with atmel_qspi_set_cfg() on
each invocation of atmel_qspi_exec_op().  Setting SMM through
atmel_qspi_init() at probe time is redundant.

Removing the SMM setting at probe time should therefore 1) be safe to do
and 2) allows for setting it to a different value in a future
implementation of .xfer() which needs to disable SMM.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
4 months agospi: atmel-quadspi: Avoid overwriting MR register settings
Alexander Dahl [Thu, 23 Jan 2025 12:12:11 +0000 (13:12 +0100)]
spi: atmel-quadspi: Avoid overwriting MR register settings

Port these commits:

- v6.11-rc5-90-g329ca3eed4a9a ("spi: atmel-quadspi: Avoid overwriting delay register settings")
- v6.12-rc1-1-g162d9b5d2308c ("spi: atmel-quadspi: Fix wrong register value written to MR").
- v6.13-rc2-27-gf663898d047a7 ("spi: atmel-quadspi: Factor out switching to Serial Memory Mode to function")

Cc: Csókás Bence <csokas.bence@prolan.hu>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
4 months agospi: atmel-quadspi: Port collected fixes from Linux v5.10 and v5.15
Alexander Dahl [Thu, 23 Jan 2025 12:12:10 +0000 (13:12 +0100)]
spi: atmel-quadspi: Port collected fixes from Linux v5.10 and v5.15

Port changes from a 4 piece patch series from Linux kernel v5.10, merged
with v5.10-rc1-83-gc732b7567d869 ("Merge series "spi: atmel-quadspi: Fix
AHB memory accesses" from Tudor Ambarus …").

Port the single fix v5.15-rc1-14-g09134c5322df9 ("spi: Fixed division by
zero warning").

Reduces differences between linux and u-boot driver.

Cc: Tudor Ambarus <tudor.ambarus@microchip.com>
Cc: Yoshitaka Ikeda <ikeda@nskint.co.jp>
Signed-off-by: Alexander Dahl <ada@thorsis.com>
4 months agospi: atmel-quadspi: Depend on SPI_MEM
Alexander Dahl [Thu, 23 Jan 2025 07:37:13 +0000 (08:37 +0100)]
spi: atmel-quadspi: Depend on SPI_MEM

Most other spi-mem drivers also depend on SPI_MEM.  Fixes this build
error:

    arm-v5te-linux-gnueabi-ld.bfd: drivers/spi/atmel-quadspi.o: in function `atmel_qspi_supports_op':
    /mnt/data/adahl/src/u-boot/drivers/spi/atmel-quadspi.c:460: undefined reference to `spi_mem_default_supports_op'
    make[1]: *** [/mnt/data/adahl/src/u-boot/Makefile:1821: u-boot] Error 1

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agospi: ca_sflash: Remove redundant dependency
Alexander Dahl [Thu, 23 Jan 2025 07:37:12 +0000 (08:37 +0100)]
spi: ca_sflash: Remove redundant dependency

This is inside of an 'if DM_SPI' block, and thus always true.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
4 months agotest: Update documentation
Simon Glass [Fri, 7 Feb 2025 18:31:00 +0000 (11:31 -0700)]
test: Update documentation

Update documentation for how to write tests and the 'ut' command.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Do flag-processing in the correct place
Simon Glass [Fri, 7 Feb 2025 18:30:59 +0000 (11:30 -0700)]
test: Do flag-processing in the correct place

At present the 'ut' command handles its flags in a strange way, in that
they must come after the subcommand.

So, we must use 'ut bloblist -r2' to run the bloblist tests twice. This
is an artefact of the way tests were run, through subcommands.

It is now possible to correct this, by doing flag-processing before
running the suite.

Update the code to handle this, so that 'ut -r2 bloblist' works. Update
the 'test_suite' test to check the new arguments.

Add a sanity-check for -I while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Move code out of cmd_ut_category()
Simon Glass [Fri, 7 Feb 2025 18:30:58 +0000 (11:30 -0700)]
test: Move code out of cmd_ut_category()

Move the logic from this function into run_suite(), on the way to having
flag parsing in the top-level 'ut' command instead of its children.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Allow running a selection of suites
Simon Glass [Fri, 7 Feb 2025 18:30:57 +0000 (11:30 -0700)]
test: Allow running a selection of suites

Enhance the ut command to accept a comma-separated list of test suites
to run. Report the summary information for these at the end.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Drop suites.h
Simon Glass [Fri, 7 Feb 2025 18:30:56 +0000 (11:30 -0700)]
test: Drop suites.h

This file is empty now. Remove it and its uses.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Make cmd_ut_category() static
Simon Glass [Fri, 7 Feb 2025 18:30:55 +0000 (11:30 -0700)]
test: Make cmd_ut_category() static

This function is not used outside the cmd_ut file anymore, so make it
static.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Drop support for test commands
Simon Glass [Fri, 7 Feb 2025 18:30:54 +0000 (11:30 -0700)]
test: Drop support for test commands

Now that everything is using the new test-suite features, drop support
for running commands.

Fix a missing closing-bracket while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Rename optee test-file
Simon Glass [Fri, 7 Feb 2025 18:30:53 +0000 (11:30 -0700)]
test: Rename optee test-file

This has nothing to do with commands anymore, so rename the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Drop the function for running optee tests
Simon Glass [Fri, 7 Feb 2025 18:30:52 +0000 (11:30 -0700)]
test: Drop the function for running optee tests

Use the new suite-runner to run these tests instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Split optee tests into three functions
Simon Glass [Fri, 7 Feb 2025 18:30:51 +0000 (11:30 -0700)]
test: Split optee tests into three functions

These tests run three different checks on the nodes, but the logic is
currently all in one tests.

Split the code out into three different tests, which do different setup
and then run the same checks.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Update optee to do init and uninit from tests
Simon Glass [Fri, 7 Feb 2025 18:30:50 +0000 (11:30 -0700)]
test: Update optee to do init and uninit from tests

Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.

Fix the comment abotu 'environment' while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Drop the function for running bootstd tests
Simon Glass [Fri, 7 Feb 2025 18:30:49 +0000 (11:30 -0700)]
test: Drop the function for running bootstd tests

Use the new suite-runner to run these tests instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
4 months agotest: Update bootstd to do init from tests
Simon Glass [Fri, 7 Feb 2025 18:30:48 +0000 (11:30 -0700)]
test: Update bootstd to do init from tests

Rather than having an init function and then running the tests, create a
test-init function to do it. This will allow us to get rid of the
command function.

Signed-off-by: Simon Glass <sjg@chromium.org>