]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
18 months agoMerge tag 'xilinx-for-v2025.04-rc1' of https://gitlab.denx.de/u-boot/custodians/u...
Tom Rini [Tue, 3 Dec 2024 21:51:56 +0000 (15:51 -0600)] 
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

18 months agoMerge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-samsung
Tom Rini [Tue, 3 Dec 2024 18:37:20 +0000 (12:37 -0600)] 
Merge branch 'master' of https://gitlab.denx.de/u-boot/custodians/u-boot-samsung

18 months agoMerge patch series "CI: Set up for an arm64 runner"
Tom Rini [Mon, 2 Dec 2024 22:36:06 +0000 (16:36 -0600)] 
Merge patch series "CI: Set up for an arm64 runner"

Tom Rini <trini@konsulko.com> says:

Hey all,

This is picking up Simon's v5 of the above-named series and making a few
more changes so that the follow-up series I have leads to arm64 being
supported for almost all jobs. To quote Simon's cover letter:

All gitlab runners are currently amd64 machines. This series attempts to
create a docker image which can also support arm64 so that sandbox tests
can be run on it.

The TARGET_... environment variables for grub could perhaps be adjusted,
using the new variables, but I have not done that for now.

Adding to what Simon said, we now build grub for all architectures as
the reason to install it was to be able to use the binaries in QEMU.
That won't provide us with amd64 binaries on arm64 hosts so we can't use
that shortcut anymore.

Link: https://lore.kernel.org/r/20241127172247.1488685-1-trini@konsulko.com
18 months agoconfigs: e850-96: Disable PSCI reset
Sam Protsenko [Tue, 19 Nov 2024 03:28:00 +0000 (21:28 -0600)] 
configs: e850-96: Disable PSCI reset

PSCI reset is not implemented in Exynos850 EL3 firmware. Disable it to
fix the reset in cases where it can be used, e.g. when running EFI
selftest.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
18 months agoCI: Add platform variable
Simon Glass [Wed, 27 Nov 2024 17:17:30 +0000 (11:17 -0600)] 
CI: Add platform variable

Add a list of possible platforms that can be used by gitlab runners.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
18 months agodocker: Install toolchains on arm64 host
Simon Glass [Wed, 27 Nov 2024 17:17:29 +0000 (11:17 -0600)] 
docker: Install toolchains on arm64 host

Refactor the code to support downloading toolchains for arm64 as well as
x86_64

There doesn't seem to be an xtensa toolchain for arm64 at the same
location, so download that only on x86

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
18 months agodocker: Fix LegacyKeyValueFormat warning with PYTHONPATH
Simon Glass [Wed, 27 Nov 2024 17:17:28 +0000 (11:17 -0600)] 
docker: Fix LegacyKeyValueFormat warning with PYTHONPATH

Fix a warning due to the syntax used for PYTHONPATH:

   LegacyKeyValueFormat: "ENV key=value" should be used instead of
      legacy "ENV key value" format (line 304)

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Tom Rini <trini@konsulko.com>
18 months agodocker: Adjust installed packages slightly
Simon Glass [Wed, 27 Nov 2024 17:17:27 +0000 (11:17 -0600)] 
docker: Adjust installed packages slightly

We no longer need to install libc6-i386 so we can drop that. Switch to
installing linux-image-generic as that will be available on all hosts,
to provide the /boot/vmlinu* file that's requires for various tools.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
18 months agodocker: Support building for multiple architectures
Simon Glass [Wed, 27 Nov 2024 17:17:26 +0000 (11:17 -0600)] 
docker: Support building for multiple architectures

Add instructions on how to build the file for multiple architectures.
Add a message indicating what is happening.

Update the documentation as well.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
18 months agodocker: Use cache mounts for apt
Tom Rini [Wed, 27 Nov 2024 17:17:25 +0000 (11:17 -0600)] 
docker: Use cache mounts for apt

Instead of deleting /var/lib/apt/lists after each relevant RUN line, use
a cache mount as is the current best practices.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agodocker: Build grub for all architectures
Tom Rini [Wed, 27 Nov 2024 17:17:24 +0000 (11:17 -0600)] 
docker: Build grub for all architectures

For consistency now, and future ease of testing with non-amd64 hosts,
build grub for all architectures rather than relying on host binaries
for i386/x86_64.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agodocker: Update to grub-2.12
Tom Rini [Wed, 27 Nov 2024 17:17:23 +0000 (11:17 -0600)] 
docker: Update to grub-2.12

The current release of grub is 2.12 and it will be good to pick this up
now so that we can update other parts of our stack.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agodocker: Use "make -j$(nproc)" when invoking make
Tom Rini [Wed, 27 Nov 2024 17:17:22 +0000 (11:17 -0600)] 
docker: Use "make -j$(nproc)" when invoking make

We had a few places that were not using "make -j$(nproc)" but instead
just plain "make" and so slowing down the overall build.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agodocker: Add kernel.org x86_64 toolchain
Tom Rini [Wed, 27 Nov 2024 17:17:21 +0000 (11:17 -0600)] 
docker: Add kernel.org x86_64 toolchain

Add in the x86_64 toolchain, but do not enforce using it for sandbox.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agotest: Adjust print_ut test to use unsigned char
Simon Glass [Wed, 27 Nov 2024 17:17:20 +0000 (11:17 -0600)] 
test: Adjust print_ut test to use unsigned char

Since char is unsigned on arm64, this test currently fails. It seems
better to use unsigned anyway, since 0xff is written into the string at
the start. Update the terminator-assert to use a character instead of a
byte.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Changes in v6:
- Re-introduce

Changes in v2:
- Use '\0' instead of 0

test/print_ut.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

18 months agosandbox: efi_loader: Correct use of addresses as pointers
Simon Glass [Wed, 27 Nov 2024 17:17:19 +0000 (11:17 -0600)] 
sandbox: efi_loader: Correct use of addresses as pointers

The cache-flush function is incorrect which causes a crash in the
remoteproc tests with arm64.

Fix both problems by using map_sysmem() to convert an address to a
pointer and map_to_sysmem() to convert a pointer to an address.

Also update the image-loader's cache-flushing logic.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 3286d223fd7 ("sandbox: implement invalidate_icache_all()")
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Changes in v6:
- Re-introduce

Changes in v2:
- Drop message about EFI_LOADER

arch/sandbox/cpu/cache.c              |  8 +++++++-
 drivers/remoteproc/rproc-elf-loader.c | 18 +++++++++++-------
 lib/efi_loader/efi_image_loader.c     |  3 ++-
 3 files changed, 20 insertions(+), 9 deletions(-)

Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
18 months agocommon: relocate fdt_blob in global_data for FDTSRC_EMBED case
Evgeny Bachinin [Mon, 25 Nov 2024 09:15:07 +0000 (12:15 +0300)] 
common: relocate fdt_blob in global_data for FDTSRC_EMBED case

