Commit graph

611 commits

Author SHA1 Message Date
Tom Rini
df863c4aa3 AMD/Xilinx changes for v2025.04-rc1
binman:
 - Separate binman description from main DT
 
 zynqmp:
 - Enable binman for ZynqMP platforms
 - DT sync with Linux v6.12
 - Update usb5744 hub for SOMs
 
 common:
 - Drop SPL_FIT_GENERATOR support
 
 versal2
 - Enable OPTEE layers
 
 ospi:
 - Refactor the flash reset functionality
 
 pytest:
 - Fix tcminit mode handling
 -----BEGIN PGP SIGNATURE-----
 
 iF0EABECAB0WIQQbPNTMvXmYlBPRwx7KSWXLKUoMIQUCZ0m53AAKCRDKSWXLKUoM
 Ie4PAJ4r7EHkSngpW3QdBEb15aLxN1pC4ACcC9DDGGn04kCTChpv0CEi/kRLUBU=
 =Veyg
 -----END PGP SIGNATURE-----

Merge tag 'xilinx-for-v2025.04-rc1' of https://gitlab.denx.de/u-boot/custodians/u-boot-microblaze into next

AMD/Xilinx changes for v2025.04-rc1

binman:
- Separate binman description from main DT

zynqmp:
- Enable binman for ZynqMP platforms
- DT sync with Linux v6.12
- Update usb5744 hub for SOMs

common:
- Drop SPL_FIT_GENERATOR support

versal2
- Enable OPTEE layers

ospi:
- Refactor the flash reset functionality

pytest:
- Fix tcminit mode handling
2024-12-03 15:51:56 -06:00
Love Kumar
e013f0c592 test/py: zynqmp_rpu: Fix tcminit mode value
Update the tcminit value to string and number both as per commit
342ccba558 ("arm64: zynqmp: Fix tcminit mode value based on argv") and
also adds negative cases based on invalid command sequences.

Signed-off-by: Love Kumar <love.kumar@amd.com>
Link: https://lore.kernel.org/r/48f75577f6735a0d14105658e89b625d45537bb1.1731672024.git.love.kumar@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
2024-11-29 13:21:17 +01:00
Simon Glass
bda30f83f9 bootstd: Remove prepared images
These are no-longer used. Drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-26 11:13:39 -06:00
Simon Glass
01c0695d9d test_ut: Drop support for fallback files
We don't need the fallback anymore. Remove the code which uses these
files.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
2024-11-26 11:13:39 -06:00
Simon Glass
2fad73a166 test_ut: Use the built mkimage
The mkimage tool is not present in the docker image. Use the one in the
build directory.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-26 11:13:39 -06:00
Simon Glass
22eef59dd3 test_ut: Drop exeception handling
We don't need the fallback anymore. As a first step to removing it,
drop the try...except clauses and unindent the code.

This produces a large diff but there are no other code changes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-26 11:13:39 -06:00
Richard Weinberger
360315b360 test_ut: Allow running unprivileged
Like for test_fs, no need to mess with loop mounts.

Signed-off-by: Richard Weinberger <richard@nod.at>
Tweaks to reduce diff (keep mnt variable):
Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-26 11:13:39 -06:00
Simon Glass
fde4e53aaa test_ut: Add an image size to setup_image()
Add a parameter to indicate the size of the image to build.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
2024-11-26 11:13:39 -06:00
Richard Weinberger
c25e8ceea4 test_fs: Rename mount dir to scratch
Since no mounting happens anymore, rename the "mnt"
directory to "scratch" and the related variables.

Signed-off-by: Richard Weinberger <richard@nod.at>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-26 11:13:39 -06:00
Richard Weinberger
5b2ea71eaf test_fs: Allow running unprivileged
There is no need to mount the filesystem on the host side.
All filesystem tools offer some way to fill the fs without mounting.

So, create the content on the host side, create and fill the fs
without mounting.
No more sudo or guestmount needed.

This new approach works because the tests don't care about user IDs
and no device files are needed.
If user IDs start to matter it's still possible to use wrapper
tools like fakeroot in future while filling the fs.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-11-26 11:13:39 -06:00
Guillaume La Roque
126254ab97 bootstd: Add test for Android boot image v2
Rename actual android bootmethod test to specify it's for boot image
version 4.
Add a unit test for testing the Android bootmethod with boot image
version 2.

This requires another mmc image (mmc8) to contain the following
partitions:
- misc: contains the Bootloader Control Block (BCB)
- boot_a: contains a fake generic kernel image

