]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
6 months agoarm64: dts: rockchip: correct gpio_pwrctrl1 typos on rk3588(s) boards
Jing Luo [Mon, 10 Jun 2024 13:13:33 +0000 (15:13 +0200)]
arm64: dts: rockchip: correct gpio_pwrctrl1 typos on rk3588(s) boards

gpio_pwrctrl2 gets duplicated by both rk806_dvs1_null and rk806_dvs2_null
gpio_pwrctrl1 is unset. This typo appears in multiple files. Let's fix them.

Note: I haven't had the chance to test them all because I don't own all
of these boards (obviously). Please test if it's needed.

Signed-off-by: Jing Luo <jing@jing.rocks>
Link: https://lore.kernel.org/r/20240420130355.639406-1-jing@jing.rocks
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: d7f2039e5321636069baa77ef2f1e5d22cb69a88 ]

(cherry picked from commit cb2b6d1d19ed10fcaec5f5859c08a3355d1c66e0)
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agoarm64: dts: rockchip: move uart2 pinmux to dtsi on rk3588-tiger
Heiko Stuebner [Mon, 10 Jun 2024 13:13:32 +0000 (15:13 +0200)]
arm64: dts: rockchip: move uart2 pinmux to dtsi on rk3588-tiger

The association of uart2 to the q7-uart pins is part of the module
itself and not the baseboard used. Therefore move the pinctrl over
to the tiger dtsi.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Link: https://lore.kernel.org/r/20240422143356.2596414-1-heiko@sntech.de
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: 5adbad5c464a708a87cf5ade1bfe2ca947bb2f82 ]

(cherry picked from commit f8314a4fbc00a3d651a7e9b4d9462d10c6c02a12)

6 months agoarm64: dts: rockchip: enable gpu on rk3588-tiger
Heiko Stuebner [Mon, 10 Jun 2024 13:13:31 +0000 (15:13 +0200)]
arm64: dts: rockchip: enable gpu on rk3588-tiger

Enable the mali gpu node and add the som-specific supply-regulator.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Link: https://lore.kernel.org/r/20240327112120.1181570-2-heiko@sntech.de
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: f5256f8ed4b729c3ab9d9cd7d406313773484b59 ]

(cherry picked from commit 27350b241eafea37dc94743cd9c5dd83295faca9)

6 months agorockchip: ringneck-px30: fix TPL_MAX_SIZE
Quentin Schulz [Thu, 6 Jun 2024 08:45:36 +0000 (10:45 +0200)]
rockchip: ringneck-px30: fix TPL_MAX_SIZE

Ringneck was mistakenly set to allow up to 128KiB for the TPL code size
while PX30 SoC only has 16KiB of SRAM.

Therefore, let's use the default value of TPL_MAX_SIZE from the SoC
(which is 10KiB) so that the max code size is actually checked and
useful.

Fixes: c925be73a0a8 ("rockchip: add support for PX30 Ringneck SoM on Haikou Devkit")
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agopower: rk8xx: properly print all supported PMICs name
Quentin Schulz [Thu, 6 Jun 2024 08:45:35 +0000 (10:45 +0200)]
power: rk8xx: properly print all supported PMICs name

The ID of the PMIC is stored in the 2 16b registers but the only part
that matters right now is the 3 MSB, which make the 3 digits (in hex) of
the part number.

Right now, only RK808 was properly displayed, with this all currently
supported PMICs should display the proper part number.

Additionally, when the PMIC variant is not found, print that value
instead of the masked unshifted value as all PMICs we support for now
have their LSB ignored to represent the actual part number.

Tested on RK806 (RK3588 Jaguar), RK808 (RK3399 Puma) and RK809 (PX30
Ringneck).

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: px30-ringneck: Update SPL_PAD_TO Kconfig option
Quentin Schulz [Thu, 6 Jun 2024 08:45:34 +0000 (10:45 +0200)]
rockchip: px30-ringneck: Update SPL_PAD_TO Kconfig option

On px30-ringneck the FIT payload is located at sector 0x200 compared to
the more Rockchip common sector 0x4000 offset:
SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200

Because FIT payload is located at sector 0x200 and the TPL+SPL is
located at sector 64, the combined size of TPL+SPL cannot take up more
than 224KiB:
(0x200 - 64) x 512 = 0x38000 (224 KiB)

Adjust SPL_PAD_TO to match the used 0x200 sector offset.

While at it, update the px30-ringneck-u-boot.dtsi to remove the now
unnecessary override of simple-bin:fit:offset since SPL_PAD_TO matches
with the current formula.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: rk3399-puma: remove unnecessary simple-bin:fit:offset override
Quentin Schulz [Thu, 6 Jun 2024 08:45:33 +0000 (10:45 +0200)]
rockchip: rk3399-puma: remove unnecessary simple-bin:fit:offset override