Patch resolves two kind of bugs, one of which is vulnerability related
to KASLR.

=== Issue briefly ===

  Working with FDT (via non-relocated gd::fdt_blob) from inside bootm
command may lead to the reading the garbage instead of FDT nodes. And
this can result in various side-effects depending on DTS nodes, being
parsed during bootm.

  But below is my specific story how I faced with this issue due to
MESON_RNG probing failure.

=== Bugs description ===

1) Bug is revealed on:
* configuration below
* U-boot 2024.10 - f919c3a889f ("Prepare v2024.10")

  It seems, the following patch is a trigger:
ea955eea4f ("fdt: automatically add /chosen/kaslr-seed if DM_RNG is enabled")

  Generally, CONFIG_OF_EMBED=y & CONFIG_RNG_MESON=y are the most
valuable ones for reproducing the issue.
```
  CONFIG_ARCH_FIXUP_FDT_MEMORY=y
  CONFIG_CMD_FDT=y
  CONFIG_DEFAULT_FDT_FILE=""
  CONFIG_FDT_64BIT=y
  CONFIG_OF_BOARD_SETUP=y
  CONFIG_OF_CONTROL=y
  CONFIG_OF_EMBED=y
  CONFIG_OF_LIBFDT_ASSUME_MASK=0x0
  CONFIG_OF_LIBFDT_OVERLAY=y
  CONFIG_OF_LIBFDT=y
  CONFIG_OF_LIST="meson-axg-our-device-name"
  CONFIG_OF_REAL=y
  CONFIG_OF_TRANSLATE=y
  CONFIG_SUPPORT_OF_CONTROL=y
  CONFIG_SYS_FDT_PAD=0x3000
  CONFIG_TOOLS_OF_LIBFDT=y

  CONFIG_DM_RNG=y
  CONFIG_RNG_MESON=y
```

2) Due to CONFIG_OF_EMBED, the DTS is embedded into U-boot ELF and
accessible via __dtb_dt_begin symbol.

  On early boot stage (board_f.c) the fdtdec_setup() is called only
once before U-boot's relocation into top of RAM. fdtdec_setup()
initializes gd::fdt_blob for FDTSRC_EMBED case:
```
  gd->fdt_blob = dtb_dt_embedded();
  gd->fdt_src = FDTSRC_EMBED;
```

3) Then reloc_fdt() is called in board_f.c

  But due to CONFIG_OF_EMBED=y the reloc_fdt() does not update
gd::fdt_blob value (strictly speaking, it is impossible for
CONFIG_OF_EMBED=y, because U-boot ELF has not been relocated yet
at this moment).

  As a result after relocation we get fdt_blob, pointing to DTS address
before relocation:
```
   # bdinfo
  <...>
  relocaddr = 0x000000000fedf000
  reloc off = 0x000000000eedf000
  <...>
  fdt_blob = 0x010ce6c0 << points to __dtb_dt_begin before relocation
  new_fdt = 0x0000000000000000  << empty erroneously
  fdt_size = 0x0000000000000000 << zero erroneously
```

4) During bootm command (according to our ITS-config file) the Linux
is loaded into 0x01080000 (which is very close to fdt_blob addr
0x010ce6c0).
```
  ## Loading kernel from FIT Image at 04000000 ...
     Trying 'kernel' kernel subimage
       <...>
       Load Address: 0x01080000
```

  So Linux image overwrites the gd::fdt_blob memory location
in RAM (0x010ce6c0).

5) Issue:

  Hence any manipulation with DTS (say, via FDT API) inside
implementation of bootm command leads to accessing the fdt_blob area
with garbage, that can lead to two situations:

5.1) Abort.

  Call to fdt_off_dt_struct() from fdt_next_tag() :: fdt_offset_ptr()::
fdt_offset_ptr_() returns with garbage, that leads to tagp value
being out of RAM top addr (256 Mb in our board), causing the abort:
```
  Boot cmd: bootm 0x4000000#boot_evt1
  bootm_run_states()
  <...>
  image_setup_libfdt()
   fdt_chosen()
    fdt_kaslrseed()
     uclass_get_device()
      uclass_get_device_tail()
       device_probe()
        device_of_to_plat()
        meson_rng_of_to_plat()
         clk_get_by_name_optional()
          clk_get_by_name()
           clk_get_by_name_nodev()
            ofnode_stringlist_search()
             fdt_stringlist_search()
              fdt_getprop()
               fdt_get_property_namelen_()
                fdt_first_property_offset()
                 fdt_check_node_offset_()
                  fdt_next_tag():
                    ```
                      tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
                    ```
                  fdt_next_tag() tagp:0x22890766
                  fdt_next_tag() ram_top:0x10000000 (tagp OUT of RAM)
  "Synchronous Abort" handler, esr 0x96000010, far 0x22890766
  elr: 000000000108be24 lr : 000000000108be24 (reloc)
  elr: 000000000ff6fe24 lr : 000000000ff6fe24
  x0 : 0000000000000041 x1 : 0000000000000000
  x2 : 000000000ff3b57c x3 : 0000000000000012
  x4 : 000000000ded2ad5 x5 : 0000000000000020
  x6 : 00000000ffffffe8 x7 : 000000000ded2f40
  x8 : 00000000ffffffd8 x9 : 000000000000000d
  x10: 0000000000000006 x11: 000000000001869f
  x12: 000000000fffffff x13: 000000000fffffff
  x14: 0000000000000000 x15: 000000000ded2abb
  x16: 000000000ff3b080 x17: 0000000000000001
  x18: 000000000ded3dc0 x19: 0000000022890766
  x20: 00000000010cb0f0 x21: 00000000000015e4
  x22: 000000000ff8f4d8 x23: 000000000000000b
  x24: 000000000ded2fbc x25: 000000000ffe2000
  x22: 000000000ff8f4d8 x23: 000000000000000b
  x24: 000000000ded2fbc x25: 000000000ffe2000
  x26: 000000000ffe2000 x27: 000000000000000b
  x28: 000000000ff9cf2d x29: 000000000ded2f40

  Code: aa1603e1 91197484 52801742 94004de8 (b9400276)
```

5.2) Vulnerability situation "KASLR is disabled".

Almost the same as in (5.1), but 2 situations happen (depending on
the value of garbage):
  * call to fdt_offset_ptr_() :: fdt_off_dt_struct(fdt)
    returns not so big garbage, leading to tagp, being inside RAM.
  * or calculations of absoffset inside fdt_offset_ptr() leads to
    failure of the one of if() conditions with NULL as retval.

  Result is fdt_next_tag() interprets the tagp as FDT_END. And we are
