]> git.ipfire.org Git - thirdparty/u-boot.git/log
thirdparty/u-boot.git
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years agotest: dm: clk_ccf: test ccf_clk_ops
Yang Xiwen [Fri, 15 Dec 2023 18:28:52 +0000 (02:28 +0800)] 
test: dm: clk_ccf: test ccf_clk_ops

Assign ccf_clk_ops to .ops of clk_ccf driver so that it can act as an
clk provider. Also add "#clock-cells=<1>" to its device tree node.

Add "i2c_root" to clk_test in the device tree and driver for testing.

Get "i2c_root" clock in CCF unit tests and add tests for it.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231111-enable_count-v3-2-08a821892fa9@outlook.com
2 years 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

2 years agoclk: nuvoton: add read only feature for clk driver
Jim Liu [Tue, 14 Nov 2023 09:00:04 +0000 (17:00 +0800)] 
clk: nuvoton: add read only feature for clk driver

Add a flag to set ahb/apb/fiu/spi clock divider as read-only
The spi clock setting is related to booting flash, it is setup by early
bootloader.
It just protects the clock source and can't modify it in uboot.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231114090004.3746024-1-JJLIU0@nuvoton.com
2 years agocmd: clk: Make soc_clk_dump static
Igor Prusov [Thu, 9 Nov 2023 10:55:16 +0000 (13:55 +0300)] 
cmd: clk: Make soc_clk_dump static

After introducing dump to clk_ops there is no need to override or expose
this symbol anymore.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-9-ivprusov@sberdevices.ru
2 years agoclk: treewide: switch to clock dump from clk_ops
Igor Prusov [Thu, 9 Nov 2023 10:55:15 +0000 (13:55 +0300)] 
clk: treewide: switch to clock dump from clk_ops

Switch to using new dump operation in clock provider drivers instead of
overriding soc_clk_dump.

Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-8-ivprusov@sberdevices.ru
2 years agocmd: clk: Use dump function from clk_ops
Igor Prusov [Thu, 9 Nov 2023 10:55:14 +0000 (13:55 +0300)] 
cmd: clk: Use dump function from clk_ops

Add another loop to dump additional info from clock providers that
implement dump operation.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-7-ivprusov@sberdevices.ru
2 years agoclk: Add dump operation to clk_ops
Igor Prusov [Thu, 9 Nov 2023 10:55:13 +0000 (13:55 +0300)] 
clk: Add dump operation to clk_ops

This adds dump function to struct clk_ops which should replace
soc_clk_dump. It allows clock drivers to provide custom dump
implementation without overriding generic CCF dump function.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
[ Fixed parameter name in documentation ]
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231109105516.24892-6-ivprusov@sberdevices.ru
2 years agoclk: amlogic: Move driver and ops structs
Igor Prusov [Thu, 9 Nov 2023 10:55:12 +0000 (13:55 +0300)] 
clk: amlogic: Move driver and ops structs

Move driver and ops structs to avoid forward declaration after switching
to dump in clk_ops.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-5-ivprusov@sberdevices.ru
2 years agoclk: k210: Move soc_clk_dump function
Igor Prusov [Thu, 9 Nov 2023 10:55:11 +0000 (13:55 +0300)] 
clk: k210: Move soc_clk_dump function

Move clock dump function to avoid forward declaration after switching to
dump in clk_ops.

Reviewed-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-4-ivprusov@sberdevices.ru
2 years agoclk: ast2600: Move soc_clk_dump function
Igor Prusov [Thu, 9 Nov 2023 10:55:10 +0000 (13:55 +0300)] 
clk: ast2600: Move soc_clk_dump function

Move clock dump function to avoid forward declaration after switching to
dump in clk_ops.

Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-3-ivprusov@sberdevices.ru
2 years agoclk: zynq: Move soc_clk_dump to Zynq clock driver
Igor Prusov [Thu, 9 Nov 2023 10:55:09 +0000 (13:55 +0300)] 
clk: zynq: Move soc_clk_dump to Zynq clock driver