we can test this with:

$ ./test/py/test.py --bd sandbox --build -k test_ut # build the mmc8.img
$ ./test/py/test.py --bd sandbox --build -k bootflow_android

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Link: https://lore.kernel.org/r/20241126-adnroidv2-v4-5-11636106dc69@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-11-26 09:59:01 +01:00
Tom Rini
48380f9b2a Prepare v2025.01-rc3
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmdFAVQACgkQFHw5/5Y0
 tyyyfQwAuHAoOJ2Q5KnesduF9tkzeSRoziCNig3D+VItbJSxKqnBxPB9U+AxxsZ8
 JVA1e5qSwcblqybyWHrFUVTYVlI4j9oJIOTQKtEmUnDUNY+vd5eT9+V8kmQqnbU0
 mhE8fuH6wSHQ3K+tdVSJuWxcZJfFOE5dZKAxz0z/LysqNfJ/r/iqg2l0YYozId2s
 Kyyq7K25jNilcWAw4zUbGcdvM+H53KNzQ3WcZ36HwenlXWoQJOKCbEEskYxAaa0e
 hSEAQCNeuD1oVoZH1jc9dP6htLx5gmOaSbIScwfaOMqBQHyWQTjv/sMEy8wGSMdA
 PqDGClxU0GCenhbS6waY9GPMLYV0JtyXsAmjrWUOXStLrGMBCrP6Xu6T2Ol7+7pt
 O+ZPZM5Xhmo0UR2sY4sWjDIC1AHVXaLZlbC7vfjadkZ30UZvwIXgDFJemS3nDW96
 /JJo/6sgdLGJGvNYGb4mitKO5+kIiz6kKeMvzcfBj+PWybfYhUbqc/AARtlf9Hzp
 +gvtFlCF
 =Q9hw
 -----END PGP SIGNATURE-----

Merge tag 'v2025.01-rc3' into next

Prepare v2025.01-rc3
2024-11-25 17:34:08 -06:00
Love Kumar
b9e0048b6d test/py: mmc: Add support for different mmc modes
Currently, MMC test runs on default mmc modes, adding a provision to
support multiple mmc modes through user defined parameters.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-11-17 13:14:22 -06:00
Love Kumar
a730947974 test/py: usb: Distinguish b/w ext2/ext4 partitions
'usb part' command shows the partition maps and shows the partition type
by displaying number such as 0c, 83 etc. Observed that ext2 and ext4
partitions shows the same number, i.e, 83, so, using the fstype command
to distiniguish between ext2 and ext4 partitions.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-11-17 13:14:18 -06:00
Love Kumar
87a9f499ab test/py: mmc: Distinguish b/w ext2/ext4 partitions
'mmc part' command shows the partition maps and shows the partition type
by displaying number such as 0c, 83 etc. Observed that ext2 and ext4
partitions shows the same number, i.e, 83, so, using the fstype command
to distiniguish between ext2 and ext4 partitions.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-11-17 13:14:13 -06:00
Love Kumar
92e1c2bf9e test/py: spi: Rephrase the warning/error messages
Rephrasing the error and warning messages to be more meaningful and
clear.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-11-15 13:11:29 -06:00
Simon Glass
5e92fbcefc test: Correct regex string in test_spi
Use an 'r' string to avoid a warning:

  test/py/tests/test_spi.py:698: DeprecationWarning: invalid escape
     sequence '\s'

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-11-13 12:01:35 -06:00
Simon Glass
79aed64f94 test: efi: boot: Set up an image suitable for EFI testing
Create a new disk for use with tests, which contains the new 'testapp'
EFI app specifically intended for testing the EFI loader.

Attach it to the USB device, since most testing is currently done with
mmc.

Initially this image will be used to test the EFI bootmeth.

Fix a stale comment in prep_mmc_bootdev() while we are here.

For now this uses sudo and a compressed fallback file, like all the
other bootstd tests. Once this series is in, the patch which moves
this to use user-space tools will be cleaned up and re-submitted.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-09 10:01:47 +01:00
Andrew Goodbody
c422501780 usb: Fix test dependency on ext4write command
The tests test_usb_ext4load_ext4write, test_usb_ext2load and
test_usb_load depend on the command ext4write being present not just
the feature of being able to write to an ext4 file system. So update
their dependencies to include the ext4write command itself. This will
prevent spurious test failures when running the USB tests against USB
storage with an ext2/ext4 partition but no ext4write command available.