returning from our callstack via functions' error paths, leading to
"No RNG device" and "KASLR disabled due to lack of seed":
```
  fdt_kaslrseed()
   uclass_get_device()
   <...>
    device_probe()
     device_of_to_plat()
      meson_rng_of_to_plat()
       clk_get_by_name()
        clk_get_by_name_nodev()
        <...>
         fdt_stringlist_search()
          fdt_getprop()
           fdt_get_property_namelen_()
            fdt_first_property_offset()
             fdt_check_node_offset_()
              fdt_next_tag():
                ```
                  tagp = fdt_offset_ptr(fdt, offset, FDT_TAGSIZE);
                ```
              fdt_next_tag() tagp:0000000001890677
              fdt_next_tag() ram_top:0x10000000 (tagp is inside RAM)
      uclass_get_device_tail():486 device_probe() ret:-22
  No RNG device
 Starting kernel ...

  [ 0.000000] Linux version 6.9.12
  [ 0.000000] KASLR disabled due to lack of seed
```

Signed-off-by: Evgeny Bachinin <EABachinin@salutedevices.com>
18 months agoRevert "global_data: Drop spl_handoff"
Simon Glass [Sun, 1 Dec 2024 14:42:35 +0000 (07:42 -0700)] 
Revert "global_data: Drop spl_handoff"

This breaks chromebook_coral which says:

   Video: No video mode configured in FSP!

This reverts commit 2e9313179a846b581c0fc3f6a49e19f3d343efa8.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agobinman: Avoid skipping binman_init()
Simon Glass [Sun, 1 Dec 2024 14:42:34 +0000 (07:42 -0700)] 
binman: Avoid skipping binman_init()

A recent lwip change stopped binman's init from working, so it is not
possible to read nodes from the image description anymore.

Correct this by dropping the offending line.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 4d4d7838127 net: lwip: add TFTP support and tftpboot command
18 months agopowerpc/t2080qds: remove spurious x permission from README file
Rasmus Villemoes [Mon, 25 Nov 2024 09:37:00 +0000 (10:37 +0100)] 
powerpc/t2080qds: remove spurious x permission from README file

It doesn't make sense for a README file to be executable. Remove that
bit.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
18 months agoarm: dts: socfpga: remove spurious execute permission from dt files
Rasmus Villemoes [Mon, 25 Nov 2024 09:33:22 +0000 (10:33 +0100)] 
arm: dts: socfpga: remove spurious execute permission from dt files

It doesn't make sense for these files to have the x bit set. It was,
probably accidentally, added in:

Fixes: 2c494e62c31a (arm: dts: Stratix10: Add QSPI node)
Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
18 months agoMakefile: avoid non-standard sed expressions
Mark Kettenis [Tue, 26 Nov 2024 19:12:14 +0000 (20:12 +0100)] 
Makefile: avoid non-standard sed expressions

The '?' that is used in the sed expression that determines MK_ARCH
is part of the extended regular expression syntax, but the default
behaviour of sed as specified by POSIX is to use only basic regular
expression syntax.  Use the equivalent '\{0,1\}' instead as
suggested by the OpenBSD re_format(7) man page.

Fixes: 04b1d84221d5 ("Makefile: fix empty MK_ARCH when using ccache")
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
Reviewed-by: Marek Vasut <marex@denx.de>
Tested-by: Quentin Schulz <quentin.schulz@cherry.de>
18 months agonet: lwip: wget: fix legacy syntax
Jerome Forissier [Tue, 26 Nov 2024 14:45:06 +0000 (15:45 +0100)] 
net: lwip: wget: fix legacy syntax

Commit 356011f7ac25 ("lwip: fix code style issues") has inadvertently
broken the support for the legacy syntax:

 => wget 192.168.0.16:test.bin
 invalid uri, no file path
 Invalid URL. Use http(s)://

The reason is two calls to strncpy() were replaced by strlcpy() without
paying attention to the fact that they are not equivalent in the present
case. Since we are using a character counter (n) and since we do not
depend on having a properly null-terminated string at each step in the
parsing, strlcpy() is not justified and strncpy() is the right tool for
the job. So use it again.

Reported-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
18 months agoRevert "efi_memory: do not add U-Boot memory to the memory map"
Ilias Apalodimas [Fri, 29 Nov 2024 17:08:13 +0000 (19:08 +0200)] 
Revert "efi_memory: do not add U-Boot memory to the memory map"

This reverts commit ("commit a68c9ac5d8af ("efi_memory: do not add
U-Boot memory to the memory map").

This code was removed when the EFI subsystem started using LMB calls for
the reservations. In hindsight it unearthed two problems.

The e820 code is adding u-boot memory as EfiReservedMemory while it
should look at what LMB added and decide instead of blindly overwriting
it. The reason this worked is that we marked that code properly late,
when the EFI came up. But now with the LMB changes, the EFI map gets
added first and the e820 code overwrites it.

The second problem is that we never mark SetVirtualAddressMap as runtime
code, which we should according to the spec. Until we fix this the
current hack can't go away, at least for architectures that *need* to
call SVAM.

More specifically x86 currently requires SVAM and sets the NX bit for
pages not marked as *_CODE. So unless we do that late, it will crash
trying to execute from non-executable memory. It's also worth noting
that x86 calls SVAM late in the boot, so this will work until someone
decides to overwrite/use BootServicesCode from the OS.

Notably arm64 disables it explicitly if the VA space is > 48bits, so
doesn't suffer from any of these problems.

This doesn't really deserve a fixes tag, since it brings back a hack to
remedy a situation that was wrong long before that commit, but in case
anyone hits the same bug ...
Simon sent the original revert in the link, but we need a proper
justification for it.

Link: https://lore.kernel.org/u-boot/20241112131830.576864-1-sjg@chromium.org/
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reported-by: Simon Glass <sjg@chromium.org>
18 months agoMerge tag 'u-boot-imx-master-20241130' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Sat, 30 Nov 2024 14:34:45 +0000 (08:34 -0600)] 
Merge tag 'u-boot-imx-master-20241130' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/23643

- Make DRAM coding GPIOs available before relocation on Data Modul
  i.MX8M Mini/Plus eDM SBC because the DRAM configuration GPIO straps
  must be accessible in SPL and before relocation because the GPIOs are
  sampled both in U-Boot SPL as well as early on in U-Boot proper.
- Pick safe DRAM size on failure on Data Modul i.MX8M Mini/Plus eDM SBC
  instead of failing with hang() or panic().
- Replace YModem with SDP on Data Modul i.MX8M Mini eDM SBC SPL since
  SDP is much more flexible.
- Deduplicate Data Modul i.MX8M eDM SBC defconfigs.
- Perform plain boot in altbootcmd on Data Modul i.MX8M Mini/Plus eDM
  SBC.

18 months agotest: add command to 'Boot fail' message
Heinrich Schuchardt [Sat, 23 Nov 2024 21:29:22 +0000 (22:29 +0100)] 
test: add command to 'Boot fail' message

