platform/kernel/u-boot.git
15 months agoARM: renesas: Add R8A779G0 V4H White Hawk board code
Hai Pham [Tue, 28 Feb 2023 21:37:08 +0000 (22:37 +0100)]
ARM: renesas: Add R8A779G0 V4H White Hawk board code

Add board code for R8A779G0 V4H White Hawk board.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Synchronize configuration symbols which are now switched to Kconfig
        Mallocate gd->bd->bi_boot_params, i.e. drop the assignment
        Sort headers, use clrbits_le32(), use BIT macros where appropriate
        Use CONFIG_SYS_CLK_FREQ for counter frequency instead of custom macro]

15 months agoARM: renesas: Add R8A779G0 V4H Kconfig entry and PRR ID
Hai Pham [Tue, 28 Feb 2023 21:37:07 +0000 (22:37 +0100)]
ARM: renesas: Add R8A779G0 V4H Kconfig entry and PRR ID

Add Kconfig entry and PRR ID to support R8A779G0 V4H SoC.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update commit message]

15 months agoARM: dts: renesas: Add R8A779G0 V4H White Hawk DTs
Tho Vu [Tue, 28 Feb 2023 21:37:06 +0000 (22:37 +0100)]
ARM: dts: renesas: Add R8A779G0 V4H White Hawk DTs

Add DTs for R8A779G0 V4H White Hawk CPU and BreakOut boards.

Based on Linux next 20230228 DTs up to
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Tho Vu <tho.vu.wh@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Sync with Linux next 20230228, update commit message
        Rename DTs to match Linux, which has dash between white-hawk]

15 months agoARM: dts: renesas: Add R8A779G0 V4H DT extras
Hai Pham [Tue, 28 Feb 2023 21:37:05 +0000 (22:37 +0100)]
ARM: dts: renesas: Add R8A779G0 V4H DT extras

Add R8A779G0 V4H DT extras for U-Boot.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update compatible string to match latest upstream]

15 months agoARM: dts: renesas: Add R8A779G0 V4H DT
Phong Hoang [Tue, 28 Feb 2023 21:37:04 +0000 (22:37 +0100)]
ARM: dts: renesas: Add R8A779G0 V4H DT

Add initial DT support for R8A779G0 (R-Car V4H). Based on Linux next
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Phong Hoang <phong.hoang.wz@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Sync with Linux next 20230228, update commit message]

15 months agopinctrl: renesas: Add R8A779G0 V4H PFC tables
Hai Pham [Tue, 28 Feb 2023 21:37:03 +0000 (22:37 +0100)]
pinctrl: renesas: Add R8A779G0 V4H PFC tables

Add pinctrl tables for R8A779G0 V4H SoC.

Based on Linux next 20230228 PFC tables tables up to
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: LUU HOAI <hoai.luu.ub@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Phong Hoang <phong.hoang.wz@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Sync with Linux next 20230228, sort sh_pfc_pinconf_set voltage args]

15 months agoclk: renesas: Add R8A779G0 V4H clock tables
Hai Pham [Tue, 28 Feb 2023 21:37:02 +0000 (22:37 +0100)]
clk: renesas: Add R8A779G0 V4H clock tables

Add clock tables for R8A779G0 V4H SoC from Linux next
commit 058f4df42121 ("Add linux-next specific files for 20230228")

There is an adjustment to the clock tables to make them easier suitable
for U-Boot, PLL2 is not treated as GEN4 PLL type PLL2_VAR, but rather a
plain PLL2. This should be sufficient until PLL2_VAR is implemented in
the clock core.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Sync with Linux next 20230228 . Update from CLK to CPG core driver
        Treat PLL2 as non-PLL2_VAR for now]

15 months agodt-bindings: clock: Add R8A779G0 V4H CPG Core Clock Definitions
Tho Vu [Tue, 28 Feb 2023 21:37:01 +0000 (22:37 +0100)]
dt-bindings: clock: Add R8A779G0 V4H CPG Core Clock Definitions

Add all Clock Pulse Generator Core Clock Outputs for the
Renesas R-Car V4H (R8A779G0) SoC from Linux next
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Tho Vu <tho.vu.wh@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update to linux next 20230228 state]

15 months agodt-bindings: power: Add R8A779G0 V4H SYSC power domain definitions
Tho Vu [Tue, 28 Feb 2023 21:37:00 +0000 (22:37 +0100)]
dt-bindings: power: Add R8A779G0 V4H SYSC power domain definitions

Add power domain indices for R-Car V4H (R8A779G0) from Linux next
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Tho Vu <tho.vu.wh@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update to linux next 20230228 state]

15 months agoARM: renesas: Add R8A779F0 S4 Spider board code
Hai Pham [Tue, 28 Feb 2023 21:34:46 +0000 (22:34 +0100)]
ARM: renesas: Add R8A779F0 S4 Spider board code

Add board code for R8A779F0 S4 Spider board.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Synchronize configuration symbols which are now switched to Kconfig
        Mallocate gd->bd->bi_boot_params, i.e. drop the assignment
Sort headers, use clrbits_le32(), use BIT macros where appropriate
Use CONFIG_SYS_CLK_FREQ for counter frequency instead of custom macro]

15 months agoARM: renesas: Add R8A779F0 S4 Kconfig entry and PRR ID
Hai Pham [Tue, 28 Feb 2023 21:34:45 +0000 (22:34 +0100)]
ARM: renesas: Add R8A779F0 S4 Kconfig entry and PRR ID

Add Kconfig entry and PRR ID to support R8A779F0 S4 SoC.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update commit message]

15 months agoARM: dts: renesas: Add R8A779F0 S4 Spider DTs
Hai Pham [Tue, 28 Feb 2023 21:34:44 +0000 (22:34 +0100)]
ARM: dts: renesas: Add R8A779F0 S4 Spider DTs

Add DTs for R8A779F0 S4 Spider CPU boards and Breakout boards.

Based on Linux next 20230228 DTs up to
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Sync with Linux next 20230228, update commit message]

15 months agoARM: dts: renesas: Add R8A779F0 S4 DT extras
Hai Pham [Tue, 28 Feb 2023 21:34:43 +0000 (22:34 +0100)]
ARM: dts: renesas: Add R8A779F0 S4 DT extras