Fixes: 1c5b6edad3 ("test/py: usb: Add tests for USB device")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Love Kumar <love.kumar@amd.com>
2024-11-04 14:48:24 -06:00
Andrew Goodbody
32e40f3dd8 usb: Fix test failure with multiple partitions
When test_usb_load finds multiple partitions of the same type then
it will cause a test failure. The call to write the test file will
write a different test file to each partition but only return the
name and size of the last one written. So the test then fails to
load the test file from the first partition as it uses the name of
a file on a different partition.

Refactor the code so that only one test file is written at a time
and is written to only the partition being tested at that time. This
allows the correct file name to always be available to the code that
runs the load command. This reduces the number of files written and
also the number of calls to crc32 needed.

Fixes: 1c5b6edad3 ("test/py: usb: Add tests for USB device")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Love Kumar <love.kumar@amd.com>
2024-11-04 14:48:05 -06:00
Simon Glass
3ef48a7c66 test: Drop the duplicate line in setup_bootmenu_image()
The mkimage call is done twice. Remove the duplicate.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-11-03 21:27:12 -06:00
Tom Rini
8e5e64d55d Merge patch series "fs: ext4: implement opendir, readdir, closedir"
Heinrich Schuchardt <heinrich.schuchardt@canonical.com> says:

With this series opendir, readdir, closedir are implemented for ext4.
These functions are needed for the UEFI sub-system to interact with
the ext4 file system.

To reduce code growth the functions are reused to implement the ls
command for ext4.

A memory leak in ext4fs_exists is resolved.

ext4fs_iterate_dir is simplified by removing a redundant pointer copy.

Link: https://lore.kernel.org/r/20241026064048.370062-1-heinrich.schuchardt@canonical.com
2024-11-01 13:38:05 -06:00
Heinrich Schuchardt
29e5a2e959 fs: ext4: use fs_ls_generic
Now that opendir, readir, closedir are implemented for ext4 we can use
fs_ls_generic() for implementing the ls command.

Adjust the unit tests:

* fs_ls_generic() produces more spaces between file size and name.
* The ext4 specific message "** Can not find directory. **\n" is not
  written anymore.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-11-01 13:37:58 -06:00
Padmarao Begari
57ea496c38 test/py: spi: prevent overwriting relocation memory
Update spi negative test case to prevent SF command
from overwriting relocation memory area.

Signed-off-by: Padmarao Begari <padmarao.begari@amd.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Love Kumar <love.kumar@amd.com>
2024-11-01 13:37:19 -06:00
Heinrich Schuchardt
a01e7d2538 cmd/eficonfig: capitalize 'enter description'
To conform with other messages capitalize the first letter:
%s/enter description/Enter description/g

Adjust the unit tests accordingly.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-10-30 21:44:39 +01:00
Andrew Goodbody
467a84e012 test: efi_loader: Fix dependency for http test
The config setting CMD_BOOTEFI_HELLO_COMPILE was removed in favour
of BOOTEFI_HELLO_COMPILE but the dependency for
test_efi_helloworld_net_http was not updated and so is now incorrect
preventing the test from ever running. Fix it.

Fixes: 6fe80876dc ("efi_loader: Rename and move CMD_BOOTEFI_HELLO_COMPILE")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-10-27 20:11:30 -06:00
Tom Rini
2800aecce0 Merge patch series "Implement ACPI on aarch64"
Patrick Rudolph <patrick.rudolph@9elements.com> says:

Based on the existing work done by Simon Glass this series adds
support for booting aarch64 devices using ACPI only.
As first target QEMU SBSA support is added, which relies on ACPI
only to boot an OS. As secondary target the Raspberry Pi4 was used,
which is broadly available and allows easy testing of the proposed
solution.

The series is split into ACPI cleanups and code movements, adding
Arm specific ACPI tables and finally SoC and mainboard related
changes to boot a Linux on the QEMU SBSA and RPi4. Currently only the
mandatory ACPI tables are supported, allowing to boot into Linux
without errors.

The QEMU SBSA support is feature complete and provides the same
functionality as the EDK2 implementation.

The changes were tested on real hardware as well on QEMU v9.0:

qemu-system-aarch64 -machine sbsa-ref -nographic -cpu cortex-a57 \
                    -pflash secure-world.rom \
                    -pflash unsecure-world.rom

qemu-system-aarch64 -machine raspi4b -kernel u-boot.bin -cpu cortex-a72 \
-smp 4 -m 2G -drive file=raspbian.img,format=raw,index=0 \
-dtb bcm2711-rpi-4-b.dtb -nographic