When a timeout occurs while executing a command a 'Boot fail' message is
written and testing is stopped. The user is left in the dark about the
failure cause.

    ! _pytest.outcomes.Exit: Boot fail: Marking connection bad - no other tests will run !

Add the executed command to the message.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
18 months agotest: add command to 'Lab failure' timeout message
Heinrich Schuchardt [Sat, 23 Nov 2024 21:29:21 +0000 (22:29 +0100)] 
test: add command to 'Lab failure' timeout message

When a timeout occurs while executing a command a 'Lab failure' message is
written and testing is stopped. The user is left in the dark about the
failure cause.

    ! _pytest.outcomes.Exit: Lab failure: Marking connection bad - no other tests will run !

Add the word 'Timeout' and the executed command to the message.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
18 months agocmd: add a fetch utility
Caleb Connolly [Fri, 15 Nov 2024 00:47:29 +0000 (01:47 +0100)] 
cmd: add a fetch utility

Add a small utility for displaying some information about U-Boot and the
hardware it's running on in a similar fashion to the popular neofetch
tool for Linux [1].

While the output is meant to be useful, it should also be pleasing to
look at and perhaps entertaining. The ufetch command aims to bring this
to U-Boot, featuring a colorful ASCII art version of the U-Boot logo.

[1]: https://en.wikipedia.org/wiki/Neofetch

Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8560-QRD
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Tony Dinh <mibodhi@gmail.com>
Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
18 months agoMerge patch series "test: Avoid needing sudo for image-creation"
Tom Rini [Fri, 29 Nov 2024 20:37:13 +0000 (14:37 -0600)] 
Merge patch series "test: Avoid needing sudo for image-creation"

Simon Glass <sjg@chromium.org> says:

This series rebases and tidies up a series sent by Richard Weinberger
to use unprivileged code to build the test images.

Link: https://patchwork.ozlabs.org/project/uboot/list/?series=417786&state=*
Link: https://lore.kernel.org/r/20241121223217.330117-1-sjg@chromium.org
Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agobootstd: Remove prepared images
Simon Glass [Thu, 21 Nov 2024 22:32:14 +0000 (15:32 -0700)] 
bootstd: Remove prepared images

These are no-longer used. Drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agotest_ut: Drop support for fallback files
Simon Glass [Thu, 21 Nov 2024 22:32:13 +0000 (15:32 -0700)] 
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>
18 months agotest_ut: Use the built mkimage
Simon Glass [Thu, 21 Nov 2024 22:32:12 +0000 (15:32 -0700)] 
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>
18 months agotest_ut: Drop exeception handling
Simon Glass [Thu, 21 Nov 2024 22:32:11 +0000 (15:32 -0700)] 
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>
18 months agotest_ut: Allow running unprivileged
Richard Weinberger [Thu, 21 Nov 2024 22:32:10 +0000 (15:32 -0700)] 
test_ut: Allow running unprivileged

Like for test_fs, no need to mess with loop mounts.

Tweaks to reduce diff (keep mnt variable):

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Simon Glass <sjg@chromium.org>
18 months agotest_ut: Add an image size to setup_image()
Simon Glass [Thu, 21 Nov 2024 22:32:09 +0000 (15:32 -0700)] 
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>
18 months agotest_fs: Rename mount dir to scratch
Richard Weinberger [Thu, 21 Nov 2024 22:32:08 +0000 (15:32 -0700)] 
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>
18 months agotest_fs: Allow running unprivileged
Richard Weinberger [Thu, 21 Nov 2024 22:32:07 +0000 (15:32 -0700)] 
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>
18 months agotest/cmd/wget.c: move net_test_wget() to the cmd test suite
Jerome Forissier [Fri, 15 Nov 2024 16:45:14 +0000 (17:45 +0100)] 
test/cmd/wget.c: move net_test_wget() to the cmd test suite

Since net_test_wget() is testing a command and is in test/cmd it should
be in the 'cmd' test suite, not 'lib'.

Saving and restoring the values of the environment variables that the
test manipulates is necessary to avoid a regression when running the
whole ut test suite. A minimal reproducer is:

 $ ./u-boot -T -c "ut cmd net_test_wget; ut dm dm_test_eth_act" | \
     grep -E "(Test:|Failures:)"

Reported-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
18 months agoRevert "arm64: dts: ti: k3-j7200: Fix OSPI boot"
Tom Rini [Fri, 29 Nov 2024 13:50:33 +0000 (07:50 -0600)] 
Revert "arm64: dts: ti: k3-j7200: Fix OSPI boot"

While I had thought this commit was a cherry-pick from upstream, it is
not. And so, this is not allowed here.

This reverts commit dfe5f16a33453b742a66cabc8ea9a52a33279810.

Signed-off-by: Tom Rini <trini@konsulko.com>
18 months agoMerge tag 'u-boot-at91-2025.04-a' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 29 Nov 2024 13:47:02 +0000 (07:47 -0600)] 
Merge tag 'u-boot-at91-2025.04-a' of https://source.denx.de/u-boot/custodians/u-boot-at91 into next

- at91 gpio driver function alternate mode for pins
- assorted fixes.

18 months agoarm64: zynqmp: Update the usb5744 hub node as per binding
Venkatesh Yadav Abbarapu [Fri, 29 Nov 2024 11:06:31 +0000 (16:36 +0530)] 
arm64: zynqmp: Update the usb5744 hub node as per binding

Updating the usb5744 hub node as per the latest upstream DT binding
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
tree/Documentation/devicetree/bindings/usb/microchip,usb5744.yaml?h=v6.8.8

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20241129110631.672637-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoarm64: zynqmp: Sync with v6.12 kernel
Michal Simek [Thu, 28 Nov 2024 14:49:14 +0000 (15:49 +0100)] 
arm64: zynqmp: Sync with v6.12 kernel

Sync zynqmp* DTS files with v6.12 Linux kernel.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/cf37760117765c4cece94736dc2a7b583d5987de.1732805351.git.michal.simek@amd.com
18 months agotest/py: zynqmp_rpu: Fix tcminit mode value
Love Kumar [Fri, 15 Nov 2024 12:02:02 +0000 (17:32 +0530)] 
test/py: zynqmp_rpu: Fix tcminit mode value