Add R8A779F0 S4 DT extras for U-Boot.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update compatible string to match latest upstream]

15 months agoARM: dts: renesas: Add R8A779F0 S4 DT
Hai Pham [Tue, 28 Feb 2023 21:34:42 +0000 (22:34 +0100)]
ARM: dts: renesas: Add R8A779F0 S4 DT

Add initial DT for R8A779F0 S4 SoC. Based on Linux next
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Sync with Linux next 20230228, update commit message]

15 months agoARM: rmobile: Turn R-Car V3U into R-Car Gen4
Hai Pham [Tue, 28 Feb 2023 21:34:41 +0000 (22:34 +0100)]
ARM: rmobile: Turn R-Car V3U into R-Car Gen4

Despite the name, R-Car V3U is the first member of the R-Car Gen4
family [1]. Hence reflect this in related files, select appropriate
configuration options and split DT build into its own GEN4 entry.

[1] https://www.renesas.com/us/en/products/automotive-products/automotive-system-chips-socs/r-car-v3u-best-class-r-car-v3u-asil-d-system-chip-automated-driving

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Deduplicate DTC_FLAGS addition using RCAR_64 symbol
        Update commit message]

15 months agopinctrl: renesas: Add R8A779F0 S4 PFC tables
LUU HOAI [Tue, 28 Feb 2023 21:34:40 +0000 (22:34 +0100)]
pinctrl: renesas: Add R8A779F0 S4 PFC tables

Add pinctrl tables for R8A779F0 S4 SoC.

Based on Linux next 20230228 PFC tables tables up to
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: LUU HOAI <hoai.luu.ub@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Use RCAR_64 Kconfig, sync with Linux next 20230228]

15 months agoclk: renesas: Add R8A779F0 S4 clock tables
Hai Pham [Tue, 28 Feb 2023 21:34:39 +0000 (22:34 +0100)]
clk: renesas: Add R8A779F0 S4 clock tables

Add clock tables for R8A779F0 S4 SoC

Based on Linux commit 24aaff6a6ce4 ("clk: renesas: cpg-mssr: Add support
for R-Car S4-8") by Yoshihiro Shimoda and sync the tables up to Linux next
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Sync with Linux next 20230228 . Update from CLK to CPG core driver]

15 months agoclk: renesas: Update R-Car Gen3 driver Gen4 support
Marek Vasut [Tue, 28 Feb 2023 21:34:38 +0000 (22:34 +0100)]
clk: renesas: Update R-Car Gen3 driver Gen4 support

Update R-Car Gen4 support in Gen3 clock driver. This patch renames the
V3U clock parts to Gen4 and extends them by new PLL2, PLL3, PLL4, PLL6
as well as SDSRC clock which use undocumented bits so far, and RPCSRC
clock which uses its own more capable divider table. The Gen4 module
standby and reset tables are also updated.

This patch makes use of union to alias Gen3 and more extensive Gen4
PLL tables, as the driver cannot ever be instantiated on hardware
that would identify itself as both Gen3 and Gen4.

The V3U clock driver is updated to match Gen4 clock driver behavior,
it is augmented with a more extensive PLL table and a valid MODEMR
register offset.

This supersedes "clk: renesas: Introduce R-Car Gen4 CPG driver"
from Hai Pham as the R-Car Gen3 and Gen4 clock core drivers are
extremely similar. That implementation was in turn based on Linux
commit 470e3f0d0b15 ("clk: renesas: rcar-gen4: Introduce R-Car Gen4 CPG driver")
by Yoshihiro Shimoda .

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agodt-bindings: clock: Add R8A779F0 S4 CPG Core Clock headers
Tho Vu [Tue, 28 Feb 2023 21:34:37 +0000 (22:34 +0100)]
dt-bindings: clock: Add R8A779F0 S4 CPG Core Clock headers

Add definitions for R8A779F0 S4 CPG Core Clock headers from Linux next
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Tho Vu <tho.vu.wh@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update to linux next 20230228 state]

15 months agodt-bindings: power: Add R8A779F0 S4 SYSC power domain definitions
Tho Vu [Tue, 28 Feb 2023 21:34:36 +0000 (22:34 +0100)]
dt-bindings: power: Add R8A779F0 S4 SYSC power domain definitions

Add power domain indices for R-Car S4 (R8A779F0) from Linux next
commit 058f4df42121 ("Add linux-next specific files for 20230228")

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Tho Vu <tho.vu.wh@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Update to linux next 20230228 state]

15 months agospi: renesas: Make driver available on R-Car Gen4
Marek Vasut [Tue, 28 Feb 2023 21:28:30 +0000 (22:28 +0100)]
spi: renesas: Make driver available on R-Car Gen4

Use CONFIG_RCAR_64 to make the driver available on both
R-Car Gen3 and R-Car Gen4.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
15 months agoserial: sh: Add HSCIF support for R-Car SoC
Hai Pham [Tue, 28 Feb 2023 21:29:19 +0000 (22:29 +0100)]
serial: sh: Add HSCIF support for R-Car SoC

Provide the basic HSCIF support for R-Car SoC.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Fill in HSSRR offset for Gen2 and SCBRR calculation for Gen2 and Gen3]
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoserial: sh: Add R-Car Gen4 support
Hai Pham [Tue, 28 Feb 2023 21:29:18 +0000 (22:29 +0100)]
serial: sh: Add R-Car Gen4 support

Add R-Car Gen4 family support. The basic function is as same as previous
R-Car Generation.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Swap RZ/A1 and Gen4 to keep the GenN sequence, use RCAR_64]

15 months agonet: ravb: Add R-Car Gen4 support
Hai Pham [Fri, 7 Apr 2023 15:12:17 +0000 (17:12 +0200)]
net: ravb: Add R-Car Gen4 support

Add support for R-Car Gen4 SoCs and a matching DT compatible.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: Drop SoC specific compatible, use RCAR_64 Kconfig symbol, update commit message]

15 months agommc: renesas-sdhi: Add R-Car Gen4 support
Hai Pham [Tue, 28 Feb 2023 21:24:06 +0000 (22:24 +0100)]
mmc: renesas-sdhi: Add R-Car Gen4 support