Since commit 6007b69d544e ("rockchip: rk3399-puma: Update SPL_PAD_TO
Kconfig option"), SPL_PAD_TO matches
(CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR - 64) * 512 and the default
value for simple-bin:fit:offset in rockchip-u-boot.dtsi is
SPL_PAD_TO, so let's remove this override.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: rk3399-puma: remove default value from defconfig
Quentin Schulz [Thu, 6 Jun 2024 08:45:32 +0000 (10:45 +0200)]
rockchip: rk3399-puma: remove default value from defconfig

CONFIG_ENV_OFFSET already defaults to 0x3F8000, however it is stored in
lowercase hexdigits instead of uppercase like in the defconfig.

No change in behavior intended.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: jaguar-rk3588: use default env size for Rockchip on MMC
Quentin Schulz [Thu, 6 Jun 2024 08:45:31 +0000 (10:45 +0200)]
rockchip: jaguar-rk3588: use default env size for Rockchip on MMC

The default env size is 0x8000 when building for Rockchip SoCs with
support for environment stored in MMC.

Jaguar hasn't entered mass production just yet, so it's a breaking
change we can afford in the name of consistency.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agoboard: rockchip: add ArmSoM Sige7 Rk3588 board
Jianfeng Liu [Tue, 28 May 2024 17:04:06 +0000 (01:04 +0800)]
board: rockchip: add ArmSoM Sige7 Rk3588 board

ArmSoM Sige7 is a Rockchip RK3588 based SBC (Single Board Computer) by
ArmSoM.

There are two variants depending on the DRAM size : 8G and 16G.

Specification:

    Rockchip Rk3588 SoC
    4x ARM Cortex-A76, 4x ARM Cortex-A55
    8/16GB memory LPDDR4x
    Mali G610MC4 GPU
    2x MIPI CSI 2 multiple lanes connector
    64GB/128GB on board eMMC
    uSD slot
    1x USB 2.0 Type-A, 1x USB 3.0 Type-A, 1x USB 3.0 Type-C
    1x HDMI 2.1 output
    2x 2.5 Gbps Ethernet port
    40-pin IO header including UART, SPI and I2C
    USB PD over USB Type-C
    Size: 92mm x 62mm

Kernel commit:
81c828a67c78 (arm64: dts: rockchip: Add ArmSom Sige7 board)

Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agorockchip: rk3588: Remove USB3 DRD nodes in u-boot.dtsi
Jianfeng Liu [Tue, 28 May 2024 17:04:05 +0000 (01:04 +0800)]
rockchip: rk3588: Remove USB3 DRD nodes in u-boot.dtsi

After we sync USB3 DRD nodes from v6.10-rc1, these obsolete nodes
can be removed.

Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agoarm64: dts: rockchip: Add ArmSom Sige7 board
Jianfeng Liu [Tue, 28 May 2024 17:04:04 +0000 (01:04 +0800)]
arm64: dts: rockchip: Add ArmSom Sige7 board

Specification:
        Rockchip Rk3588 SoC
        4x ARM Cortex-A76, 4x ARM Cortex-A55
        8/16/32GB Memory LPDDR4/LPDDR4x
        Mali G610MP4 GPU
        2× MIPI-CSI Connector
        1× MIPI-DSI Connector
        1x M.2 Key M (PCIe 3.0 4-lanes)
        2x RTL8125 2.5G Ethernet
        Onboard AP6275P for WIFI6/BT5
        32GB/64GB/128GB eMMC
        MicroSD card slot
        1x USB2.0, 1x USB3.0 Type-A, 1x US3.0 Type-C
        1x HDMI Output, 1x type-C DP Output

Functions work normally:
        USB2.0 Host
        USB3.0 Type-A Host
        M.2 Key M (PCIe 3.0 4-lanes)
        2x RTL8125 2.5G Ethernet
        eMMC
        MicroSD card

More information can be obtained from the following website
        https://docs.armsom.org/armsom-sige7

Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Weizhao Ouyang <weizhao.ouyang@arm.com>
Link: https://lore.kernel.org/r/20240420034300.176920-4-liujianfeng1994@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: 81c828a67c78bb03ea75819c417c93c7f3d637b5 ]

(cherry picked from commit d427a11542bcf5364a5260280e077f0a2e030dcb)
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agoarm64: dts: rockchip: add rk3588 pcie and php IOMMUs
Niklas Cassel [Tue, 28 May 2024 17:04:03 +0000 (01:04 +0800)]
arm64: dts: rockchip: add rk3588 pcie and php IOMMUs

The mmu600_pcie is connected with the five PCIe controllers.
The mmu600_php is connected with the USB3 controller, the GMAC
controllers, and the SATA controllers.

See 8.2 Block Diagram, in rk3588 TRM (Technical Reference Manual).

The IOMMUs are disabled by default, as further patches are needed to
program the SID/SSIDs in to the IOMMUs.

iommu: Default domain type: Translated
iommu: DMA domain TLB invalidation policy: strict mode
arm-smmu-v3 fc900000.iommu: ias 48-bit, oas 48-bit (features 0x001c1eaf)
arm-smmu-v3 fc900000.iommu: allocated 65536 entries for cmdq
arm-smmu-v3 fc900000.iommu: allocated 32768 entries for evtq
arm-smmu-v3 fc900000.iommu: msi_domain absent - falling back to wired irqs

Additionally, the IOMMU correctly triggers an IOMMU fault when
a PCIe device performs a write (since the device hasn't been
assigned a SID/SSID):
arm-smmu-v3 fc900000.iommu: event 0x02 received:
arm-smmu-v3 fc900000.iommu:      0x0000010000000002
arm-smmu-v3 fc900000.iommu:      0x0000000000000000
arm-smmu-v3 fc900000.iommu:      0x0000000000000000
arm-smmu-v3 fc900000.iommu:      0x0000000000000000

While this doesn't provide much value as is, having the devices as
disabled in the device tree will allow developers to see that the rk3588
actually has IOMMUs on the SoC.

Signed-off-by: Niklas Cassel <cassel@kernel.org>
Link: https://lore.kernel.org/r/20240502140231.477049-2-cassel@kernel.org
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: cd81d3a0695cc54ad6ac0ef4bbb67a7c8f55d592 ]

(cherry picked from commit ea9a34aa0d786cbf4b87f1ba528e69b07219738f)
Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agoarm64: dts: rockchip: add USB3 DRD controllers on rk3588
Sebastian Reichel [Tue, 28 May 2024 17:04:02 +0000 (01:04 +0800)]
arm64: dts: rockchip: add USB3 DRD controllers on rk3588

Add both USB3 dual-role controllers to the RK3588 devicetree.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20240408225109.128953-8-sebastian.reichel@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: 33f393a2a990e16f56931ca708295f31d2b44415 ]

(cherry picked from commit c7ed588e14f7dd04a92fb55f12680f94c7b14edf)
Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agoarm64: dts: rockchip: add USBDP phys on rk3588
Sebastian Reichel [Tue, 28 May 2024 17:04:01 +0000 (01:04 +0800)]
arm64: dts: rockchip: add USBDP phys on rk3588

Add both USB3-DisplayPort PHYs to RK3588 SoC DT.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20240408225109.128953-7-sebastian.reichel@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: e18e5e8188f2671abf63abe7db5f21555705130f ]

(cherry picked from commit 5110caca9865718616cf7093ed4a9a1bc54780db)
Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agoarm64: dts: rockchip: reorder usb2phy properties for rk3588
Sebastian Reichel [Tue, 28 May 2024 17:04:00 +0000 (01:04 +0800)]
arm64: dts: rockchip: reorder usb2phy properties for rk3588

Reorder common DT properties alphabetically for usb2phy, according
to latest DT style rules.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20240408225109.128953-6-sebastian.reichel@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: abe68e0ca71dddce0e5419e35507cb464d61870d ]

(cherry picked from commit f6835a60a8a28ff14ffb3dd80c99ce1c137d06c5)
Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agoarm64: dts: rockchip: fix usb2phy nodename for rk3588
Sebastian Reichel [Tue, 28 May 2024 17:03:59 +0000 (01:03 +0800)]
arm64: dts: rockchip: fix usb2phy nodename for rk3588

usb2-phy should be named usb2phy according to the DT binding,
so let's fix it up accordingly.

Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20240408225109.128953-5-sebastian.reichel@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: 4e07a95f7402de092cd71b2cb96c69f85c98f251 ]

(cherry picked from commit 5a3e4638492497ae81b9bd4a8627f4727e312ccc)
Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agoarm64: dts: rockchip: Fix ordering of nodes on rk3588s
Diederik de Haas [Tue, 28 May 2024 17:03:58 +0000 (01:03 +0800)]
arm64: dts: rockchip: Fix ordering of nodes on rk3588s

Fix the ordering of the main nodes by sorting them alphabetically and
then the ones with a memory address sequentially by that address.

Signed-off-by: Diederik de Haas <didi.debian@cknow.org>
Link: https://lore.kernel.org/r/20240406172821.34173-1-didi.debian@cknow.org
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: cbb97fe18e299ece1c0074924c630de6a19b320f ]

(cherry picked from commit bbf7c16f2f1208b96349f6f6648b69cfaa1a482b)
Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agoarm64: dts: rockchip: Add rk3588 GPU node
Boris Brezillon [Tue, 28 May 2024 17:03:57 +0000 (01:03 +0800)]
arm64: dts: rockchip: Add rk3588 GPU node