Update the tcminit value to string and number both as per commit
342ccba5586a ("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>
18 months agocadence_qspi: Refactor the flash reset functionality
Venkatesh Yadav Abbarapu [Fri, 8 Nov 2024 06:35:37 +0000 (12:05 +0530)] 
cadence_qspi: Refactor the flash reset functionality

As the flash reset is handled in spi nor core, removing the
flash reset functionality. As the configuration like tristate
and hysterisis need to be enabled by the cdo. Handle the flash
reset only for mini u-boot case.

Rename the "cadence_qspi_versal_flash_reset" to generic name
"cadence_qspi_flash_reset" as this can be used by other platforms
as well.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20241108063537.13180-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoconfigs: versal2: Enable OPTEE support
Venkatesh Yadav Abbarapu [Wed, 27 Nov 2024 04:37:45 +0000 (10:07 +0530)] 
configs: versal2: Enable OPTEE support

Add OPTEE support for versal2 platform.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Link: https://lore.kernel.org/r/20241127043745.249580-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoconfigs: zynqmp_kria: Enable the USB onboard hub
Venkatesh Yadav Abbarapu [Tue, 26 Nov 2024 04:12:38 +0000 (09:42 +0530)] 
configs: zynqmp_kria: Enable the USB onboard hub

USB host support on ZYNQMP KRIA SOM needs onboard USB
hub driver for handling reset GPIO and for i2c initialization
sequence.

Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20241126041238.1969723-1-venkatesh.abbarapu@amd.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
18 months agoARM: dts: imx: Enable PCIe and NVMe on Data Modul i.MX8M Mini eDM SBC
Marek Vasut [Fri, 29 Nov 2024 00:35:43 +0000 (01:35 +0100)] 
ARM: dts: imx: Enable PCIe and NVMe on Data Modul i.MX8M Mini eDM SBC

Enable PCIe/NVMe support on Data Modul i.MX8M Mini eDM SBC. Except for
the configuration options which are enabled, add slight adjustment
to board u-boot.dtsi, which is necessary as there is currently no
driver for the I2C PCIe clock generator. Since the generator is
strapped to be always on, it is possible to supplant the generator
functionality by fixed-clock.

Signed-off-by: Marek Vasut <marex@denx.de>
18 months agoARM: imx: Replace YModem with SDP on Data Modul i.MX8M Mini eDM SBC SPL
Marek Vasut [Fri, 29 Nov 2024 02:41:47 +0000 (03:41 +0100)] 
ARM: imx: Replace YModem with SDP on Data Modul i.MX8M Mini eDM SBC SPL

The YModem support in SPL was never really used on this device,
the SDP support is much more convenient on i.MX8M Mini based
hardware. Replace the YModem support with SDP support.

The SDP can be utilized by forcing the board into SDP boot mode
by grounding test point right next to silkscreen label U30, and
then by using mfgtools 'uuu -brun spl flash.bin' once the device
enumerates on host system USB bus. The SDP capable USB port is
available on the USB micro-B port on the base board.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
18 months agoARM: imx: Deduplicate Data Modul i.MX8M eDM SBC defconfigs
Marek Vasut [Fri, 29 Nov 2024 00:13:56 +0000 (01:13 +0100)] 
ARM: imx: Deduplicate Data Modul i.MX8M eDM SBC defconfigs

Deduplicate defconfigs for all Data Modul i.MX8M eDM SBC systems by factoring
out the common parts into generic imx8m_data_modul.config and including
those using the #include <configs/...> preprocessor macro in the current
set of board specific defconfigs. The preprocessor macro is applicable
to defconfigs as well.

This introduces no functional change, the resulting .config is almost
identical for all Data Modul i.MX8M eDM SBC systems, except for slight
alignment in DEBUG_UART and SYS_PBSIZE.

Signed-off-by: Marek Vasut <marex@denx.de>
18 months agoARM: imx: Perform plain boot in altbootcmd on Data Modul i.MX8M Mini/Plus eDM SBC
Marek Vasut [Fri, 29 Nov 2024 00:13:55 +0000 (01:13 +0100)] 
ARM: imx: Perform plain boot in altbootcmd on Data Modul i.MX8M Mini/Plus eDM SBC

The current A/B switching preparatory altbootcmd is confusing
to users, replace it with plain 'run bootcmd' which can be
replaced by proper A/B switching altbootcmd when the matching
updater is added on top of the platform. By default, keep the
boot counter incrementing, but do not do any A/B partition
switching.

Signed-off-by: Marek Vasut <marex@denx.de>
18 months agoARM: dts: imx: Pick safe DRAM size on failure on Data Modul i.MX8M Mini/Plus eDM SBC
Marek Vasut [Fri, 29 Nov 2024 00:13:54 +0000 (01:13 +0100)] 
ARM: dts: imx: Pick safe DRAM size on failure on Data Modul i.MX8M Mini/Plus eDM SBC

In case gpio_request_list_by_name_nodev() in board dmo_get_memcfg()
returns error code, pick a safe default DRAM configuration instead
of bailing out with some sort of hang() or panic(). The BIT(2)|BIT(0)
strap option is the lowest known option of 2 GiB , use that.

Signed-off-by: Marek Vasut <marex@denx.de>
18 months agoARM: dts: imx: Make DRAM coding GPIOs available before relocation on Data Modul i...
Marek Vasut [Fri, 29 Nov 2024 00:13:53 +0000 (01:13 +0100)] 
ARM: dts: imx: Make DRAM coding GPIOs available before relocation on Data Modul i.MX8M Mini/Plus eDM SBC

The DRAM configuration GPIO straps must be accessible in SPL and before
relocation because the GPIOs are sampled both in U-Boot SPL as well as early
on in U-Boot proper. The already present bootph-pre-ram DT property made the
GPIO controllers available in SPL, but not early on in U-Boot proper, which
made gpio_request_list_by_name_nodev() in board dmo_get_memcfg() fail. Add
missing bootph-some-ram DT property to all GPIO controllers which are
referenced in dmo,ram-coding-gpios DT property to make those GPIO
controllers available early in U-Boot proper as well.

Fixes: 8c103c33fb14 ("dm: dts: Convert driver model tags to use new schema")
Signed-off-by: Marek Vasut <marex@denx.de>
18 months agomtd: nand: raw: atmel: Remove redundant PMECC probe
Alexander Dahl [Mon, 11 Mar 2024 15:23:06 +0000 (16:23 +0100)] 
mtd: nand: raw: atmel: Remove redundant PMECC probe

Always probing pmecc in the generic nand controller probe function and
bailing out if pmecc is missing, prevents the driver to be usable for
SoCs which do not have a pmecc hardware ecc engine like older sam9 SoCs,
for example at91sam9g20.  Tested on sam9x60 that the call, which the
comment was moved to, is sufficient to probe the pmecc.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
18 months agogpio: at91: Implement ops get_flags
Zixun LI [Wed, 13 Nov 2024 10:11:09 +0000 (11:11 +0100)] 
gpio: at91: Implement ops get_flags

Add ops get_dir_flags() to read status from GPIO registers.

Signed-off-by: Zixun LI <admin@hifiphile.com>
18 months agogpio: at91: Implement ops set_flags
Zixun LI [Wed, 13 Nov 2024 10:10:54 +0000 (11:10 +0100)] 
gpio: at91: Implement ops set_flags

Support GPIO configuration with following flags:
- in, out, out_active
- open_drain, pull_up

Signed-off-by: Zixun LI <admin@hifiphile.com>
18 months agogpio: at91: Implement GPIOF_FUNC in get_function()
Zixun LI [Wed, 13 Nov 2024 10:10:22 +0000 (11:10 +0100)] 
gpio: at91: Implement GPIOF_FUNC in get_function()

This patch adds support for determining whether a gpio pin is mapped as
peripheral function.

Signed-off-by: Zixun LI <admin@hifiphile.com>
18 months agodrivers/mtd/ubispl/ubispl.c: Fix error message
Benedikt Spranger [Fri, 18 Oct 2024 08:30:03 +0000 (10:30 +0200)] 
drivers/mtd/ubispl/ubispl.c: Fix error message

The bad CRC error message has transposed characters, which render the
output useless:

"bad CRC at record 213: #08x, not #08x" instead of
"bad CRC at record 213: #00000000, not #4be31f4d"

Fix the error message.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
18 months agotiny-printf: Handle NULL pointer argument to %s
Benedikt Spranger [Fri, 18 Oct 2024 08:30:02 +0000 (10:30 +0200)] 
tiny-printf: Handle NULL pointer argument to %s

A NULL pointer argument to %s causes a NULL pointer dereference in the
fixed width numerical printout code, since p is overwritten with NULL.
In case of %s width is 0. Check width before dereferencing the pointer.

Signed-off-by: Benedikt Spranger <b.spranger@linutronix.de>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
19 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Wed, 27 Nov 2024 13:34:17 +0000 (07:34 -0600)] 
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/23592

