Commit graph

25357 commits

Author SHA1 Message Date
Enrico Leto
1c73e05b03 siemens,am335x: clean-up draco targets
Draco is a family of 3 boards: thuban, rastaban & etamin. Rename all
targets of the family adding the draco- prefix to increase readibility
and simplify future commits about concerning all boards of the family.

The name draco was initially used for the first target. It's deprecated
since a 2nd target was introduced. Unfortunately the draco target was
copied to the thuban target instead to be renamed. Remove it to save
unnecessary maintenance effort.

Signed-off-by: Enrico Leto <enrico.leto@siemens.com>
2023-11-22 19:10:03 -05:00
Manorit Chawdhry
2fadd62fe6 arm: dts: k3-am68*: Sync with kernel v6.7-rc1
Sync devicetree with kernel v6.7-rc1

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2023-11-22 13:48:20 -05:00
Manorit Chawdhry
7e7d2bfb2c arm: dts: k3-j721s2*: Sync with kernel v6.7-rc1
Sync devicetree with kernel v6.7-rc1

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
2023-11-22 13:48:20 -05:00
Neha Malcom Francis
4509b9ff0b arm: dts: k3-*-binman: Move to using templated FITs
Reduce redundancy in code by using templates to generate the A72 boot
binaries (tispl.bin and u-boot.img) as well as R5 boot binary sysfw.itb
(for legacy boot following devices J721E and AM65x).

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Acked-by: Andrew Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
2023-11-22 13:48:20 -05:00
Neha Malcom Francis
b153bad0f1 arm: dts: k3-binman: Add support for FIT templates
Add templates for FIT images used extensively across K3 boards with most
of the code common. This includes the FIT portions of:
	- tispl.bin
	- u-boot.img
	- sysfw.itb (in case of legacy boot flow)

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-22 13:48:20 -05:00
Nishanth Menon
b1c7fa0bf0 arm: dts: k3-am625-sk-r5/u-boot: Drop duplicate bootph-nodes
Kernel dts import now provides bootph-all and bootph-pre-ram properties
for the properties we have been overriding so far. Drop the same.

While at this enable the DM and TIFS UARTs for programming pinmux
since they are marked reserved by board.dts

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Tested-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 13:48:20 -05:00
Nishanth Menon
ab9d07b181 arm: dts: k3-am625-beagleplay-u-boot: drop duplicate bootph-nodes
Kernel dts import now provides bootph-all and bootph-pre-ram properties
for the properties we have been overriding so far. Drop the same.

Reviewed-by: Dhruva Gole <d-gole@ti.com>
Tested-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 13:48:20 -05:00
Nishanth Menon
1146dc0854 arm: dts: k3-am625: Drop SoC provided bootph params from board u-boot/r5 dtsi
k3-am62* SoC dtsi files now provide the following:

bootph-all: dmss secure_proxy_main dmsc k3_pds k3_clks k3_reset
   main_pmx0 main_timer0 mcu_pmx0 wkup_conf chipid

bootph-pre-ram: secure_proxy_sa3 main_esm mcu_esm

Drop these from board r5 and u-boot.dtsi files as these are duplicate in
them now.

Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Tested-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 13:47:39 -05:00
Nishanth Menon
a0ca5f24c8 arm: dts: k3-am625*: Sync with kernel v6.7-rc1
Sync with kernel v6.7-rc1 and sync up the u-boot dts files accordingly.

Tested-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 13:47:39 -05:00
Roger Quadros
0fc6f663ea arm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix DMA with BCDMA
BCDMA can be used at SPL for OSPI boot and mem-to-mem DMA
so add "bootph-all" to BCDMA node.

Suggested-by: Nishanth Menon <nm@ti.com>
Fixes: 9a3f2b6798 ("arm: dts: k3-am625-verdin-wifi-dev-u-boot.dtsi: Fix DMA/Ethernet")
Signed-off-by: Roger Quadros <rogerq@kernel.org>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2023-11-22 13:47:39 -05:00
Reid Tonking
910bcb76f6 arm: dts: k3-j7200: Sync with Linux 6.7-rc1
Sync u-boot device tree with Linux kernel 6.7-rc1

