]> git.dujemihanovic.xyz Git - u-boot.git/log
u-boot.git
7 months agorockchip: rk356x: Migrate to OF_UPSTREAM
Jonas Karlman [Sat, 4 May 2024 19:43:00 +0000 (19:43 +0000)]
rockchip: rk356x: Migrate to OF_UPSTREAM

Migrate RK356x boards that exists in Linux v6.8 to use OF_UPSTREAM.

Following targets is not migrated to use OF_UPSTREAM:
- anbernic-rgxx3-rk3566: Multi device target
- generic-rk3568: Generic target only meant for U-Boot use
- pinetab2-rk3566: Merged in v6.9-rc1

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk356x: Add rk3568-u-boot.dtsi
Jonas Karlman [Sat, 4 May 2024 19:42:59 +0000 (19:42 +0000)]
rockchip: rk356x: Add rk3568-u-boot.dtsi

Add a <CONFIG_SYS_SOC>-u-boot.dtsi file that gets included by default
for RK356x boards when a board specific u-boot.dtsi file dont exists.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Remove redundant device tree files
Jonas Karlman [Sat, 4 May 2024 19:42:58 +0000 (19:42 +0000)]
rockchip: rk3399: Remove redundant device tree files

Remove redundant device tree files now that RK3399 boards have been
migrated to use OF_UPSTREAM.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Migrate to OF_UPSTREAM
Jonas Karlman [Sat, 4 May 2024 19:42:57 +0000 (19:42 +0000)]
rockchip: rk3399: Migrate to OF_UPSTREAM

All RK3399 boards has now been synced to Linux kernel v6.8 DTs and can
migrate to use OF_UPSTREAM.

Migrate RK3399 boards that exists in Linux v6.8 to use OF_UPSTREAM.

Following target is not migrated to use OF_UPSTREAM:
- nanopi-m4-2gb-rk3399: DDR3 variant of nanopi-m4-rk3399 (LPDDR3)

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3328: Remove redundant device tree files
Jonas Karlman [Sat, 4 May 2024 19:42:56 +0000 (19:42 +0000)]
rockchip: rk3328: Remove redundant device tree files

Remove redundant device tree files now that RK3328 boards have been
migrated to use OF_UPSTREAM.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3328: Migrate to OF_UPSTREAM
Jonas Karlman [Sat, 4 May 2024 19:42:55 +0000 (19:42 +0000)]
rockchip: rk3328: Migrate to OF_UPSTREAM

All RK3328 boards has now been synced to Linux kernel v6.8 DTs and can
migrate to use OF_UPSTREAM.

Migrate all RK3328 boards to use OF_UPSTREAM.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3308: Remove redundant device tree files
Jonas Karlman [Sat, 4 May 2024 19:42:54 +0000 (19:42 +0000)]
rockchip: rk3308: Remove redundant device tree files

Remove redundant device tree files now that RK3308 boards have been
migrated to use OF_UPSTREAM.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3308: Migrate to OF_UPSTREAM
Jonas Karlman [Sat, 4 May 2024 19:42:53 +0000 (19:42 +0000)]
rockchip: rk3308: Migrate to OF_UPSTREAM

All RK3308 boards has now been synced to Linux kernel v6.8 DTs and can
migrate to use OF_UPSTREAM.

Migrate all RK3308 boards to use OF_UPSTREAM.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Drop ethernet0 alias from SoC u-boot.dtsi
Jonas Karlman [Wed, 1 May 2024 16:22:39 +0000 (16:22 +0000)]
rockchip: rk3399: Drop ethernet0 alias from SoC u-boot.dtsi

Remove the obsolete ethernet0 alias now that all board device tree files
have been fully synced with Linux kernel v6.8.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Christopher Obbard <chris.obbard@collabora.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
7 months agorockchip: rk3399-pinephone-pro: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:38 +0000 (16:22 +0000)]
rockchip: rk3399-pinephone-pro: Sync DT from v6.8 and update defconfig

Sync rk3399-pinephone-pro device tree from Linux kernel v6.8.

Add SPI flash related node and options to support boot from SPI flash.

Remove REGULATOR_PWM=y, board does not use pwm-regulator compatible.

Add SYS_NS16550_MEM32=y to use readl/writel for serial console.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-pinebook-pro: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:37 +0000 (16:22 +0000)]
rockchip: rk3399-pinebook-pro: Sync DT from v6.8 and update defconfig

Sync rk3399-pinebook-pro device tree from Linux kernel v6.8.

Add SF_DEFAULT_SPEED=10000000 and SPI_FLASH_SFDP_SUPPORT=y to improve
support for booting from SPI flash.

Add CMD_POWEROFF=y to support poweroff using cmdline and power on using
the pwr button on the board.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-rockpro64: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:36 +0000 (16:22 +0000)]
rockchip: rk3399-rockpro64: Sync DT from v6.8 and update defconfig

Sync rk3399-rockpro64 device tree from Linux kernel v6.8.

Add SF_DEFAULT_SPEED=10000000 and SPI_FLASH_SFDP_SUPPORT=y to improve
support for booting from SPI flash.

Remove USE_PREBOOT=y to speed up booting, standard boot will init USB
after faster boot media has been evaluated.

Add CMD_POWEROFF=y to support poweroff using cmdline and power on using
the pwr button on the board.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-rock-pi-4: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:35 +0000 (16:22 +0000)]
rockchip: rk3399-rock-pi-4: Sync DT from v6.8 and update defconfig

Sync rk3399-rock-pi-4 related device tree from Linux kernel v6.8.

Add SPI flash related nodes and options to support boot from SPI flash.

Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support SATA HAT.

Change to SPL_MAX_SIZE=0x40000, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Christopher Obbard <chris.obbard@collabora.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-khadas: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:34 +0000 (16:22 +0000)]
rockchip: rk3399-khadas: Sync DT from v6.8 and update defconfig

Sync rk3399-khadas related device tree from Linux kernel v6.8.

Add SPI flash related options to support booting from SPI flash.

Add DM_RESET=y to support reset signals.

Add PCI=y, CMD_PCI=y and NVME_PCI=y to support PCIe and NVMe boot.

Change to SPL_MAX_SIZE=0x40000, SPL can be up to 256 KiB.

Add CMD_ROCKUSB=y, CMD_USB_MASS_STORAGE=y and USB_GADGET=y to support
RockUSB and UMS gadget.