Support R-Car Gen4 family. The default quirk is similar to previous
generation.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Use RCAR_64 Kconfig
15 months agommc: tmio: Replace ifdeffery with IS_ENABLED/CONFIG_IS_ENABLED macros
Marek Vasut [Tue, 28 Feb 2023 21:18:13 +0000 (22:18 +0100)]
mmc: tmio: Replace ifdeffery with IS_ENABLED/CONFIG_IS_ENABLED macros

Instead of #if and #ifdef, use IS_ENABLED and CONFIG_IS_ENABLED macros.
This improves build test coverage. The CONFIG_SPL_BUILD must remain an
ifdef, as CONFIG_SPL_STACK may not always be defined, e.g. in U-Boot
proper build. No functional change.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agommc: tmio: Check 'addr' width before checking for 64bit limitation
Marek Vasut [Tue, 28 Feb 2023 21:18:12 +0000 (22:18 +0100)]
mmc: tmio: Check 'addr' width before checking for 64bit limitation

The 64bit limitation check is compiled and optimized out on 32bit
platforms, but generates a type width warning:

drivers/mmc/tmio-common.c: In function ‘tmio_sd_addr_is_dmaable’:
drivers/mmc/tmio-common.c:376:26: warning: right shift count >= width of type [-Wshift-count-overflow]
  376 |                 if (addr >> 32)
      |                          ^~

Fix the warning by checking the addr type width to see whether the
shift even makes sense in the first place. The width check is also
optimized out at compile time.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
15 months agoi2c: rcar_i2c: Add R-Car Gen4 support
Hai Pham [Tue, 28 Feb 2023 21:25:51 +0000 (22:25 +0100)]
i2c: rcar_i2c: Add R-Car Gen4 support

Add support for R-Car Gen4 SoCs into the driver.

While I2C on R-Car Gen4 does support some extra features (Slave Clock
Stretch Select), for now it is treated the same as I2C on R-Car Gen3,
which let us share the same driver.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> # Use RCAR_64 Kconfig
Reviewed-by: Heiko Schocher <hs@denx.de>
15 months agogpio: renesas: Add R-Car Gen4 support
Hai Pham [Tue, 28 Feb 2023 21:23:07 +0000 (22:23 +0100)]
gpio: renesas: Add R-Car Gen4 support

Add support for the GPIO controller block in the R-Car Gen4 family.

It has a General Input Enable Register (INEN), whose reset state is to
have all inputs disabled.

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
15 months agoARM: rmobile: Add R-Car Generation 4 support
Hai Pham [Tue, 28 Feb 2023 21:22:03 +0000 (22:22 +0100)]
ARM: rmobile: Add R-Car Generation 4 support

This adds R-Car Generation 4 (Gen4) support as Renesas ARM64 SoC.

In this version, reusing R-Car Gen3 lowlevel initialize routine [1]
and R-Car Gen3 memory map tables [2] .

[1] arch/arm/mach-rmobile/lowlevel_init_gen3.S
[2] arch/arm/mach-rmobile/memmap-gen3.c

Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
[Marek: - Enable DTO support by default
        - Sort the Kconfig lists
- Select RCAR_64 Kconfig option to pull in all the shared
  Kconfig options with Gen3, and use where applicable to
  deduplicate entries.
- Fix reference [2] typo in commit message
- Drop config options moved to Kconfig, rename rest to CFG_
  accordingly to synchronize with upstream changes. Drop
  removed CONFIG_VERY_BIG_RAM.
        - Move board size limit to arch/Kconfig
- Move GICR_BASE to headers instead of common config]

15 months agoMerge tag 'fsl-qoriq-2023-4-6' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Thu, 6 Apr 2023 02:19:57 +0000 (22:19 -0400)]
Merge tag 'fsl-qoriq-2023-4-6' of https://source.denx.de/u-boot/custodians/u-boot-fsl-qoriq

convert NXP LS1028A RDB and QDS to DM_SERIAL
enable DM_SERIAL for ls1088a
sync serial nodes with linux for lx2160a/ls1088a

15 months agoMerge branch '2023-04-05-blkmap-composable-virtual-block-devices'
Tom Rini [Wed, 5 Apr 2023 22:59:47 +0000 (18:59 -0400)]
Merge branch '2023-04-05-blkmap-composable-virtual-block-devices'

To quote the author:
Block maps are a way of looking at various sources of data through the
lens of a regular block device. It lets you treat devices that are not
block devices, like RAM, as if they were. It also lets you export a
slice of an existing block device, which does not have to correspond to
a partition boundary, as a new block device.

This is primarily useful because U-Boot's filesystem drivers only
operate on block devices, so a block map lets you access filesystems
wherever they might be located.

The implementation is loosely modeled on Linux's "Device Mapper"
subsystem, see the kernel documentation [1] for more information.

The primary use-cases are to access filesystem images stored in RAM, and
within FIT images stored on disk. See doc/usage/blkmap.rst for more
details.

The architecture is pluggable, so adding other types of mappings should
be quite easy.

[1]: https://docs.kernel.org/admin-guide/device-mapper/index.html

15 months agoefi_loader: device_path: support blkmap devices
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:55 +0000 (16:33 +0100)]
efi_loader: device_path: support blkmap devices

Create a distinct EFI device path for each blkmap device.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agodoc: blkmap: Add introduction and examples
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:54 +0000 (16:33 +0100)]
doc: blkmap: Add introduction and examples

Explain block maps by going through two common use-cases.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agotest: blkmap: Add test suite
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:53 +0000 (16:33 +0100)]
test: blkmap: Add test suite

Verify that:

- Block maps can be created and destroyed
- Mappings aren't allowed to overlap
- Multiple mappings can be attached and be read/written from/to

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agocmd: blkmap: Add blkmap command
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:52 +0000 (16:33 +0100)]
cmd: blkmap: Add blkmap command

Add a frontend for the blkmap subsystem. In addition to the common
block device operations, this allows users to create and destroy
devices, and map in memory and slices of other block devices.

With that we support two primary use-cases:

- Being able to "distro boot" from a RAM disk. I.e., from an image
  where the kernel is stored in /boot of some filesystem supported
  by U-Boot.

- Accessing filesystems not located on exact partition boundaries,
  e.g. when a filesystem image is wrapped in an FIT image and stored
  in a disk partition.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoblk: blkmap: Add linear device mapping support
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:51 +0000 (16:33 +0100)]
blk: blkmap: Add linear device mapping support