Move clock dump function in preparation for switching to dump function
in clk_ops.

Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Igor Prusov <ivprusov@sberdevices.ru>
Link: https://lore.kernel.org/r/20231109105516.24892-2-ivprusov@sberdevices.ru
2 years agodm: test: clk: Add test for ccf clk_set_rate()
Igor Prusov [Tue, 5 Dec 2023 23:23:34 +0000 (02:23 +0300)] 
dm: test: clk: Add test for ccf clk_set_rate()

Add a simple test case which sets clock rate to its current value.

Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231205232334.2931-3-ivprusov@salutedevices.com
2 years agoclk: Check that composite clock's div has set_rate()
Igor Prusov [Tue, 5 Dec 2023 23:23:33 +0000 (02:23 +0300)] 
clk: Check that composite clock's div has set_rate()

It's possible for composite clocks to have a divider that does not
implement set_rate() operation. For example, sandbox_clk_composite()
registers composite clock with a divider that only has get_rate().
Currently clk_composite_set_rate() only checks thate rate_ops are
present, so for sandbox it will cause NULL dereference during
clk_set_rate().

This patch adds rate_ops->set_rate check tp clk_composite_set_rate().

Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231205232334.2931-2-ivprusov@salutedevices.com
2 years agoclk: get correct ops for clk_enable() and clk_disable()
Yang Xiwen [Sat, 18 Nov 2023 22:10:06 +0000 (06:10 +0800)] 
clk: get correct ops for clk_enable() and clk_disable()

assign clk_dev_ops(clkp->dev) to ops to ensure correct clk operations
are called on clocks.

This fixes the incorrect enable_count issue as described in [1].

[1]: https://lore.kernel.org/all/SEZPR06MB695927A6DEEEF8489A06897396A7A@SEZPR06MB6959.apcprd06.prod.outlook.com/

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20231111-enable_count-v2-2-20e3728600b5@outlook.com
2 years agoclk: check parent_name in clk_register to avoid confusing log_error() output
Yang Xiwen [Fri, 10 Nov 2023 19:19:52 +0000 (03:19 +0800)] 
clk: check parent_name in clk_register to avoid confusing log_error() output

For some gate clocks and fixed clocks without a parent, calling
clk_register will print an useless error message indicating that parent
is missing. Fix that by gaurding log_xxx() with an if-statement.

Signed-off-by: Yang Xiwen <forbidden405@outlook.com>
Suggested-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Link: https://lore.kernel.org/r/20230807-clk-fix-v2-1-0b688e21fb4e@outlook.com
2 years 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.

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years agoMerge tag 'u-boot-imx-20231214' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Tom Rini [Fri, 15 Dec 2023 13:22:20 +0000 (08:22 -0500)] 
Merge tag 'u-boot-imx-20231214' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

- Fix for i.MX8M Plus eDM SBC DDR timings with inline ECC
- Switch to FPWM mode on Data Modul i.MX8M Plus eDM SBC so that DRAM
  EDAC detects more correctable errors
- Fix for imx8mp-venice board DDR initialization

2 years agoimx8mp-venice: update DRAM config for 2000MHz
Tim Harvey [Thu, 14 Dec 2023 16:22:27 +0000 (08:22 -0800)] 
imx8mp-venice: update DRAM config for 2000MHz

The imx8mp venice boards can support 2000Mhz DRAM.
Update the DRAM config to support this.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoimx8mp-venice: fix DRAM bus configuration
Tim Harvey [Thu, 14 Dec 2023 16:22:26 +0000 (08:22 -0800)] 
imx8mp-venice: fix DRAM bus configuration

The DRAM configuration for the 1GB and 4GB imx8mp venice boards had a
bus mapping issue (channel A and B swapped) which creates an invalid
deskewing configuration during training causing the DRAM to not be able
to run at its full bus speed.

Update the various config structures to resolve this.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoboard: gateworks: venice: remove extra file
Tim Harvey [Thu, 14 Dec 2023 16:22:25 +0000 (08:22 -0800)] 
board: gateworks: venice: remove extra file

