Commit graph

97955 commits

Author SHA1 Message Date
Tien Fong Chee
b005eca0c9 arm: socfpga: agilex5: Add SPL for Agilex5 SoCFPGA
Add SPL support for Agilex5 SoCFPGA.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:54:01 -06:00
Tingting Meng
04ea9147d5 ddr: altera: Add DDR driver for Agilex5 series
Adding DDR driver support for Agilex5 series.

Signed-off-by: Tingting Meng <tingting.meng@altera.com>
2025-02-25 10:54:01 -06:00
Alif Zakuan Yuslaimi
034ebe3302 arm: socfpga: smc: Add memory coherency support to mailbox command
As cache is enabled in U-Boot and disabled in ATF(BL31). We need to
perform cache flush of buffers that are shared between U-Boot and
ATF using secure monitor calls.

Signed-off-by: Mahesh Rao <mahesh.rao@altera.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:54:00 -06:00
Tien Fong Chee
19f20cfc49 configs: agilex5: Add configuration for malloc pool
Adding configuration for SPL malloc pool.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:54:00 -06:00
Alif Zakuan Yuslaimi
8c172a423c arm: socfpga: Export board ID as U-Boot environment
Board ID is exported as environment variable for use to boot Linux with FIT
configuration.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:59 -06:00
Alif Zakuan Yuslaimi
6ec6b75e9a arm: socfpga: agilex5: Update CPU info
Update the print info per Agilex5

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:58 -06:00
Tien Fong Chee
0d2010faac arm: socfpga: agilex5: Add SMMU initialization
Allow non-secure accesses only with SMMU peripherals. This would protect
the content in DDR secure region from accidentally modified by SMMU
peripherals.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:57 -06:00
Tien Fong Chee
9bb68bff4e arm: socfpga: agilex5: Enable cache flush for system memory cache in CCU
set/way instructions "dc cisw" which is used by the "dcache flush" command
only flushing CPU data caches from L1 -> L2 -> L3 to system memory cache in
cache coherency unit, hence this patch enables data flush from system
memory cache of CCU into DDR memory.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:56 -06:00
Alif Zakuan Yuslaimi
7d2f2883dc arch: arm: Enable PSCI reset driver for Agilex5
Enable PSCI reset driver for Agilex5 cold and warm reset

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:54 -06:00
Tien Fong Chee
fe41a5e1b9 arm: dts: agilex5: Enable XGMAC
Enable XGMAC for SoCFPGA Agilex5 devkit.

Link: https://lore.kernel.org/all/20241204064755.10226-2-mun.yew.tham@intel.com/
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:53 -06:00
Tien Fong Chee
f504e59e00 arm: dts: agilex5: Add firewall configure settings
These firewall configure settings are needed to disable firewall on
respective hardware component so both secure and non-secure transactions
are allowed.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:52 -06:00
Tien Fong Chee
e3097ca2bb arm: dts: agilex5: Add HPS cache coherency unit configuration settings
These configuration settings are required to enable cache maintenance and
access between initiators and targets.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:48 -06:00
Tien Fong Chee
b833de8d42 arm: socfpga: Add handoff data support for SoCFPGA Agilex5 device
Agilex5 supports both HPS handoff data and DDR handoff data.
Existing HPS handoff functions are restructured to support both existing
devices and Agilex5 device.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:47 -06:00
Alif Zakuan Yuslaimi
cad50a19f5 arm: socfpga: Disable GIC for Agilex5
Status polling is used instead of using interrupt controller for Agilex5.

Disabling GICV3 in Agilex5 target, as well as disabling GICV2 enabled by
default for all SoCFPGA devices.

All the other SoCFPGA devices uses GICV2, thus enabling GICV2 in each of
the devices.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:46 -06:00
Alif Zakuan Yuslaimi
9288e0b446 arm: socfpga: agilex5: Add warm reset mask for Agilex5
There are 5 L4 watchdogs and one SDM triggered warm reset bit
in Agilex5 reset manager "stat" register where bit 16:20 for L4
watchdogs. Assigning value 1 to these bits in the register address
will initiate SDM to trigger warm reset.