Allow a slice of an existing block device to be mapped to a
blkmap. This means that filesystems that are not stored at exact
partition boundaries can be accessed by remapping a slice of the
existing device to a blkmap device.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoblk: blkmap: Add memory mapping support
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:50 +0000 (16:33 +0100)]
blk: blkmap: Add memory mapping support

Allow a slice of RAM to be mapped to a blkmap. This means that RAM can
now be accessed as if it was a block device, meaning that existing
filesystem drivers can now be used to access ramdisks.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoblk: blkmap: Add basic infrastructure
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:49 +0000 (16:33 +0100)]
blk: blkmap: Add basic infrastructure

blkmaps are loosely modeled on Linux's device mapper subsystem. The
basic idea is that you can create virtual block devices whose blocks
can be backed by a plethora of sources that are user configurable.

This change just adds the basic infrastructure for creating and
removing blkmap devices. Subsequent changes will extend this to add
support for actual mappings.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agocmd: blk: Allow generic read/write operations to work in sandbox
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:48 +0000 (16:33 +0100)]
cmd: blk: Allow generic read/write operations to work in sandbox

Ensure that the memory destination/source addresses of block
read/write operations are mapped in before access. Currently, this is
only needed on sandbox builds.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoimage: Fix script execution from FIT images with external data
Tobias Waldekranz [Thu, 16 Feb 2023 15:33:47 +0000 (16:33 +0100)]
image: Fix script execution from FIT images with external data

Update the script loading code to recognize when script data is stored
externally from the FIT metadata (i.e., built with `mkimage -E`).

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoMerge branch '2023-04-04-android-image-v3-v4-support'
Tom Rini [Wed, 5 Apr 2023 14:40:05 +0000 (10:40 -0400)]
Merge branch '2023-04-04-android-image-v3-v4-support'

To quote the author:
* This is based on Roman Stratiienko's work to support boot image header version 3 and 4.

* This supports the new boot image headers v3, v4 and bootconfig feature.
https://source.android.com/docs/core/architecture/bootloader/boot-image-header
https://source.android.com/docs/core/architecture/bootloader/implementing-bootconfig

- Tested on Amlogic Khadas vim3l, a reference board for Android Open Source Project
  https://www.khadas.com/vim3l

  And on AM625 Texas Instruments board with 5.10 linux kernel

Main changes :
- New partition : vendor boot, with a specific vendor ramdisk
- DTB is stored in the vendor boot partition
- The generic ramdisk is placed after the vendor ramdisk
- Bootconfig feature support

Here is a link to see the related android boot flow changes on KHADAS vim3l as an example:
https://gitlab.baylibre.com/baylibre/amlogic/atv/u-boot/-/commits/souajih/BootImagev4/

15 months agoDockerfile: add mkbootimg tool
Safae Ouajih [Sun, 5 Feb 2023 23:50:21 +0000 (00:50 +0100)]
Dockerfile: add mkbootimg tool

mkbootimg tool is part of the Android project and it is
used to pack Android boot images such as boot image
and vendor_boot image.

Use the following command to run mkbootimg:
$ python3 -m mkbootimg

Add mkbootimg to the docker file

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agotest/py: android: extend abootimg test
Safae Ouajih [Sun, 5 Feb 2023 23:50:20 +0000 (00:50 +0100)]
test/py: android: extend abootimg test

test_abootimg is extended to include the testing of boot images
version 4. For this, boot.img and vendor_boot.img have been
generated using mkbootimg tool with setting the header
version to 4.

This tests:
- Getting the header version using abootimg
- Extracting the load address of the dtb
- Extracting the dtb start address in RAM

Running test:
$ ./test/py/test.py --bd sandbox --build -k test_abootimg

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agodoc: android: add documentation for v3, v4 boot image header
Safae Ouajih [Sun, 5 Feb 2023 23:50:19 +0000 (00:50 +0100)]
doc: android: add documentation for v3, v4 boot image header

Update the Android documentation to describe version 3 and 4 of boot
image header.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: support bootconfig
Safae Ouajih [Sun, 5 Feb 2023 23:50:18 +0000 (00:50 +0100)]
android: boot: support bootconfig

Support Bootconfig feature.
- The bootconfig feature replaces the androidboot.*
  kernel cmdline options.