Remove lpddr4_timing_imx8mm_512mb.c mistakenly committed

Fixes: a1c711046b0d "(board: gateworks: venice: add imx8mm-gw7903 support)"
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
2 years agoARM: imx: Update DRAM timings with inline ECC on Data Modul i.MX8M Plus eDM SBC
Marek Vasut [Thu, 7 Dec 2023 17:50:32 +0000 (18:50 +0100)] 
ARM: imx: Update DRAM timings with inline ECC on Data Modul i.MX8M Plus eDM SBC

Import DRAM timings generated by the DDR tool 3.31 which introduce assorted
tweaks to the DRAM controller settings. Furthermore, enable DBI to improve
noise resilience of the DRAM bus by reducing the number of bit changes on
the bus.

Reduce the DRAM rate to 3600 MTps to remove all remaining correctable errors
reported by EDAC . It is not entirely clear why the slightly faster setting
does produce sporadic correctable errors, while this one does not, but this
could be related to simpler PLL setting at 3600 MTps.

Enable inline ECC which is necessary to detect ECC errors and collect
statistics by the EDAC driver in Linux. This reduces the DRAM size by
64 MiB for each 512 MiB of DRAM, so for a 4 GiB device the available
DRAM size becomes 3.5 GiB .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoARM: imx: Force DRAM regulators into FPWM mode on Data Modul i.MX8M Plus eDM SBC
Marek Vasut [Thu, 7 Dec 2023 17:50:31 +0000 (18:50 +0100)] 
ARM: imx: Force DRAM regulators into FPWM mode on Data Modul i.MX8M Plus eDM SBC

In case the Buck5 and Buck6 regulators which supply DRAM Vdd1 and Vdd2/Vddq
respectively operate in automatic PWM/PFM mode, the DRAM EDAC detects more
correctable errors than if the regulators operate in forced PWM only mode.
Force DRAM regulators to forced PWM mode only to stop tempting the DRAM.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoARM: imx: Enable CAAM on DH i.MX8M Plus DHCOM
Marek Vasut [Sat, 2 Dec 2023 01:58:28 +0000 (02:58 +0100)] 
ARM: imx: Enable CAAM on DH i.MX8M Plus DHCOM

Enable CAAM in U-Boot to make crypto available early in the boot process.

This has a side-effect that in case an older kernel version contains a
broken CAAM initialization timeout code, initialization in bootloader
will help that old kernel version function correctly.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoARM: imx: Enable CAAM on Data Modul i.MX8M Mini/Plus eDM SBC
Marek Vasut [Sat, 2 Dec 2023 01:55:06 +0000 (02:55 +0100)] 
ARM: imx: Enable CAAM on Data Modul i.MX8M Mini/Plus eDM SBC

Enable CAAM in U-Boot to make crypto available early in the boot process.

This has a side-effect that in case an older kernel version contains a
broken CAAM initialization timeout code, initialization in bootloader
will help that old kernel version function correctly.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoddr: imx: Add 3600 MTps rate support
Marek Vasut [Sat, 2 Dec 2023 01:48:40 +0000 (02:48 +0100)] 
ddr: imx: Add 3600 MTps rate support

Add PLL settings for DDR 3600 MTps . This is very similar to 3200 MTps
PLL setting, except the divider is not 9 but 8 .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoddr: imx: Handle 3734 in addition to 3733 and 3732 MTps rates
Marek Vasut [Sat, 2 Dec 2023 01:48:00 +0000 (02:48 +0100)] 
ddr: imx: Handle 3734 in addition to 3733 and 3732 MTps rates

The new MX8M DDR tool 3.31 now generates a programming file which uses
data rate 3734 instead of 3733 or 3732 . Handle another rounding option .

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years agoarm64: imx8mp: Inhibit DTC warning on DH i.MX8MP DHCOM rev.100 DTO
Marek Vasut [Sun, 5 Nov 2023 00:04:32 +0000 (01:04 +0100)] 
arm64: imx8mp: Inhibit DTC warning on DH i.MX8MP DHCOM rev.100 DTO