Remove CONFIG_NET_RANDOM_ETHADDR=y, ethaddr and eth1addr is set based on
cpuid read from eFUSE.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add MMC_SDHCI_SDMA=y to use DMA transfer for eMMC.

Add DM_ETH_PHY=y to support ethernet PHY.

Add PHY_ROCKCHIP_INNO_USB2=y and PHY_ROCKCHIP_TYPEC=y to support USB PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-rock960: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:33 +0000 (16:22 +0000)]
rockchip: rk3399-rock960: Sync DT from v6.8 and update defconfig

Sync rk3399-rock960 related device tree from Linux kernel v6.8.

Add DM_RESET=y to support reset signals.

Add PCI=y, CMD_PCI=y and NVME_PCI=y to support PCIe and NVMe boot.

Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support PCIe SATA boot.

Change to SPL_MAX_SIZE=0x40000, SPL can be up to 256 KiB.

Remove CONFIG_NET_RANDOM_ETHADDR=y, ethaddr and eth1addr is set based on
cpuid read from eFUSE.

Add MMC_SDHCI_SDMA=y to use DMA transfer for eMMC.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Add PHY_ROCKCHIP_INNO_USB2=y and PHY_ROCKCHIP_TYPEC=y to support USB PHY.

Remove REGULATOR_PWM=y and DM_REGULATOR_GPIO=y, boards does not use
pwm-regulator or regulator-gpio compatible.

Add USB_XHCI_HCD=y, USB_DWC3=y and USB_DWC3_GENERIC=y to support USB3.

Remove USE_PREBOOT=y to speed up booting, standard boot will init USB
after faster boot media has been evaluated.

Add CMD_ROCKUSB=y, CMD_USB_MASS_STORAGE=y and USB_GADGET=y to support
RockUSB and UMS gadget.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-nanopi-4: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:32 +0000 (16:22 +0000)]
rockchip: rk3399-nanopi-4: Sync DT from v6.8 and update defconfig

Sync rk3399-nanopi-4 related device tree from Linux kernel v6.8.

Add DM_RESET=y to support reset signals.

Add PCI=y, CMD_PCI=y and NVME_PCI=y to support PCIe and NVMe boot.

Add AHCI=y, SCSI_AHCI=y, AHCI_PCI=y and SCSI=y to support M4 SATA HAT.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add MMC_SDHCI_SDMA=y to use DMA transfer for eMMC.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Add PHY_ROCKCHIP_INNO_USB2=y and PHY_ROCKCHIP_TYPEC=y to support USB PHY.

Remove REGULATOR_PWM=y, boards does not use pwm-regulator compatible.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-roc-pc: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:31 +0000 (16:22 +0000)]
rockchip: rk3399-roc-pc: Sync DT from v6.8 and update defconfig

Sync rk3399-roc-pc related device tree from Linux kernel v6.8.

Add SF_DEFAULT_SPEED=30000000 and SPI_FLASH_SFDP_SUPPORT=y to improve
support for booting from SPI flash.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add MMC_SDHCI_SDMA=y to use DMA transfer for eMMC.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Remove USE_PREBOOT=y to speed up booting, standard boot will init USB
after faster boot media has been evaluated.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-orangepi: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:30 +0000 (16:22 +0000)]
rockchip: rk3399-orangepi: Sync DT from v6.8 and update defconfig

Sync rk3399-orangepi device tree from Linux kernel v6.8.

Add DM_RESET=y to support reset signals.

Change to SPL_MAX_SIZE=0x40000, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add MMC_SDHCI_SDMA=y to use DMA transfer for eMMC.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Add PHY_ROCKCHIP_INNO_USB2=y and PHY_ROCKCHIP_TYPEC=y to support USB PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-firefly: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:29 +0000 (16:22 +0000)]
rockchip: rk3399-firefly: Sync DT from v6.8 and update defconfig

Sync rk3399-firefly device tree from Linux kernel v6.8.

Change to SPL_MAX_SIZE=0x40000, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add MMC_SDHCI_SDMA=y to use DMA transfer for eMMC.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Add PHY_ROCKCHIP_INNO_USB2=y and PHY_ROCKCHIP_TYPEC=y to support USB PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-evb: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:28 +0000 (16:22 +0000)]
rockchip: rk3399-evb: Sync DT from v6.8 and update defconfig

Sync rk3399-evb device tree from Linux kernel v6.8.

Drop bootph prop for i2c0 and rk808 node, PMIC support is not included
in TPL/SPL and PMIC regulators are working fine in U-Boot proper.

Change to use sdmmc_cd pinconf and drop cd-gpios for card detect pin.

Change to SPL_MAX_SIZE=0x40000, SPL can be up to 256 KiB.

Remove CONFIG_NET_RANDOM_ETHADDR=y, ethaddr and eth1addr is set based on
cpuid read from eFUSE.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-leez: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:27 +0000 (16:22 +0000)]
rockchip: rk3399-leez: Sync DT from v6.8 and update defconfig

Sync rk3399-leez-p710 device tree from Linux kernel v6.8.

Add DM_RESET=y to support reset signals.

Change to SPL_MAX_SIZE=0x40000, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add MMC_SDHCI_SDMA=y to use DMA transfer for eMMC.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Add PHY_ROCKCHIP_INNO_USB2=y and PHY_ROCKCHIP_TYPEC=y to support USB PHY.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-eaidk-610: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:26 +0000 (16:22 +0000)]
rockchip: rk3399-eaidk-610: Sync DT from v6.8 and update defconfig

Sync rk3399-eaidk-610 device tree from Linux kernel v6.8.

Add DM_RESET=y to support reset signals.

Change to SPL_MAX_SIZE=0x40000, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add MMC_SDHCI_SDMA=y to use DMA transfer for eMMC.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Add PHY_ROCKCHIP_INNO_USB2=y and PHY_ROCKCHIP_TYPEC=y to support USB PHY.

Remove REGULATOR_PWM=y, board does not use pwm-regulator compatible.

Remove SPL_TINY_MEMSET=y to use full memset in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-rock-pi-n10: Sync DT from v6.8 and update defconfig
Jonas Karlman [Wed, 1 May 2024 16:22:25 +0000 (16:22 +0000)]
rockchip: rk3399-rock-pi-n10: Sync DT from v6.8 and update defconfig