This was adapted from downstream [1] commit : 7af0a0506d4d ("cuttlefish:
support bootconfig parameters").

Link:[1] https://android.googlesource.com/platform/external/u-boot/

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: support boot image header version 3 and 4
Safae Ouajih [Sun, 5 Feb 2023 23:50:17 +0000 (00:50 +0100)]
android: boot: support boot image header version 3 and 4

Enable the support for boot image header version 3 and 4
using abootimg command.

In order to use version 3 or 4:

1- Vendor boot image address should be given to abootimg cmd.

abootimg addr $1 $vendor_boot_load_addr

2- "ramdisk_addr_r" env variable (ramdisk address) should be set to host
the ramdisk : generic ramdisk + vendor ramdisk

Replace "struct andr_boot_img_hdr_v0*" by "void *" in
some functions since v3 and v4 are now supported as well.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agodrivers: fastboot: zImage flashing is not supported for v3, v4
Safae Ouajih [Sun, 5 Feb 2023 23:50:16 +0000 (00:50 +0100)]
drivers: fastboot: zImage flashing is not supported for v3, v4

With vendor boot image introduced in version 3 and 4 of boot
image header, boot information is located in both boot image
and vendor boot image.

Flashing zImage is not supported for version 3 and 4 since this
requires updating vendor boot image and/or generating a new image.

Print an error message when the boot image header version is
greater than 2.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: update android_image_get_dtb_img_addr to support v3, v4
Safae Ouajih [Sun, 5 Feb 2023 23:50:15 +0000 (00:50 +0100)]
android: boot: update android_image_get_dtb_img_addr to support v3, v4

Add support for boot image version 3 and 4 in
android_image_get_dtb_img_addr().
Since the dtb is now included in vendor_boot image
instead of boot image, extract the dtb address from
vendor_boot image when a v3 or v4 is used.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: support extra command line
Safae Ouajih [Sun, 5 Feb 2023 23:50:14 +0000 (00:50 +0100)]
android: boot: support extra command line

In version 3 and 4 of boot image header, the vendor specific
command line are located in vendor boot image. Thus, use
extra command line to add those cmd to bootargs.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: ramdisk: support vendor ramdisk
Safae Ouajih [Sun, 5 Feb 2023 23:50:13 +0000 (00:50 +0100)]
android: boot: ramdisk: support vendor ramdisk

Version 3 and 4 of boot image header introduced
vendor boot ramdisk: Please check include/android_image.h
for details.

The ramdisk is now split into a generic ramdisk in boot image
and a vendor ramdisk in vendor boot image.

Support the new vendor ramdisk.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: update android_image_get_data to support v3, v4
Safae Ouajih [Sun, 5 Feb 2023 23:50:12 +0000 (00:50 +0100)]
android: boot: update android_image_get_data to support v3, v4

Since boot image header version 3 and 4 introduced vendor boot image,
use the following functions to fill the generic android
structure : andr_image_data:

 - android_boot_image_v3_v4_parse_hdr()
 - android_vendor_boot_image_v3_v4_parse_hdr()

Update android_image_get_data() to support v3 and v4

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: add vendor boot image to prepare for v3, v4 support
Safae Ouajih [Sun, 5 Feb 2023 23:50:11 +0000 (00:50 +0100)]
android: boot: add vendor boot image to prepare for v3, v4 support

Introduce vendor boot image for version 3 and 4 of boot image header.
The vendor boot image will hold extra information about kernel, dtb
and ramdisk.

This is done to prepare for boot image version 3 and 4 support.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: boot image header v3, v4 do not support recovery DTBO
Safae Ouajih [Sun, 5 Feb 2023 23:50:10 +0000 (00:50 +0100)]
android: boot: boot image header v3, v4 do not support recovery DTBO

android_image_get_dtbo() is used to get recovery DTBO via abootimg cmd.
This is not supported in boot image header v3 and v4. Thus, print an
error message when v1,v2 header version are not used.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: content print is not supported for v3, v4 header version
Safae Ouajih [Sun, 5 Feb 2023 23:50:09 +0000 (00:50 +0100)]
android: boot: content print is not supported for v3, v4 header version

Content print is not supported for version 3 and 4 of boot image header.
Thus, only print that content when v2 is used.

Update android_print_contents() to print an error message
when trying to print boot image header version 3 or 4 content.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: move to andr_image_data structure
Safae Ouajih [Sun, 5 Feb 2023 23:50:08 +0000 (00:50 +0100)]
android: boot: move to andr_image_data structure

Move from andr_boot_img_hdr_v0 to andr_image_data
structure to prepare for boot image header
version 3 and 4.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: kcomp: support andr_image_data
Safae Ouajih [Sun, 5 Feb 2023 23:50:07 +0000 (00:50 +0100)]
android: boot: kcomp: support andr_image_data

andr_image_data structure is used as a global representation of
boot image header structure. Introduce this new structure to
support all boot header versions : v0,v1.v2.v3.v4 and to support
v3 and v4 while maitaining support for v0,v1,v2.
The need of using andr_image_data comes from the change of header
structure in both version 3 and 4.

Rework android_image_get_kcomp()  to support this new struct.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: add boot image header v3 and v4 structures
Safae Ouajih [Sun, 5 Feb 2023 23:50:06 +0000 (00:50 +0100)]
android: boot: add boot image header v3 and v4 structures

Add support for v3/v4 boot image format by adding
the following structures:

- andr_boot_img_hdr_v3 : describes boot image header
- andr_vnd_boot_img_hdr : describes vendor boot image header

These definitions have been copied over from the AOSP documentation at
[1] and [2]

Boot arg sizes are taken from [3]:
commit: 35fb6262bc3f (ANDROID: Support for vendor boot)

This also adds documentation for boot image header v3/v4 structure
that was imported from [4], file: include/bootimg/bootimg.h
commit: 8d0922bfb932 (Adding GKI signature in boot.img v4)

Link:[1] https://source.android.com/docs/core/architecture/bootloader/boot-image-header
Link:[2] https://source.android.com/docs/core/architecture/bootloader/partitions/vendor-boot-partitions#vendor-boot-header
Link:[3] https://android.googlesource.com/platform/external/u-boot
Link:[4] https://android.googlesource.com/platform/system/tools/mkbootimg

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: replace android_image_check_header
Safae Ouajih [Sun, 5 Feb 2023 23:50:05 +0000 (00:50 +0100)]
android: boot: replace android_image_check_header

With the new vendor boot image introduced in versions 3 and 4
of boot image header, the header check must be done for both boot
image and vendor boot image. Thus, replace android_image_check_header()
by is_android_boot_image_header() to only refer to boot image header check.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: support vendor boot image in abootimg
Safae Ouajih [Sun, 5 Feb 2023 23:50:04 +0000 (00:50 +0100)]
android: boot: support vendor boot image in abootimg

Vendor boot image is introduced in boot image header
version 3 and 4. Please check [1] for more details.

To prepare for boot image v3/v4 support, allow the abootimg command
to store the vendor_boot image address.

Full support for this new format will be done in a future patch.

Link:[1] https://source.android.com/docs/core/architecture/bootloader/partitions/vendor-boot-partitions

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoandroid: boot: rename andr_img_hdr -> andr_boot_img_hdr_v0
Safae Ouajih [Sun, 5 Feb 2023 23:50:03 +0000 (00:50 +0100)]
android: boot: rename andr_img_hdr -> andr_boot_img_hdr_v0

Android introduced boot header version 3 or 4.
The header structure change with version 3 and 4 to support
the new updates such as:
- Introducing Vendor boot image: with a vendor ramdisk
- Bootconfig feature (v4)

Change andr_img_hdr struct name to maintain support for version v0,
v1 and v2 while introducing version 3 and 4.

Signed-off-by: Safae Ouajih <souajih@baylibre.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
15 months agoMerge branch '2023-04-04-update-to-clang-16'
Tom Rini [Tue, 4 Apr 2023 18:36:43 +0000 (14:36 -0400)]
Merge branch '2023-04-04-update-to-clang-16'

- Update our CI to use clang-16 for tests. This also changes slightly
  how we do linker lists so that we don't rely on undefined behavior
  that lead to clang-15 and later failing to work (and in some cases
  seemingly, earlier versions of clang would sometimes fail).

15 months agoCI: Move to clang-16
Tom Rini [Tue, 21 Mar 2023 19:07:45 +0000 (15:07 -0400)]
CI: Move to clang-16

As this is now the stable release, move to using that now for our tests.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agolinker_lists: Rework start/end macros to not rely on undefined behavior
Tom Rini [Tue, 28 Mar 2023 18:54:51 +0000 (14:54 -0400)]
linker_lists: Rework start/end macros to not rely on undefined behavior

Per the GCC bug listed below, the way we do linker lists is relying on
undefined behavior that seems to work in gcc, but doesn't always work in
clang. Andrew suggests rewriting our start/end macros in a different way
(as implemented here, from what he said in comment 1) to avoid these
problems.

Reported-by: AdityaK <appujee@google.com>
Suggested-by: Andrew Pinski <apinski@marvell.com>
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108915
Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andrew Pinski <apinski@marvell.com>
15 months agosmartweb: Enable LTO
Tom Rini [Tue, 28 Mar 2023 18:54:50 +0000 (14:54 -0400)]
smartweb: Enable LTO

In order to prepare for slight size growth due to reworking linker list
support, enable LTO here to save more space again.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
15 months agoDockerfile: Populate a pip cache
Tom Rini [Thu, 23 Mar 2023 18:57:58 +0000 (14:57 -0400)]
Dockerfile: Populate a pip cache

Given the number of jobs in CI we have which use python and pip install
packages, we should do this once in the Dockerfile, in order to populate
the cache. We let each job continue to create and use the virtual
environments they need to facilitate making updates to these
environments easier.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agopytest: Update requirements to match sphinx versions
Tom Rini [Thu, 23 Mar 2023 18:57:57 +0000 (14:57 -0400)]
pytest: Update requirements to match sphinx versions

In order to better make use of pip caches, and also for better overall
consistency, we should use the same versions of packages in each of our
python requirements files. Update pytest to use the newer versions of
packages we use in sphinx builds.

Signed-off-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
15 months agoMerge tag 'u-boot-imx-next-20230404' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Tue, 4 Apr 2023 13:50:13 +0000 (09:50 -0400)]
Merge tag 'u-boot-imx-next-20230404' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