Introducing new warm reset mask for Agilex5 to trigger warm reset
to all five L4 watchdogs.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:42 -06:00
Alif Zakuan Yuslaimi
58ef50ff9a drivers: clk: agilex5: Set PLL to asynchronous mode
PLL frequency would overshoot from the original target in
synchronous mode during low VCC voltage condition.

To resolve this issue, PLL is set to run on asynchronous mode
instead of enabling synchronous mode in the clock driver.

Signed-off-by: Muhammad Hazim Izzat Zamri <muhammad.hazim.izzat.zamri@altera.com>
Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:41 -06:00
Alif Zakuan Yuslaimi
9e7986e061 drivers: clk: agilex5: Replace status polling with wait_for_bit_le32()
Replace cm_wait_for_fsm() function with wait_for_bit_le32() function
which supports accurate timeout.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:37 -06:00
Alif Zakuan Yuslaimi
746f5b8ddb drivers: clk: agilex5: Configure intosc as boot_clk source
Some customers prefer to minimize the use of external oscillators,
especially when using the FPGA first configuration mode.

By enabling the configuration of the HPS internal oscillator as
the boot_clk source instead of the default external oscillator,
(HPS_OSC_CLK) in non-secure boot scenarios, this allows them
to eliminate the need for an additional oscillator device and
a dedicated HPS pin, simplifying board layout and routing.

Signed-off-by: Tingting Meng <tingting.meng@altera.com>
Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@altera.com>
2025-02-25 10:53:35 -06:00
Alif Zakuan Yuslaimi
6d07e1980c arm: socfpga: misc: Exclude Agilex5 from clock manager base address retrieval
Agilex5 retrieves its clock manager address via probing its own clock
driver model during SPL initialization.

Therefore, excluding Agilex5 from calling generic clock driver in misc
driver.

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
Reviewed-by: Tien Fong Chee <tien.fong.chee@intel.com>
2025-02-25 10:53:32 -06:00
Tien Fong Chee
35638172f9 arm: socfpga: agilex5: Add new driver model for system manager in Agilex5
Initial creation of new system manager driver.

Add supports for the SOCFPGA System Manager Register block which
aggregates different peripheral function into one area.
On 64 bit ARM parts, the system manager only can be accessed during
EL3 mode, this driver model provide user the high level access
to system register and abstract user from low level access.

The base address of system manager can be retrieved
using DT framework through the System Manager driver.

Signed-off-by: Tien Fong Chee <tien.fong.chee@altera.com>
Signed-off-by: Boon Khai Ng <boon.khai.ng@altera.com>
2025-02-25 10:53:31 -06:00
Alif Zakuan Yuslaimi
cbb6b57d3e arch: arm: dts: agilex5: Enable I2C3
Enable i2c3 node in Agilex5 device tree

Signed-off-by: Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>
2025-02-25 10:53:30 -06:00
Tom Rini
dc0ee458f1 Prepare v2025.04-rc3
Signed-off-by: Tom Rini <trini@konsulko.com>
2025-02-24 16:53:59 -06:00
Marek Vasut
dbb9e136b8 mmc: Fix size calculation for sector addressed MMC version 4
For eMMC v4 and newer that is smaller than 2 GiB, the JEDEC JESD84-B51
section 6.2.4 Configure partitions indicates that EXT_CSD SEC_COUNT
should not be used to determine device size, and instead device size
should be calculated from C_SIZE and C_SIZE_MULT.

This is not exactly accurate, the 2 GiB limit is not a hard line,
there are eMMC devices which are smaller than 2 GiB and still
require device size to be determined from EXT_CSD SEC_COUNT. The
hard line is instead OCR HCS bit, which indicates whether the device
is byte or sector addressed, the former applies to most devices
below 2 GiB, and the later applies mostly to devices above 2 GiB.