Sync rk3399-rock-pi-n10 related device tree from Linux kernel v6.8.

Remove SPL_GPIO=y, board does not use gpio in SPL.

Change to SPL_MAX_SIZE=0x40000, SPL can be up to 256 KiB.

Add ROCKCHIP_IODOMAIN=y to configure io-domain voltage.

Add MMC_SDHCI_SDMA=y to use DMA transfer for eMMC.

Add PHY_REALTEK=y and DM_ETH_PHY=y to support ethernet PHY.

Remove REGULATOR_PWM=y, board does not use pwm-regulator compatible.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-puma: Sync DT from Linux kernel v6.8
Jonas Karlman [Wed, 1 May 2024 16:22:24 +0000 (16:22 +0000)]
rockchip: rk3399-puma: Sync DT from Linux kernel v6.8

Sync rk3399-puma related device tree from Linux kernel v6.8.

The vdd_log node is already part of rk3399-puma.dtsi, only keep the
regulator-init-microvolt prop in u-boot.dtsi.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-gru: Sync DT from Linux kernel v6.8
Jonas Karlman [Wed, 1 May 2024 16:22:23 +0000 (16:22 +0000)]
rockchip: rk3399-gru: Sync DT from Linux kernel v6.8

Sync rk3399-gru related device tree from Linux kernel v6.8.

The spi_flash symbol is no longer part of upstream DT, it is re-defined
to allow existing reference use in related u-boot.dtsi-files.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Sync SoC DT from Linux kernel v6.8
Jonas Karlman [Wed, 1 May 2024 16:22:22 +0000 (16:22 +0000)]
rockchip: rk3399: Sync SoC DT from Linux kernel v6.8

Sync RK3399 SoC common .dtsi-files from Linux kernel v6.8.

The ethernet0 alias is moved to rk3399-u-boot.dtsi in this patch, the
alias will be added in board specific .dts-files and finally removed
from rk3399-u-boot.dtsi in following patches.

The rng node is replaced with crypto0 and crypto1, both can supply
random numbers.

There is no other intended change with this patch.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agoclk: rockchip: rk3399: Add SCLK_USB3OTGx_REF support
Jonas Karlman [Wed, 1 May 2024 16:22:21 +0000 (16:22 +0000)]
clk: rockchip: rk3399: Add SCLK_USB3OTGx_REF support

The SCLK_USB3OTGx_REF clocks is used as reference clock for USB3 block.

Add simple support to get rate of SCLK_USB3OTGx_REF clocks to fix
reference clock period configuration.

Also replace use of 24000000 with the OSC_HZ constant.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agoclk: rockchip: rk3399: Improve support for SCLK_PCIEPHY_REF clock
Jonas Karlman [Wed, 1 May 2024 16:22:20 +0000 (16:22 +0000)]
clk: rockchip: rk3399: Improve support for SCLK_PCIEPHY_REF clock

rk3399-nanopi-4.dtsi try to set parent of and set rate to 100 MHz of the
SCLK_PCIEPHY_REF clock.

The existing enable/disable ops for SCLK_PCIEPHY_REF currently force
use of 24 MHz parent and rate.

Add improved support for setting parent and rate of the pciephy refclk
to driver to better support assign-clock props for pciephy refclk in DT.

This limited implementation only support setting 24 or 100 MHz rate,
and expect npll and clk_pciephy_ref100m divider to use default values.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agoclk: rockchip: rk3399: Add dummy support for ACLK_VDU clock
Jonas Karlman [Wed, 1 May 2024 16:22:19 +0000 (16:22 +0000)]
clk: rockchip: rk3399: Add dummy support for ACLK_VDU clock

rk3399.dtsi from linux v5.19 and newer try to set VDU clock rate to
400 MHz using an assigned-clock-rates prop of the CRU node.

U-Boot does not use or need this clock so add dummy support for getting
and setting ACLK_VDU clock rate to allow CRU driver to be loaded with an
updated rk3399.dtsi.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agoclk: rockchip: rk3399: Rename SCLK_DDRCLK to SCLK_DDRC
Jonas Karlman [Wed, 1 May 2024 16:22:18 +0000 (16:22 +0000)]
clk: rockchip: rk3399: Rename SCLK_DDRCLK to SCLK_DDRC

Sync rk3399-cru.h with one from Linux kernel v6.2+ and fix use of the
SCLK_DDRCLK name that was only used by U-Boot.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Configure sdmmc regulator pinctrl in SPL
Jonas Karlman [Tue, 30 Apr 2024 15:30:25 +0000 (15:30 +0000)]
rockchip: rk3399: Configure sdmmc regulator pinctrl in SPL

A few boards have shown to be required to properly configure pinctrl
for the fixed regulator gpio pin used by sdmmc before being able to read
from SD-cards.

Include the related gpio, regulator and pinctrl nodes and enable related
Kconfig options so that pinctrl can be configured in SPL for boards that
may be affected by such issue.

Also change to imply SPL_DM_SEQ_ALIAS for all boards because it must be
enabled for working gpio usage in SPL after a future DT sync.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Fix loading FIT from SD-card when booting from eMMC
Jonas Karlman [Tue, 30 Apr 2024 15:30:24 +0000 (15:30 +0000)]
rockchip: rk3399: Fix loading FIT from SD-card when booting from eMMC

When RK3399 boards run SPL from eMMC and fail to load FIT from eMMC due
to it being missing or checksum validation fails there can be a fallback
to read FIT from SD-card. However, without proper pinctrl configuration
reading FIT from SD-card may fail:

  U-Boot SPL 2024.04-rc4 (Mar 17 2024 - 22:54:45 +0000)
  Trying to boot from MMC2
  mmc_load_image_raw_sector: mmc block read error
  Trying to boot from MMC2
  mmc_load_image_raw_sector: mmc block read error
  Trying to boot from MMC1
  Card did not respond to voltage select! : -110
  mmc_init: -95, time 12
  spl: mmc init failed with error: -95
  SPL: failed to boot from all boot devices (err=-6)
  ### ERROR ### Please RESET the board ###

Fix this by tagging related sdhci, sdmmc and spi flash pinctrl nodes
with bootph props. Also move bootph for common nodes shared by all
boards to the SoC u-boot.dtsi.