Add Mali GPU Node to the RK3588 SoC DT including GPU clock
operating points

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Link: https://lore.kernel.org/r/20240326165232.73585-3-sebastian.reichel@collabora.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
[ upstream commit: 6fca4edb93d335f29f81e484936f38a5eed6a9b1 ]

(cherry picked from commit 3cd15354ea0c8668812bc0b3a4136606c10803e9)
Signed-off-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
6 months agorockchip: px30/rk3326: migrate to OF_UPSTREAM
Quentin Schulz [Fri, 24 May 2024 09:23:33 +0000 (11:23 +0200)]
rockchip: px30/rk3326: migrate to OF_UPSTREAM

Migrate PX30/RK3326 boards that exists in Linux v6.8 to use OF_UPSTREAM.

firefly-px30 is not migrated to OF_UPSTREAM because there's no Device
Tree in the Linux kernel.

Differences between U-Boot's Odroid-Go2 and Linux's are now moved to the
-u-boot.dtsi, though I have a gut feeling that the existing cru
overrides aren't necessary (anymore?).

The U-Boot GPIO led-0 is on GPIO0_C1 but such is the pin of PWM3 which
is used for Linux's PWM led-2 so keep Linux's.

I also doubt vcc_cam is actually used, though the Odroid-Go2 Black
Edition uses this dcdc regulator for WiFi, so let's just move it to the
-u-boot.dtsi to play it safe.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: evb-px30: make UART5 the debug UART
Quentin Schulz [Fri, 24 May 2024 09:23:32 +0000 (11:23 +0200)]
rockchip: evb-px30: make UART5 the debug UART

In the Device Tree, UART5 is the system UART, but in the defconfig it
currently is UART2. Let's sync the two by making the defconfig use UART5
as well.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: evb-px30: do not remove pinctrl nodes from SPL DTB
Quentin Schulz [Fri, 24 May 2024 09:23:31 +0000 (11:23 +0200)]
rockchip: evb-px30: do not remove pinctrl nodes from SPL DTB

In order to be able to properly mux UART on PX30 EVB, the pinmux needs
to be done at runtime, so let's not remove the pinctrl nodes from the
SPL DTB.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: px30: make UART pinmux accessible to TPL/SPL DTB
Quentin Schulz [Fri, 24 May 2024 09:23:30 +0000 (11:23 +0200)]
rockchip: px30: make UART pinmux accessible to TPL/SPL DTB

This adds the default pinmux for UART2 and UART5 to the TPL/SPL DTB (if
not removed through the CONFIG_OF_SPL_REMOVE_PROPS symbol) as those two
controllers are always made available to all boards.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: px30-core-*: Use common bss and stack addresses
Quentin Schulz [Fri, 24 May 2024 09:23:29 +0000 (11:23 +0200)]
rockchip: px30-core-*: Use common bss and stack addresses

U-Boot proper pre-reloc is currently running out of memory on PX30
Ringneck and it is thus impossible to boot into U-Boot CLI. It is
assumed the same problem can be seen on other PX30 boards though I
cannot guarantee it since I don't have access to them.

Fix this by migrating to the common bss and stack addresses for PX30,
which drastically increases the size of the pre-reloc allocation pool (8
times bigger now). The memory layout in SPL and U-Boot proper now
match the other SoCs' using ROCKCHIP_COMMON_STACK_ADDR.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: odroid-go2: Use common bss and stack addresses
Quentin Schulz [Fri, 24 May 2024 09:23:28 +0000 (11:23 +0200)]
rockchip: odroid-go2: Use common bss and stack addresses

U-Boot proper pre-reloc is currently running out of memory on PX30
Ringneck and it is thus impossible to boot into U-Boot CLI. It is
assumed the same problem can be seen on other PX30 boards though I
cannot guarantee it since I don't have access to them.

Fix this by migrating to the common bss and stack addresses for PX30,
which drastically increases the size of the pre-reloc allocation pool (8
times bigger now). The memory layout in SPL and U-Boot proper now
match the other SoCs' using ROCKCHIP_COMMON_STACK_ADDR.

Tested-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: firefly-px30: Use common bss and stack addresses
Quentin Schulz [Fri, 24 May 2024 09:23:27 +0000 (11:23 +0200)]
rockchip: firefly-px30: Use common bss and stack addresses

U-Boot proper pre-reloc is currently running out of memory on PX30
Ringneck and it is thus impossible to boot into U-Boot CLI. It is
assumed the same problem can be seen on other PX30 boards though I
cannot guarantee it since I don't have access to them.

Fix this by migrating to the common bss and stack addresses for PX30,
which drastically increases the size of the pre-reloc allocation pool (8
times bigger now). The memory layout in SPL and U-Boot proper now
match the other SoCs' using ROCKCHIP_COMMON_STACK_ADDR.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agorockchip: evb-px30: Use common bss and stack addresses
Quentin Schulz [Fri, 24 May 2024 09:23:26 +0000 (11:23 +0200)]
rockchip: evb-px30: Use common bss and stack addresses

U-Boot proper pre-reloc is currently running out of memory on PX30
Ringneck and it is thus impossible to boot into U-Boot CLI. It is
assumed the same problem can be seen on other PX30 boards though I
cannot guarantee it since I don't have access to them.

Fix this by migrating to the common bss and stack addresses for PX30,
which drastically increases the size of the pre-reloc allocation pool (8
times bigger now). The memory layout in SPL and U-Boot proper now
match the other SoCs' using ROCKCHIP_COMMON_STACK_ADDR.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
6 months agoMerge patch series "Enable OSPI boot for j721s2"
Tom Rini [Thu, 13 Jun 2024 00:40:46 +0000 (18:40 -0600)]
Merge patch series "Enable OSPI boot for j721s2"

Manorit Chawdhry <m-chawdhry@ti.com> says:

The series enables ospi boot for j721s2.

Test logs: https://gist.github.com/manorit2001/6bb91885c608e3a8cb0267ab2c614781

6 months agoconfigs: j721s2_evm_*_defconfig: Enable OSPI configs
Manorit Chawdhry [Tue, 4 Jun 2024 06:09:13 +0000 (11:39 +0530)]
configs: j721s2_evm_*_defconfig: Enable OSPI configs

Enable OSPI related configs to boot using OSPI

Reviewed-by: Apurva Nandan <a-nandan@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoarch: arm: dts: k3-j721s2-*-u-boot.dtsi: Enable the ospi0 node
Manorit Chawdhry [Tue, 4 Jun 2024 06:09:12 +0000 (11:39 +0530)]
arch: arm: dts: k3-j721s2-*-u-boot.dtsi: Enable the ospi0 node

Enable ospi0 node for all boot stages

Reviewed-by: Apurva Nandan <a-nandan@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoarch: arm: dts: k3-j721s2-r5: Override ospi and fss for 32-bit mode
Manorit Chawdhry [Tue, 4 Jun 2024 06:09:11 +0000 (11:39 +0530)]
arch: arm: dts: k3-j721s2-r5: Override ospi and fss for 32-bit mode