Signed-off-by: Reid Tonking <reidt@ti.com>
2023-11-22 13:47:39 -05:00
Joao Paulo Goncalves
52a86e69e2 arm: k3: Enable instruction cache for main domain SPL
Change spl_enable_dcache so it also enable icache on SPL
initialization for the main domain part of the boot flow. This
improves bootloader booting time.

Link: https://lore.kernel.org/all/20231109140958.1093235-1-joao.goncalves@toradex.com/
Signed-off-by: Joao Paulo Goncalves <joao.goncalves@toradex.com>
Tested-by: Nishanth Menon <nm@ti.com>
2023-11-22 13:47:39 -05:00
Nishanth Menon
5b70caa6a4 arm: dts: k3-am62a*: Sync with kernel v6.7-rc1
Sync with kernel v6.7-rc1 and sync up the u-boot dts files accordingly.

Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 13:46:33 -05:00
Nishanth Menon
6a331b8014 arm: mach-k3: am62a: Add main_timer0 id to the dev list
main_timer0 is used by u-boot as the tick-timer. Add it to the soc
devices list so it an be enabled via the k3 power controller.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2023-11-22 13:46:33 -05:00
Neha Malcom Francis
170ae49d81 arm: dts: k3-j721e-*: Sync with kernel v6.7-rc1
Sync the U-Boot DTS files with those of Kernel v6.7-rc1.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
2023-11-22 13:46:33 -05:00
Nishanth Menon
429ac50fdd board: beagle: Add BeagleBone AI-64 support
Add base support for BeagleBone AI-64 board support.

Further information at  https://beagleboard.org/ai-64

Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 13:22:24 -05:00
Robert Nelson
7f78636667 arm: dts: Add k3-j721e-beagleboneai64
BeagleBoard.org BeagleBone AI-64 is an open source hardware single
board computer based on the Texas Instruments TDA4VM SoC featuring
dual-core 2.0GHz Arm Cortex-A72 processor, C7x+MMA and 2 C66x
floating-point VLIW DSPs, 3x dual ARM Cortex-R5 co-processors,
2x 6-core Programmable Real-Time Unit and Industrial Communication
SubSystem, PowerVR Rogue 8XE GE8430 3D GPU. The board features 4GB
DDR4, USB3.0 Type-C, 2x USB SS Type-A, miniDisplayPort, 2x 4-lane
CSI, DSI, 16GB eMMC flash, 1G Ethernet, M.2 E-key for WiFi/BT, and
BeagleBone expansion headers.

This board family can be indentified by the BBONEAI-64-B0 in the
at24 eeprom:

[aa 55 33 ee 01 37 00 10  2e 00 42 42 4f 4e 45 41 |.U3..7....BBONEA|]
[49 2d 36 34 2d 42 30 2d  00 00 42 30 30 30 37 38 |I-64-B0-..B00078|]

Baseline of the devicetree is from v6.6-rc1

https://beagleboard.org/ai-64
https://git.beagleboard.org/beagleboard/beaglebone-ai-64

Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 13:22:24 -05:00
Nishanth Menon
0218b20888 board: Move omap3 beagle under beagle vendor folder
Move the omap3 beagle to the beagle vendor folder representing
BeagleBoard.org platforms.

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 13:22:24 -05:00
Nishanth Menon
73e88a9010 board: Move beagleplay under beagle vendor folder
Move beagleplay support away from ti/am62x to it's own beagle vendor
folder.

This forms the starting point for new beagle platforms added under it's
own board vendor folder.

As part of this create all the associated files with a bare minimum
beagleplay.c file.