However, there are a couple of devices which are smaller than 2 GiB
and still set the OCR HCS bit to indicate they are sector addressed,
and therefore the size calculation for those devices should also
use EXT_CSD SEC_COUNT . Use mmc->high_capacity flag to discern the
devices instead of arbitrary 2 GiB limit. The mmc->high_capacity flag
reflects the OCR HCS bit state.

Fixes: 639b7827d1 ("mmc: fix the condition for MMC version 4")
Signed-off-by: Marek Vasut <marex@denx.de>
2025-02-24 14:16:28 -06:00
Joao Marcos Costa
59fd62d71c fs/squashfs: fix potential integer overflows
The length of buffers used to read inode tables, directory tables, and
reading a file are calculated as: number of blocks * block size, and
such plain multiplication is prone to overflowing (thus unsafe).

Replace it by __builtin_mul_overflow, i.e. safe math.

Signed-off-by: Joao Marcos Costa <joaomarcos.costa@bootlin.com>
2025-02-24 08:49:04 -06:00
Tom Rini
5061eab96a Merge branch 'picasso' of https://source.denx.de/u-boot/custodians/u-boot-tegra
Branch contains bringup of Acer Iconia Tab A500 (codename picasso), a
Tegra 2 Android device with decent Linux kernel support. Ondevice tests
and U-Boot test suit all passed.
2025-02-22 08:42:01 -06:00
Tom Rini
313b9856f9 Pull request efi-2025-04-rc3
UEFI:
 
 * create a parent device for all EFI block devices
 * move lmb_map_update_notify() to EFI
 * make efi_add_memory_map_pg() static
 * remove comparisons to string literals from runtime
 * ix potential deref-after-null
 
 Other:
 
 * avoid superfluous value check in lmb_map_update_notify()
 * support more efi protocols in uuid_guid_get_str()
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEK7wKXt3/btL6/yA+hO4vgnE3U0sFAme3XJYACgkQhO4vgnE3
 U0tbDRAAo8wMa/PLC0dB/NRwCclbZxRfLbirwKTawPC5Ub8HYH5aXtvd4JW+qvKJ
 A1fz8092P1Rbv8zXILME6Cig3LOBZrvQhbgfTKbPK/VYXrpLPD0f6jyfEywLj1Fn
 pqMp0VkH60qj9xh3axqdJPS1lL7yGr6+L1AOmqptZ6hr2IjtWGZ7/VYj26WqIf9X
 awV7hjmxJTwvivy9aezcb3cyBq82TvVLfm+TFTsXJHIlgbYnyYHE3b5uuM+XOOgt
 bVL+Wj4kEU1t7qtkR7ZTn6k1VyEgSRecdJP0Q4pP3TFLxUX2ku4MyHvCl4BwQOBf
 UV4AT2SgiOIZKcaVpzb1ukMACgCBba6RTvjB86MWU9N0dgbHs8ZTXmmQPYmEUxgR
 68ufeA89xuSFNoQ8ft2lMYjfY0OjtNr6riTVdEeEwXVq+r/ogCY/p2/NpRMAR8LG
 yNwLBQ3Hwqmyy+VYHJ53anvRR44hPf4ZFLtlgGtuDEfrgZ03ZNU5TPB+1v6A0C1L
 K772WYp6LOn1nedYoWp3fB5GhA1oiFdUvgOXi0nxkPr1jW+rewAFyGWtV8AP9msz
 AtAEfJPLBV4LhxZBR4mHADeOAt+AUThWRuY1i3yOg1o+XAJazK3K2DIlfnmr4cc1
 TZbMR4NPTtgpZomJlSYlGWRutgQwHt/la5qlfF+sFdqUmy+Dq/A=
 =7bV8
 -----END PGP SIGNATURE-----

Merge tag 'efi-2025-04-rc3' of https://source.denx.de/u-boot/custodians/u-boot-efi

CI:

* https://source.denx.de/u-boot/custodians/u-boot-efi/-/pipelines/24709

UEFI:

* create a parent device for all EFI block devices
* move lmb_map_update_notify() to EFI
* make efi_add_memory_map_pg() static
* remove comparisons to string literals from runtime
* ix potential deref-after-null

Other:

* avoid superfluous value check in lmb_map_update_notify()
* support more efi protocols in uuid_guid_get_str()
2025-02-20 11:21:41 -06:00
Tom Rini
7a6dbb9dbe Merge branch 'master' of https://source.denx.de/u-boot/custodians/u-boot-riscv
CI: https://source.denx.de/u-boot/custodians/u-boot-riscv/-/pipelines/24692

- board: VisionFive 2: Update maintainer file
- configs: starfive: Add LwIP network and wget command
- configs: microchip: set DEFAULT_FDT_FILE
2025-02-20 08:34:52 -06:00
Tom Rini
ee69293e0d Merge tag 'u-boot-rockchip-20250220' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/24690

Please pull the fixes for rockchip platform:
- Fix for rk3399 bob and kevin
- Fix for sdram more than 4GB
- Fix for dwc_eth on rk356x/rk3588
- Fix for sdmmc access on rk33080rock-s9
2025-02-20 08:32:53 -06:00
Heinrich Schuchardt
5ce629db25 efi_loader: make efi_add_memory_map_pg() static
The function is only used in the efi_memory.c module.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 11:09:33 +01:00
Heinrich Schuchardt
41d5734442 lmb: move lmb_map_update_notify() to EFI
When building with qemu_arm64_defconfig with CONFIG_CC_OPTIMIZE_FOR_DEBUG=y
and CONFIG_EFI_LOADER=n an error undefined reference to efi_add_memory_map_pg
occurs.

Move the EFI dependent part of lmb_map_update_notify() to the EFI
sub-system.

Reported-by: Liya Huang <1425075683@qq.com>
Acked-by: Liya Huang <1425075683@qq.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 11:09:33 +01:00
Heinrich Schuchardt
08573d7688 lmb: avoid superfluous value check in lmb_map_update_notify()
Instead of testing the value of parameter op at runtime use an enum to
ensure that only valid values are used.

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 11:09:33 +01:00
Heinrich Schuchardt
bd8bc53162 efi_driver: create a parent device for all EFI block devices
Up to now root has been the parent device for all block devices created via
calling ConnectController(). This does not work well together with the
implementation of bootstd.

Add a dummy parent device for all EFI block devices.