- some configs modification

19 months agoMerge branch 'u-boot-nand-20241126' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Wed, 27 Nov 2024 13:33:06 +0000 (07:33 -0600)] 
Merge branch 'u-boot-nand-20241126' of https://source.denx.de/u-boot/custodians/u-boot-nand-flash

CI: https://source.denx.de/u-boot/custodians/u-boot-nand-flash/-/pipelines/23584

Remove device specific nand driver files as they are now replaced by a
common driver bcmbca_nand.c

Make use of OF_UPSTREAM which uses Linux dts.

Implement a minimal set of defconfig options to enable basic NAND
functionality. Tested on:
47622
63146
63158
63178
6813

Set parameter_page_big_endian to zero for bcmbca.

Update log level messages so that more critical messages can be logged
to console and help the troubleshooting with field devices.

19 months agoconfigs: enable CONFIG_PCI_REGION_MULTI_ENTRY=y in sifive_unmatched_defconfig
Yuri Zaporozhets [Tue, 19 Nov 2024 20:59:59 +0000 (21:59 +0100)] 
configs: enable CONFIG_PCI_REGION_MULTI_ENTRY=y in sifive_unmatched_defconfig

Currently, the PCI subsystem selects the small "region 2" (which starts at 0x7000000)
as bus_addr/phys_addr. As a consequence, the BAR0 on PCIe video card cannot be initialized,
because it simply doesn't fit into 0x1000000 bytes size of "region 2".

U-Boot should use "region 1" instead (the one which starts at 0x60090000), because
it has much bigger size (0xFF70000), and easily accomodates BAR0 of the video card.
Linux kernel also uses 0x60090000 as bus_start/phys_start.

Signed-off-by: Yuri Zaporozhets <yuriz@vodafonemail.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
19 months agoconfigs: visionfive2: re-enable SPL_SYS_MMCSD_RAW_MODE
Andreas Schwab [Tue, 12 Nov 2024 16:27:22 +0000 (17:27 +0100)] 
configs: visionfive2: re-enable SPL_SYS_MMCSD_RAW_MODE

To restore MMC boot, enable SPL_SYS_MMCSD_RAW_MODE and recover
SYS_MMCSD_RAW_MODE_U_BOOT_USE_PARTITION and
SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION.

Fixes: 2a00d73d081 ("spl: mmc: Try to clean up raw-mode options")
Signed-off-by: Andreas Schwab <schwab@suse.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
19 months agoconfigs: SiFive Unmatched: enable 'env erase' sub-command
Heinrich Schuchardt [Tue, 12 Nov 2024 10:42:23 +0000 (11:42 +0100)] 
configs: SiFive Unmatched: enable 'env erase' sub-command

With the move from script based booting to using bootmeth a lot of
environment variables have changed. To always use the default environment
it is recommendable to erase the environment stored in the SPI flash.
This can be done with the 'env erase' sub-command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
19 months agospl: increase SPL_SYS_MALLOC_SIZE when using BIOSEMU on RISC-V
Yuri Zaporozhets [Mon, 11 Nov 2024 19:24:04 +0000 (20:24 +0100)] 
spl: increase SPL_SYS_MALLOC_SIZE when using BIOSEMU on RISC-V

If BIOSEMU is compiled for RISC-V (SiFive Unmatched board) and the function
dm_pci_run_vga_bios() is executed, U-Boot stops with error message saying
that the SPL malloc pool is too small. So increase the default pool size
when both BIOSEMU and RISCV parameters are set.

Signed-off-by: Yuri Zaporozhets <yuriz@qrv-systems.net>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
19 months agoarm64: zynqmp: Also generate images with single DT
Michal Simek [Wed, 20 Nov 2024 08:05:27 +0000 (09:05 +0100)] 
arm64: zynqmp: Also generate images with single DT

Create u-boot-single.itb where only actual DTB is used not really multiple
of DTS from OF_LIST. This results in small files without option to change
DT.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/9362da506c13382da0c0d41ad8a111d9c1150f08.1732089924.git.michal.simek@amd.com
19 months agobinman: Add option for pointing to separate description
Michal Simek [Fri, 1 Nov 2024 09:17:54 +0000 (10:17 +0100)] 
binman: Add option for pointing to separate description

Adding binman node with target images description can be unwanted feature
but as of today there is no way to disable it.
Also on size constrained systems it is not useful to add binman description
to DTB.
Introduce BINMAN_DTB Kconfig symbol which allows separate DTB for target
from DTB for binman itself.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f1379d2587f9bf279a7a75c318aabbc1b35ee0c6.1730452668.git.michal.simek@amd.com
19 months agoarm64: zynqmp: Describe empty binman node
Michal Simek [Fri, 1 Nov 2024 09:17:56 +0000 (10:17 +0100)] 
arm64: zynqmp: Describe empty binman node

For enabling binman by default there is a need to have at least empty node
present that's why create -u-boot.dtsi with empty node to cover all ZynqMP
platforms.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/14d874ad4568fa8e3178e893224fecc5c676f04c.1730452668.git.michal.simek@amd.com
19 months agoMakefile: Drop SPL_FIT_GENERATOR support
Marek Vasut [Fri, 1 Nov 2024 09:18:00 +0000 (10:18 +0100)] 
Makefile: Drop SPL_FIT_GENERATOR support

