]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
12 months agobootm: Create a function to run through the booti states
Simon Glass [Sat, 16 Dec 2023 03:14:25 +0000 (20:14 -0700)]
bootm: Create a function to run through the booti states

In a few places, the booti command is used to handle a boot. We want
these to be done without needing CONFIG_CMDLINE, so add a new
booti_run() function to handle this.

So far this is not used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agostm32: Use bootm_run() and bootz_run()
Simon Glass [Sat, 16 Dec 2023 03:14:24 +0000 (20:14 -0700)]
stm32: Use bootm_run() and bootz_run()

Use the new bootm/z_run() functions to avoid having to create an
argument list for the stm32prog code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
12 months agobootm: Create a function to run through the bootz states
Simon Glass [Sat, 16 Dec 2023 03:14:23 +0000 (20:14 -0700)]
bootm: Create a function to run through the bootz states

In a few places, the bootz command is used to handle a boot. We want
these to be done without needing CONFIG_CMDLINE, so add a new
bootz_run() function to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agostm32: Use local vars in stm32prog for initrd and fdt
Simon Glass [Sat, 16 Dec 2023 03:14:22 +0000 (20:14 -0700)]
stm32: Use local vars in stm32prog for initrd and fdt

Rather than assigning to the bootm_argv[] array multiple times, use
local variables for the two things that can change and assign them at
the end.

This makes it easier to drop the array eventually.

Tidu up an overly short line while we are here.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
12 months agobootm: Create a function to run through the bootm states
Simon Glass [Sat, 16 Dec 2023 03:14:21 +0000 (20:14 -0700)]
bootm: Create a function to run through the bootm states

In quite a few places, the bootm command is used to handle a boot. We
want these to be done without needing CONFIG_CMDLINE, so add a new
bootm_run() function to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobootm: Tidy up boot_selected_os()
Simon Glass [Sat, 16 Dec 2023 03:14:20 +0000 (20:14 -0700)]
bootm: Tidy up boot_selected_os()

Use struct bootm_info with this function, to avoiding needing to
create a new one.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobootm: Rename do_bootm_states() to bootm_run_states()
Simon Glass [Sat, 16 Dec 2023 03:14:19 +0000 (20:14 -0700)]
bootm: Rename do_bootm_states() to bootm_run_states()

Rename the function to bootm_run_states() to better indicate ts
purpose. The 'do_' prefix is used to indicate a command processor,
which this is now not.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobootm: Drop arguments from do_bootm_states()
Simon Glass [Sat, 16 Dec 2023 03:14:18 +0000 (20:14 -0700)]
bootm: Drop arguments from do_bootm_states()

Use the bootm_info struct to hold the information required by bootm.

Now that none of the functions called from do_bootm_states() needs an
argv[] list, change the arguments of do_bootm_states() as well. Take
care to use the same value for boot_progress even though it is a little
inconsistent.

For booti make sure it only uses argv[] and argc at the top of the
function, so we can eventually refactor to remove these parameters.

With bootm, some OSes need access to the arguments provided to the
command, so set these up in the bootm_info struct, for bootm only.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobootz: Avoid use of #ifdef
Simon Glass [Sat, 16 Dec 2023 03:14:17 +0000 (20:14 -0700)]
bootz: Avoid use of #ifdef

Use the compiler to get the set of states, instead of the preprocessor.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobooti: Avoid use of #ifdef
Simon Glass [Sat, 16 Dec 2023 03:14:16 +0000 (20:14 -0700)]
booti: Avoid use of #ifdef

Use the compiler to get the set of states, instead of the preprocessor.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobootm: Move do_bootm_states() comment to header file
Simon Glass [Sat, 16 Dec 2023 03:14:15 +0000 (20:14 -0700)]
bootm: Move do_bootm_states() comment to header file

This is an exported function, so move the function comment to the
bootm.h header file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobootm: Add more fields to bootm_info
Simon Glass [Sat, 16 Dec 2023 03:14:14 +0000 (20:14 -0700)]
bootm: Add more fields to bootm_info

Add fields for the three bootm parameters and other things needed for
booting. Also add a helper to set up the struct correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobootm: Adjust arguments of boot_os_fn
Simon Glass [Sat, 16 Dec 2023 03:14:13 +0000 (20:14 -0700)]
bootm: Adjust arguments of boot_os_fn

Adjust boot_os_fn to use struct bootm_info instead of the separate
argc, argv and image parameters. Update the handlers accordingly. Few
of the functions make use of the arguments, so this improves code size
slightly.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agobootm: Create a struct for argument information
Simon Glass [Sat, 16 Dec 2023 03:14:12 +0000 (20:14 -0700)]
bootm: Create a struct for argument information

Some OS functions require the arguments to the 'bootm' command. This is
inconvenient for two reasons.

Firstly, there may not be any actual command, if CMDLINE is not enabled
and programmatic boot is being used.

Secondly, most functions don't require the arguments, so it is
inefficient to pass them when not needed. For example it increases code
size.

Create a new struct which holds the arguments, which can be used if
needed.

Add the images pointer as well, since this is commonly needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agosandbox: bootm: Enable more bootm OS methods
Simon Glass [Sat, 16 Dec 2023 03:14:11 +0000 (20:14 -0700)]
sandbox: bootm: Enable more bootm OS methods

It is useful for sandbox to build as much code as possible. Enable
support for booting various other operating systems. Add the missing
cache functions.