Tested against FWTS V24.03.00.

Known issues:
- The QEMU rpi4 support is currently limited as it doesn't emulate PCI,
  USB or ethernet devices!
- The SMP bringup doesn't work on RPi4, but works in QEMU (Possibly
  cache related).
- PCI on RPI4 isn't working on real hardware since the pcie_brcmstb
  Linux kernel module doesn't support ACPI yet.

Link: https://lore.kernel.org/r/20241023132116.970117-1-patrick.rudolph@9elements.com
2024-10-27 18:44:13 -06:00
Patrick Rudolph
f570ab6361 acpi: Allocate and write ACPI tables
Allocate memory for ACPI tables in generic acpi code. When ACPI wasn't
installed in other places, install the ACPI table using BLOBLISTs.

This allows non x86 platforms to boot using ACPI only in case the
EFI loader is being used, since EFI is necessary to advertise the location
of the ACPI tables in memory.

TEST: Booted QEMU SBSA (no QFW) using EFI and ACPI only.

Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
2024-10-27 17:24:13 -06:00
Dmitry Rokosov
a995084beb cmd: bcb: introduce 'ab_dump' command to print BCB block content
It's really helpful to have the ability to dump BCB block for debugging
A/B logic on the board supported this partition schema.

Command 'bcb ab_dump' prints all fields of bootloader_control struct
including slot_metadata for all presented slots.

Output example:
=====
> board# bcb ab_dump ubi 0#misc
> Read 512 bytes from volume misc to 000000000bf07580
> Read 512 bytes from volume misc to 000000000bf42f40
> Bootloader Control:       [misc]
> Active Slot:              _a
> Magic Number:             0x42414342
> Version:                  1
> Number of Slots:          2
> Recovery Tries Remaining: 0
> CRC:                      0x2c8b50bc (Valid)
>
> Slot[0] Metadata:
> 	- Priority:         15
> 	- Tries Remaining:  0
> 	- Successful Boot:  1
> 	- Verity Corrupted: 0
>
> Slot[1] Metadata:
> 	- Priority:         14
> 	- Tries Remaining:  7
> 	- Successful Boot:  0
> 	- Verity Corrupted: 0
====

The ab_dump command allows you to display ABC data directly on the
U-Boot console. During an A/B test execution, this test verifies the
accuracy of each field within the ABC data.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android
Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-5-43bfcc096d95@salutedevices.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-10-24 09:45:55 +02:00
Dmitry Rokosov
b523b4d2c3 treewide: bcb: move ab_select command to bcb subcommands
To enhance code organization, it is beneficial to consolidate all A/B
BCB management routines into a single super-command.
The 'bcb' command is an excellent candidate for this purpose.

This patch integrates the separate 'ab_select' command into the 'bcb'
group as the 'ab_select' subcommand, maintaining the same parameter list
for consistency.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3_android
Link: https://lore.kernel.org/r/20241017-android_ab_master-v5-3-43bfcc096d95@salutedevices.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2024-10-24 09:45:55 +02:00
Andrew Goodbody
2438203728 test: Fix skip check for sleep command test
When the config option CMD_MISC was renamed to CMD_SLEEP the check
in the test for the sleep command was not updated. Do that now.

Fixes: 1606085409 ("cmd: Rename CMD_MISC to CMD_SLEEP")
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-10-15 12:30:07 -06:00
Heinrich Schuchardt
ee34507f70 test: don't call restart_uboot in EFI watchdog test
Calling u_boot_console.restart_uboot() in
test_efi_selftest_watchdog_reboot() may lead to incorrect results.

While the watchdog triggered reboot is running thee test environment may
need some time before triggering a reboot itself. This may lead to
duplicate output of the U-Boot greeter which is recorded as an error.

Reported-by: Tom Rini <trini@konsulko.com>
Fixes: df172e117d ("test/py: test reboot by EFI watchdog")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-10-09 22:04:56 -06:00
Simon Glass
6fe80876dc efi_loader: Rename and move CMD_BOOTEFI_HELLO_COMPILE
This is not actually a command so the name is confusing. Use
BOOTEFI_HELLO_COMPILE instead. Put it in the efi_loader directory
with the other such config options.

The link rule (for $(obj)/%_efi.so) in scripts/Makefile.lib handles
pulling in efi_crt0.o and efi_reloc.o so drop the 'extra' rules.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-10-09 22:04:56 -06:00
Tom Rini
2add54d496 Merge patch series "Miscellaneous fixes"
Jerome Forissier <jerome.forissier@linaro.org> says:

Miscellaneous fixes made when developing the lwIP series [1]. They are
posted separately since they make sense on their own. Subsequent
versions of the lwIP series will contain a squashed version of this one.

[1] http://patchwork.ozlabs.org/project/uboot/list/?series=420712&state=%2A&archive=both
2024-09-24 13:41:21 -06:00
Jerome Forissier
d2056e2ed0 test/py: test_efi_loader: add HTTP (wget) test for the EFI loader
Add a test to test_efi_loader.py similar to the TFTP test but for HTTP
with the wget command.

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Tested-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
2024-09-24 13:41:21 -06:00
Jerome Forissier
9f8c10c7ab test/py: test_efi_loader: add missing dependency on cmd_tftpboot
test_efi_helloworld_net() and test_efi_grub_net() depend on
cmd_tftpboot so add the missing annotations.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-24 13:41:21 -06:00
Jerome Forissier
a95e99f2df test/py: net_boot: fix comment
If env__pxe_boot_test_skip is not present, it defaults to True not
False. Therefore fix the comment.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-09-24 13:41:21 -06:00
Tom Rini
8a5ef6effb test/py/tests/test_bootstage.py: Combine stash/unstash tests
When running the bootstage tests currently we get a warning like:
tests/test_bootstage.py::test_bootstage_stash
...PytestReturnNotNoneWarning: Expected None, but tests/test_bootstage.py::test_bootstage_stash returned (37748736, 4096), which will be an error in a future version of pytest.  Did you mean to use `assert` in stead of `return`?

This is because the unstash test will run the stash test and fetch the
addr / size from that. Rework the test to be stash and unstash and then
run the unstash command at the end of the current stash test.

Acked-by: Michal Simek <michal.simek@amd.com>
Reviewed-by: Love Kumar <love.kumar@amd.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
2024-09-24 10:10:18 -06:00
Tom Rini
c17805e19b Merge patch series "Fix various bugs"
Simon Glass <sjg@chromium.org> says:

This series includes the patches needed to make make the EFI 'boot' test
work. That test has now been split off into a separate series along with
the EFI patches.

This series fixes these problems:
- sandbox memory-mapping conflict with PCI
- the fix for that causes the mbr test to crash as it sets up pointers
  instead of addresses for its 'mmc' commands
- the mmc and read commands which cast addresses to pointers
- a tricky bug to do with USB keyboard and stdio
- a few other minor things
2024-09-18 13:07:19 -06:00
Simon Glass
b6ef3382e8 test/py: Fix some pylint warnings in test_ut.py
Tidy up most of these warnings. Remaining are four of these:

   R0914: Too many local variables

which can only by fixed by splitting things into functions, so that is
left for another time.