Inhibit DTC warning in imx8mp-dhcom-pdk3-overlay-rev100.dts:
"
arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dtbo: Warning (reg_format): /fragment@0/__overlay__:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dtbo: Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default #address-cells value
arch/arm/dts/imx8mp-dhcom-pdk3-overlay-rev100.dtbo: Warning (avoid_default_addr_size): /fragment@0/__overlay__: Relying on default #size-cells value
"

The DTO overwrites the 'reg' property of an ethernet PHY and is only
used on specific combination of old prototype SoM and old prototype
PDK3 carrier board, which had incorrectly placed pull resistor, which
made the PHY change its MDIO address in that specific combination and
which is already fixed on production hardware.

The DTO is implemented in this simple manner because if it contained a
full MDIO bus node reference to define #address-cells and #size-cells,
it would also require a full new copy of the PHY node, i.e.
ethernet-phy@5 { ... reg = <5>; ... }, to avoid DTC warnings about
mismatch between node unit and reg value. The node unit in SoM DT is
ethernet-phy@7 { ... }; .

This simpler approach avoids unnecessary duplication without adverse
side effects.

Reported-by: Fabio Estevam <festevam@denx.de>
Reported-by: Sean Anderson <seanga2@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Tested-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
2 years 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

2 years agospi: cadence-quadspi: Fix error message on stuck busy state
Jan Kiszka [Mon, 30 Oct 2023 16:20:29 +0000 (17:20 +0100)] 
spi: cadence-quadspi: Fix error message on stuck busy state

We are not iterating CQSPI_REG_RETRY, we are waiting 'timeout' ms, since
day 1.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Stefan Roese <sr@denx.de>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agomtd: spi-nor-ids: add support for xtx XT55Q02G
Bruce Suen [Wed, 18 Oct 2023 03:38:02 +0000 (23:38 -0400)] 
mtd: spi-nor-ids: add support for xtx XT55Q02G

Add support for XTX XT55Q02G(1.8V,2Gbit).

Signed-off-by: Bruce Suen <bruce_suen@163.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agomtd: spinand: add support for ESMT F50x1G41LB
Igor Prusov [Tue, 17 Oct 2023 19:29:26 +0000 (22:29 +0300)] 
mtd: spinand: add support for ESMT F50x1G41LB

Adaptation of Linux commit d74c36480a67

This patch adds support for ESMT F50L1G41LB and F50D1G41LB.
It seems that ESMT likes to use random JEDEC ID from other vendors.
Their 1G chips uses 0xc8 from GigaDevice and 2G/4G chips uses 0x2c from
Micron. For this reason, the ESMT entry is named esmt_c8 with explicit
JEDEC ID in variable name.

Datasheets:
https://www.esmt.com.tw/upload/pdf/ESMT/datasheets/F50L1G41LB(2M).pdf
https://www.esmt.com.tw/upload/pdf/ESMT/datasheets/F50D1G41LB(2M).pdf

Signed-off-by: Igor Prusov <ivprusov@salutedevices.com>
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
Signed-off-by: Martin Kurbanov <mmkurbanov@sberdevices.ru>
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Tested-by: Martin Kurbanov <mmkurbanov@sberdevices.ru>
Reviewed-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years agomtd: spi-nor-core: Implement spi_nor_read_sfdp_dma_unsafe() for sfdp parse
Vaishnav Achath [Fri, 3 Jun 2022 07:01:32 +0000 (12:31 +0530)] 
mtd: spi-nor-core: Implement spi_nor_read_sfdp_dma_unsafe() for sfdp parse

During SFDP header parse and BFPT parse, structures in stack are used
to perform spi_nor_read_sfdp() which expects a dma-safe buffer.

This commit introduces spi_nor_read_sfdp_dma_unsafe() to wrap
spi_nor_read_sfdp() using a kmalloc'ed bounce buffer which is
the same implementation in Linux (drivers/mtd/spi-nor/sfdp.c).

Signed-off-by: Vaishnav Achath <vaishnav.a@ti.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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

2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>
2 years 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>