These operating systems do not actually boot on sandbox, of course.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agobootm: Adjust how the board is reset
Simon Glass [Sat, 16 Dec 2023 03:14:10 +0000 (20:14 -0700)]
bootm: Adjust how the board is reset

Use reset_cpu() to reset the board, copying the logic from the 'reset'
command. This makes more sense than directly calling the do_reset()
function with the arguments passsed to the bootm command.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
12 months agoriscv: Add a reset_cpu() function
Simon Glass [Sat, 16 Dec 2023 03:14:09 +0000 (20:14 -0700)]
riscv: Add a reset_cpu() function

The current do_reset() is called from a command context. Add a function
which can be used from anywhere, as is done on ARM. Adjust do_reset()
to call it.

Note that reset_cpu() is normally provided by SYSRESET so make this
declaration conditional on that being disabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Chanho Park <chanho61.park@samsung.com>
Tested-by: Chanho Park <chanho61.park@samsung.com>
12 months agonios2: Add a reset_cpu() function
Simon Glass [Sat, 16 Dec 2023 03:14:08 +0000 (20:14 -0700)]
nios2: Add a reset_cpu() function

The current do_reset() is called from a command context. Add a function
which can be used from anywhere, as is done on ARM.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agoppc: Add a reset_cpu() function
Simon Glass [Sat, 16 Dec 2023 03:14:07 +0000 (20:14 -0700)]
ppc: Add a reset_cpu() function

The current do_reset() is called from a command context. Add a function
which can be used from anywhere, as is done on ARM.

This is only needed if CONFIG_SYSRESET is disabled.

Since there are lots of reset functions, this one actually just calls
do_reset(). Future refactoring could correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agom68k: Add a reset_cpu() function
Simon Glass [Sat, 16 Dec 2023 03:14:06 +0000 (20:14 -0700)]
m68k: Add a reset_cpu() function

The current do_reset() is called from a command context. Add a function
which can be used from anywhere, as is done on ARM.

Since there are lots of reset functions, this one actually just calls
do_reset(). Future refactoring could correct this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Angelo Dureghello <angelo@kernel-spcece.org>
12 months agomips: Add a reset_cpu() function
Simon Glass [Sat, 16 Dec 2023 03:14:05 +0000 (20:14 -0700)]
mips: Add a reset_cpu() function

The current do_reset() is called from a command context. Add a function
which can be used from anywhere, as is done on ARM.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agoboard: ti: k3: Remove need for CFG_SYS_SDRAM_BASE
Andrew Davis [Thu, 30 Nov 2023 14:49:11 +0000 (08:49 -0600)]
board: ti: k3: Remove need for CFG_SYS_SDRAM_BASE

