]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
9 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>
9 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>
9 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>
9 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
9 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>
9 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>
9 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>
9 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>
9 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>
9 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.

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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.

9 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>
9 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
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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

9 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.

9 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>
9 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>
9 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>
9 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>
9 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
9 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
9 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
9 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
9 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
9 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
9 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
9 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
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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

9 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.

9 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>
9 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

9 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)

9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 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>
9 months agobootstd: Add test for Android boot image v2
Guillaume La Roque [Tue, 26 Nov 2024 08:06:13 +0000 (09:06 +0100)] 
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>
9 months agoconfigs: khadas-vim3_android{_ab}: move on bootmeth android
Guillaume La Roque [Tue, 26 Nov 2024 08:06:12 +0000 (09:06 +0100)] 
configs: khadas-vim3_android{_ab}: move on bootmeth android

Actually khadas vim3 use distro command to boot android image.
Move on new bootmeth android for A/B and non-A/B vim3 android.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Link: https://lore.kernel.org/r/20241126-adnroidv2-v4-4-11636106dc69@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
9 months agoconfigs: khadas-vim3l_android{_ab}: move on bootmeth android
Guillaume La Roque [Tue, 26 Nov 2024 08:06:11 +0000 (09:06 +0100)] 
configs: khadas-vim3l_android{_ab}: move on bootmeth android

Actually khadas vim3l use distro command to boot android image.
Move on new bootmeth android for A/B and non-A/B vim3l android.

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Acked-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
Link: https://lore.kernel.org/r/20241126-adnroidv2-v4-3-11636106dc69@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
9 months agobootstd: android: add non-A/B image support
Guillaume La Roque [Tue, 26 Nov 2024 08:06:10 +0000 (09:06 +0100)] 
bootstd: android: add non-A/B image support

Update android bootmeth to support non-A/B image.
Enable AB support only when ANDROID_AB is enabled.

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-2-11636106dc69@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
9 months agobootstd: android: add support of bootimage v2
Guillaume La Roque [Tue, 26 Nov 2024 08:06:09 +0000 (09:06 +0100)] 
bootstd: android: add support of bootimage v2

Android bootmeth only support boot image v3/4.

Add support of Android Boot Image version 2 [1].
Vendor boot image is only supported in version 3 and 4 so don't try to
read it when header version is less than 3.

[1] https://source.android.com/docs/core/architecture/bootloader/boot-image-header#header-v2

Tested-by: Julien Masson <jmasson@baylibre.com>
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-1-11636106dc69@baylibre.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
9 months agousb: ci_udc: don't use "advance" feature when setting address
Ion Agorria [Tue, 26 Nov 2024 07:29:56 +0000 (09:29 +0200)] 
usb: ci_udc: don't use "advance" feature when setting address

In the older USB controllers like for example in ChipIdea controller
used by the Tegra 2 the "USBADRA: Device Address Advance" bitflag
does not exist, so the new device address set during SET_ADDRESS
can't be deferred by hardware, which causes the host to not recognize
the device and give an error.

Instead store it until ep completes to apply the change into the hw
register as Linux kernel does. This should fix regression on old and
and be compatible with newer controllers.

Inspired by: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ef15e5490edc7edf808d3477ab32e0e320792f65

Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20241126072956.64778-2-clamor95@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
9 months agoboard: phytec: phycore-imx8mm: Add EEPROM detection initialisation
Yunus Bas [Fri, 22 Nov 2024 10:29:38 +0000 (11:29 +0100)] 
board: phytec: phycore-imx8mm: Add EEPROM detection initialisation

Add EEPROM detection initialisation for phyCORE-i.MX8MM.

Signed-off-by: Yunus Bas <y.bas@phytec.de>
9 months agoboard: phytec: imx93: Add phyCORE-i.MX 93 support for all SOM variants
Christoph Stoidner [Wed, 20 Nov 2024 16:31:43 +0000 (17:31 +0100)] 
board: phytec: imx93: Add phyCORE-i.MX 93 support for all SOM variants