R5 being a 32-bit processor can't understand the 64-bit mapping being
done in ospi node. Override the ospi node for 32-bit register ranges and
the fss node ( the parent node of ospi ) to map the ranges for the
updated child node correctly.

Reviewed-by: Apurva Nandan <a-nandan@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agomtd: spi-nor-core: Do not start or end writes at odd address in DTR mode
Pratyush Yadav [Tue, 4 Jun 2024 06:09:10 +0000 (11:39 +0530)]
mtd: spi-nor-core: Do not start or end writes at odd address in DTR mode

On DTR capable flashes like Micron Xcella the writes cannot start or end
at an odd address in DTR mode. Extra 0xff bytes need to be prepended or
appended respectively to make sure both the start and end addresses are
even.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Tested-by: Jonathan Humphreys <j-humphreys@ti.com>
Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoMerge tag 'efi-next-20240611' of https://source.denx.de/u-boot/custodians/u-boot...
Tom Rini [Tue, 11 Jun 2024 13:42:55 +0000 (07:42 -0600)]
Merge tag 'efi-next-20240611' of https://source.denx.de/u-boot/custodians/u-boot-efi into next

Pull request efi-next-20240611

UEFI:

* Allow specifying a device-tree in an EFI load option
  using the efidebug or eficonfig command.
* Let the EFI boot manager fall back to an OS provided device-tree
  if no device-tree is specified.

6 months agoefi_loader: rename struct efi_initrd_dp to efi_lo_dp_prefix
Heinrich Schuchardt [Mon, 10 Jun 2024 08:00:01 +0000 (10:00 +0200)]
efi_loader: rename struct efi_initrd_dp to efi_lo_dp_prefix

As we now also store device-tree device-paths in load options rename
struct efi_initrd_dp to efi_lo_dp_prefix.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
6 months agoefi_loader: load distro dtb in bootmgr
Heinrich Schuchardt [Fri, 26 Apr 2024 14:13:21 +0000 (16:13 +0200)]
efi_loader: load distro dtb in bootmgr

If no device-tree is specified, try to load a device-tree from the boot
device use the $fdtfile concatenated to either of the paths '/dtb/', '/',
'/dtb/current/'.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agoefi_loader: export efi_load_image_from_path
Heinrich Schuchardt [Fri, 26 Apr 2024 14:13:20 +0000 (16:13 +0200)]
efi_loader: export efi_load_image_from_path

We can reuse this function to load the device-tree.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agoefi_loader: return binary from efi_dp_from_lo()
Heinrich Schuchardt [Fri, 26 Apr 2024 14:13:19 +0000 (16:13 +0200)]
efi_loader: return binary from efi_dp_from_lo()

For finding distro supplied device-trees we need to know from which device
we are booting. This can be identified via the device-path of the binary.

Up to now efi_dp_from_lo() only could return the initrd or fdt device-path.
Allow returning the binary device-path, too.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agoefi_loader: move distro_efi_get_fdt_name()
Heinrich Schuchardt [Fri, 26 Apr 2024 14:13:18 +0000 (16:13 +0200)]
efi_loader: move distro_efi_get_fdt_name()

Move distro_efi_get_fdt_name() to a separate C module
and rename it to efi_get_distro_fdt_name().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agoefi_loader: load device-tree specified in boot option
Heinrich Schuchardt [Fri, 26 Apr 2024 14:13:17 +0000 (16:13 +0200)]
efi_loader: load device-tree specified in boot option

We allow to specify the triple of binary, initrd, and device-tree in boot
options.

Add the code to actually load the specified device-tree.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agocmd: efidebug: add support for setting fdt
Heinrich Schuchardt [Fri, 26 Apr 2024 14:13:12 +0000 (16:13 +0200)]
cmd: efidebug: add support for setting fdt

We already support creating a load option where the device-path
field contains the concatenation of the binary device-path and
optionally the device path of the initrd which we expose via the
EFI_LOAD_FILE2_PROTOCOL.

Allow to append another device-path pointing to the device-tree
identified by the device-tree GUID.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agocmd: eficonfig: add support for setting fdt
Heinrich Schuchardt [Fri, 26 Apr 2024 14:13:11 +0000 (16:13 +0200)]
cmd: eficonfig: add support for setting fdt

We already support creating a load option where the device-path
field contains the concatenation of the binary device-path and
optionally the device path of the initrd which we expose via the
EFI_LOAD_FILE2_PROTOCOL.

Allow to append another device-path pointing to the device-tree
identified by the device-tree GUID.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agoefi_loader: allow concatenation with contained end node
Heinrich Schuchardt [Fri, 24 May 2024 12:54:26 +0000 (14:54 +0200)]
efi_loader: allow concatenation with contained end node

Allow appending a device-path to a device-path that contains an end node
as separator. We need this feature for creating boot options specifying
kernel, initrd, and dtb.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agoAdded arm64 assembly for examples/api crt0
Brunham, Kalen [Fri, 17 May 2024 19:13:48 +0000 (19:13 +0000)]
Added arm64 assembly for examples/api crt0

I've encountered a problem when compiling the 'examples/api' directory for ARM64 in U-boot. The problem lies in the assembly code in 'examples/api/crt0.S' where the current CONFIG_ARM code is only 32-bit. When targeting ARM64, a 64-bit version is necessary.

I have proposed a fix by including a 'CONFIG_ARM64' section in the assembly code as shown below.  These changes have been check via https://github.com/u-boot/u-boot/pull/538.

Feedback is welcome.

Signed-off-by: Kalen Brunham <kalen.brunham@intel.com>
6 months agoabootimg: Add init_boot image support
Roman Stratiienko [Thu, 23 May 2024 07:06:07 +0000 (07:06 +0000)]
abootimg: Add init_boot image support

Quote from [1]:

"For devices launching with Android 13, the generic ramdisk is removed
from the boot image and placed in a separate init_boot image.
This change leaves the boot image with only the GKI kernel."

While at it, update wrong error handling message when vendor_boot
cannot be loaded.

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

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
6 months agoandroid: Fix ramdisk loading for bootimage v3+
Roman Stratiienko [Sun, 19 May 2024 13:09:51 +0000 (13:09 +0000)]
android: Fix ramdisk loading for bootimage v3+

The boot_ramdisk and vendor_ramdisk must be both concatenated together.
Without this change, Android root is missing some of the necessary tools
to complete virtual AB OTA.

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
6 months agoarm: move _end to linker symbols
Ilias Apalodimas [Tue, 28 May 2024 06:18:27 +0000 (09:18 +0300)]
arm: move _end to linker symbols

commit 6e2228fb052b ("Merge patch series "Clean up arm linker scripts")
was cleaning up linker scripts for armv7 and v8 but was leaving
_end and __secure_stack_start/end.

commit d0b5d9da5de2 ("arm: make _end compiler-generated")
was moving _end to be compiler generated. _end is defined as c variable
in its own section to force the compiler emit relative a reference.
However, defining those in the linker script will do the same thing
since [0].

So let's remove the special sections from the linker scripts, the
variable definitions from sections.c and define them as a symbols.
It's worth noting that _image_binary_end symbol is now redundant and
can be removed in the future.

- SPL

The .end section has been removed from the new binary
[ 5] .end
     PROGBITS         00000000fffdf488  000000000002f488  0
     0000000000000000 0000000000000000  0                 1
     [0000000000000003]: WRITE, ALLOC

$~ bloat-o-meter kria_old/spl/u-boot-spl krina_new/spl/u-boot-spl
add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0)
Function                                     old     new   delta
Total: Before=115980, After=115980, chg +0.00%