Suggested-by: Andrew Davis <afd@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
[trini: Update k3-binman.dtsi to use full path to scheme.yaml now]
Signed-off-by: Tom Rini <trini@konsulko.com>
2023-11-22 13:22:01 -05:00
Nishanth Menon
b25c2d7127 arm: dts: k3-am625-beagleplay-u-boot/r5: Just depend on k3-binman.dtsi
With the upcoming folder separation, there is no further need to depend
on am625-binman.dtsi. Duplicate the existing definitions to u-boot.dtsi
and r5.dts as appropriate.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
2023-11-22 12:04:14 -05:00
Nishanth Menon
c36377d09e arm: mach-k3: j721e: Improve support for UDA FS
Commit 5019170970 ("arch: arm: mach-k3: j721e: add support for UDA
FS") introduced basic UDA FS support, however, we can Take approach
similar to commit 0f1c1e8b36 ("arm: mach-k3: am625: Add support for
UDA FS"). While boot partition support with EMMC boot is useful, it is
constrained by the size of boot hardware partition itself.

In the case of K3 devices, tispl images can contain OP-TEE images that
can substantially vary in size and the u-boot image itself can vary over
time as we enable various features.

So use the CSD information in the case of EMMC_BOOT configuration being
enabled to pick boot partition or UDA FS mode operation to pick.

If EMMC_BOOT is disabled, then depend on filesystem configuration to
pick data from UDA.

Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 12:04:14 -05:00
Nishanth Menon
fdb7d45c76 arm: mach-k3: arm64-mmu: Refactor to be independent of board
Refactor J721E J7200 definition to make this independent of board
macros.

Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 12:04:14 -05:00
Nishanth Menon
3c11584c21 board: ti: j721e: Select SOC_K3_J721E_J7200 for J7200evm
Enable SOC_K3_J721E_J7200 when board is J7200 EVM - this allows us to
differentiate J7200 platform cleanly in board independent codebase.

Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 12:04:14 -05:00
Nishanth Menon
97bf082c9f arm: mach-k3: Kconfig: Introduce a symbol to indicate J7200
J7200 shares quite a few characteristics with J721E. However a few sets
are different. Introduce a Kconfig to differentiate the two to allow for
new boards to be introduced in a seamless manner.

Signed-off-by: Nishanth Menon <nm@ti.com>
2023-11-22 12:04:14 -05:00
Nishanth Menon
110b07c8bc arm: mach-k3: Move TI dummy keys out of board folder
This file is used to emulate customer keys on TI development board
ecosystems, move it out of board/ directory and into mach-k3. And
change the relative paths to absolute paths in the binman paths.

While at it, drop the reference in verdin-binman file which is
redundant.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Acked-by: Manorit Chawdhry <m-chawdhry@ti.com>
2023-11-22 12:04:14 -05:00
Nishanth Menon
f1c8e9c442 arm: mach-k3: Move K3 degenerate keys out of board folder
This file is common for all of K3, move it out of board/ directory and
into mach-k3. And change the relative paths to absolute paths in the
binman paths.

While at it, drop the reference in verdin-binman file which is
redundant.

Signed-off-by: Nishanth Menon <nm@ti.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Andrew Davis <afd@ti.com>
2023-11-22 12:04:14 -05:00
Andrew Davis
140d427cc9 arm: mach-k3: Move sysfw-loader into R5 directory
SYSFW is only ever loaded by the R5 core, move the code into that
directory. While here also move the related Kconfig symbols.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-11-22 12:04:14 -05:00
Andrew Davis
cf2a075b8c arm: mach-k3: Remove incorrect checks for SPL build
The kconfig option SPL means this build supports SPL but not that
this build is SPL, nor that this build is the SPL running on R5.
For options that are for R5 SPL use CPU_V7R.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-11-22 12:04:14 -05:00
Andrew Davis
ffda1089dd arm: mach-k3: Move R5 specific code into new r5/ directory
This makes it clear these are only to be used by the R5 builds of SPL.
And this will be used to later more cleanly split the two builds.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-11-22 12:04:13 -05:00
Andrew Davis
5710d0a853 arm: mach-k3: j721s2: Move board selection to mach-k3
Currently each set of board targets from a vendor is selected inside
the board directory for that vendor. This has the problem of multiple
targets, one from each vendor, being selectable at the same time.
For instance you can select both TARGET_AM654_A53_EVM and
TARGET_IOT2050_A53 in the same build.

To fix this we need to move the target board choice to a common location
for each parent SoC selection. Do this in arch/arm/mach-k3.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-11-22 09:37:23 -05:00
Andrew Davis
e4439cadb6 arm: mach-k3: am62ax: Move board selection to mach-k3
Currently each set of board targets from a vendor is selected inside
the board directory for that vendor. This has the problem of multiple
targets, one from each vendor, being selectable at the same time.
For instance you can select both TARGET_AM654_A53_EVM and
TARGET_IOT2050_A53 in the same build.

To fix this we need to move the target board choice to a common location
for each parent SoC selection. Do this in arch/arm/mach-k3.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-11-22 09:37:23 -05:00
Andrew Davis
f3bfec72d1 arm: mach-k3: am62x: Move board selection to mach-k3
Currently each set of board targets from a vendor is selected inside
the board directory for that vendor. This has the problem of multiple
targets, one from each vendor, being selectable at the same time.
For instance you can select both TARGET_AM654_A53_EVM and
TARGET_IOT2050_A53 in the same build.

To fix this we need to move the target board choice to a common location
for each parent SoC selection. Do this in arch/arm/mach-k3.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-11-22 09:37:23 -05:00
Andrew Davis
ed51c911a6 arm: mach-k3: am64x: Move board selection to mach-k3
Currently each set of board targets from a vendor is selected inside
the board directory for that vendor. This has the problem of multiple
targets, one from each vendor, being selectable at the same time.
For instance you can select both TARGET_AM654_A53_EVM and
TARGET_IOT2050_A53 in the same build.

To fix this we need to move the target board choice to a common location
for each parent SoC selection. Do this in arch/arm/mach-k3.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-11-22 09:37:23 -05:00
Andrew Davis
c3a9f9b2b9 arm: mach-k3: am65x: Move board selection to mach-k3
Currently each set of board targets from a vendor is selected inside
the board directory for that vendor. This has the problem of multiple
targets, one from each vendor, being selectable at the same time.
For instance you can select both TARGET_AM654_A53_EVM and
TARGET_IOT2050_A53 in the same build.

To fix this we need to move the target board choice to a common location
for each parent SoC selection. Do this in arch/arm/mach-k3.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-11-22 09:37:23 -05:00
Andrew Davis
1736b2f0fd arm: mach-k3: j721e: Move board selection to mach-k3
Currently each set of board targets from a vendor is selected inside
the board directory for that vendor. This has the problem of multiple
targets, one from each vendor, being selectable at the same time.
For instance you can select both TARGET_AM654_A53_EVM and
TARGET_IOT2050_A53 in the same build.

To fix this we need to move the target board choice to a common location
for each parent SoC selection. Do this in arch/arm/mach-k3.

Signed-off-by: Andrew Davis <afd@ti.com>
2023-11-22 09:37:23 -05:00
Tom Rini
dca7a8958f Prepare v2024.01-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmVbZ4QACgkQFHw5/5Y0
 tyzlggwAowkAYxSOUkwhWSbEYctVObZUPF1kDEbWlbskx52ZrQ56nWbfojZPKYdT
 OYe7fNrOJaYpbpU31lJ6U7Jm/iLCHw7vqMBmTJCNNr/BBW5jQ/exEVMa+/ZG640T
 6pTWqAHp3CfqNjBK9bnFmIqWTwrqUCZKNllPfEWNs1Pl00ypJsY9ZYaAw+4I9t0p
 2cG/BrSUyCDkgLYHi0YVUHXWQKYU4LVfz6EASGIOwTrrJGEUJ9EAGJmzgUSC0Zuw
 7qQBwHPXHBkpfP4bOFZ6xSKLp79rHXNSdjx21XW/4yerp4GC16xB+pZWZOSuz2J9
 0anoiSGPh1N81B6aciTOWeCdKPJeXEp1AxqyCcvmwLZrOOs+MSGjbKCUFnjyNtAJ
 hTXzlJQM6tQ3BhGQLY85sNe8/dOF3WNt4RiRM3K87mU8e0pahrYKSj5oUSbcrOBx
 4Hk6rQc33MvyLAYEhSJ3naktA0dPQseleOrXuOGdSWOlFf2sweVEjip4VKBlbUNb
 t3kEfQ9F
 =YBkC
 -----END PGP SIGNATURE-----

Merge tag 'v2024.01-rc3' into next

Prepare v2024.01-rc3
2023-11-20 09:19:50 -05:00
Chris Packham
0585c28fda Revert "arm64: Use FEAT_HAFDBS to track dirty pages when available"
This reverts commit 6cdf6b7a34. This is
part of a series trying to make use of the arm64 hardware features for
tracking dirty pages. Unfortunately this series causes problems for the
AC5/AC5X SoCs. Having exhausted other options the consensus seems to be
reverting this series is the best course of action.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-11-17 11:58:26 -05:00
Chris Packham
eed8294b75 Revert "arm64: Use level-2 for largest block mappings when FEAT_HAFDBS is present"
This reverts commit 836b8d4b20. This is
part of a series trying to make use of the arm64 hardware features for
tracking dirty pages. Unfortunately this series causes problems for the
AC5/AC5X SoCs. Having exhausted other options the consensus seems to be
reverting this series is the best course of action.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-11-17 11:58:26 -05:00
Chris Packham
ee23d7466c Revert "armv8: enable HAFDBS for other ELx when FEAT_HAFDBS is present"
This reverts commit c1da6fdb5c. This is
part of a series trying to make use of the arm64 hardware features for
tracking dirty pages. Unfortunately this series causes problems for the
AC5/AC5X SoCs. Having exhausted other options the consensus seems to be
reverting this series is the best course of action.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
2023-11-17 11:58:26 -05:00
Marcel Ziswiler
ac33a7976a imx: spl_imx_romapi: fix emmc fast boot mode case
This fixes a regression in the eMMC fast boot mode case where the buffer
was missing 464 bytes.

The code figures out how many bytes must at least be fetched to honor
the current read, rounds that up to the ss->pagesize [which is a no-op
in the USB download case because that has ->pagesize==1], fetches that
many bytes, but then recorded the original upper bound as the new end of
the valid data. However, this did not take into account the rounding up
to the ss->pagesize. Fix this by recording the actual bytes downloaded.

Fixes: 4b4472438f ("imx: spl_imx_romapi: avoid tricky use of spl_load_simple_fit() to get full FIT size")
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Acked-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2023-11-17 11:58:26 -05:00
Marcel Ziswiler
e2dcadbba4 imx: spl_imx_romapi: fix comment about stream(usb) download failure
Fix comment about Stream(USB) download failure.

Fixes: 1cbebc7862 ("imx: add rom api support")
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2023-11-17 11:58:26 -05:00
Tom Rini
ae7ec8b0be Merge branch '2023-11-16-assorted-updates' into next
- squashfs improvements, remove common.h in some places, assorted code
  fixes, fix a few CONFIG symbol names in Kconfig files, bring in
  linux's <linux/time.h> conversion functions, poplar updates, bcb
  improvements.
2023-11-17 08:38:05 -05:00
Christophe Leroy
80ac19fd56 powerpc: mpc8xx: Remove usage of common.h
Remove inclusion of common.h and add relevant
includes when necessary.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
2023-11-16 18:53:09 -05:00
Sean Anderson
5271e359a4 spl: Only support bl_len when we have to
Aligning addresses and sizes causes overhead which is unnecessary when we
are not loading from block devices. Remove bl_len when it is not needed.

For example, on iot2050 we save 144 bytes with this patch (once the rest of
this series is applied):

add/remove: 0/0 grow/shrink: 0/3 up/down: 0/-144 (-144)
Function                                     old     new   delta
spl_load_simple_fit                          920     904     -16
load_simple_fit                              496     444     -52
spl_spi_load_image                           384     308     -76
Total: Before=87431, After=87287, chg -0.16%

We use panic() instead of BUILD_BUG_ON in spl_set_bl_len because we still
need to be able to compile it for things like mmc_load_image_raw_sector,
even if that function will not be used.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-16 13:49:14 -05:00
Sean Anderson
afdd2d98c2 spl: Remove filename from spl_load_info
For filesystems, filename serves the same purpose as priv. However,
spl_load_fit_image also uses it to determine whether to use a DMA-aligned
buffer. This is beneficial for FAT, which uses a bounce-buffer if the
destination is not DMA-aligned. However, this is unnecessary now that
filesystems set bl_len to ARCH_DMA_MINALIGN instead. With this done, we can
remove filename entirely.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-16 13:49:14 -05:00
Sean Anderson
73c40fcb73 spl: Refactor spl_load_info->read to use units of bytes
Simplify things a bit for callers of spl_load_info->read by refactoring it
to use units of bytes instead of bl_len. This generally simplifies the
logic, as MMC is the only loader which actually works in sectors. It will
also allow further refactoring to remove the special-case handling of
filename.  spl_load_legacy_img already works in units of bytes (oops) so it
doesn't need to be changed.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-16 13:49:14 -05:00
Sean Anderson
feaeb8fa6f spl: Remove NULL assignments in spl_load_info
Remove NULL assignments to fields in spl_load_info when .load doesn't
reference these fields. This can result in more efficient code. filename
must stay even if it is unused, since load_simple_fit uses it.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2023-11-16 13:49:13 -05:00
Tom Rini
5e6a112e11 Merge patch series "nand: Add sandbox tests"
To quote the author:

This series tests raw nand flash in sandbox and fixes various bugs discovered in
the process. I've tried to do things in a contemporary manner, avoiding the
(numerous) variations present on only a few boards. The test is pretty minimal.
Future work could test the rest of the nand API as well as the MTD API.

Bloat (for v1) at [1] (for boards with SPL_NAND_SUPPORT enabled). Almost
everything grows by a few bytes due to nand_page_size. A few boards grow more,
mostly those using nand_spl_loaders.c. CI at [2].

[1] https://gist.github.com/Forty-Bot/9694f3401893c9e706ccc374922de6c2
[2] https://source.denx.de/u-boot/custodians/u-boot-clk/-/pipelines/18443
2023-11-16 13:49:13 -05:00
Sean Anderson
a9a7379973 arm: Enable SYS_THUMB_BUILD on AT91
Several AT91 boards are quite close to their SPL size limit. For example,
sama5d27_wlsom1_ek_mmc is just 173 bytes short of its limit and doesn't
even fit with older GCCs.

All AT91 processors should have thumb support. Enable SYS_THUMB_BUILD. This
shrinks SPL by around 30%.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-11-16 13:48:58 -05:00
Sean Anderson
8502b5bf20 test: spl: Add a test for NAND
Add a SPL test for the NAND load method. We use some different functions to
do the writing from the main test since things like nand_write_skip_bad
aren't available in SPL.

We disable BBT scanning, since scan_bbt is only populated when not in SPL.
We use nand_spl_loaders.c as it seems to be common to at least a few boards
already. However, we do not use nand_spl_simple.c because it would require
us to implement cmd_ctrl.  The various nand load functions are adapted from
omap_gpmc. However, they have been modified for simplicity/correctness.

Signed-off-by: Sean Anderson <seanga2@gmail.com>
2023-11-16 12:43:49 -05:00