The phyCORE-i.MX 93 is available in various variants (e.g. different ram
sizes, eMMC HS400 yes/no). Enable hardware introspection for the
imx93-phyboard-segin_defconfig, so that during startup the SOM module
variant can be detected, and the hardware can be configured accordingly.
The resulting SPL and u-boot binary shall able to boot each
phyCORE-i.MX 93 module variant on each carrier board. Finally rename
imx93-phyboard-segin_defconfig to imx93-phycore_defconfig, to highlight
its SOM scope.

Signed-off-by: Christoph Stoidner <c.stoidner@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
9 months agoboard: phytec: imx93: Add eeprom-based hardware introspection
Christoph Stoidner [Wed, 20 Nov 2024 16:31:42 +0000 (17:31 +0100)] 
board: phytec: imx93: Add eeprom-based hardware introspection

The phyCORE-i.MX 93 is available in various variants. Relevant variant
options for the spl/u-boot are:
- with or without HS400 support for the eMMC
- with 1GB ram chip, or 2GB ram chip

The phyCORE's eeprom contains all information about the existing variant
options. Add evaluation of the eeprom data to the spl/u-boot to
enable/disable HS400 and to select the appropriate ram configuration at
startup.

Signed-off-by: Christoph Stoidner <c.stoidner@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Yannic Moog <y.moog@phytec.de>
Tested-by: Primoz Fiser <primoz.fiser@norik.com>
9 months agoboard: phytec: phycore-imx93: Add 2GB LPDDR4X RAM timings
Christoph Stoidner [Wed, 20 Nov 2024 16:31:41 +0000 (17:31 +0100)] 
board: phytec: phycore-imx93: Add 2GB LPDDR4X RAM timings

The phyCORE-i.MX 93 is available with a 1GB ram chip or a 2GB ram chip.
Add the ram timings for the 2GB chip, in form of a diff compared
to the existing LPDDR4X 1GB timings. With that, the SPL can select the
appropriate timings at startup.
Update also the 1GB ram timings with new version of the DDR Tool.

Signed-off-by: Christoph Stoidner <c.stoidner@phytec.de>
Tested-by: Primoz Fiser <primoz.fiser@norik.com>
9 months agosiemens: capricorn: update maintainers
Enrico Leto [Sat, 23 Nov 2024 16:53:04 +0000 (17:53 +0100)] 
siemens: capricorn: update maintainers

update MAINTAINERS file, add some more board maintainers.

Signed-off-by: Enrico Leto <enrico.leto@siemens.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
9 months agosiemens: add ddr signal integrity test
Enrico Leto [Sat, 23 Nov 2024 16:53:03 +0000 (17:53 +0100)] 
siemens: add ddr signal integrity test

The signal integrity test generates pattern on DDR lines
for certification. The signals must be as fast as possible
and unidirectional.

The test is required from our HW team. The available
u-boot memory test doesn't full fill the our requirements.

The test is planed to be used in all new siemens boards.

Signed-off-by: Enrico Leto <enrico.leto@siemens.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
9 months agosiemens: add ddr full memory test
Enrico Leto [Sat, 23 Nov 2024 16:53:02 +0000 (17:53 +0100)] 
siemens: add ddr full memory test

Add siemens specific memory test. Enable it through Kconfig option
SPL_CMT. The test is required from our HW team. It runs over
temperature during many days:
* must run indefinitively through the *whole* DDR area,
  so we cannot use linux memtest for example.
* must write/read/check all values

Signed-off-by: Enrico Leto <enrico.leto@siemens.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
9 months agosiemens: capricorn: get module name from eeprom
Enrico Leto [Sat, 23 Nov 2024 16:53:01 +0000 (17:53 +0100)] 
siemens: capricorn: get module name from eeprom

The eeprom contains the information on which module
we are running, so read it from the eeprom and print
it on the console.

Signed-off-by: Enrico Leto <enrico.leto@siemens.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
9 months agosiemens: capricorn: get ram size from system controller
Enrico Leto [Sat, 23 Nov 2024 16:53:00 +0000 (17:53 +0100)] 
siemens: capricorn: get ram size from system controller

Get the memory region information from system controller to reduce the
number of platform specific headers. We were aligned on NXP mek board
implementation. This need at least 1 header per memory configuration.

Signed-off-by: Enrico Leto <enrico.leto@siemens.com>
Signed-off-by: Heiko Schocher <hs@denx.de>