$~ readelf -sW kria_old/u-boot kria_new/u-boot | grep -w _end
 12047: 000000000813a0f0     0 OBJECT  GLOBAL DEFAULT   11 _end
 12047: 000000000813a118     0 NOTYPE  GLOBAL DEFAULT   11 _end

$~ readelf -sW kria_old/spl/u-boot-spl kria_new/spl/u-boot-spl | grep -w _end
  1605: 00000000fffdf488     0 OBJECT  GLOBAL DEFAULT    5 _end
  1603: 00000000fffdf498     0 NOTYPE  GLOBAL DEFAULT    4 _end

$~ readelf -sW old/u-boot new/u-boot | grep -w _end
  8847: 0000000000103710     0 OBJECT  GLOBAL DEFAULT   11 _end
  8847: 0000000000103738     0 NOTYPE  GLOBAL DEFAULT   11 _end

$~ readelf -sW old_v7/u-boot new_v7/u-boot | grep -w _end
 10638: 000da824     0 OBJECT  GLOBAL DEFAULT   10 _end
 10637: 000da84c     0 NOTYPE  GLOBAL DEFAULT   10 _end

- For both QEMU instances
$~ bloat-o-meter old/u-boot new/u-boot
add/remove: 0/0 grow/shrink: 1/0 up/down: 20/0 (20)
Function                                     old     new   delta
version_string                                50      70     +20
Total: Before=656915, After=656935, chg +0.00%

[0] binutils commit 6b3b0ab89663 ("Make linker assigned symbol dynamic only for shared object")

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
6 months agoimage: Set load_end on partial loads
Mattijs Korpershoek [Thu, 23 May 2024 09:27:09 +0000 (11:27 +0200)]
image: Set load_end on partial loads

When decompressing, it's possible that the algorithm only performs
a partial decompression.
This usually happens when CONFIG_SYS_BOOTM_LEN is too small for
the uncompressed image.

When that happens, image_decomp() returns an error and *load_end == load.
The error is then handled by handle_decomp_error().

handle_decomp_error() expects the number of uncompressed bytes in
uncomp_size but receives *load_end - load == load - load == 0.

Because of this, handle_decomp_error does not report the expected
"Image too large: increase CONFIG_SYS_BOOTM_LEN" error message.

Modify the image_decomp() logic to always report the decompressed size,
even when a partial decompression happened.

Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
6 months agofs: relax ext4_write_file() dependency
Baruch Siach [Wed, 15 May 2024 04:37:16 +0000 (07:37 +0300)]
fs: relax ext4_write_file() dependency

ext4_write_file() depends on CONFIG_EXT4_WRITE. Allow build without
CONFIG_CMD_EXT4_WRITE.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
6 months agodm: use newly added linux/compat alloc functions
Maxim Moskalets [Wed, 15 May 2024 20:13:30 +0000 (23:13 +0300)]
dm: use newly added linux/compat alloc functions

Signed-off-by: Maxim Moskalets <maximmosk4@gmail.com>
6 months agomemory: ti-gpmc: use printf to dump settings/timings
Roger Quadros [Wed, 15 May 2024 12:20:08 +0000 (15:20 +0300)]
memory: ti-gpmc: use printf to dump settings/timings

pr_info() depends on CONFIG_LOGLEVEL > 6. If user has
enabled CONFIG_TI_GPMC_DEBUG then we should print the
GPMC settings/timings regardless of CONFIG_LOGLEVEL.

So use printf() instead of pr_info().

Signed-off-by: Roger Quadros <rogerq@kernel.org>
6 months agoarm: dts: k3-j7200: Move to OF_UPSTREAM
Aniket Limaye [Tue, 21 May 2024 05:48:42 +0000 (11:18 +0530)]
arm: dts: k3-j7200: Move to OF_UPSTREAM

Move to using OF_UPSTREAM config and thus using the devicetree-rebasing
subtree.

Signed-off-by: Aniket Limaye <a-limaye@ti.com>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
6 months agoinclude: extension_board: Increase overlay file name size
Daniel Schultz [Wed, 22 May 2024 07:21:00 +0000 (00:21 -0700)]
include: extension_board: Increase overlay file name size

Upstream overlays like the ARM64 TI
k3-am625-beagleplay-csi2-tevi-ov5640.dtso can easily have more then
32 characters. Increase the overlay length to 64 characters to
apply overlays with longer names.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Acked-by: Kory Maincent <kory.maincent@bootlin.com>
6 months agoMerge patch series "*** phyCORE-AM62x: DDR detection / Inject DDR timing deltas ***"
Tom Rini [Fri, 7 Jun 2024 20:03:36 +0000 (14:03 -0600)]
Merge patch series "*** phyCORE-AM62x: DDR detection / Inject DDR timing deltas ***"

Wadim Egorov <w.egorov@phytec.de> says:

Changes in v2:
  - Reabse to current next
  - Add Tested-by: John Ma <jma@phytec.com>
  - Add Kconfig option to select RAM size statically
  - Make board/phytec/common/k3 always compile for CONFIG_ARCH_K3

v1: https://lists.denx.de/pipermail/u-boot/2024-May/553057.html

6 months agoboard: phytec: am62x: Add support for 1 & 4 GB RAM variants
Wadim Egorov [Wed, 22 May 2024 07:55:05 +0000 (09:55 +0200)]
board: phytec: am62x: Add support for 1 & 4 GB RAM variants

Use content of EEPROM to detect the actual RAM size and adjust
DDR timings, size and banks accordingly.
Also enable the SoM detection per default in the defconfigs.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: John Ma <jma@phytec.com>
6 months agoboard: phytec: common: Introduce a method to inject DDR timings deltas
Wadim Egorov [Wed, 22 May 2024 07:55:04 +0000 (09:55 +0200)]
board: phytec: common: Introduce a method to inject DDR timings deltas

Introduce fdt_apply_ddrss_timings_patch() to allow board code to
override DDR settings in the device tree prior to DDRSS driver probing.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: John Ma <jma@phytec.com>
6 months agoarm: mach-k3: am625: Call do_board_detect() before DDR probing
Wadim Egorov [Wed, 22 May 2024 07:55:03 +0000 (09:55 +0200)]
arm: mach-k3: am625: Call do_board_detect() before DDR probing

Call do_board_detect() hook before the K3 DDRSS driver gets probed.
It will allow boards to adjust DDR timings in do_board_detect().

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: John Ma <jma@phytec.com>
6 months agoboard: phytec: Fix function definitions in AM6x SOM detection
Wadim Egorov [Wed, 22 May 2024 07:55:02 +0000 (09:55 +0200)]
board: phytec: Fix function definitions in AM6x SOM detection