u-boot-imx-next-20230404
------------------------

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

- boards : DH-Electronics, Toradex, imx8mp-beacon-kit

15 months agoboard: freescale: lx2160a: remove the PL01X device instantiation
Ioana Ciornei [Wed, 15 Mar 2023 11:04:18 +0000 (13:04 +0200)]
board: freescale: lx2160a: remove the PL01X device instantiation

There is no need for the board file to instantiate a PL01X platform
device anymore. This is all taken care of by the DM code which now will
probe the device based on the DT node.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoarch: arm: dts: fsl-lx2160a.dtsi: tag serial nodes with bootph-all
Ioana Ciornei [Wed, 15 Mar 2023 11:04:17 +0000 (13:04 +0200)]
arch: arm: dts: fsl-lx2160a.dtsi: tag serial nodes with bootph-all

Tag the serial nodes with bootph-all in order to have these nodes and
the drivers available before relocation.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoarch: arm: dts: fsl-lx2160a.dtsi: sync serial nodes with Linux
Ioana Ciornei [Wed, 15 Mar 2023 11:04:16 +0000 (13:04 +0200)]
arch: arm: dts: fsl-lx2160a.dtsi: sync serial nodes with Linux

Sync the serial nodes of the LX2160A based boards with their
representation in Linux. We also imported the clockgen and sysclk nodes
which are dependencies.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoarch: arm: dts: fsl-lx2160a.dtsi: move the serial nodes under soc
Ioana Ciornei [Wed, 15 Mar 2023 11:04:15 +0000 (13:04 +0200)]
arch: arm: dts: fsl-lx2160a.dtsi: move the serial nodes under soc

Move the serial nodes under the soc node. No changes are made to the
nodes, just their location is changed.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoarch: arm: dts: fsl-lx2160a.dtsi: add an 'soc' node
Ioana Ciornei [Wed, 15 Mar 2023 11:04:14 +0000 (13:04 +0200)]
arch: arm: dts: fsl-lx2160a.dtsi: add an 'soc' node

The u-boot dts for these boards do not have an soc node, unlike its
Linux counterpart. This patch just adds the soc node as seen in Linux,
the next patches will move some nodes under it.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoconfigs: ls1088a: enable DM_SERIAL
Ioana Ciornei [Wed, 15 Mar 2023 11:04:13 +0000 (13:04 +0200)]
configs: ls1088a: enable DM_SERIAL

Now that the DT nodes for the serial devices are in place for these
boards, enable DM_SERIAL in the associated configs.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoarch: arm: dts: fsl-ls1088a.dtsi: tag serial nodes with bootph-all
Ioana Ciornei [Wed, 15 Mar 2023 11:04:12 +0000 (13:04 +0200)]
arch: arm: dts: fsl-ls1088a.dtsi: tag serial nodes with bootph-all

Tag the serial nodes with bootph-all in order to have these nodes and
the drivers available before relocation.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoarch: arm: dts: fsl-ls1088a.dtsi: sync serial nodes with Linux
Ioana Ciornei [Wed, 15 Mar 2023 11:04:11 +0000 (13:04 +0200)]
arch: arm: dts: fsl-ls1088a.dtsi: sync serial nodes with Linux

Sync the serial nodes of the LS1088A based boards with their
representation in Linux. We also imported the clockgen and sysclk nodes
which are dependencies.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoarch: arm: dts: fsl-ls1088a.dtsi: move the serial nodes under soc
Ioana Ciornei [Wed, 15 Mar 2023 11:04:10 +0000 (13:04 +0200)]
arch: arm: dts: fsl-ls1088a.dtsi: move the serial nodes under soc

Move the serial nodes under the soc node. No changes are made to the
nodes, just their location is changed.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoarch: arm: dts: fsl-ls1088a.dtsi: add an 'soc' node
Ioana Ciornei [Wed, 15 Mar 2023 11:04:09 +0000 (13:04 +0200)]
arch: arm: dts: fsl-ls1088a.dtsi: add an 'soc' node