The SPL_FIT_GENERATOR is long superseded by binman, drop SPL_FIT_GENERATOR
support as there are no more users.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/22109373594b6a5d1110be9420ccd8fbb93a61d3.1730452668.git.michal.simek@amd.com
19 months agocommon: binman: Calling initr_binman() when BINMAN_FDT
Michal Simek [Fri, 1 Nov 2024 09:17:55 +0000 (10:17 +0100)] 
common: binman: Calling initr_binman() when BINMAN_FDT

Calling empty function when BINMAN_FDT is adding +64B for nothing which is
not helping on size sensitive configurations as Xilinx mini configurations.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/f79dc1fbf796dd5ad290f6080608ee68d7652cfc.1730452668.git.michal.simek@amd.com
19 months agoarm64: zynqmp: Remove mkimage fit script
Michal Simek [Fri, 1 Nov 2024 09:17:59 +0000 (10:17 +0100)] 
arm64: zynqmp: Remove mkimage fit script

Platform has been switched to binman that's why there is no need for this
script and also Kconfig symbols.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/cf438091e43c4c9d535a9cfa2886673aa42a4370.1730452668.git.michal.simek@amd.com
19 months agoarm64: zynqmp: Generate u-boot.itb and QSPI image via binman
Michal Simek [Fri, 1 Nov 2024 09:17:58 +0000 (10:17 +0100)] 
arm64: zynqmp: Generate u-boot.itb and QSPI image via binman

u-boot.itb has been generated via mkimage_fit_atf.sh but it is on the way
out that's why convert it's description to binman.
Compare to script binman description is not able to configure BL31 and BL32
load/entry addresses which should be done separately.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/90b613796aee38158252c8bb1dfc3da0420f089d.1730452668.git.michal.simek@amd.com
19 months agoarm64: zynqmp: Add binman description for SOM
Michal Simek [Fri, 1 Nov 2024 09:17:57 +0000 (10:17 +0100)] 
arm64: zynqmp: Add binman description for SOM

There is necessary to do some steps to compose boot images. These steps
were in scripts in layers for a while. That's why introduce description via
binman to simplify wiring and remove all scripting around.
This should make sure that everybody is up2date with the latest versions.

The first step is to create fit image with DTBs with descriptions in
configuration node which is written as regular expression to match all SOM
versions.
Description is there for k24 and k26 in spite of low level psu_init
configuration is different. The reason is that it goes to u-boot.itb image
which is the same for k24 and k26.
u-boot.itb is another image which is generated. It is normally generated
via arch/arm/mach-zynqmp/mkimage_fit_atf.sh but this script is supposed to
be deprecated.
FIT image by purpose is using 64bit addresses to have default option to
move images to high DDR (above 4GB). TF-A and TEE are optional components
but in the most cases TF-A is present all the time and TEE(OP-TEE) is used
by some configurations too.

3rd generated image is boot.bin with updated user field which contains
version number. This image can be used with updated Image Selector
which supports A/B update mechanisms with rollback protection.

4th image is image.bin which binary file which contains boot.bin and
u-boot.itb together and can be programmed via origin Image Selector.
This image can be also used for creating one capsule which contains both
boot images (in SPL boot flow).

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/35bc47a4a4799c5f5dbea56a45340a2810538330.1730452668.git.michal.simek@amd.com
19 months agomtd: rawnand: brcmnand: update log level messages
david regan [Wed, 13 Nov 2024 06:27:15 +0000 (22:27 -0800)] 
mtd: rawnand: brcmnand: update log level messages

Update log level messages so that more critical messages can be logged
to console and help the troubleshooting with field devices.

This is a port of the upstream Linux patch to U-Boot.

https://lore.kernel.org/linux-mtd/20240223034758.13753-4-william.zhang@broadcom.com/

Signed-off-by: david regan <dregan@broadcom.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Anand Gore <anand.gore@broadcom.com>
19 months agomtd: rawnand: brcmnand: Default bcmbca parameter_page_big_endian to zero
david regan [Wed, 13 Nov 2024 06:27:14 +0000 (22:27 -0800)] 
mtd: rawnand: brcmnand: Default bcmbca parameter_page_big_endian to zero

Set parameter_page_big_endian to zero for bcmbca

Signed-off-by: david regan <dregan@broadcom.com>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Anand Gore <anand.gore@broadcom.com>
19 months agoarm: dts: Use upstream dts
david regan [Wed, 13 Nov 2024 06:27:13 +0000 (22:27 -0800)] 
arm: dts: Use upstream dts

Make use of OF_UPSTREAM which uses Linux dts.

Signed-off-by: david regan <dregan@broadcom.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Anand Gore <anand.gore@broadcom.com>
19 months agomtd: nand: brcmnand: remove device specific nand driver files
david regan [Wed, 13 Nov 2024 06:27:12 +0000 (22:27 -0800)] 
mtd: nand: brcmnand: remove device specific nand driver files

These device specific nand driver files can be removed because
they are now replaced by a common driver bcmbca_nand.c

Signed-off-by: david regan <dregan@broadcom.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: William Zhang <william.zhang@broadcom.com>
Reviewed-by: Anand Gore <anand.gore@broadcom.com>
19 months agobootstd: Remove prepared images
Simon Glass [Thu, 21 Nov 2024 22:32:14 +0000 (15:32 -0700)] 
bootstd: Remove prepared images

These are no-longer used. Drop them.

Signed-off-by: Simon Glass <sjg@chromium.org>
19 months agotest_ut: Drop support for fallback files
Simon Glass [Thu, 21 Nov 2024 22:32:13 +0000 (15:32 -0700)] 
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>
19 months agotest_ut: Use the built mkimage
Simon Glass [Thu, 21 Nov 2024 22:32:12 +0000 (15:32 -0700)] 
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>
19 months agotest_ut: Drop exeception handling
Simon Glass [Thu, 21 Nov 2024 22:32:11 +0000 (15:32 -0700)] 
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>
19 months agotest_ut: Allow running unprivileged
Richard Weinberger [Thu, 21 Nov 2024 22:32:10 +0000 (15:32 -0700)] 
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>
19 months agotest_ut: Add an image size to setup_image()
Simon Glass [Thu, 21 Nov 2024 22:32:09 +0000 (15:32 -0700)] 
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>
19 months agotest_fs: Rename mount dir to scratch
Richard Weinberger [Thu, 21 Nov 2024 22:32:08 +0000 (15:32 -0700)] 
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>
19 months agotest_fs: Allow running unprivileged
Richard Weinberger [Thu, 21 Nov 2024 22:32:07 +0000 (15:32 -0700)] 
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>
19 months agoMerge tag 'u-boot-dfu-next-20241126' of https://source.denx.de/u-boot/custodians...
Tom Rini [Tue, 26 Nov 2024 16:50:05 +0000 (10:50 -0600)] 
Merge tag 'u-boot-dfu-next-20241126' of https://source.denx.de/u-boot/custodians/u-boot-dfu into next

CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/23573