Functions are declared as phytec_am6* and not phytec_am62*.
Update the definitions to match the declarations.

Fixes: 9d152c23279c ("board: phytec: Add SOM detection for AM6x")
Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: John Ma <jma@phytec.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
6 months agoboard: phytec: Make AM6 SoM detection depend on I2C
Wadim Egorov [Wed, 22 May 2024 07:55:01 +0000 (09:55 +0200)]
board: phytec: Make AM6 SoM detection depend on I2C

SoM detection is using I2C driver model functions.
Let's depend on I2C.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: John Ma <jma@phytec.com>
Reviewed-by: Dhruva Gole <d-gole@ti.com>
6 months agoMerge patch series "PHYTEC SOM Detection API v3"
Tom Rini [Fri, 7 Jun 2024 20:02:02 +0000 (14:02 -0600)]
Merge patch series "PHYTEC SOM Detection API v3"

Daniel Schultz <d.schultz@phytec.de> says:

This patch series adds support for the EEPROM v3 API.

V3 is backwards compatible to V2 and therefore, the V2 image still
exists at the beginning. Only the API version changed from 2 to 3.

V3 is a block-based memory layout organized as singled-linked list
with different types of blocks. This is a more flexible approach and
allows us to extend it by more block types in the future.

The V3 data starts with a 8-byte large header which defines the
block count (u8), V3 subversion (u8) and data payload length (u16).
Additionally the header contains a CRC8 checksum a 3 reserved bytes.

Each block starts with a 4-byte large header which defined the
block type (u8), the absolute address of the next block (u16) and a
CRC8 checksum. The content itself is defined via the block type and
we currently have 2 different types:

1) MAC: Contains the Ethernet interface number (u8), MAC address
        (6 x u8) and a CRC8 checksum.

6 months agoconfigs: phycore_am62x_a53_defconfig: Enable CONFIG_ENV_OVERWRITE
Daniel Schultz [Wed, 22 May 2024 06:18:27 +0000 (23:18 -0700)]
configs: phycore_am62x_a53_defconfig: Enable CONFIG_ENV_OVERWRITE

Enable CONFIG_ENV_OVERWRITE to overwrite ethaddr in the environment.
This is required because our environment is not located in the
boot partition.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
6 months agoboard: phytec: common: k3: Set MAC
Daniel Schultz [Wed, 22 May 2024 06:18:26 +0000 (23:18 -0700)]
board: phytec: common: k3: Set MAC

Read the EEPROM API v3 content and set all available
MAC-Addresses to the environment.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
6 months agoboard: phytec: common: Add API v3
Daniel Schultz [Wed, 22 May 2024 06:18:25 +0000 (23:18 -0700)]
board: phytec: common: Add API v3

This API is based on a block structure with a 8 Byte large
API v3 header and various of different blocks following. It extends
our current API v2, which is always 32 Byte large, and is located
directly after v2.

Add the MAC block as first block type. It contains the physical
Ehternet interface number, a MAC address and a CRC checksum over the
MAC payload.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
6 months agoboard: phytec: common: Move API v2 init to new function
Daniel Schultz [Wed, 22 May 2024 06:18:24 +0000 (23:18 -0700)]
board: phytec: common: Move API v2 init to new function

Move the entire initialization code for API v2 into a dedicated
function. This rework will allow to easily integrate the API v3
as next step during init.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
6 months agoboard: phytec: common: Define PHYTEC_API2_DATA_LEN
Daniel Schultz [Wed, 22 May 2024 06:18:23 +0000 (23:18 -0700)]
board: phytec: common: Define PHYTEC_API2_DATA_LEN

The EEPROM image length for API v2 is fixed to 32 bytes. No need
to use sizeof while this value won't change. This value is
also be required for API v3 to know where the API v3 header starts.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
6 months agoboard: phytec: common: Move eeprom read to new function
Daniel Schultz [Wed, 22 May 2024 06:18:22 +0000 (23:18 -0700)]
board: phytec: common: Move eeprom read to new function

We need to read multiple times from different offsets in API v3.
Move the EEPROM read logic into a dedicated function to make it
usable multiple times.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Tested-by: Wadim Egorov <w.egorov@phytec.de>
6 months agoMerge patch series "Add remoteproc support for J784S4 SoCs"
Tom Rini [Fri, 7 Jun 2024 20:01:38 +0000 (14:01 -0600)]
Merge patch series "Add remoteproc support for J784S4 SoCs"

Beleswar Padhi <b-padhi@ti.com> says:

Hello All,

This series adds remoteproc support for TI's J784S4 SoCs. The K3 J784S4
SoCs have four dual-core R5F subsystems and four C71x DSP subsystems.
Enable the remoteproc drivers in defconfig and set the rproc firmware
names to add remoteproc support.

Note: No driver changes are required as J784S4 SoCs have the same data
as J721S2 SoCs. Thus, utilize the existing compatible string for driver
probe.

6 months agoboard: ti: j784s4: j784s4.env: Set remoteproc firmware names
Beleswar Padhi [Wed, 22 May 2024 04:53:31 +0000 (10:23 +0530)]
board: ti: j784s4: j784s4.env: Set remoteproc firmware names

Include k3_rproc.env to access rproc boot commands and specify
rproc firmware names for adding remoteproc support in J784S4 SoCs.

Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
6 months agoconfigs: j784s4_evm_a72_defconfig: Enable remoteproc drivers
Beleswar Padhi [Wed, 22 May 2024 04:53:30 +0000 (10:23 +0530)]
configs: j784s4_evm_a72_defconfig: Enable remoteproc drivers

The K3 J784S4 SoC has four dual-core R5F subsystems and four C71x DSP
subsystems. Set config values to enable the remoteproc functionality
with these R5F and DSP subsystems.

Signed-off-by: Beleswar Padhi <b-padhi@ti.com>
6 months agoMerge patch series "Adding support to load secure firmware for HS devices"
Tom Rini [Fri, 7 Jun 2024 20:01:15 +0000 (14:01 -0600)]
Merge patch series "Adding support to load secure firmware for HS devices"

Udit Kumar <u-kumar1@ti.com> says:

Some use case needs rproc firmware to be loaded at u-boot stage,
using following commands at u-boot shell, firmware could be loaded

=> setenv dorprocboot 1
=> run boot_rprocs

For Secure devices, secure version of rproc firmware should be loaded,
which is appended by sec keyword[0].
but currently non-secure firmware is loaded even for secure devices.
So adding support for loading secure firmware on Secured devices.

[0]: https://gist.github.com/uditkumarti/cd8bf6a448079b59145d17a0e8bf13b7

Bootlogs:
GP : https://gist.github.com/uditkumarti/23a00c313e1c28b62537aab733a585df#file-gp_device line 65 onwards
HS : https://gist.github.com/uditkumarti/23a00c313e1c28b62537aab733a585df#file-hs-device line 60 onwards

6 months agomach-k3: common.c: add a flag for booting authenticated rproc binaries
Manorit Chawdhry [Tue, 21 May 2024 10:56:48 +0000 (16:26 +0530)]
mach-k3: common.c: add a flag for booting authenticated rproc binaries