The u-boot dts for these boards do not have an soc node, unlike its
Linux counterpart. This patch just adds the soc node as seen in Linux,
the next patches will move some nodes under it.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoconfigs: convert NXP LS1028A RDB and QDS to DM_SERIAL
Vladimir Oltean [Wed, 15 Mar 2023 11:01:16 +0000 (13:01 +0200)]
configs: convert NXP LS1028A RDB and QDS to DM_SERIAL

Since the device trees are more or less synchronized with Linux, the
only necessary changes are to enable CONFIG_DM_SERIAL and the DM_SERIAL
driver for ns16550 (ns16550.c rather than serial_ns16550.c).

ls1028aqds_tfa_lpuart_defconfig already uses DM_SERIAL for the LPUART
driver, so I didn't touch that.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
15 months agoarm64: imx: Add support for imx8mp-beacon-kit
Adam Ford [Fri, 24 Mar 2023 03:06:16 +0000 (22:06 -0500)]
arm64: imx: Add support for imx8mp-beacon-kit

Beacon Embedded has an i.MX8M Plus development kit which consists
of a SOM + baseboard.  The SOM includes Bluetooth, WiFi, QSPI, eMMC,
and one Ethernet PHY. The baseboard includes audio, HDMI, USB-C Dual
Role port, USB Hub with five ports, a PCIe slot, and a second Ethernet
PHY.  The device trees are already queued for inclusion in Linux 6.3.

Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
15 months agoARM: imx: Enable LTO for DH electronics i.MX6 DHCOM
Marek Vasut [Tue, 7 Mar 2023 07:51:04 +0000 (08:51 +0100)]
ARM: imx: Enable LTO for DH electronics i.MX6 DHCOM

Enable LTO to reduce the size of SPL, which with SPL SDP
support may be close to the limit.

Signed-off-by: Marek Vasut <marex@denx.de>
15 months agoARM: dts: imx: Add support for Data Modul i.MX8M Plus eDM SBC
Marek Vasut [Mon, 3 Apr 2023 23:07:43 +0000 (01:07 +0200)]
ARM: dts: imx: Add support for Data Modul i.MX8M Plus eDM SBC

Add support for Data Modul i.MX8M Plus eDM SBC board. This is an
evaluation board for various custom display units. Currently
supported are serial console, ethernet, eMMC, SD, SPI NOR, USB.

Signed-off-by: Marek Vasut <marex@denx.de>
15 months agoARM: dts: imx: Add WDT reboot bindings on DH i.MX6 DHSOM
Marek Vasut [Mon, 3 Apr 2023 22:39:37 +0000 (00:39 +0200)]
ARM: dts: imx: Add WDT reboot bindings on DH i.MX6 DHSOM

Add WDT reboot bindings on DH i.MX6 DHSOM to permit the platform
to reboot via WDT in U-Boot. These are custom U-Boot bindings,
hence they are placed in -u-boot.dtsi .

Reviewed-by: Fabio Estevam <festevam@denx.de>
Signed-off-by: Marek Vasut <marex@denx.de>
15 months agoboard: verdin-imx8mp: change prints in spl_dram_init function
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:57 +0000 (14:01 +0200)]
board: verdin-imx8mp: change prints in spl_dram_init function

change prints to show which DDR configuration (single/dual rank) is used

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
15 months agoboard: verdin-imx8mp: compact slight different lpddr4 configuration
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:56 +0000 (14:01 +0200)]
board: verdin-imx8mp: compact slight different lpddr4 configuration

Deduplicate similar DDRC configurations and LPDDR4 training patterns
by patching a single configuration.

The aim is to reduce the SPL memory footprint and simplify maintenance
of lpddr4_timing.c

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
15 months agoboard: verdin-imx8mp: update lpddr4 configuration and training
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:55 +0000 (14:01 +0200)]
board: verdin-imx8mp: update lpddr4 configuration and training

Update LPDDR4 configuration and training using updated spreadsheet and
tools from NXP using data from previous spreadsheet and verified
toward datasheet:
 - MX8M_Plus_LPDDR4_RPA_v9.xlsx
 - mscale_ddr_tool_v3.30.exe

From:
https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/i-MX-8M-Family-DDR-Tool-Release/ta-p/1104467

Some register values differ due to these fixes/modifications:

- corrected calculation of T_CKPDX parameter (equal to tCKCKEH for LPDDR4)
- corrected ECC related items, none of which affect normal operation
  when ECC is not enabled
- corrected formula for calculation of tRTP in cell D122

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
15 months agoboard: verdin-imx8mp: fix lpddr4 refresh timing
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:54 +0000 (14:01 +0200)]
board: verdin-imx8mp: fix lpddr4 refresh timing

Change tRFCmin (tRFCab) from 280 ns to 380 ns to be compliant with
current and futures memories.

Fixes: 2bc2f817cea7 ("board: toradex: add verdin imx8m plus support")

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
15 months agoboard: verdin-imx8mp: update ddrc config for different lpddr4 memories
Emanuele Ghidoli [Mon, 3 Apr 2023 12:01:53 +0000 (14:01 +0200)]
board: verdin-imx8mp: update ddrc config for different lpddr4 memories

Add support to Verdin IMX8MP V1.1B SKU which uses
MT53E1G32D2FW-046 WT:B memory.
Compared to the 8 GB memory (MT53E2G32D4NQ-046 WT:A) used on
Verdin IMX8MP V1.0A it has 16 row addresses instead of 17.
In fact, the new memory, is a 2 GB/rank memory. The 8 GB memory is a
4 GB/rank memory.

Manually tweaking Host Interface addresses vs LPDDR4 signals mapping it
is possible to have a single configuration working with both memories:
 - Old configuration: HIF bit 30 -> rank, HIF bit 29 -> Row 16
 - New configuration: HIF bit 29 -> rank, HIF bit 30 -> Row 16

With this change the memory space from the host processor is contiguous
for both the configurations and the correct memory size is computed
using get_ram_size() at runtime.

Support for single rank memories still works thanks to the fact
dual ranks training fails (ddr_init->ddr_cfg_phy) toward single rank
memories.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
15 months agoconfigs: tqma6: enable DM_THERMAL
Markus Niebel [Mon, 27 Mar 2023 08:23:31 +0000 (10:23 +0200)]
configs: tqma6: enable DM_THERMAL