The base address of extended DDR does not change across the K3 family.
Setting this per SoC is not needed. Remove this definition to help
remove the last bits from K3 include/configs/*.h files.

Signed-off-by: Andrew Davis <afd@ti.com>
12 months agoboard: ti: am62x/am62ax: Update virtual interrupt allocations in board config
Vishal Mahaveer [Tue, 28 Nov 2023 19:40:24 +0000 (13:40 -0600)]
board: ti: am62x/am62ax: Update virtual interrupt allocations in board config

Updates as a result of TIFS core now reserving a virtual interrupt
for enabling interrupts between DM to TIFS core. Because of this
change other virtual interrupt counts decrease by one.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
12 months agoboard: ti: am62x/am62ax: Update MCU GPIO interrupt allocation in board config
Vishal Mahaveer [Tue, 28 Nov 2023 19:40:23 +0000 (13:40 -0600)]
board: ti: am62x/am62ax: Update MCU GPIO interrupt allocation in board config

Share the MCU GPIO interrupts between A53 core and DM R5 core. Allocating
2 instances each to A53 and DM R5.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
12 months agoboard: ti: am62ax: Add C7x resource allocation entries to board config
Vishal Mahaveer [Tue, 28 Nov 2023 19:40:22 +0000 (13:40 -0600)]
board: ti: am62ax: Add C7x resource allocation entries to board config

Update am62ax rm-cfg with allocation entries for C7x core. Following
updates are added for C7x:
- Share split BCDMA tx and rx channels between DM R5 and C7x
- Share rings for split BCDMA tx and rx channels between DM R5 and C7x
- Add Global events and Virtual interrupts for C7x

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
12 months agoboard: ti: am62x/am62ax: Formatting updates to board config files
Vishal Mahaveer [Tue, 28 Nov 2023 19:40:21 +0000 (13:40 -0600)]
board: ti: am62x/am62ax: Formatting updates to board config files

Minor formatting updates to the rm board configuration file for
am62x and am62ax boards.

Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
12 months agoarm: mach-k3: Merge initial memory maps
Andrew Davis [Tue, 28 Nov 2023 17:05:28 +0000 (11:05 -0600)]
arm: mach-k3: Merge initial memory maps

The Device vs Normal memory map is the same for all K3 SoCs. Merge
the SoC specific maps into one.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
12 months agoarm: mach-k3: Remove non-cached memory map areas
Andrew Davis [Tue, 28 Nov 2023 17:05:27 +0000 (11:05 -0600)]
arm: mach-k3: Remove non-cached memory map areas

All normal memory areas should be mapped as such.

We added these un-cached holes in our memory map to hack around the
remoteproc driver missing the proper cache maintenance operations.

The problem is having these non-cached memory map areas causes stability
issues later in system operation due to the nature of the K3 coherency
architecture. Plus these are board specific carveouts and instead
should have been added at the board level, not here in the SoC common
code area.

Remove these non-cached memory map areas.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
12 months agoarm: mach-k3: Do not map ATF and OPTEE regions in MMU
Andrew Davis [Tue, 28 Nov 2023 17:05:26 +0000 (11:05 -0600)]
arm: mach-k3: Do not map ATF and OPTEE regions in MMU

ATF and OPTEE regions may be firewalled from non-secure entities. To
prevent access to this area we leave a hole there in the MMU map. This
is the same idea as [0] but we complete that patch by adding the same
for AM65, J721e, J7200, and J721s2 here.

[0] commit 0688ff3ae23c ("arm: mach-k3: arm64-mmu: do not map ATF and OPTEE regions in A53 MMU")

Signed-off-by: Andrew Davis <afd@ti.com>
12 months agoarm: mach-k3: Let the compiler size the mem_map lists
Andrew Davis [Tue, 28 Nov 2023 17:05:25 +0000 (11:05 -0600)]
arm: mach-k3: Let the compiler size the mem_map lists

NR_MMU_REGIONS is a copy/paste from another platform that extends
this list later. We do not do that, so let the list be the size
of the initializer list.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Nishanth Menon <nm@ti.com>
Tested-by: Nishanth Menon <nm@ti.com>
12 months agoarm: mach-k3: Move K3 common schema.yaml out of board directory
Andrew Davis [Wed, 22 Nov 2023 21:30:05 +0000 (15:30 -0600)]
arm: mach-k3: Move K3 common schema.yaml out of board directory

This file is common for all K3, move it out of board/ directory and
into mach-k3. As we need to change the path in k3-binman.dtsi let's
take this opportunity to switch to absolute paths which makes adding
non-TI boards (like Toradex Verdin) not need to override these paths.

Signed-off-by: Andrew Davis <afd@ti.com>
12 months agoMerge tag 'u-boot-stm32-20231215' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Fri, 15 Dec 2023 18:33:11 +0000 (13:33 -0500)]
Merge tag 'u-boot-stm32-20231215' of https://source.denx.de/u-boot/custodians/u-boot-stm into next

_ run savedefconfig on all STM32 defconfig

STM32 MCU:
_ Sync stm32f469-disco DT with Linux 6.5
_ rework ltdc node for stm32f769-disco
_ clk: stm32f: Fix settings for LCD_CLK
_ Support display on stm32f469-disco board

STM32 MPU:
_ stm32mp_dfu : Fix board_get_alt_info_mtd()
_ stm32mp_dfu : Simplify MTD device parsing

12 months agoMerge patch series "bootm: Handle compressed arm64 images with bootm"
Tom Rini [Fri, 15 Dec 2023 14:41:44 +0000 (09:41 -0500)]
Merge patch series "bootm: Handle compressed arm64 images with bootm"

To quote the author:

This little series corrects a problem I noticed with arm64 images,
where the kernel is not recognised if compression is used:

   U-Boot> tftp image.fit
   Using ethernet@7d580000 device
   TFTP from server 192.168.4.7; our IP address is 192.168.4.147
   Filename 'image.fit'.
   Load address: 0x1000000
   Loading: ##################################################  23 MiB
     20.5 MiB/s
   done
   Bytes transferred = 24118272 (1700400 hex)
   U-Boot> bootm
   ## Loading kernel from FIT Image at 01000000 ...
      Using 'conf-768' configuration
      Trying 'kernel' kernel subimage
        Description:  Linux
        Type:         Kernel Image (no loading done)
        Compression:  gzip compressed
        Data Start:   0x01000120
        Data Size:    13662338 Bytes = 13 MiB
      Verifying Hash Integrity ... OK
   Bad Linux ARM64 Image magic!

With this series:

   U-Boot> tftp 20000000 image.fit
   Using ethernet@7d580000 device
   TFTP from server 192.168.4.7; our IP address is 192.168.4.147
   Filename 'image.fit'.
   Load address: 0x20000000
   Loading: ##################################################  23.5 MiB
     20.8 MiB/s
   done
   Bytes transferred = 24642560 (1780400 hex)
   U-Boot> bootm 0x20000000
   ## Loading kernel from FIT Image at 20000000 ...
      Using 'conf-768' configuration
      Trying 'kernel' kernel subimage
        Description:  Linux
        Type:         Kernel Image (no loading done)
        Compression:  zstd compressed
        Data Start:   0x20000120
        Data Size:    14333475 Bytes = 13.7 MiB
      Verifying Hash Integrity ... OK
   Using kernel load address 80000
   ## Loading fdt from FIT Image at 20000000 ...
      Using 'conf-768' configuration
      Trying 'fdt-768' fdt subimage
        Description:  Raspberry Pi 4 Model B
        Type:         Flat Device Tree
        Compression:  zstd compressed
        Data Start:   0x215f820c
        Data Size:    9137 Bytes = 8.9 KiB
        Architecture: AArch64
      Verifying Hash Integrity ... OK
      Uncompressing Flat Device Tree to 3aff3010
      Booting using the fdt blob at 0x3aff3010
   Working FDT set to 3aff3010
      Uncompressing Kernel Image (no loading done) to 80000
   Moving Image from 0x80000 to 0x200000, end=2b00000
      Using Device Tree in place at 000000003aff3010, end 000000003afff4c4
   Working FDT set to 3aff3010

   Starting kernel ...

   [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd083]

The problem is that the arm64 magic is checked before the image is
decompressed. However this is only part of it. The kernel_noload image
type doesn't work with compression, since the kernel is not loaded. So
this series deals with that by using an lmb-allocated buffer for the
uncompressed kernel.

Another issue is that the arm64 handling is done too early, before the
image is loaded. This series moves it to after loading, so that
compression can be handled.

A patch is included to show the kernel load-address, so it is easy to
see what is going on.

One annoying feature of arm64 is that the image is often copied to
another address. It might be possible for U-Boot to figure that out
earlier and decompress it to the right place, but perhaps not.

With all of this it should be possible to boot a compressed kernel on
any of the 990 arm64 boards supported by Linux, although I have only
tested two.

12 months agobootm: Support kernel_noload with compression
Simon Glass [Sun, 19 Nov 2023 14:43:34 +0000 (07:43 -0700)]
bootm: Support kernel_noload with compression

It is not currently possible to execute the kernel in-place without
loading it. Use lmb to allocate memory for it.

Co-developed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
12 months agobootm: Move arm64-image processing later
Simon Glass [Sun, 19 Nov 2023 14:43:33 +0000 (07:43 -0700)]
bootm: Move arm64-image processing later

If the image is compressed, then the existing check fails, since the
header is wrong.

Move the check later in the boot process, after the kernel is
decompressed. This allows use of bootm with compressed kernels, while
still permitting an uncompressed kernel to be used.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agoimage: Show the load address when decompressing
Simon Glass [Sun, 19 Nov 2023 14:43:32 +0000 (07:43 -0700)]
image: Show the load address when decompressing

The destination address for decompression (or copying) is useful
information. Show this to the user while booting, e.g.:

   Uncompressing Kernel Image (no loading done) to 2080000

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agoimage: Correct load_bug typo
Simon Glass [Sun, 19 Nov 2023 14:43:31 +0000 (07:43 -0700)]
image: Correct load_bug typo

Correct a typo in the function comment for image_decomp().

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agoconfigs: stm32: Apply savedefconfig
Patrice Chotard [Fri, 15 Dec 2023 14:32:20 +0000 (15:32 +0100)]
configs: stm32: Apply savedefconfig

Apply savedefconfig on all stm32 defconfig.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoboard: st: common: simplify MTD device parsing
Patrice Chotard [Fri, 17 Nov 2023 17:01:07 +0000 (18:01 +0100)]
board: st: common: simplify MTD device parsing

Simplify the way all MTD devices are parsed.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
12 months agoboard: st: common: Fix board_get_alt_info_mtd()
Patrice Chotard [Fri, 17 Nov 2023 17:01:06 +0000 (18:01 +0100)]
board: st: common: Fix board_get_alt_info_mtd()

Since MTD devices are partioned, we got the following
error when command "dfu 0" is executed:

DFU alt info setting: done
ERROR: Too many arguments for nor0
ERROR: DFU entities configuration failed!
ERROR: (partition table does not match dfu_alt_info?)

Fixes: 31325e1b8b9c ("stm32mp1: dynamically build DFU_ALT_INFO")
Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
12 months agoboard: stm32f469-disco: add splash screen with stmicroelectronics logo
Dario Binacchi [Mon, 11 Dec 2023 22:05:56 +0000 (23:05 +0100)]
board: stm32f469-disco: add splash screen with stmicroelectronics logo

Display the STMicroelectronics logo with features VIDEO_LOGO and
SPLASH_SCREEN on stm32f469-disco board.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoboard: stm32f469-disco: add support to display
Dario Binacchi [Mon, 11 Dec 2023 22:05:55 +0000 (23:05 +0100)]
board: stm32f469-disco: add support to display

Add support to Orise Tech OTM8009A display on stm32f469-disco board.

It was necessary to retrieve the framebuffer address from the device tree
because the address returned by the video-uclass driver pointed to a memory
area that was not usable.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoARM: dts: stm32: support MIPI DSI on stm32f469-disco board
Dario Binacchi [Mon, 11 Dec 2023 22:05:54 +0000 (23:05 +0100)]
ARM: dts: stm32: support MIPI DSI on stm32f469-disco board

Unlike Linux, the DSI driver requires the LTDC clock to be properly
probed. Hence, the changes made to the DSI node.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoARM: dts: stm32: make the DSI clock usable by the clock driver
Dario Binacchi [Mon, 11 Dec 2023 22:05:53 +0000 (23:05 +0100)]
ARM: dts: stm32: make the DSI clock usable by the clock driver

As described in [1], the "clocks" property contains "a phandle to the
clock device node, an index selecting between gated clocks (0) and other
clocks (1), and an index specifying the clock to use." The current version
of the clock driver, unlike the kernel, is currently able to properly
handle nodes with "clocks" properties with an index set to 0.

This patch is preparatory for future developments that require the use
of the DSI clock.

[1] Documentation/devicetree/bindings/clock/st,stm32-rcc.txt
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoARM: dts: stm32: make the LTDC clock usable by the clock driver
Dario Binacchi [Mon, 11 Dec 2023 22:05:52 +0000 (23:05 +0100)]
ARM: dts: stm32: make the LTDC clock usable by the clock driver

As described in [1], the "clocks" property contains "a phandle to the
clock device node, an index selecting between gated clocks (0) and other
clocks (1), and an index specifying the clock to use." The current version
of the clock driver, unlike the kernel, is currently able to properly
handle nodes with "clocks" properties with an index set to 0.

This patch is preparatory for future developments that require the use
of the LTDC clock.

[1] Documentation/devicetree/bindings/clock/st,stm32-rcc.txt
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoARM: dts: stm32f469-disco: sync with Linux 6.5
Dario Binacchi [Mon, 11 Dec 2023 22:05:51 +0000 (23:05 +0100)]
ARM: dts: stm32f469-disco: sync with Linux 6.5

Sync the devicetree with linux 6.5 for stm32f746-disco board.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoclk: stm32f: fix setting of LCD clock
Dario Binacchi [Sat, 11 Nov 2023 10:46:19 +0000 (11:46 +0100)]
clk: stm32f: fix setting of LCD clock

Set pllsaidivr only if the PLLSAIR output frequency is an exact multiple
of the pixel clock rate. Otherwise, we search through all combinations
of pllsaidivr * pllsair and use the one which gives the rate closest to
requested one.

Fixes: 5e993508cb25 ("clk: clk_stm32f: Add set_rate for LTDC clock")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoclk: stm32f: fix setting of division factor for LCD_CLK
Dario Binacchi [Sat, 11 Nov 2023 10:46:18 +0000 (11:46 +0100)]
clk: stm32f: fix setting of division factor for LCD_CLK

The value to be written to the register must be appropriately shifted,
as is correctly done in other parts of the code.

Fixes: 5e993508cb25 ("clk: clk_stm32f: Add set_rate for LTDC clock")
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoARM: dts: stm32f769-disco: rework ltdc node
Dario Binacchi [Sat, 11 Nov 2023 10:44:36 +0000 (11:44 +0100)]
ARM: dts: stm32f769-disco: rework ltdc node

With commit f479f5dbb7ac ("ARM: dts: stm32: add ltdc support on
stm32f746 MCU"), which adds the 'ltdc' node in stm32f746.dtsi, we can
simplify stm32f769-disco-uboot.dtsi and align stm32f769-disco.dtsi with
the kernel version.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
12 months agoMerge tag 'xilinx-for-v2024.04-rc1' of https://source.denx.de/u-boot/custodians/u...
Tom Rini [Thu, 14 Dec 2023 18:27:11 +0000 (13:27 -0500)]
Merge tag 'xilinx-for-v2024.04-rc1' of https://source.denx.de/u-boot/custodians/u-boot-microblaze into next

Xilinx changes for v2024.04-rc1

zynqmp:
- Introduce Kria specific defconfig
- Calculate SPI image location based on boot offset
- DT updates

zynqmp-clk:
- Fix topsw_lsbus_clock for DP

axi-enet:
- Support older DT binding

mailbox:
- Add support for multiple mailboxes

pcie-xilinx:
- Covert driver to newer interface
- Enable MMIO region

zynq:
- dfu updates
- Enable capsule update for Antminer S9
- DT updates

xilinx_spi:
- Add new xfer callback and support runtime fifo depth discovery

12 months agoMerge tag 'u-boot-imx-next-20231214' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Thu, 14 Dec 2023 12:37:02 +0000 (07:37 -0500)]
Merge tag 'u-boot-imx-next-20231214' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

- Add TPM support for venice boards
- Add networking support for imx93-evk
- Enable TCP, IPv6, wget for DHCOM and Data Modul boards
- Enable fastboot support for Toradex boards
- Allow pico-imx7d to boot from SD
- Enable fastboot for beacon imx8m beacon boards, disabled
  SYS_CONSOLE_IS_IN_ENV
- Fix mxsboot to prevent NAND blocks being reported as bad
- Add imx8mm PWM clock support
- Several devicetree syncs with the kernel
- Add support for i.MX8MP Polyhex Debix Model A SBC
- Reworked ddr_load_train_firmware() to get a 50ms boot time improvement

12 months agoarm64: imx8mp: Enable TCP, IPv6, wget on Data Modul i.MX8M eDM SBC
Marek Vasut [Wed, 22 Nov 2023 23:37:38 +0000 (00:37 +0100)]
arm64: imx8mp: Enable TCP, IPv6, wget on Data Modul i.MX8M eDM SBC

Enable support for TCP protocol, wget, and IPv6 on this platform.
The former two allow users download payload into the U-Boot from
a web server, which may be more convenient or easier to set up
than TFTP server. The later is enabled to future proof the IP
stack on this platform.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoarm64: imx8mp: Enable TCP, IPv6, wget on DH i.MX8MP DHCOM
Marek Vasut [Sat, 4 Nov 2023 16:32:21 +0000 (17:32 +0100)]
arm64: imx8mp: Enable TCP, IPv6, wget on DH i.MX8MP DHCOM

Enable support for TCP protocol, wget, and IPv6 on this platform.
The former two allow users download payload into the U-Boot from
a web server, which may be more convenient or easier to set up
than TFTP server. The later is enabled to future proof the IP
stack on this platform.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoarm: imx6: Enable TCP, IPv6, wget on DH i.MX6 DHCOM
Marek Vasut [Sat, 4 Nov 2023 16:32:20 +0000 (17:32 +0100)]
arm: imx6: Enable TCP, IPv6, wget on DH i.MX6 DHCOM

Enable support for TCP protocol, wget, and IPv6 on this platform.
The former two allow users download payload into the U-Boot from
a web server, which may be more convenient or easier to set up
than TFTP server. The later is enabled to future proof the IP
stack on this platform.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
12 months agoMerge tag 'dm-next-13dec23' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm...
Tom Rini [Wed, 13 Dec 2023 21:02:38 +0000 (16:02 -0500)]
Merge tag 'dm-next-13dec23' of https://gitlab.denx.de/u-boot/custodians/u-boot-dm into next

minor improvements to test, acpi
updates for new PyPl release

12 months agotest: vboot: Using variable 'old_dtb' before assignment
Heinrich Schuchardt [Mon, 11 Dec 2023 18:07:33 +0000 (19:07 +0100)]
test: vboot: Using variable 'old_dtb' before assignment

old_dtb can only be assumed initialized in the finally block
if it is assigned a value before the try statement.

Avoid a pylint error reported by current pylint.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agotest: fit: Using variable 'old_dtb' before assignment
Heinrich Schuchardt [Mon, 11 Dec 2023 18:07:32 +0000 (19:07 +0100)]
test: fit: Using variable 'old_dtb' before assignment

old_dtb can only be assumed initialized in the finally block
if it is assigned a value before the try statement.

Avoid a pylint error reported by current pylint.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agobinman: elf: Using variable 'old_val' before assignment
Heinrich Schuchardt [Sat, 9 Dec 2023 18:50:31 +0000 (19:50 +0100)]
binman: elf: Using variable 'old_val' before assignment

old_val can only be assumed initialized in the finally block
if it is assigned a value before the try statement.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agocmd: check argc for acpi dump
Heinrich Schuchardt [Sat, 9 Dec 2023 17:05:36 +0000 (18:05 +0100)]
cmd: check argc for acpi dump

'acpi dump' without parameter results in a NULL dereference. Check the
number of arguments.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agobootstd: Fix a memory leak in the efi manager bootflow
Ilias Apalodimas [Thu, 7 Dec 2023 12:36:36 +0000 (14:36 +0200)]
bootstd: Fix a memory leak in the efi manager bootflow

efi_get_var() allocates memory which has to be freed after the value of
the variable is consumed. Free the memory properly

Fixes: f2bfa0cb1794 ("bootstd: Make efi_mgr bootmeth work for non-sandbox setups")
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
12 months agodoc: board: ti: k3: Mention TI_DM argument
Neha Malcom Francis [Tue, 5 Dec 2023 09:42:20 +0000 (15:12 +0530)]
doc: board: ti: k3: Mention TI_DM argument

Mention TI_DM argument can be used to fetch a custom DM binary in the
A72 build instructions for K3 devices.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
12 months agoarm: dts: k3-*-binman: Move to using ti-dm entry type
Neha Malcom Francis [Tue, 5 Dec 2023 09:42:19 +0000 (15:12 +0530)]
arm: dts: k3-*-binman: Move to using ti-dm entry type

Move the DM entry in tispl.bin FIT image from default fetching an
external blob entry to fetching using ti-dm entry type. This way, the
DM entry will be populated by the TI_DM pathname if provided. Else it
will resort to the ti-dm.bin file.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agobinman: etype: dm: Add entry type for TI DM
Neha Malcom Francis [Tue, 5 Dec 2023 09:42:18 +0000 (15:12 +0530)]
binman: etype: dm: Add entry type for TI DM

K3 devices introduces the concept of centralized power, resource and
security management to System Firmware. This is to overcome challenges
by the traditional approach that implements system control functions on
each of the processing units.

The software interface for System Firmware is split into TIFS and DM. DM
(Device Manager) is responsible for resource and power management from
secure and non-secure hosts. This additional binary is necessary for
specific platforms' ROM boot images and is to be packaged into tispl.bin

Add an entry for DM. The entry can be used for the packaging of
tispl.bin by binman along with ATF and TEE.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Andrew Davis <afd@ti.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agobinman: doc: fix typo
Dario Binacchi [Thu, 23 Nov 2023 13:10:00 +0000 (14:10 +0100)]
binman: doc: fix typo

s/use set/set/

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-By: Michael Trimarchi <michael@amarulasolutions.com>
12 months agocmd: acpi: fix acpi list command
Heinrich Schuchardt [Tue, 21 Nov 2023 14:41:28 +0000 (15:41 +0100)]
cmd: acpi: fix acpi list command

ACPI tables may comprise either RSDT, XSDT, or both. The current code fails
to check the presence of the RSDT table before accessing it. This leads to
an exception if the RSDT table is not provided.

The XSDT table takes precedence over the RSDT table.

The return values of list_rsdt() and list_rsdp() are always zero and not
checked. Remove the return values.

Addresses in the XSDT table are 64-bit. Adjust the output accordingly.

As the RSDT table has to be ignored if the XSDT command is present there is
no need to compare the tables in a display command. Anyway the
specification does not require that the sequence of addresses in the RSDT
and XSDT table are the same.

The FACS table header does not provide revision information. Correct the
description of dump_hdr().

Adjust the ACPI test to match the changed output format of the 'acpi list'
command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agoacpi: fix struct acpi_xsdt
Heinrich Schuchardt [Tue, 21 Nov 2023 14:41:27 +0000 (15:41 +0100)]
acpi: fix struct acpi_xsdt

The size of the ACPI table header is not a multiple of 8. We have to mark
struct acpi_xsdt as packed to correctly access field Entry.

Add a unit test for the offsets of field Entry in the RSDT and XSDT tables.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agotools: Move python tools to version 0.0.6
Simon Glass [Sun, 19 Nov 2023 15:36:06 +0000 (08:36 -0700)]
tools: Move python tools to version 0.0.6

A new release has been done with this version, so update it. Use the
version numbers in dependencies also.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agopatman: Update the run script
Simon Glass [Sun, 19 Nov 2023 15:36:05 +0000 (08:36 -0700)]
patman: Update the run script

Patman now has its main program in a function, so update the toml file
to match.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotools/make_pip: Add mention of u_boot_pylib in tool list
Simon Glass [Sun, 19 Nov 2023 15:36:04 +0000 (08:36 -0700)]
tools/make_pip: Add mention of u_boot_pylib in tool list

This is not a tool but it is handled by the script, so update the help
to include it.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agou_boot_pylib: Correct files used for pip release
Simon Glass [Sun, 19 Nov 2023 15:36:03 +0000 (08:36 -0700)]
u_boot_pylib: Correct files used for pip release

The files list is incorrect and dates from a time when the script was
run from a different directory. Update it to match all the other tools.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotools: Keep test_util and patman test files in the pip release
Simon Glass [Sun, 19 Nov 2023 15:36:02 +0000 (08:36 -0700)]
tools: Keep test_util and patman test files in the pip release

The test_util module is actually imported by some tools, e.g. binman so
include it in the pip release.

The patman tool uses its test code when starting up, so keep that too.

Show a list of deleted files so it is clear what is happening.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agou_boot_pylib: Correct readme formatting
Simon Glass [Sun, 19 Nov 2023 15:36:01 +0000 (08:36 -0700)]
u_boot_pylib: Correct readme formatting

Correct a heading which is too short in the readme.

Fixes: 75554dfac29 ("patman: Add support for building a u_boot_tools...")
Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agodoc: Update documentation URL
Simon Glass [Sun, 19 Nov 2023 15:36:00 +0000 (08:36 -0700)]
doc: Update documentation URL

Update to use the new docs.u-boot.org URL for documentation.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: unit test for acpi_find_table()
Heinrich Schuchardt [Sat, 18 Nov 2023 21:57:27 +0000 (22:57 +0100)]
test: unit test for acpi_find_table()

Provide a unit test for acpi_find_table()

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agoacpi: consider XSDT in acpi_find_table()
Heinrich Schuchardt [Sat, 18 Nov 2023 21:57:26 +0000 (22:57 +0100)]
acpi: consider XSDT in acpi_find_table()

The RSDT table is deprecated and does not exist on all systems.

By preference scan XSDT for the table to find. If no XSDT table exists, try
to use the RSDT table.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
12 months agoacpi: simplify acpi_write_ssdt()
Heinrich Schuchardt [Sat, 18 Nov 2023 21:52:37 +0000 (22:52 +0100)]
acpi: simplify acpi_write_ssdt()

* Converting to void * is superfluous when calling memset().
* acpi_fill_header() already fills oem_table_id.

Fixes: d953137526cc ("x86: Move SSDT table to a writer function")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agoacpi: cannot have RSDT above 4 GiB
Heinrich Schuchardt [Sun, 12 Nov 2023 23:53:56 +0000 (00:53 +0100)]
acpi: cannot have RSDT above 4 GiB

The field RsdtAddress has only 32 bit. The RSDT table cannot be located
beyond 4 GiB.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agofdt: Move ft_verify_fdt() before the final fixups
Simon Glass [Sun, 12 Nov 2023 15:27:50 +0000 (08:27 -0700)]
fdt: Move ft_verify_fdt() before the final fixups

Move this check before the FDT fixups so that we can use a livetree
after this point.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agofdt: Drop the confusing casts in lmb_free()
Simon Glass [Sun, 12 Nov 2023 15:27:49 +0000 (08:27 -0700)]
fdt: Drop the confusing casts in lmb_free()

Just use map_to_sysmem() instead of all the casting.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agoboot: Move adding initrd earlier in image_setup_libfdt()
Simon Glass [Sun, 12 Nov 2023 15:27:48 +0000 (08:27 -0700)]
boot: Move adding initrd earlier in image_setup_libfdt()

This may as well happen before the general event is emitted, so move it.
This will allow us to use the livetree for the event part, but the
flattree for the earlier part.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agofdt: ppc: Drop extra size for ramdisk
Simon Glass [Sun, 12 Nov 2023 15:27:47 +0000 (08:27 -0700)]
fdt: ppc: Drop extra size for ramdisk

This code dates from around 2008:

   56844a22b76 powerpc: Fix bootm to boot up again with a Ramdisk

Since then we have added FDT relocation which provides enough space
for expansion. We have also added all sorts of fixups earlier in
image_setup_libfdt() which require more space, with ramdisk being the
least of them.

Therefore this extra hack for ramdisk seems unnecessary. Drop it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agofdt: Improve the comment for fdt_shrink_to_minimum()
Simon Glass [Sun, 12 Nov 2023 15:27:46 +0000 (08:27 -0700)]
fdt: Improve the comment for fdt_shrink_to_minimum()

Add a bit more detail about what this function does.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agofdt: Check for a valid fdt in oftree_ensure()
Simon Glass [Sun, 12 Nov 2023 15:27:45 +0000 (08:27 -0700)]
fdt: Check for a valid fdt in oftree_ensure()

Check the header before starting to use it, since this could provide
very confusing later, when ofnode calls start to fail.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agoboot: Drop size parameter from image_setup_libfdt()
Simon Glass [Sun, 12 Nov 2023 15:27:44 +0000 (08:27 -0700)]
boot: Drop size parameter from image_setup_libfdt()

The of_size parameter is not used, so remove it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
12 months agoacpi: move acpi_get_rsdp_addr() to acpi/acpi_table.h
Heinrich Schuchardt [Thu, 9 Nov 2023 17:23:02 +0000 (09:23 -0800)]
acpi: move acpi_get_rsdp_addr() to acpi/acpi_table.h

Function acpi_get_rsdp_addr() is needed on all architectures which
write ACPI tables. Move the definition from the x86 include to an
architecture independent one.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
12 months agobootstd: Add a menu option to bootflow scan
Simon Glass [Mon, 2 Oct 2023 01:15:25 +0000 (19:15 -0600)]
bootstd: Add a menu option to bootflow scan

Allow showing a menu and automatically booting, with 'bootflow scan'.
This is more convenient than using a script.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agosandbox: Add a dummy booti command
Simon Glass [Mon, 2 Oct 2023 01:15:24 +0000 (19:15 -0600)]
sandbox: Add a dummy booti command

Add basic sandbox support for 'booti' so we can start to boot the test
ARMbian image. This is helpful in checking that it is parsed correctly.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agovideo: Add a function to clear the display
Simon Glass [Mon, 2 Oct 2023 01:15:23 +0000 (19:15 -0600)]
video: Add a function to clear the display

Move the code from the 'cls' command into the console file, so it can
be called from elsewhere.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: print: Skip test on x86
Simon Glass [Mon, 2 Oct 2023 01:15:22 +0000 (19:15 -0600)]
test: print: Skip test on x86

These tests cannot work on x86 machines as memory at address zero is
not writable. Add a condition to skip these.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: lmb: Move tests into the lib suite
Simon Glass [Mon, 2 Oct 2023 01:15:21 +0000 (19:15 -0600)]
test: lmb: Move tests into the lib suite

These tests are marked as driver model tests, but have nothing to do
with driver model. As a result, they are run as part of 'ut dm' which
only exists for sandbox.

Move them to the 'lib' suite and drop the requirement for initing
devices, since they don't use devices.

Also put the lib_test_lmb_max_regions() macro inside the same #ifdef
as its function, to avoid a build error if the condition is false.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: event: Only run test_event_probe() on sandbox
Simon Glass [Mon, 2 Oct 2023 01:15:20 +0000 (19:15 -0600)]
test: event: Only run test_event_probe() on sandbox

This needs test devices which are only present on sandbox. Add a check
for this and skip just this test if running on a real board.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: font: Add dependencies on fonts
Simon Glass [Mon, 2 Oct 2023 01:15:19 +0000 (19:15 -0600)]
test: font: Add dependencies on fonts

The font test needs two fonts. If one is not available, skip out early,
to avoid an error.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: fdt: Add a special case for real boards
Simon Glass [Mon, 2 Oct 2023 01:15:18 +0000 (19:15 -0600)]
test: fdt: Add a special case for real boards

The error that this test checks for is only shown on sandbox. For real
boards, there is normally no error. Add a special case to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: bdinfo: Add missing asserts
Simon Glass [Mon, 2 Oct 2023 01:15:17 +0000 (19:15 -0600)]
test: bdinfo: Add missing asserts

Calling into sub-test functions should be done using ut_assertok() so
that the test exits immediately on failure. Add those which are
missing.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: Handle use of stack pointer in bdinfo
Simon Glass [Mon, 2 Oct 2023 01:15:16 +0000 (19:15 -0600)]
test: Handle use of stack pointer in bdinfo

This test assumes that the stack pointer is the same across two calls
to lmb_init_and_reserve() but this is not the case on x86, for example.

Add a special case to handle this, along with a detailed comment.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: Run bootstd tests only on sandbox
Simon Glass [Mon, 2 Oct 2023 01:15:15 +0000 (19:15 -0600)]
test: Run bootstd tests only on sandbox

These make use of disk images which are not available on reak boards.
Add a new Kconfig to ensure these tests only run where they are valid.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: Make UT_LIB_ASN1 depend on sandbox
Simon Glass [Mon, 2 Oct 2023 01:15:14 +0000 (19:15 -0600)]
test: Make UT_LIB_ASN1 depend on sandbox

This doesn't seem to work on a real board, so use the test on sandbox
only.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: Add helper to skip to partial console line
Simon Glass [Mon, 2 Oct 2023 01:15:13 +0000 (19:15 -0600)]
test: Add helper to skip to partial console line

Sometimes we need to skip to a line but it includes addresses or other
information which can vary depending on the runtime conditions.

Add a new ut_assert_skip_to_linen() which is similar to the existing
ut_assert_skip_to_line() function but only checks that the console line
matches up to the length of the provided string.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agotest: Add a new suite for commands
Simon Glass [Mon, 2 Oct 2023 01:15:12 +0000 (19:15 -0600)]
test: Add a new suite for commands

Add a new suite for 'cmd' tests, used for testing commands. These are
kept in the test/cmd directory.

For now it is empty, but it will be used for coreboot-command tests.

Signed-off-by: Simon Glass <sjg@chromium.org>
12 months agopico-imx7d: add baseboard SD card boot detect
Benjamin Szőke [Wed, 13 Dec 2023 18:51:49 +0000 (15:51 -0300)]
pico-imx7d: add baseboard SD card boot detect

Technexion PICO-IMX7 SoM is supporting USDHC3 (eMMC or micro SD on SoM)
and USDHC1 (SD on carrier board) to use on any carrier board like
PICO-NYMPH. Based on the U-Boot version from Technexion it adds
baseboard SD card boot detect to able to boot from selected USDHC1
or USDHC3 boot devices.

Signed-off-by: Benjamin Szőke <egyszeregy@freemail.hu>
Tested-by: Fabio Estevam <festevam@gmail.com>