With this change EFI block devices are also accessible via commands like
'cat', 'load', and 'ls'.

    => dm tree
     Class     Seq    Probed  Driver                Name
    -----------------------------------------------------------
     efi           0  [ + ]   EFI block driver      `-- efi
     blk           3  [ + ]   efi_blk                   `-- efi.efiblk#0
     partition     0  [ + ]   blk_partition                 `-- efi.efiblk#0:1

    => ls efiloader 0:1
           13   hello.txt
            7   u-boot.txt
    2 file(s), 0 dir(s)

    => cat efiloader 0:1 hello.txt
    Hello world!

    => efidebug dh
    0000000018df1700 (efi.efiblk#0:1)
      /VenHw(dbca4c98-6cb0-694d-0872-819c650cb7b8)/HD(1,MBR,0xd1535d21,0x1,0x7f)
      Block IO
      Simple File System

Adjust the event dump unit test to consider the new event spy.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 11:07:44 +01:00
Ilias Apalodimas
530e869ff8 efi_loader: remove comparisons to string literals from runtime
For EFI runtime services, we manage to preserve string literals
by placing the .efi_runtime section just before .data and preserving
it when marking the runtime memory by marking surrounding boottime
code as runtime. This is ok for now but will break if we update any
linker scripts and decouple .text and .runtime sections.

So let's define the strings we used to compare in the appropriate
section for runtime services

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
2025-02-20 09:22:53 +01:00
Maks Mishin
80908fee77 efi_loader: Fix potential deref-after-null
After having been compared to a NULL value at efi_disk.c:426,
pointer 'part_info' is dereferenced at efi_disk.c:534.

Signed-off-by: Maks Mishin <maks.mishinFZ@gmail.com>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-02-20 09:04:12 +01:00
Vincent Stehlé
87ef1987de lib: uuid: support more efi protocols in uuid_guid_get_str()
Add more EFI protocols GUIDs to the translation table used by
uuid_guid_get_str().

Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
Cc: Tom Rini <trini@konsulko.com>
2025-02-20 08:40:52 +01:00
E Shattow
399a03442f configs: starfive: use LwIP network stack and enable wget command
Use LwIP network stack and enable wget HTTP command. The tftpput command
is not currently supported by LwIP network stack so remove it.

Signed-off-by: E Shattow <e@freeshell.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-02-20 12:18:41 +08:00
Hal Feng
c6337c91e5 board: starfive: Update the maintainer file for VisionFive 2 board
Update the maintainer file and mark jh7110 / visionfive2 related files
with N: patterns.

Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-02-20 12:18:41 +08:00
Heinrich Schuchardt
3955668a9d configs: microchip_mpfs_icicle: set DEFAULT_FDT_FILE
Variable $fdtfile needs to be set for automatically loading a device-tree
from the ESP or boot partition.

* Set CONFIG_DEFAULT_FDT_FILE in the defconfig.
* Add $fdtfile to the default environment.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-02-20 12:18:40 +08:00
Jonas Karlman
d69097683d arm64: dts: rockchip: Fix sdmmc access on rk3308-rock-s0 v1.1 boards
BootROM leave GPIO4_D6 configured as SDMMC_PWREN function and DW MCI
driver set PRWEN high on MMC_POWER_UP and low on MMC_POWER_OFF.
Similarly U-Boot also set PRWEN high before accessing mmc.

However, HW revision prior to v1.2 must pull GPIO4_D6 low to access
sdmmc. For HW revision v1.2 the state of GPIO4_D6 has no impact.

Model an always-on active low fixed regulator using GPIO4_D6 to fix
use of sdmmc on older HW revisions of the board.

Fixes: adeb5d2a4ba4 ("arm64: dts: rockchip: Add Radxa ROCK S0")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Link: https://lore.kernel.org/r/20241119230838.4137130-1-jonas@kwiboo.se
Signed-off-by: Heiko Stuebner <heiko@sntech.de>

[ upstream commit: 26c100232b09ced0857306ac9831a4fa9c9aa231 ]

(cherry picked from commit ca8e0bedbc790b19b11efc223677d178b8eeb74e)
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2025-02-19 23:26:40 +08:00
Jonas Karlman
8d25dbb725 net: dwc_eth_qos_rockchip: Fix disable of RX/TX delay for RK3588
When rgmii-rxid/txid/id phy-mode is used the MAC should not add RX
and/or TX delay. Currently RX/TX delay is configured as enabled using
zero as delay value for the rgmii-rxid/txid/id modes.

Change to disable RX and/or TX delay and using zero as delay value.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:26:11 +08:00
Jonas Karlman
c4ec920cb9 net: dwc_eth_qos_rockchip: Fix disable of RX/TX delay for RK356x
When rgmii-rxid/txid/id phy-mode is used the MAC should not add RX
and/or TX delay. Currently RX/TX delay is configured as enabled using
zero as delay value for the rgmii-rxid/txid/id modes.

Change to disable RX and/or TX delay and using zero as delay value.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:26:11 +08:00
Jonas Karlman
d5a3fb9ef8 pinctrl: rockchip: rk3328: Fix pinmux for GPIO2-B and GPIO3-B pins
The pinmux bits for GPIO2-B0 to GPIO2-B6 actually have 2 bits width,
correct the bank flag for GPIO2-B. The pinmux bits for GPIO2-B7 is
recalculated so it remain unchanged. Add missing GPIO3-B1 to GPIO3-B7
pinmux data to rk3328_mux_recalced_data as mux register offset for these
pins does not follow rockchip convention.

This matches changes in following Linux commits:
- e8448a6c817c ("pinctrl: rockchip: fix pinmux bits for RK3328 GPIO2-B pins")
- 5ef6914e0bf5 ("pinctrl: rockchip: fix pinmux bits for RK3328 GPIO3-B pins")
- 128f71fe014f ("pinctrl: rockchip: correct RK3328 iomux width flag for GPIO2-B pins")

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:24:48 +08:00
Jonas Karlman
110428931c rockchip: rk3288: Use rk3288-cru.h from dts/upstream
clock/rk3288-cru.h in include/dt-bindings is almost identical to the
version in dts/upstream, remove the copy from include/dt-bindings to
only use the version from dts/upstream.

One clk, SCLK_MAC_PLL, is not part of the upstream bindings, this clk is
not used by upstream, in-tree or vendor DTs and can safely be dropped.

No functional change to board DTs is intended with this removal.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:14:59 +08:00
Johan Jonker
d4aac2894a rockchip: use OF_UPSTREAM for rk3036
The device tree for rk3036 combined is now
available in the /dts/upstream directory.
Use imply OF_UPSTREAM to migrate all rk3036 boards.

Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Johan Jonker <jbx6244@gmail.com>
2025-02-19 23:14:50 +08:00
Jonas Karlman
d5fc369a59 rockchip: sdram: Ensure ram_base is correct in SPL
Most Rockchip SoCs use 0x0 as DRAM base address, however some SoCs use
0x60000000 and RK3576 use 0x40000000 as DRAM base address.

CFG_SYS_SDRAM_BASE is defined with correct address for each SoC and
U-Boot proper use this to set correct gd->ram_base in setup_dest_addr().

SPL never assign any value to gd->ram_base and instead use the default,
0x0. Set correct gd->ram_base in dram_init() to ensure its correctness
in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:11:06 +08:00
Jonas Karlman
356236126d rockchip: sdram: Limit usable ram_top to max 4G
U-Boot only works correctly when it uses RAM below the 4G address
boundary on Rockchip SoCs. Limit usable gd->ram_top to max 4G.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:11:06 +08:00
Jonas Karlman
57ad1ed7e8 rockchip: sdram: Allow the first bank to extend beyond 4 GiB
Allow the first bank to extend beyond 4 GiB when the blob of space for
peripheral is located before start of DRAM, e.g. when start of DRAM
is 0x40000000 and continue beyond the 4 GiB mark.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:11:06 +08:00
Chen-Yu Tsai
64cec76899 rockchip: rk3399: grf: Fix enum typos for UART2
In the GRF header file, some instances of UART2 pinmux are prefixed with
"GRF_UART2DBG" while others have "GRF_UART2DGB".

Since UART2 is the default console UART and used for debugging, it is
more likely the name should be UART2DBG.

Fix the ones that are wrong.

Fixes: a2c08df381 ("pinctrl: add driver for rk3399")
Fixes: fa72de1045 ("rockchip: arm64: rk3399: move grf register definitions to grf_rk3399.h")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Paul Kocialkowski <paulk@sys-base.io>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:06:42 +08:00
Jonas Karlman
7622834065 Revert "rockchip: rk3399: Fix TPL build of bob and kevin"
These power rails must be on very early for the U-Boos TPL banner to be
show over debug UART.

This reverts commit 4576e65a5d.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:03:03 +08:00
Jonas Karlman
227b505f04 rockchip: rk3399-gru: Enable TPL_GPIO for bob and kevin
The PP1500 and PP3000 power rails must be on very early for the U-Boot
TPL banner to be shown on debug UART.

Enable TPL_GPIO Kconfig option for bob and kevin to allow use of
spl_gpio.h functions in TPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-02-19 23:03:03 +08:00