Enabling this gives some informal output at boot time.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
15 months agoconfigs: tqma6: enable DM for MDIO / PHY
Markus Niebel [Mon, 27 Mar 2023 08:23:30 +0000 (10:23 +0200)]
configs: tqma6: enable DM for MDIO / PHY

Since this works with current device trees, enabled these.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
15 months agoconfigs: tqma6: switch to DM_SERIAL
Markus Niebel [Mon, 27 Mar 2023 08:23:29 +0000 (10:23 +0200)]
configs: tqma6: switch to DM_SERIAL

Usage without DM_SERIAL is deprecated. Fix this.

Signed-off-by: Markus Niebel <Markus.Niebel@ew.tq-group.com>
15 months agoarm: imx: add u-boot-nand.imx to boot from NAND without SPL
Luca Ceresoli [Fri, 10 Mar 2023 10:07:52 +0000 (11:07 +0100)]
arm: imx: add u-boot-nand.imx to boot from NAND without SPL

U-Boot can be booted from NAND without SPL by prepending the DCD header to
the actual U-Boot binary. However this requires prepending 1024 bytes to
u-boot.imx (DCD + u-boot.bin).

There is already a similar target to build spl/u-boot-nand-spl.imx, add the
same option for no-SPL boot.

Tested on i.MX6ULL.

The resulting layout of u-boot-nand.imx is:

 - Offset 0x0000 (0 KiB): padding
 - Offset 0x0400 (1 KiB): DCD header
 - Offset 0x1000 (4 KiB): u-boot.bin

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
15 months agoARM: imx: Enable SDP download in SPL on DH i.MX6 DHSOM
Marek Vasut [Tue, 7 Mar 2023 07:51:05 +0000 (08:51 +0100)]
ARM: imx: Enable SDP download in SPL on DH i.MX6 DHSOM

Enable SDP protocol support in SPL for DH i.MX6 DHSOM, now that those
components fit into the SPL due to LTO.

To start U-Boot via SDP upload on i.MX6 DHSOM based board, proceed as follows:
- Compile imx_usb [1] .
- Power off the i.MX6 DHSOM based board.
- Connect both USB-serial console and USB-OTG miniB ports to host PC.
- Switch board to USB boot mode.
- Power on the board.
- Verify using '$ dmesg' that a new device has been detected as follows:
    New USB device found, idVendor=15a2, idProduct=0054, bcdDevice= 0.01
    New USB device strings: Mfr=1, Product=2, SerialNumber=0
    Product: SE Blank ARIK
    Manufacturer: Freescale SemiConductor Inc

- Upload U-Boot SPL:
$ imx_usb u-boot-with-spl.imx

- Wait for SPL to come up, the following print ought to be the last on
  UART console:
SDP: handle requests...

- Upload U-Boot proper:
$ imx_usb u-boot.img

[1] https://github.com/boundarydevices/imx_usb_loader.git

Signed-off-by: Marek Vasut <marex@denx.de>
15 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-usb
Tom Rini [Tue, 4 Apr 2023 00:49:03 +0000 (20:49 -0400)]
Merge https://source.denx.de/u-boot/custodians/u-boot-usb

- Two USB gadget fixes

15 months agomx6sx-udoo-neo-basic-u-boot.dtsi: Correct to bootph-all
Tom Rini [Tue, 4 Apr 2023 00:48:24 +0000 (20:48 -0400)]
mx6sx-udoo-neo-basic-u-boot.dtsi: Correct to bootph-all

Updating this was missed in the merge of the next branch back in to
master.

Signed-off-by: Tom Rini <trini@konsulko.com>
15 months agousb: gadget: f_sdp: Add missing spl_board_prepare_for_boot() call
Marek Vasut [Tue, 7 Mar 2023 07:42:33 +0000 (08:42 +0100)]
usb: gadget: f_sdp: Add missing spl_board_prepare_for_boot() call

The spl_board_prepare_for_boot() should be called before jump_to_image_no_args()
to perform board-specific deinitialization before jumping to the next stage.
This board-specific deinitialization can be very much anything, e.g. disable
dcache in case it was enabled, or such.

Add the missing spl_board_prepare_for_boot() call into f_sdp .

Signed-off-by: Marek Vasut <marex@denx.de>
15 months agousb: gadget: missing fallthrough in composite_setup()
Heinrich Schuchardt [Sat, 1 Apr 2023 07:06:55 +0000 (09:06 +0200)]
usb: gadget: missing fallthrough in composite_setup()

Add a missing fallthrough macro. This fixes a -Wimplicit-fallthrough
warning.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
15 months agoMerge branch 'next'
Tom Rini [Mon, 3 Apr 2023 20:45:41 +0000 (16:45 -0400)]
Merge branch 'next'

Signed-off-by: Tom Rini <trini@konsulko.com>
15 months agoPrepare v2023.04
Tom Rini [Mon, 3 Apr 2023 20:38:50 +0000 (16:38 -0400)]
Prepare v2023.04

Signed-off-by: Tom Rini <trini@konsulko.com>
15 months agoarm: dts: k3-j721e-sk-u-boot: fix boot on j721e SK
Sinthu Raja [Mon, 3 Apr 2023 17:03:12 +0000 (12:03 -0500)]
arm: dts: k3-j721e-sk-u-boot: fix boot on j721e SK

J721e SK has been broken since at least March 2022.

The main-navss and mcu-navss nodes were renamed and this caused the
A72 SPL to fail early in the boot even before the serial port was
enabled. Fix this.

A later patch series between v2022.07 and v2022.10 additionally broke
boot on this board by introducing hbmc nodes which are not present on
this board. The right fix is to disable these by default in the SOC
dtsi file, but for now we can also disable them in the u-boot dtsi.

With both these fixed, we can now boot the j721e SK board fully from
mainline u-boot.

Fixes: 58d61fb5a77ef ("arm: dts: k3-j721e-sk: Add initial A72 specific dts support")
Fixes: 297daac43afb9 ("arm: dts: k3-j721e-mcu-wakeup: Add HyperBus Controller node")
Reported-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Sinthu Raja <sinthu.raja@ti.com>
[gadiyar@ti.com: update commit description]
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Cc: Bryan Brattlof <bb@ti.com>