The flag will be used for booting authenticated remote procs from hs-se
devices which can optionally be used in hs-fs devices also.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 months agoinclude: env: ti: Add support for secure firmwares
Udit Kumar [Tue, 21 May 2024 10:56:47 +0000 (16:26 +0530)]
include: env: ti: Add support for secure firmwares

Secure firmwares must be loaded if SOC is secure,
currently rproc framework chooses non-secure firmware always.

So adding support to load secure firmware, when SOC is secure

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 months agodrivers: remoteproc: ti_k3 : enable secure booting with firmware images
Manorit Chawdhry [Tue, 21 May 2024 10:56:46 +0000 (16:26 +0530)]
drivers: remoteproc: ti_k3 : enable secure booting with firmware images

Remoteproc firmware images aren't authenticated in the current boot flow.
Authenticates remoteproc firmware images to complete the root of trust
in secure booting.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 months agoinclude: mach-k3: move k3 security functions to security.h
Manorit Chawdhry [Tue, 21 May 2024 10:56:45 +0000 (16:26 +0530)]
include: mach-k3: move k3 security functions to security.h

ti_secure_image_post_process and ti_secure_image_check_binary is used
for the authentication purposes in the current boot flow. Authentication
of remoteproc firmware images require ti_secure_image_post_process to be
available outside mach-k3.

Signed-off-by: Manorit Chawdhry <m-chawdhry@ti.com>
Signed-off-by: Udit Kumar <u-kumar1@ti.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> # Intel Edison
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
6 months agoMerge patch series "k3-j721e: Enable OF_UPSTREAM for J721E"
Tom Rini [Fri, 7 Jun 2024 20:00:26 +0000 (14:00 -0600)]
Merge patch series "k3-j721e: Enable OF_UPSTREAM for J721E"

Neha Malcom Francis <n-francis@ti.com> says:

This series was plucked out from the larger series [1] that did some
templating reformatting and also enabled OF_UPSTREAM for J721E. The
former has been kept aside till all the platforms affected have moved to
using OF_UPSTREAM to have less conflicts while merging.

Patches split J721E EVM and J721E SK to using separate builds, as well
as enable OF_UPSTREAM for both the platforms.

Boot logs:
https://gist.github.com/nehamalcom/8f326376b6c6b1196084721405159bb9

[1] https://lore.kernel.org/all/20240322131011.1029620-1-n-francis@ti.com/

6 months agoarm: dts: k3-j721e: Move to OF_UPSTREAM
Neha Malcom Francis [Mon, 20 May 2024 09:59:16 +0000 (15:29 +0530)]
arm: dts: k3-j721e: Move to OF_UPSTREAM

Move to using OF_UPSTREAM config and thus using the devicetree-rebasing
subtree.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Acked-by: Sumit Garg <sumit.garg@linaro.org>
6 months agoconfigs: j721e_sk: Move to separate defconfig for J721E SK board
Neha Malcom Francis [Mon, 20 May 2024 09:59:15 +0000 (15:29 +0530)]
configs: j721e_sk: Move to separate defconfig for J721E SK board

Add defconfig for J721E SK R5 and A72 configuration.

This includes and modifies the J721E EVM defconfigs:
j721e_evm_r5_defconfig -> j721e_sk_r5_defconfig
j721e_evm_a72_defconfig -> j721e_sk_a72_defconfig

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
6 months agoarm: dts: k3-j721e-r5*: Introduce k3-j721e-r5.dtsi
Neha Malcom Francis [Mon, 20 May 2024 09:59:14 +0000 (15:29 +0530)]
arm: dts: k3-j721e-r5*: Introduce k3-j721e-r5.dtsi

Introduce k3-j721e-r5.dtsi to be used by board R5 DTS files. This
helps sync SoC changes across boards.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Manorit Chawdhry <m-chawdhry@ti.com>
6 months agoMerge patch series "arm: dts: k3-am625-verdin: Enable LPDDR4 WDQS control"
Tom Rini [Fri, 7 Jun 2024 19:58:25 +0000 (13:58 -0600)]
Merge patch series "arm: dts: k3-am625-verdin: Enable LPDDR4 WDQS control"

Emanuele Ghidoli <emanuele.ghidoli@toradex.com> says:

Manually, since SysConfig tool do not have the relevant option,
set PHY_LP4_WDQS_OE_EXTEND to 1.
Since WDQS control mode is required on our modules LPDDR4,
this enables WDQS control mode 1.

6 months agoarm: dts: k3-am625-verdin: Enable LPDDR4 WDQS control
Emanuele Ghidoli [Wed, 15 May 2024 08:00:58 +0000 (10:00 +0200)]
arm: dts: k3-am625-verdin: Enable LPDDR4 WDQS control

Manually, since SysConfig tool do not have the relevant option,
set PHY_LP4_WDQS_OE_EXTEND to 1.
Since WDQS control mode is required on our modules LPDDR4,
this enables WDQS control mode 1.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
6 months agoarm: dts: k3-am625-verdin: Update autogenerated LPDDR4 configuration
Emanuele Ghidoli [Wed, 15 May 2024 08:00:57 +0000 (10:00 +0200)]
arm: dts: k3-am625-verdin: Update autogenerated LPDDR4 configuration

Update the autogenerated LPDDR4 configuration using the latest available
SysConfig tool.
This changes are cosmetic and are made to track the last used tool version.

Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
6 months agoMerge patch series "'eeprom' command improvements"
Tom Rini [Fri, 7 Jun 2024 16:48:41 +0000 (10:48 -0600)]
Merge patch series "'eeprom' command improvements"

Marek Behún <kabel@kernel.org> says:

This series contains improvements for the 'eeprom' command:
- refactors
- fixes
- improvements
- ability to use driver model EEPROMs (uclass UCLASS_I2C_EEPROM)
- more flexible EEPROM layout support

It should not cause any behavior change for any existing board.

This series is a dependency for some DDR issue fixes for Turris Omnia.
I will be sending that one separately.

github PR link (with CI):
  https://github.com/u-boot/u-boot/pull/540
- there is a failure for
    test.py for sandbox sandbox_clang
  but it seems unrelated to these changes

6 months agocmd: eeprom: Extend to EEPROMs probed via driver model
Marek Behún [Tue, 21 May 2024 07:13:35 +0000 (09:13 +0200)]
cmd: eeprom: Extend to EEPROMs probed via driver model

Extend the 'eeprom' command to allow accessing EEPROMs probed via
driver model, uclass UCLASS_I2C_EEPROM.

When the CONFIG_I2C_EEPROM config option is enabled (and so the
i2c-eeprom driver is built), the 'eeprom' command now accepts driver
model device name as EEPROM specifier for the 'eeprom' command, in
addition to the legacy [[bus] devaddr] specifier.

Moreover if no device specifier is given, then the first
UCLASS_I2C_EEPROM device is used, if found.

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocmd: eeprom: Don't read/write whole EEPROM if not necessary
Marek Behún [Tue, 21 May 2024 07:13:34 +0000 (09:13 +0200)]
cmd: eeprom: Don't read/write whole EEPROM if not necessary