eMMC, SD-Card and SPI flash nodes are also changed to only be tagged
with bootph props for SPL and U-Boot pre-reloc phases.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Include uart related pinctrl nodes in TPL/SPL
Jonas Karlman [Tue, 30 Apr 2024 15:30:23 +0000 (15:30 +0000)]
rockchip: rk3399: Include uart related pinctrl nodes in TPL/SPL

The initial serial console UART iomux is typically configured in
board_debug_uart_init() at TPL stage on Rockchip platform.

Later stages typically use pinctrl driver to configure iomux UART once
again based on the control FDT.

Include uart related pinctrl nodes in TPL/SPL control FDT to make it
possible for pinctrl driver to configure UART iomux at TPL/SPL stage.

Following debug log message may also be seen at U-Boot pre-reloc stage:

  ns16550_serial serial@ff1a0000: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19

This can be resolved by including bootph prop for U-Bood pre-reloc
phase (bootph-some-ram or bootph-all). However, this has intentionally
been excluded due to including it unnecessarily slows down boot around
200-400 ms.

Also add the clock-frequency prop similar to what has been done for
other Rockchip SoCs.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-puma: Move uart0 bootph to board u-boot.dtsi
Jonas Karlman [Tue, 30 Apr 2024 15:30:22 +0000 (15:30 +0000)]
rockchip: rk3399-puma: Move uart0 bootph to board u-boot.dtsi

rk3399-puma is the only supported board that use uart0 for serial
console, other RK3399 boards typically use uart2 for serial console
and may use uart0 for bluetooth.

Move setting bootph prop to board u-boot.dtsi to only include the uart0
node in TPL/SPL control FDT for the rk3399-puma target.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Fix bootph prop for vop nodes
Jonas Karlman [Tue, 30 Apr 2024 15:30:21 +0000 (15:30 +0000)]
rockchip: rk3399: Fix bootph prop for vop nodes

The vop nodes should not be included in TPL/SPL control FDT, it should
only be included at U-Boot proper pre-reloc phase.

Change to use bootph-some-ram prop to fix this.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Sort nodes in u-boot.dtsi files
Jonas Karlman [Tue, 30 Apr 2024 15:30:20 +0000 (15:30 +0000)]
rockchip: rk3399: Sort nodes in u-boot.dtsi files

Sort nodes alphabetically by name, symbol or reg addr in RK3399 related
u-boot.dtsi files. Also remove one of the duplicated &pmu nodes.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Remove inherited bootph-all props
Jonas Karlman [Tue, 30 Apr 2024 15:30:19 +0000 (15:30 +0000)]
rockchip: rk3399: Remove inherited bootph-all props

Remove superfluous bootph-all props already inherited from main soc
u-boot.dtsi file.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Add a default spl-boot-order prop
Jonas Karlman [Tue, 30 Apr 2024 15:30:18 +0000 (15:30 +0000)]
rockchip: rk3399: Add a default spl-boot-order prop

A lot of RK3399 boards use a u-boot,spl-boot-order of "same-as-spl",
&sdhci and &sdmmc.

Move this to rk3399-u-boot.dtsi and make this default for boards
currently missing a u-boot,spl-boot-order prop.

