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>
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).
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.
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.
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.
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.
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:
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.
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:
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>
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>
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>
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>
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>
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>
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.
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.
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.
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.
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.
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.
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.
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.
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 …").
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.
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.
Simon Glass [Fri, 7 Feb 2025 18:30:46 +0000 (11:30 -0700)]
test: Update fdt_overlay 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.
Simon Glass [Fri, 7 Feb 2025 18:30:44 +0000 (11:30 -0700)]
test: Move fdt_overlay init into a function
Move the init code into a separate function since it is quite large.
Adjust it to use unit-test functions which have become available since
the test was written.
Simon Glass [Fri, 7 Feb 2025 18:30:38 +0000 (11:30 -0700)]
test: Support an init/uninit functions for test suites
Some suites need things to be set up before they can run. Add a way to
declare an init function using the UNIT_TEST_INIT() macro. The init
function is just like any other test, but is always placed first so that
it runs before all the other test functions in the suite.
Add an uninit function as well, to clean up after the test.
Simon Glass [Fri, 7 Feb 2025 18:30:36 +0000 (11:30 -0700)]
test: Show the average time per test
Show the average duration of a test, so we can keep track of how it is
trending. Report the suite with the longest average test to encourage
people to improve it.
Add a function to update the stats based on the results from a single
suite and another to show the summary information.
Make this optional, since sandbox's SPL tests do not have a timer driver
and people may want to print results without times.
Simon Glass [Fri, 7 Feb 2025 18:30:34 +0000 (11:30 -0700)]
test: Add up the number of tests manually
All tests should belong to a suite, but if there is a suite we don't
know about (e.g. not added to cmd_ut.c) then the totals will not add up.
Add a check for this.
Tom Rini [Wed, 12 Feb 2025 00:09:05 +0000 (18:09 -0600)]
Merge patch series "Enable bloblist support on Vexpress64"
Harrison Mutai <harrison.mutai@arm.com> says:
This series of patches enhances the vexpress64 platform by enabling bloblist
support. It also introduces support for CONFIG_BLOBLIST_PASSAGE. This is
necessary to boot vexpress64 and other boards without manually specifying a
fixed address and size for the bloblist.
After this change, all the bloblist init modes are supported (i.e., fixed,
alloc, passage) and Vexpress64 boots with CONFIG_BLOBLIST_PASSAGE.
Harrison Mutai [Tue, 4 Feb 2025 17:58:41 +0000 (17:58 +0000)]
bloblist: add support for CONFIG_BLOBLIST_PASSAGE
When the configuration option CONFIG_BLOBLIST_PASSAGE is selected, the
bloblist present in the incoming standard passage is utilised in-place.
There is no need to specify the size of the bloblist as the system
automatically detects it using the header information.
Signed-off-by: Harrison Mutai <harrison.mutai@arm.com>
Anton Moryakov [Thu, 6 Feb 2025 22:01:23 +0000 (01:01 +0300)]
common: Add NULL checks for xrealloc in make_string cli_hush.c
- Check return value of xrealloc for NULL.
- Free allocated memory and return NULL if xrealloc fails.
- Prevent NULL pointer dereference in strlen and strcat.
Triggers found by static analyzer Svace.
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Anton Moryakov [Thu, 6 Feb 2025 21:55:21 +0000 (00:55 +0300)]
common: Add NULL checks for malloc_cache_aligned in autoboot.c
- Check return value of malloc_cache_aligned for presskey and sha.
- Return -ENOMEM if memory allocation fails.
- Free allocated memory in error paths."
Triggers found by static analyzer Svace.
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Anton Moryakov [Thu, 30 Jan 2025 13:42:43 +0000 (16:42 +0300)]
tools: fix NULL_AFTER_DEREF in image-host.c
Report of the static analyzer:
1. NULL_AFTER_DEREF Pointer 'str', which is dereferenced at
image-host.c:688 by calling function 'strdup', is compared to a NULL
value at image-host.c:691.
2. NULL_AFTER_DEREF Pointer 'list', which is dereferenced at
image-host.c:689, is compared to a NULL value at image-host.c:691.
Corrections explained:
1. Checking for NULL before using pointers: The if (!list || !str) check
is now performed before calling strdup and realloc, which prevents
null pointer dereferences.
2. Checking the result of strdup: strdup can return NULL if memory
allocation fails. This also needs to be checked.
3. Checking the result of realloc: If realloc returns NULL, then memory
has not been allocated and dup must be freed to avoid memory leaks.
Triggers found by static analyzer Svace.
Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
Simon Glass [Sun, 1 Dec 2024 14:42:29 +0000 (07:42 -0700)]
CI: Drop extra condition for sjg lab
The rules part of the template makes sure that this doesn't run until
specifically requested. Drop the check in the script itself, so it is
possible to trigger a run manually without re-pushing the tree.
Santhosh Kumar K [Wed, 29 Jan 2025 23:44:02 +0000 (17:44 -0600)]
arm: mach-k3: am62*_init: Probe ESM nodes
On AM62A and AM62P devices, it is possible to route Main ESM error
events to MCU ESM. MCU ESM high error output can trigger the reset
logic to reset the device. So, for these devices we have Main ESM and
MCU ESM nodes in the device tree. Add functions to probe these nodes
if CONFIG_ESM_K3 is enabled.
Signed-off-by: Santhosh Kumar K <s-k6@ti.com> Signed-off-by: Judith Mendez <jm@ti.com>
Andre Przywara [Thu, 30 Jan 2025 13:36:46 +0000 (13:36 +0000)]
env: fat: Avoid writing to read-only location
The env_fat_get_dev_part() function mostly returns a fixed string, set
via some Kconfig variable. However when the first character is a colon,
that means that the boot device number is determined at runtime, and
patched in. This requires altering the string.
So far this was done via some ugly and actually illegal direct write to
the .rodata string storage. We got away with this because U-Boot maps
everything as read/write/execute so far.
A proposed patch set actually enforces read-only (and no-execute)
permissions in the page tables, so this routine now causes an exception:
=======================
Loading Environment from FAT... "Synchronous Abort" handler, esr 0x9600004f, far 0xfffb7d4c
elr: 000000004a054228 lr : 000000004a05421c (reloc)
elr: 00000000fff7c228 lr : 00000000fff7c21c
.....
=======================
Rewrite the routine to do away with the dodgy string manipulation,
instead allocate the string in the r/w .data section, where we can
safely manipulate it.
Signed-off-by: Andre Przywara <andre.przywara@arm.com> Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tom Rini [Mon, 10 Feb 2025 16:29:36 +0000 (10:29 -0600)]
Merge patch series "FIX: Re-enable MUX_MMIO on J721E/J7200"
Siddharth Vadapalli <s-vadapalli@ti.com> says:
Hello,
This series re-enables MUX_MMIO at U-Boot proper on J721E and J7200
SoCs. The commits which introduced support for Hyperflash boot on both
of these SoCs disabled MUX_MMIO functionality at U-Boot proper, thereby
introducing a regression.
Series is based on commit 2b1c8d3b2d cmd: Fix Kconfig coding style
of the master branch of U-Boot.
configs: j7200_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper
Commit under Fixes introduced support for Hyperflash boot but also disabled
MUX_MMIO support at U-Boot proper. MUX_MMIO is required at U-Boot proper
to setup the SERDES Lane Mapping as described by the device-tree. On J7200
SoC, PCIe functionality is broken since commit under fixes.
configs: j721e_evm_a72_defconfig: Re-enable MUX_MMIO at U-Boot proper
Commit under Fixes introduced support for Hyperflash boot but also disabled
MUX_MMIO support at U-Boot proper. MUX_MMIO is required at U-Boot proper
to setup the SERDES Lane Mapping as described by the device-tree.
Wadim Egorov [Wed, 5 Feb 2025 04:30:11 +0000 (05:30 +0100)]
arch: arm: dts: phyboard-electra-uboot.dtsi: Add bootph props to i2c
Add bootph-all properties to I2C0 nodes to ensure the bus and EEPROM
are accessible across all stages. This enables reading the SoM
configuration at any point during the boot process.