Don't read/write whole EEPROM if not necessary when printing / updating
EEPROM layout fields. Only read/write layout.data_size bytes.

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocmd: eeprom: Refactor command execution into function by action
Marek Behún [Tue, 21 May 2024 07:13:33 +0000 (09:13 +0200)]
cmd: eeprom: Refactor command execution into function by action

Refactor the eeprom_execute_command() function into separate functions
do_eeprom_rw(), do_eeprom_print() and do_eeprom_update().

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocmd: eeprom: Refactor eeprom device specifier parsing
Marek Behún [Tue, 21 May 2024 07:13:32 +0000 (09:13 +0200)]
cmd: eeprom: Refactor eeprom device specifier parsing

In preparation for allowing to access eeprom by driver-model device
name, refactor the eeprom device specifier parsing. Instead of filling
two parameters (i2c_bus, i2c_addr), the parsing function now fills one
parameter of type struct eeprom_dev_spec.

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocmd: eeprom: Deduplicate parse_i2c_bus_addr() calls
Marek Behún [Tue, 21 May 2024 07:13:31 +0000 (09:13 +0200)]
cmd: eeprom: Deduplicate parse_i2c_bus_addr() calls

Deduplicate the calls to parse_i2c_bus_addr().

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocmd: eeprom: Hide eeprom layout versioning behind a Kconfig option
Marek Behún [Tue, 21 May 2024 07:13:30 +0000 (09:13 +0200)]
cmd: eeprom: Hide eeprom layout versioning behind a Kconfig option

Add a new Kconfig option EEPROM_LAYOUT_VERSIONS, and hide eeprom
layout versionsing code behind it. Only print the relevant help in
'eeprom' command usage if this option is enabled.

Enable this new option for cm_fx6_defconfig and cm_t43_defconfig.
These are the only boards using EEPROM layout versioning.

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocmd: eeprom: Fix usage help for the eeprom command
Marek Behún [Tue, 21 May 2024 07:13:29 +0000 (09:13 +0200)]
cmd: eeprom: Fix usage help for the eeprom command

The bus and devaddr arguments of the eeprom command are optional, and if
only one is given, it is assumed to be devaddr. Change the usage help
from
  <bus> <devaddr>
to
  [[bus] [devaddr]

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocommon: eeprom_field: Drop unnecessary comparison
Marek Behún [Tue, 21 May 2024 07:13:28 +0000 (09:13 +0200)]
common: eeprom_field: Drop unnecessary comparison

The byte variable is of type unsigned char, it is never less than zero.
The error case is handled by *endptr, so drop the comparison altogether.

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocommon: eeprom_field: Fix updating binary field
Marek Behún [Tue, 21 May 2024 07:13:27 +0000 (09:13 +0200)]
common: eeprom_field: Fix updating binary field

The __eeprom_field_update_bin() function is expected to parse a hex
string into bytes (potentially in reverse order), but the
simple_strtoul() function is given 0 as base. This does not work since
the string does not contain '0x' prefix. Add explicit base 16.

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocommon: eeprom_layout: Split field finding code from the field update function
Marek Behún [Tue, 21 May 2024 07:13:26 +0000 (09:13 +0200)]
common: eeprom_layout: Split field finding code from the field update function

Split the eeprom layout field finding code from the
eeprom_layout_update_field() function in order to make it usable in
alternative implementations of update method.

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agocommon: eeprom_layout: Assign default layout methods and parameters before specific...
Marek Behún [Tue, 21 May 2024 07:13:25 +0000 (09:13 +0200)]
common: eeprom_layout: Assign default layout methods and parameters before specific ones

Assign the default eeprom layout parameter .data_size and methods
.print() and .update() before calling eeprom_layout_assign() in
eeprom_layout_setup().

This allows eeprom_layout_assign() to overwrite these if needed.

Signed-off-by: Marek Behún <kabel@kernel.org>
6 months agoMerge tag 'v2024.07-rc4' into next
Tom Rini [Tue, 4 Jun 2024 00:42:11 +0000 (18:42 -0600)]
Merge tag 'v2024.07-rc4' into next

Prepare v2024.070-rc4

6 months agoPrepare v2024.07-rc4
Tom Rini [Tue, 4 Jun 2024 00:34:59 +0000 (18:34 -0600)]
Prepare v2024.07-rc4

Signed-off-by: Tom Rini <trini@konsulko.com>
6 months agoMerge tag 'u-boot-imx-next-20240603' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Mon, 3 Jun 2024 17:42:51 +0000 (11:42 -0600)]
Merge tag 'u-boot-imx-next-20240603' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx into next

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

- Support different RAM sizes on imx8m phycoce boards.
- Support new toradex variants.
- Support Samsung 4GB DDR and Realtek RTL8211E PHY on imx8mm-cl-iot-gate.
- Convert imx8mm-phycore and imx8mp-phycore boards to use OF_UPSTREAM.

6 months agoMerge branch 'next-cleanup' of https://source.denx.de/u-boot/custodians/u-boot-sh...
Tom Rini [Mon, 3 Jun 2024 17:42:38 +0000 (11:42 -0600)]
Merge branch 'next-cleanup' of https://source.denx.de/u-boot/custodians/u-boot-sh into next

6 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-samsung
Tom Rini [Mon, 3 Jun 2024 15:48:03 +0000 (09:48 -0600)]
Merge https://source.denx.de/u-boot/custodians/u-boot-samsung

6 months agoMerge branch 'master-cleanup' of https://source.denx.de/u-boot/custodians/u-boot-sh
Tom Rini [Mon, 3 Jun 2024 15:47:43 +0000 (09:47 -0600)]
Merge branch 'master-cleanup' of https://source.denx.de/u-boot/custodians/u-boot-sh

6 months agoimx8mm-cl-iot-gate: Add support for the Realtek RTL8211E PHY
Fabio Estevam [Tue, 28 May 2024 19:15:10 +0000 (16:15 -0300)]
imx8mm-cl-iot-gate: Add support for the Realtek RTL8211E PHY

Newer imx8mm-cl-iot-gate versions are populated with a Realtek RTL8211E
PHY instead of the Atheros AR8033.

Adapted Compulab's patch from:
https://github.com/compulab-yokneam/meta-bsp-imx8mm/blob/iot-gate-imx8_5.10.72/recipes-bsp/u-boot/compulab/imx8mm/0125-imx8mm-net-enable-phy-Realtek-RTL8211E.patch

to support both PHYs in U-Boot.

Signed-off-by: Fabio Estevam <festevam@denx.de>
6 months agoimx8mm-cl-iot-gate: Add support for Samsung 4GB DDR
Fabio Estevam [Tue, 28 May 2024 19:15:09 +0000 (16:15 -0300)]
imx8mm-cl-iot-gate: Add support for Samsung 4GB DDR

Newer versions of the imx8mm-cl-iot-gate boards may come populated with a
Samsung 4GB DDR model.

Add support for it.

Signed-off-by: Fabio Estevam <festevam@denx.de>