Part of this change was done by the flynt tool.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-09-18 13:00:59 -06:00
Caleb Connolly
2bf0a87ae3 sandbox: switch to dynamic UUIDs
Migrate sandbox over to generating it's capsule update image GUIDs
dynamically from the namespace and board/image info. Update the
reference and tests to use the new GUIDs.

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
2024-09-12 17:35:37 +02:00
Love Kumar
2349cc00d9 test/py: spi: Set the expected error message
If erase/write/read size is 0 then it throws the mentioned error message
when debug message ie enabled as per 899fb5aa8b ("cmd: sf/nand: Print
and return failure when 0 length is passed"), setting it to None as
debug message is not enabled by default for testing.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-09-10 13:15:06 -06:00
Love Kumar
ce6895dd12 test/py: spi: Add tests for SPI flash device
Add test cases for sf commands to verify various SPI flash operations
such as erase, write and read. It also adds qspi lock unlock cases.
This test relies on boardenv_* configurations to run it for different
SPI flash family such as single SPI, QSPI, and OSPI.

Signed-off-by: Love Kumar <love.kumar@amd.com>
2024-08-27 14:31:08 -06:00
Simon Glass
3403422767 upl: Add an end-to-end test
Now that sandbox_vpl supports UPL, add a test that checks that the
payload can be loaded by SPL and the handoff information passed through
to U-Boot proper.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-09 16:03:20 -06:00
Simon Glass
b3cb1c4c0b sandbox_vpl: Enable Universal Payload
Use the sandbox_vpl build to test UPL since it supports a real devicetree
in SPL. The sandbox_spl build uses OF_PLATDATA.

Enable writing the UPL handoff in SPL and reading it in U-Boot proper.
Provide a test to check that this handoff works.

Note that the test uses the standard devicetree rather than the test one,
since it is a lot smaller and fits in the existing bloblist.

Signed-off-by: Simon Glass <sjg@chromium.org>
2024-08-09 16:03:20 -06:00
Tom Rini
4595600007 Merge patch series "bootstd: Add Android support"
Mattijs Korpershoek <mkorpershoek@baylibre.com> says:

Android boot flow is a bit different than a regular Linux distro.
Android relies on multiple partitions in order to boot.

A typical boot flow would be:
1. Parse the Bootloader Control Block (BCB, misc partition)
2. If BCB requested bootonce-bootloader, start fastboot and wait.
3. If BCB requested recovery or normal android, run the following:
   a. Get slot (A/B) from BCB
   b. Run AVB (Android Verified Boot) on boot partitions
   c. Load boot and vendor_boot partitions
   d. Load device-tree, ramdisk and boot

The AOSP documentation has more details at [1], [2], [3]

This has been implemented via complex boot scripts such as [4].
However, these boot script are neither very maintainable nor generic.
Moreover, DISTRO_DEFAULTS is being deprecated [5].

Add a generic Android bootflow implementation for bootstd.

For this initial version, only boot image v4 is supported.

This has been tested on sandbox using:
$ ./test/py/test.py --bd sandbox --build -k test_ut

This has also been tested on the AM62X SK EVM using TI's Android SDK[6]
To test on TI board, the following (WIP) patch is needed as well:
84cceb912b

[1] https://source.android.com/docs/core/architecture/bootloader
[2] https://source.android.com/docs/core/architecture/partitions
[3] https://source.android.com/docs/core/architecture/partitions/generic-boot
[4] https://source.denx.de/u-boot/u-boot/-/blob/master/include/configs/meson64_android.h
[5] https://lore.kernel.org/r/all/20230914165615.1058529-17-sjg@chromium.org/
[6] https://software-dl.ti.com/processor-sdk-android/esd/AM62X/09_02_00/docs/android/Overview.html
2024-07-18 17:03:47 -06:00
Tom Rini
cbfd2c28a0 Merge patch series "finish using .dtso for overlay source files"
Rasmus Villemoes <rasmus.villemoes@prevas.dk> says:

This is a followup to the patches that landed in 2024.01 and nearly
made sure that source files for producing .dtbo files use the .dtso
extension. In the same release, a few new .dts files snuck in, and
there was also some test code involving .dtbo -> .dtbo.S -> .dtbo.o I
didn't really know how to handle at the time. This should finish the
job, bring us in sync with linux (at least in this respect), and drop
the .dts -> .dtbo build rule.
2024-07-18 17:03:47 -06:00
Mattijs Korpershoek
c2a2a06e01 bootstd: Add test for bootmeth_android
Add a unit test for testing the Android bootmethod.

This requires another mmc image (mmc7) to contain the following partitions:
- misc: contains the Bootloader Control Block (BCB)
- boot_a: contains a fake generic kernel image
- vendor_boot_a: contains a fake vendor_boot image

Also add BOOTMETH_ANDROID as a dependency on sandbox so that we can test
this with:

$ ./test/py/test.py --bd sandbox --build -k test_ut # build the mmc7.img
$ ./test/py/test.py --bd sandbox --build -k bootflow_android

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Julien Masson <jmasson@baylibre.com>
Reviewed-by: Guillaume La Roque <glaroque@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2024-07-18 13:51:30 -06:00
Rasmus Villemoes
7c996f2443 test/py: efi_capsule: rename device tree overlay source to .dtso
Distinguish more clearly between source files meant for producing .dtb
from those meant for producing .dtbo.

Note that in the linux tree, all device tree overlay sources have been
renamed to .dtso, and the .dts->.dtbo rule is gone since v6.5 (commit
81d362732bac). So this is also a step towards staying closer to linux
with respect to both Kbuild and device tree sources, and eventually
eliminating all .dts -> .dtbo instances.

This also matches the documentation update done in commit 4fb7e570d6.

Cc: Masahisa Kojima <kojima.masahisa@socionext.com>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
2024-07-18 13:51:07 -06:00
Ilias Apalodimas
e6003091db test: test for ignore OsIndications
The tests we currently have expect the firmware update to fail
when OsIndications is not set properly. However, we have a Kconfig flag
that explicitly ignores that variable. Adjust the tests accordingly

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
2024-07-14 09:56:24 +02:00