Before commit a7e69952eb6d ("rockchip: spl: Cache boot source id for
later use") it was required to include the SPI flash node in the
u-boot,spl-boot-order prop to successfully load FIT from SPI flash.

The SPI flash node reference has been dropped from spl-boot-order from
pinebook-pro, roc-pc and rockpro64 now that "same-as-spl" also gets
resolved to the SPI flash node and loading FIT from SPI flash works
without having the node explicitly referenced in spl-boot-order prop.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Remove use of xPL_MISC_DRIVERS options
Jonas Karlman [Tue, 30 Apr 2024 15:30:17 +0000 (15:30 +0000)]
rockchip: rk3399: Remove use of xPL_MISC_DRIVERS options

The TPL and/or SPL control FDT on RK3399 boards does not contain any
node with a compatible that is supported by driver/misc/ drivers.

Remove use of xPL_MISC_DRIVERS options to stop including e.g an unused
efuse driver in TPL and/or SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Enable DT overlay support on all boards
Jonas Karlman [Tue, 30 Apr 2024 15:30:16 +0000 (15:30 +0000)]
rockchip: rk3399: Enable DT overlay support on all boards

Imply OF_LIBFDT_OVERLAY Kconfig options to add device tree overlay
support on all RK3399 boards.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
7 months agorockchip: rk3399: Imply support for GbE PHY
Jonas Karlman [Tue, 30 Apr 2024 15:30:15 +0000 (15:30 +0000)]
rockchip: rk3399: Imply support for GbE PHY

Imply support for GbE PHY status parsing and configuration when support
for onboard ethernet is enabled.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
7 months agorockchip: rk3399: Enable random generator on all boards
Jonas Karlman [Tue, 30 Apr 2024 15:30:14 +0000 (15:30 +0000)]
rockchip: rk3399: Enable random generator on all boards

The RK3399 SoC contain a crypto engine block that can generate random
numbers.

Imply DM_RNG and RNG_ROCKCHIP Kconfig options to take advantage of the
random generator on all RK3399 boards. Also remove the unnecessary use
of a status = "okay" prop.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
7 months agorockchip: rk3399: Enable ARMv8 crypto and FIT checksum validation
Jonas Karlman [Tue, 30 Apr 2024 15:30:13 +0000 (15:30 +0000)]
rockchip: rk3399: Enable ARMv8 crypto and FIT checksum validation

The RK3399 SoC support the ARMv8 Cryptography Extensions, use of ARMv8
crypto can speed up FIT checksum validation in SPL.

Imply ARMV8_SET_SMPEN and ARMV8_CRYPTO to take advantage of the crypto
extensions for SHA256 when validating checksum of FIT images.

Imply SPL_FIT_SIGNATURE and LEGACY_IMAGE_FORMAT to enable FIT checksum
validation to almost all RK3399 boards.

The following boards have been excluded:
- chromebook_bob: SPL max size limitation of 120 KiB
- chromebook_kevin: SPL max size limitation of 120 KiB

Also imply OF_LIVE to help speed up init of U-Boot proper and disable
CONFIG_SPL_RAW_IMAGE_SUPPORT on leez-rk3399 to ensure SPL does not try
to jump to code that failed checksum validation.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399: Sort imply statements alphabetically
Jonas Karlman [Tue, 30 Apr 2024 15:30:12 +0000 (15:30 +0000)]
rockchip: rk3399: Sort imply statements alphabetically

Sort imply statements under ROCKCHIP_RK3399 alphabetically.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
7 months agorockchip: rk3399-ficus: Enable TPL and use common bss and stack addr
Jonas Karlman [Tue, 30 Apr 2024 15:30:11 +0000 (15:30 +0000)]
rockchip: rk3399-ficus: Enable TPL and use common bss and stack addr

The rk3399-ficus board is only using SPL and not TPL+SPL like all other
RK3399 boards, chromebook bob/kevin excluded. It does not seem to be any
technical reason why this board was left using only SPL.

Switch to use TPL+SPL and to use the common bss and stack addresses
introduced in commit 008ba0d56d00 ("rockchip: Add common default bss and
stack addresses"). Also add the missing DEFAULT_FDT_FILE option.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-puma: Use common bss and stack addresses
Jonas Karlman [Tue, 30 Apr 2024 15:30:10 +0000 (15:30 +0000)]
rockchip: rk3399-puma: Use common bss and stack addresses

The rk3399-puma board is currently using SPL stack and bss addr in SRAM,
the same addr typically used by TPL, this differs from most other RK3399
boards.

Switch to use the common bss and stack addresses introduced in commit
008ba0d56d00 ("rockchip: Add common default bss and stack addresses").

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-puma: Update SPL_PAD_TO Kconfig option
Jonas Karlman [Tue, 30 Apr 2024 15:30:09 +0000 (15:30 +0000)]
rockchip: rk3399-puma: Update SPL_PAD_TO Kconfig option

On rk3399-puma 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 IDBlock is located at
sector 64, the combined size of TPL+SPL (idbloader.img) cannot take up
more than 224 KiB:

  (0x200 - 64) x 512 = 0x38000 (224 KiB)

Adjust SPL_PAD_TO to match the used 0x200 sector offset.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agorockchip: rk3399-gru: Fix max SPL size on bob and kevin
Jonas Karlman [Tue, 30 Apr 2024 15:30:08 +0000 (15:30 +0000)]
rockchip: rk3399-gru: Fix max SPL size on bob and kevin

Chromebook bob and kevin typically run coreboot as the initial boot
loader, however, U-Boot proper can be used as a secondary boot loader.
It is also possible to run U-Boot SPL and proper bare metal, with SPL
and the U-Boot payload loaded from SPI flash.

Because of this chromebook bob and kevin only use SPL and not TPL+SPL
like other RK3399 boards, this mean that SPL is loaded to and run from
SRAM instead of DRAM.

The U-Boot payload is located at 0x40000 (256 KiB) offset in SPI flash
and because the BROM only read first 2 KiB for each 4 KiB page, the size
of SPL (idbloader.img) is limited to max 128 KiB.

The chosen bss start address further limits the size of SPL to 120 KiB.

  0xff8e0000 (SPL_BSS_START_ADDR) - 0xff8c2000 (SPL_TEXT_BASE) = 0x1e000

Update SPL_MAX_SIZE to reflect the 120 KiB max size limitation.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
7 months agoPrepare v2024.07-rc2
Tom Rini [Mon, 6 May 2024 19:54:17 +0000 (13:54 -0600)]
Prepare v2024.07-rc2

Signed-off-by: Tom Rini <trini@konsulko.com>
7 months agoMerge tag 'u-boot-imx-master-20240505' of https://gitlab.denx.de/u-boot/custodians...
Tom Rini [Sun, 5 May 2024 22:15:02 +0000 (16:15 -0600)]
Merge tag 'u-boot-imx-master-20240505' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx

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

- Add SPL variant of DM_RNG so that the DM_RNG can be disabled in SPL if
  necessary. This may be necessary due to e.g. size constraints of the SPL.
- dd SPL variant of SPL_FSL_CAAM_RNG so that the SPL_FSL_CAAM_RNG can be
  disabled in SPL if necessary. This may be necessary due to e.g.  size
  constraints of the SPL.
- Differentiate between CAAM and DCP in Kconfig entry.

7 months agocrypto/fsl: Differentiate between CAAM and DCP in Kconfig entry
Marek Vasut [Thu, 25 Apr 2024 23:02:09 +0000 (01:02 +0200)]
crypto/fsl: Differentiate between CAAM and DCP in Kconfig entry

Differentiate between "Enable Random Number Generator support" and
"Enable Random Number Generator support" in Kconfig entry, mark the
first as CAAM and the second as DCP, otherwise users cannot easily
decide which of the options is which and enable the correct one.

Signed-off-by: Marek Vasut <marex@denx.de>
7 months agocrypto/fsl: Introduce SPL_FSL_CAAM_RNG
Marek Vasut [Thu, 25 Apr 2024 23:02:08 +0000 (01:02 +0200)]
crypto/fsl: Introduce SPL_FSL_CAAM_RNG

Add SPL variant of SPL_FSL_CAAM_RNG so that the SPL_FSL_CAAM_RNG can
be disabled in SPL if necessary. This may be necessary due to e.g.
size constraints of the SPL.

Signed-off-by: Marek Vasut <marex@denx.de>
7 months agorng: Introduce SPL_DM_RNG
Marek Vasut [Thu, 25 Apr 2024 23:02:07 +0000 (01:02 +0200)]
rng: Introduce SPL_DM_RNG

Add SPL variant of DM_RNG so that the DM_RNG can be disabled in SPL
if necessary. This may be necessary due to e.g. size constraints of
the SPL.

Signed-off-by: Marek Vasut <marex@denx.de>
7 months agoMerge branch '2024-05-02-assorted-updates'
Tom Rini [Fri, 3 May 2024 22:18:51 +0000 (16:18 -0600)]
Merge branch '2024-05-02-assorted-updates'

- Typo fixes, gpt command fix, a few npcm fixes, fix a reported Coverity
  issue and increase the malloc pool on am62x_evm_r5 to fix some use
  cases.

7 months agoMAINTAINERS: update Broadcom BCMBCA maintainer
William Zhang [Fri, 3 May 2024 05:23:43 +0000 (22:23 -0700)]
MAINTAINERS: update Broadcom BCMBCA maintainer

Joel is no longer with Broadcom. Remove his email from bcmbca maintainer
list and replace him with myself for stack protection maintainer.

Signed-off-by: William Zhang <william.zhang@broadcom.com>
7 months agoconfigs: am62x_evm_r5: Increase size of malloc_simple heap after relocation
Judith Mendez [Mon, 29 Apr 2024 21:49:36 +0000 (16:49 -0500)]
configs: am62x_evm_r5: Increase size of malloc_simple heap after relocation

On AM62x SK we can see a boot failure with signature "alloc space
exhausted", so fix by increasing size of SPL_STACK_R_MALLOC_SIMPLE_LEN.

Fixes: 128f81290b ("arm: dts: k3: binman: am625: add support for signing TIFSSTUB Images")
Signed-off-by: Judith Mendez <jm@ti.com>
Tested-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
7 months agobinman: Fix typo in mkimage etype description
Marek Vasut [Thu, 25 Apr 2024 22:54:08 +0000 (00:54 +0200)]
binman: Fix typo in mkimage etype description

Fix a typo, no functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
7 months agoboard: arbel: Limit the dram effective size to bank0 maximal size
Jim Liu [Tue, 23 Apr 2024 07:22:10 +0000 (15:22 +0800)]
board: arbel: Limit the dram effective size to bank0 maximal size

For 4GB dram size, the dram is divided into 2 banks and
the address space of these 2 banks are not concatenated.
Limit the gd->ram_top to not exceed bank0 top to prevent
accessing invalid memory region.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
7 months agoconfigs: arbel: increase u-boot mapping size
Jim Liu [Tue, 23 Apr 2024 07:22:09 +0000 (15:22 +0800)]
configs: arbel: increase u-boot mapping size

When u-boot enable CONFIG_SYS_BOOT_RAMDISK_HIGH, rootfs image relocated
from FIU address space to memory address before jump to kernel.

Since Arbel reserved memory from 0x00000000 to 0x06200000 for tip image,
and rootfs image may too large that cannot found a suitable location
before 128MB(0x8000000), so increase mapping size from 128MB to 192MB.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
7 months agoArm: npcm: fix npcm7xx boot to kernel error
Jim Liu [Tue, 23 Apr 2024 07:22:08 +0000 (15:22 +0800)]
Arm: npcm: fix npcm7xx boot to kernel error

Add mem and console env information and modify the wrong earlycon env.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
7 months agonet: consider option-length when parsing NIS domain
Heinrich Schuchardt [Tue, 23 Apr 2024 07:09:44 +0000 (09:09 +0200)]
net: consider option-length when parsing NIS domain

When parsing option 40 (network information service domain) the
option length is in variable 'oplen' and not in 'size'.

Addresses-Coverity-ID: 492765 Uninitialized variables (UNINIT)
Fixes: 8ab388bfdbcf ("net: add support to parse the NIS domain for the dhcp options")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 months agospi: npcm_pspi: Reset HW in driver probe
Jim Liu [Tue, 23 Apr 2024 06:38:42 +0000 (14:38 +0800)]
spi: npcm_pspi: Reset HW in driver probe

Reset HW to clear old status and use default data mode(8-bit).

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
7 months agocmd: gpt: initialize partition table
Kishan Dudhatra [Mon, 22 Apr 2024 18:17:33 +0000 (23:47 +0530)]
cmd: gpt: initialize partition table

Change in v2:
- Fix applies to all block devices, not just MMC.

If partition init is not completed within the gpt write,
the gpt partition list will not be updated.

Signed-off-by: Kishan Dudhatra <kishan.dudhatra@siliconsignals.io>
7 months agotools: typo arguemnts
Heinrich Schuchardt [Fri, 19 Apr 2024 11:37:46 +0000 (13:37 +0200)]
tools: typo arguemnts

%s/arguemnts/arguemnts/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 months agoevent: typo arguemnts
Heinrich Schuchardt [Fri, 19 Apr 2024 11:37:45 +0000 (13:37 +0200)]
event: typo arguemnts

%s/arguemnts/arguments/

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 months agommc: sdhci: Correct ADMA_DESC_LEN to 12
Alexander Sverdlin [Wed, 1 May 2024 18:53:04 +0000 (20:53 +0200)]
mmc: sdhci: Correct ADMA_DESC_LEN to 12

Commit 37cb626da25d0d ("mmc: sdhci: Add Support for ADMA2") introduced
ADMA_DESC_LEN == 16 (64 bit case), but it was never used before commit
74755c1fed1b0 ("mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops").

"sizeof(struct sdhci_adma_desc)" (== 12 for 64bit case) was used instead.

Confusion probably originates from Linux commit 685e444bbaa0
("mmc: sdhci: Add ADMA2 64-bit addressing support for V4 mode"), but
the latter "V4 mode" was never ported to U-Boot.

Fixes: 74755c1fed1b0 ("mmc: sdhci: introduce adma_write_desc() hook to struct sdhci_ops")
Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>
Tested-by: Jonathan Humphreys <j-humphreys@ti.com>
Tested-by: Judith Mendez <jm@ti.com>
7 months agoMerge https://source.denx.de/u-boot/custodians/u-boot-riscv
Tom Rini [Thu, 2 May 2024 01:40:32 +0000 (19:40 -0600)]
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv

CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/20596

- RISC-V: cmd: Add SBI implementation ID and extension ID
- Board: Rename spl_soc_init to spl_dram_init
- Board: milkv_duo: Add SPI NOR flash, Ethernet, Sysreset support

7 months agoMerge tag 'efi-2024-07-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Tom Rini [Thu, 2 May 2024 01:39:45 +0000 (19:39 -0600)]
Merge tag 'efi-2024-07-rc2' of https://source.denx.de/u-boot/custodians/u-boot-efi

Pull request efi-2024-07-rc2

Documentation:

* correct description of 'env print -e'

UEFI:

* remove superfluous efi_restore_gd after EFI_CALL
* terminate efidebug test bootmgr early on error
* do not install device-tree if bootmgr fails
* pass GUID by address to efi_dp_from_lo
* remove dead code in efi_var_mem_init()
* enable QueryVariableInfo at runtime for file backed variables

7 months agoboard: starfive: Rename spl_soc_init() to spl_dram_init()
Lukas Funke [Wed, 24 Apr 2024 07:43:39 +0000 (09:43 +0200)]
board: starfive: Rename spl_soc_init() to spl_dram_init()

Rename spl_soc_init() to spl_dram_init() because the generic function
name does not reflect what the function actually does. Also
spl_dram_init() is commonly used for dram initialization and should be
called from board_init_f().

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
7 months agoboard: sifive: Rename spl_soc_init() to spl_dram_init()
Lukas Funke [Wed, 24 Apr 2024 07:43:38 +0000 (09:43 +0200)]
board: sifive: Rename spl_soc_init() to spl_dram_init()

Rename spl_soc_init() to spl_dram_init() because the generic function
name does not reflect what the function actually does. Also
spl_dram_init() is commonly used for dram initialization and should be
called from board_init_f().

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agoconfigs: milkv_duo: Add spi nor configs
Kongyang Liu [Sat, 20 Apr 2024 07:08:25 +0000 (15:08 +0800)]
configs: milkv_duo: Add spi nor configs

Add configs related to spi nor flash for Sophgo Milk-V Duo board

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agoriscv: dts: sophgo: Add spi nor flash controller node
Kongyang Liu [Sat, 20 Apr 2024 07:08:24 +0000 (15:08 +0800)]
riscv: dts: sophgo: Add spi nor flash controller node

Add spi nor flash controller node for cv18xx SoCs

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agospi: cv1800b: Add spi nor flash controller driver for cv1800b SoC
Kongyang Liu [Sat, 20 Apr 2024 07:08:23 +0000 (15:08 +0800)]
spi: cv1800b: Add spi nor flash controller driver for cv1800b SoC

Add spi nor flash controller driver for cv1800b SoC

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agoconfigs: milkv_duo: Add ethernet configs
Kongyang Liu [Sat, 20 Apr 2024 07:00:29 +0000 (15:00 +0800)]
configs: milkv_duo: Add ethernet configs

Add configs related to ethernet and ethernet boot command for Sophgo Milk-V
Duo board

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agoriscv: dts: sophgo: Add ethernet node
Kongyang Liu [Sat, 20 Apr 2024 07:00:28 +0000 (15:00 +0800)]
riscv: dts: sophgo: Add ethernet node

Add ethernet node for cv1800b SoC

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agoboard: milkv_duo: Add init code for Milk-V Duo ethernet
Kongyang Liu [Sat, 20 Apr 2024 07:00:27 +0000 (15:00 +0800)]
board: milkv_duo: Add init code for Milk-V Duo ethernet

Initialize register in cv1800b ethernet phy to make it compatible with
generic phy driver

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agocmd: sbi: add coreboot and oreboot implementation IDs
Heinrich Schuchardt [Wed, 17 Apr 2024 14:01:28 +0000 (16:01 +0200)]
cmd: sbi: add coreboot and oreboot implementation IDs

Let the sbi command detect the coreboot and oreboot SBI Implementation IDs
defined in SBI specification v2.0.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agocmd: sbi: add Supervisor Software Events extension
Heinrich Schuchardt [Wed, 17 Apr 2024 14:01:27 +0000 (16:01 +0200)]
cmd: sbi: add Supervisor Software Events extension

OpenSBI has implemented the Supervisor Software Events Extension.
Allow detecting it in the sbi command.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agoconfigs: milkv_duo: Add sysreset configs
Kongyang Liu [Tue, 16 Apr 2024 07:52:40 +0000 (15:52 +0800)]
configs: milkv_duo: Add sysreset configs

Add sysreset configs as well as poweroff and reset commands for Sophgo
Milk-V Duo board.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agoboard: sophgo: milkv_duo: Bind sysreset driver
Kongyang Liu [Tue, 16 Apr 2024 07:52:39 +0000 (15:52 +0800)]
board: sophgo: milkv_duo: Bind sysreset driver

Bind cv1800b sysreset driver for Sophgo Milk-V Duo board in board_init
function.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agosysreset: cv1800b: Add sysreset driver for cv1800b SoC
Kongyang Liu [Tue, 16 Apr 2024 07:52:38 +0000 (15:52 +0800)]
sysreset: cv1800b: Add sysreset driver for cv1800b SoC

Add sysreset driver for cv1800b SoC

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agommc: cv1800b: Add transmit tap delay config to fix write error
Kongyang Liu [Tue, 16 Apr 2024 07:31:05 +0000 (15:31 +0800)]
mmc: cv1800b: Add transmit tap delay config to fix write error

Currently, only the receive delay is configured while the transmit delay
is not set, which may result in errors when writing to the file. This issue
can be resolved by setting PHY_TX_SRC_INVERT to SDHCI_PHY_TX_RX_DLY.

Signed-off-by: Kongyang Liu <seashell11234455@gmail.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
7 months agoriscv: andesv5: Set default cache line size to 64-bytes
Yu Chien Peter Lin [Thu, 11 Apr 2024 09:29:45 +0000 (17:29 +0800)]
riscv: andesv5: Set default cache line size to 64-bytes

The instruction and data cache line sizes of Andes core
are 64-byte. Select SYS_CACHE_SHIFT_6 for RISCV_NDS so
the SYS_CACHELINE_SIZE is enabled with a default value.

Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
7 months agoefi_loader: pass GUID by address to efi_dp_from_lo
Heinrich Schuchardt [Fri, 26 Apr 2024 14:13:08 +0000 (16:13 +0200)]
efi_loader: pass GUID by address to efi_dp_from_lo

We should not pass GUIDs by value as this requires copying.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 months agoefi_loader: fix description efi_dp_shorten
Heinrich Schuchardt [Fri, 26 Apr 2024 10:09:38 +0000 (12:09 +0200)]
efi_loader: fix description efi_dp_shorten

Use Sphinx style for return value.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 months agoefi_selftest: add tests for QueryVariableInfo at boottime
Ilias Apalodimas [Thu, 25 Apr 2024 05:18:21 +0000 (08:18 +0300)]
efi_selftest: add tests for QueryVariableInfo at boottime

Previous patches added QueryVariableInfo at runtime tests and
split a common function that can be used at boottime. Weire it
up and run a similar set of tets. While at it move a test which is
checiking for 0 available storage in the common code

Add tests for
- Test QueryVariableInfo returns EFI_SUCCESS
- Test null pointers for the function arguments
- Test invalid combination of attributes

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 months agoefi_selftest: add tests for QueryVariableInfo at runtime
Ilias Apalodimas [Thu, 25 Apr 2024 05:18:20 +0000 (08:18 +0300)]
efi_selftest: add tests for QueryVariableInfo at runtime

Since we support QueryVariableInfo at runtime now add the relevant
tests. Since we want those to be reusable at bootime, add them
in a separate file

Add tests for
- Test QueryVariableInfo returns EFI_SUCCESS
- Test null pointers for the function arguments
- Test invalid combination of attributes

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 months agoefi_loader: enable QueryVariableInfo at runtime for file backed variables
Ilias Apalodimas [Thu, 25 Apr 2024 05:18:19 +0000 (08:18 +0300)]
efi_loader: enable QueryVariableInfo at runtime for file backed variables

Since commit c28d32f946f0 ("efi_loader: conditionally enable SetvariableRT")
we are enabling the last bits of missing runtime services.
Add support for QueryVariableInfo which we already support at boottime
and we just need to mark some fucntions available at runtime and move
some checks around.

It's worth noting that pointer checks for maxmimum and remaining
variable storage aren't when we store variables on the RPMB, since the
Secure World backend is already performing them.

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 months agoefi_loader: address coverity report 492766 for dead code
Ilias Apalodimas [Tue, 23 Apr 2024 05:38:06 +0000 (08:38 +0300)]
efi_loader: address coverity report 492766 for dead code

The check of the return code is already done a few lines above.
Although it doesn't cause any functional issues, remove the superfluous
checks

Addresses-Coverity-ID: 492766 Control flow issues  (DEADCODE)
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 months agodoc: correct description of 'env print -e'
Heinrich Schuchardt [Mon, 22 Apr 2024 20:00:56 +0000 (22:00 +0200)]
doc: correct description of 'env print -e'

If 'env print -e' is invoked without variable name, all UEFI variables are
listed.

Describe that 'env print -e' requires CONFIG_HEXDUMP=y to print content of
UEFI variables.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 months agoefi_loader: do not install dtb if bootmgr fails
Heinrich Schuchardt [Mon, 22 Apr 2024 09:03:10 +0000 (11:03 +0200)]
efi_loader: do not install dtb if bootmgr fails

If the UEFI boot manager fails there is no point in installing the
device-tree as a configuration table.

Unload image if device-tree cannot be installed.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
7 months agoefi_loader: improve error handling in try_load_entry()
Heinrich Schuchardt [Mon, 22 Apr 2024 08:41:00 +0000 (10:41 +0200)]
efi_loader: improve error handling in try_load_entry()

The image is not unloaded if a security violation occurs.

If efi_set_load_options() fails, we do not free the memory allocated for
the optional data. We do not unload the image.

* Unload the image if a security violation occurs.
* Free load_options if efi_set_load_options() fails.
* Unload the image if efi_set_load_options() fails.

Fixes: 53f6a5aa8626 ("efi_loader: Replace config option for initrd loading")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 months agocmd: terminate efidebug test bootmgr early on error
Heinrich Schuchardt [Sat, 20 Apr 2024 14:06:16 +0000 (16:06 +0200)]
cmd: terminate efidebug test bootmgr early on error

If efi_bootmgr_load() fails, there is no point in trying to start an image
that has not been loaded.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 months agoefi_loader: superfluous efi_restore_gd after EFI_CALL
Heinrich Schuchardt [Fri, 19 Apr 2024 09:59:01 +0000 (11:59 +0200)]
efi_loader: superfluous efi_restore_gd after EFI_CALL

EFI_CALL() invokes __efi_entry_check() which executes set_gd(efi_gd).
There is no need to execute set_gd(efi_gd) again via efi_restore_gd().

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
7 months agoMerge patch series "Update PHYTEC SOM Detection"
Tom Rini [Mon, 29 Apr 2024 16:56:05 +0000 (10:56 -0600)]
Merge patch series "Update PHYTEC SOM Detection"

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

This patch series extends PHYTEC's SOM detection by minor
fixes, a generic helper function and a new valid flag.

Moreover, it adds a module to provide access to the SOM
detection for our TI AM6 products.

7 months agoboard: phytec: Add SOM detection for AM6x
Daniel Schultz [Fri, 19 Apr 2024 15:55:40 +0000 (08:55 -0700)]
board: phytec: Add SOM detection for AM6x

Add all functions to read each SOM option from the EEPROM
image and detect whether it's the correct product for this
image.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
7 months agoboard: phytec: common: Fix eepom is empty check
Daniel Schultz [Fri, 19 Apr 2024 15:55:39 +0000 (08:55 -0700)]
board: phytec: common: Fix eepom is empty check

The ptr variable is currently defined as int and sizeof
returns the size of the eeprom data struct as Byte (32 in total).

In case the eeprom is empty, the check, if the eeprom is empty,
will most likely stop after 8 iterations because it will continue
with the stack which should contain some data. Therefore, the
init function will detect an empty EEPROM as API0 and return with
the valid flag set to True.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>
7 months agoboard: phytec: check eeprom_data validity
Yannic Moog [Fri, 19 Apr 2024 15:55:38 +0000 (08:55 -0700)]
board: phytec: check eeprom_data validity

For all of the functions that access the eeprom_data, make sure these
data are valid. Use the valid member of the phytec_eeprom_data struct.
This fixes a bug where only the API revision check guarded against
accessing rubbish. But if API revision was e.g. 6, eeprom setup failed
before, but phytec_get_imx8m_eth would still happily access the data.

Fixes: dc22188cdc8 ("board: phytec: Add common PHYTEC SoM detection")
Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>
7 months agoboard: phytec: introduce eeprom struct member 'valid'
Yannic Moog [Fri, 19 Apr 2024 15:55:37 +0000 (08:55 -0700)]
board: phytec: introduce eeprom struct member 'valid'

Add a new nember to the eeprom_data that indicates whether the
associated data is valid or not. Make use of this new member in the
phytec_eeprom_data_init function by setting the valid value
appropriately.
Move the eeprom data to a new struct payload that holds
the payload of the eeprom.

Signed-off-by: Yannic Moog <y.moog@phytec.de>
Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>
7 months agoboard: phytec: common: Generic "add extension" function
Daniel Schultz [Fri, 19 Apr 2024 15:55:36 +0000 (08:55 -0700)]
board: phytec: common: Generic "add extension" function

Add a generic function to apply overlays in our board code to not
implement the same logic in different PHYTEC products.

Signed-off-by: Daniel Schultz <d.schultz@phytec.de>
Reviewed-by: Teresa Remmet <t.remmet@phytec.de>