Android:
- bootstd: Implement bootimage v2 support
- bootstd: Support non-A/B in bootmeth_android
- Migrate VIM3 and VIM3L to use bootmeth_android
- bootstd: Additional test for bootimage v2
- bootstd: Optimize load time when reading partitions

19 months agoMerge tag 'u-boot-imx-next-20241126' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Tue, 26 Nov 2024 16:49:44 +0000 (10:49 -0600)] 
Merge tag 'u-boot-imx-next-20241126' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

CI: https://source.denx.de/u-boot/custodians/u-boot-imx/-/pipelines/23563

- Make Siemens i.MX8 Capricorn board to boot U-Boot mainline again.
- Add support for phycore-imx93 2GB LPDDR4X variant.
- Add phycore-imx8mm EEPROM detection initialisation.

19 months agoconfigs: Resync with savedefconfig
Tom Rini [Tue, 26 Nov 2024 14:10:18 +0000 (08:10 -0600)] 
configs: Resync with savedefconfig

Rsync all defconfig files using qconfig.py

Signed-off-by: Tom Rini <trini@konsulko.com>
19 months agoMerge tag 'u-boot-dfu-20241126' of https://source.denx.de/u-boot/custodians/u-boot-dfu
Tom Rini [Tue, 26 Nov 2024 14:05:11 +0000 (08:05 -0600)] 
Merge tag 'u-boot-dfu-20241126' of https://source.denx.de/u-boot/custodians/u-boot-dfu

CI: https://source.denx.de/u-boot/custodians/u-boot-dfu/-/pipelines/23572

- Fastboot:
  - handle unknown partition type as "raw"
- USB gadget:
  - Fix ci_udc gadget driver for Tegra 2 devices by not using USBADRA

19 months agoMerge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-marvell
Tom Rini [Tue, 26 Nov 2024 14:04:44 +0000 (08:04 -0600)] 
Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-marvell

CI: https://dev.azure.com/sr0718/u-boot/_build/results?buildId=379&view=results

- mvebu: Disable JFFS2 support for Kirkwood and Armada XP boards (Tony)
- kirkwood: Enable bootstd for Sheevaplug board (Tony)
- mvebu: Add Allied Telesis x250 board (Chris)
- mvebu: Updates for Allied Telesis boards (Chris)

19 months agoarm: mvebu: Add Allied Telesis x250 board
Chris Packham [Mon, 25 Nov 2024 19:55:53 +0000 (08:55 +1300)] 
arm: mvebu: Add Allied Telesis x250 board

The x250 and SE250 are series of 10G L2+ switches from Allied Telesis.
There are a number of them in the range but as far as U-Boot is
concerned all the CPU block components are the same so there's only one
board defined.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoarm: mvebu: x530: Enable IPV6 support
Chris Packham [Fri, 22 Nov 2024 00:30:21 +0000 (13:30 +1300)] 
arm: mvebu: x530: Enable IPV6 support

Enable IPV6 support for the x530 board.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoarm: mvebu: x530: Don't build mkeficapsule
Chris Packham [Fri, 22 Nov 2024 00:30:20 +0000 (13:30 +1300)] 
arm: mvebu: x530: Don't build mkeficapsule

The x530 board doesn't use EFI and our toolchains don't include gnutls
so disable the tool in the defconfig.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoarm: mvebu: x530: Remove dead comments
Chris Packham [Fri, 22 Nov 2024 00:30:19 +0000 (13:30 +1300)] 
arm: mvebu: x530: Remove dead comments

As things have been moved to Kconfig there are a number of dead comments
left over in x530.h. Remove them.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoarm: mvebu: x240: Enable IPV6 support
Chris Packham [Fri, 22 Nov 2024 00:30:18 +0000 (13:30 +1300)] 
arm: mvebu: x240: Enable IPV6 support

Enable IPV6 support for the x240 board.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoarm: mvebu: x240: Don't build mkeficapsule
Chris Packham [Fri, 22 Nov 2024 00:30:17 +0000 (13:30 +1300)] 
arm: mvebu: x240: Don't build mkeficapsule

The x240 board doesn't use EFI and our toolchains don't include gnutls
so disable the tool in the defconfig.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoarm: mvebu: x240: Switch to standard boot
Chris Packham [Fri, 22 Nov 2024 00:30:16 +0000 (13:30 +1300)] 
arm: mvebu: x240: Switch to standard boot

Use standard boot instead of the distro boot scripts. Regenerate the
board defconfig now that some options are selected automatically.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoarm: mvebu: x240: Use default baudrate table
Chris Packham [Fri, 22 Nov 2024 00:30:15 +0000 (13:30 +1300)] 
arm: mvebu: x240: Use default baudrate table

Remove CFG_SYS_BAUDRATE_TABLE as there's no reason not to use the
defaults defined via config_fallbacks.h.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoarm: kirkwood: Enable bootstd for Sheevaplug board
Tony Dinh [Thu, 21 Nov 2024 19:02:27 +0000 (11:02 -0800)] 
arm: kirkwood: Enable bootstd for Sheevaplug board

Enable bootstd for Sheevaplug board.
Remove JFFS2 support. See JFFS2 Vulnerability[1].
Enable LTO to keep board size within limit.
Move default envs to text-base environment

[1] https://lore.kernel.org/u-boot/20241114233005.GN3600562@bill-the-cat/T/#m2fc25da1d2c019bc3cd8676991fdd64b8a21aa9b

Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agoarm: mvebu: Disable JFFS2 support for Kirkwood and Armada XP boards
Tony Dinh [Mon, 18 Nov 2024 19:34:59 +0000 (11:34 -0800)] 
arm: mvebu: Disable JFFS2 support for Kirkwood and Armada XP boards

These boards don't use JFFS2 file system for booting so remove it.

Ref: https://lore.kernel.org/u-boot/20241114233005.GN3600562@bill-the-cat/T/#t
Signed-off-by: Tony Dinh <mibodhi@gmail.com>
Acked-by: Phil Sutter <phil@nwl.cc>
Reviewed-by: Stefan Roese <sr@denx.de>
19 months agobootstd: android: don't read whole partition sizes
Julien Masson [Thu, 21 Nov 2024 10:59:55 +0000 (11:59 +0100)] 
bootstd: android: don't read whole partition sizes

The current implementation is reading the whole partition for boot and
vendor_boot image which can be long following the size of the
partition or the time to read blocks (driver/SoC specific).

For example with mediatek mt8365 EVK board, we have a 64MiB boot
partition and the boot image flashed in this partition is only 42MiB.
It takes ~8-9 secs to read the boot partition.

Instead we can retrieved the boot image and vendor boot image size
with these new functions:
- android_image_get_bootimg_size
- android_image_get_vendor_bootimg_size
Use these information and read only the necessary.

By doing this with mt8365 EVK board, we read boot image in ~5 secs.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241121-bootmeth-android-part-sizes-v1-1-25760bbd0f08@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>