27785 Commits

Author SHA1 Message Date
Yu-Chien Peter Lin
6be961a758 Kconfig: Add a default cache line size for RISC-V
The RISC-V ISA profile RVA23U64 requires extension Zic64b (Cache blocks
must be 64 bytes in size, naturally aligned in the address space).

Some RISC-V platforms do not define the d-cache line size through SYS_CACHE_SHIFT_n.
Set a default value of 64 bytes for such cases.

Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-01-16 15:34:30 +08:00
Mayuresh Chitale
4492c8db60 riscv: Fallback to riscv,isa
Update the cpu probing to fallback to "riscv,isa" property if
"riscv,isa-extensions" is not available and modify the riscv CMO code
to use the block size that was probed during cpu setup.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-01-16 15:34:18 +08:00
Mayuresh Chitale
ab15e20ea9 riscv: Enhance extension probing
Enhance the existing extension probing mechanism by adding support for
more extensions and probing using the "riscv,isa" property. This patch
is ported from the latest upstream linux.

Signed-off-by: Mayuresh Chitale <mchitale@ventanamicro.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-01-16 15:34:18 +08:00
E Shattow
9c4d760637 riscv: dts: starfive: split out visionfive2 target specific configuration
Split out StarFive VisionFive2 multi-board target specific configuration
into starfive-visionfive2-binman.dtsi in preparation for removal of
jh7110-u-boot and jh7110-common-u-boot in part or whole as sent upstream.

Signed-off-by: E Shattow <e@freeshell.de>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
2025-01-16 15:34:05 +08:00
Tom Rini
e26a9ac4c6 Merge patch series "Add fdt-fixups for AM62P variants"
Aparna Patra <a-patra@ti.com> says:

This series implements fdt fixups, by reading hardware
information from registers and accordingly delete/modify
the DT nodes, at run-time.

Logs for AM62P boot:
https://gist.github.com/itsme-aparna/b889fe59882c1acf0ef25a644bd325c4

Link: https://lore.kernel.org/r/20250108044939.392785-1-a-patra@ti.com
2025-01-14 15:51:47 -06:00
Aparna Patra
969f43c563 arm: mach-k3: am62p: Set a53 cpu freq based on speed-grade
The maximum frequency of the A53 CPU on the AM62P depends on the speed
grade of the SoC. This value is hardcoded in the DT for all AM62P
variants, potentially causing specifications to be exceeded. Moreover,
setting a common lower frequency for all variants increases boot time.
To prevent these issues, modify the DT at runtime from the R5 core to
adjust the A53 CPU frequency.

Signed-off-by: Aparna Patra <a-patra@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
2025-01-14 15:50:07 -06:00
Aparna Patra
8d05cbef73 arm: mach-k3: am62p: Fixup a53 max cpu frequency by speed-grade
AM62P SoC has multiple speed grades. Add function to delete
non-relevant CPU frequency nodes, based on the information
retrieved from hardware registers. Fastest grade's maximum
frequency also depends on PMIC voltage, hence to simplify
implementation use the smaller value.

Signed-off-by: Aparna Patra <a-patra@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
2025-01-14 15:50:07 -06:00
Aparna Patra
a226a6422c arm: mach-k3: am62p: Fixup thermal zone critical points
Read the max temperature for the SoC temperature grade from the hardware
and modify the critical trip nodes on each thermal zone of FDT at
runtime so they are correct with the hardware value for its grade.

Signed-off-by: Aparna Patra <a-patra@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
2025-01-14 15:50:07 -06:00
Aparna Patra
e44098d1aa arm: mach-k3: am62p: Fixup CPU core, CAN-FD and Video-codec nodes in fdt
AM62P SOC is available in multiple variants:
-CPU cores (Cortex-A) AM62Px1 (1 core),
 AM62Px2 (2 cores), AM62Px4 (4 cores)
-With and without CAN-FD & Video-codec support

Remove the relevant FDT nodes by reading the actual configuration
from the SoC registers, with that change it is possible to have a single
dts/dtb file handling the different variant at runtime.

Signed-off-by: Aparna Patra <a-patra@ti.com>
Reviewed-by: Bryan Brattlof <bb@ti.com>
2025-01-14 15:50:07 -06:00
Tom Rini
08733bf313 Merge patch series "Inline ECC Series"
Santhosh Kumar K <s-k6@ti.com> says:

Hello,

This series adds support for Inline ECC in DDR for AM64X, AM62X,
AM62AX, AM62PX, J721E, J721S2, J722S and J784S4 devices.

Test Results: https://gist.github.com/santhosh21/88de920771ed2efa0463a5a367cb8d7b

Link: https://lore.kernel.org/r/20250106090708.1541212-1-s-k6@ti.com
2025-01-14 15:49:41 -06:00
Santhosh Kumar K
bc07851897 board: ti: Pull redundant DDR functions to a common location and Fixup DDR size when ECC is enabled
As there are few redundant functions in board/ti/*/evm.c files, pull
them to a common location of access to reuse and include the common file
to access the functions.

Call k3-ddrss driver through fixup_ddr_driver_for_ecc() to fixup the
device tree and resize the available amount of DDR, if ECC is enabled.
Otherwise, fixup the device tree using the regular
fdt_fixup_memory_banks().

Also call dram_init_banksize() after every call to
fixup_ddr_driver_for_ecc() is made so that gd->bd is populated
correctly.

Ensure that fixup_ddr_driver_for_ecc() is agnostic to the number of DDR
controllers present.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Reviewed-by: Wadim Egorov <w.egorov@phytec.de>
2025-01-14 15:47:07 -06:00
Neha Malcom Francis
01fa91bd5b arm: mach-k3: Set NR_DRAM_BANKS to 2
Set CONFIG_NR_DRAM_BANKS to 2 as we have two banks described in the
memory/ node for lower and higher addressible DDR regions.

This allows use of FDT functions from fdt_support.c to set up and fix up
the memory/ node correctly.

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
2025-01-14 15:47:07 -06:00
Santhosh Kumar K
8ff96fb6d0 arm: dts: k3-*-ddr: Add ss_cfg reg entry
Add ss_cfg memory region which maps the DDRSS configuration region
for the memory controller node.

Signed-off-by: Santhosh Kumar K <s-k6@ti.com>
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Tested-by: Neha Malcom Francis <n-francis@ti.com>
2025-01-14 15:47:07 -06:00
Tom Rini
079214e4be Merge patch series "SMBIOS improvements"
Raymond Mao <raymond.mao@linaro.org> says:

Motivations for changes:
Current SMBIOS library and command-line tool is not fully matching with
the requirements:
1. Missing support for other mandatory types (#7, #9, #16, #17, #19).
2. Only a few platforms support SMBIOS node from the device tree.
3. Values of some fields are hardcoded in the library other than fetching
   from the device hardware.
4. Embedded data with dynamic length is not supported (E.g. Contained
   Object Handles in Type #2 and Contained Elements in Type #3)

Changes:
1. Refactor the SMBIOS library and command-line tool to better align with
   the SMBIOS spec.
2. Create an arch-specific driver for all aarch64-based platforms to fetch
   SMBIOS private data from the device hardware (processor and cache).
3. Create a sysinfo driver to poppulate platform SMBIOS private data.
4. Add generic SMBIOS DTS file for arm64 platforms for those common strings
   and values which cannot be retrieved from the system registers.
   Vendors can create their own SMBIOS node using this as an example.
   For those boards without SMBIOS nodes, this DTS file can be included to
   have a generic SMBIOS information of the system.
5. Add support for Type #7 (Cache Information) and link its handles to
   Type #4.
6. To minimize size-growth for those platforms which have not sufficient
   ROM spaces or the platforms which don't need detailed SMBIOS
   information, new added fields are only being built when kconfig
   GENERATE_SMBIOS_TABLE_VERBOSE is selected.

Once this patch is acceptted, subsequent patch sets will add other missing
types (#9, #16, #17, #19).

Tests:
To test this with QEMU arm64, please follow the guide on dt_qemu.rst to
get a merged DT to run with.
```
qemu-system-aarch64 -machine virt -machine dumpdtb=qemu.dtb
cat  <(dtc -I dtb qemu.dtb) <(dtc -I dtb ./dts/dt.dtb | grep -v /dts-v1/) \
  | dtc - -o merged.dtb
qemu-system-aarch64 -machine virt -nographic -bios u-boot.bin \
  -dtb merged.dtb
```

Link: https://lore.kernel.org/r/20241206225438.13866-1-raymond.mao@linaro.org
2025-01-14 14:29:49 -06:00
Raymond Mao
86898a98fd armv8: Add generic smbios information into the device tree
Add common smbios information that can be used by all armv8
platforms and set it as default for qemu-arm64.
>From now smbios library can load values from here for those fields
doesn't exist in the sysinfo driver.

To run this with QEMU arm64, we need to dump the generated DTB
from QEMU first, merge it with the one we build and then re-run
QEMU with the merged DTB.
```
qemu-system-aarch64 -machine virt -machine dumpdtb=qemu.dtb
cat  <(dtc -I dtb qemu.dtb) <(dtc -I dtb ./dts/dt.dtb | \
  grep -v /dts-v1/) | dtc - -o merged.dtb
qemu-system-aarch64 -machine virt -nographic -bios u-boot.bin \
  -dtb merged.dtb
```
For details please take reference on dt_qemu.rst

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
2025-01-14 14:29:29 -06:00
Raymond Mao
c0e1775a86 armv8: Add arch-specific sysinfo platform driver
Add sysinfo platform driver for all armv8 platforms to retrieve
hardware information on processor and cache.

Signed-off-by: Raymond Mao <raymond.mao@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2025-01-14 14:29:29 -06:00
Jonathan Stroud
b446b8a865 arm64: zynqmp: Add eeprom labels for System Controller dts
Label all eeproms so we can open by label rather than a fixed i2c address.

Signed-off-by: Jonathan Stroud <jonathan.stroud@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/878558c3c859599d29bc4ae2278baebf84b368e0.1736152966.git.michal.simek@amd.com
2025-01-14 08:29:45 +01:00
Michal Simek
e7ce901452 arm64: zynqmp: Enable iio-hwmon description only for SOM
Description is coming from SOM only that's why enable it only on SOM.

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/08ee4ce2fe242905dd99cea2b87373b57d8fea91.1736152939.git.michal.simek@amd.com
2025-01-14 08:29:45 +01:00
Michal Simek
bb1562e347 arm64: zynqmp: Sync DTs with Linux v6.13-rc1
Sync zynqmp* DTS files with v6.13-rc1 Linux kernel including three patches
from Sean:
arm64: zynqmp: Enable AMS for all boards
arm64: zynqmp: Expose AMS to userspace as HWMON
arm64: zynqmp: Add thermal zones

Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/06e466d64c9d8e718e2f06a76cc65d6da2a37a7b.1733996500.git.michal.simek@amd.com
2025-01-14 08:29:45 +01:00
Naman Trivedi
9ce8f720af arm64: zynqmp: add clock-output-names property in clock nodes
Replace underscores with hyphens in the clock node names as per
dt-schema rule.

Also, add clock-output-names property to all clock nodes, so that the
resulting clock name do not change when clock node name is changed.

Signed-off-by: Naman Trivedi <naman.trivedimanojbhai@amd.com>
Acked-by: Senthil Nathan Thangaraj <senthilnathan.thangaraj@amd.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/1080e31393c3e1b49735b77e7ddc14d570b83222.1733991159.git.michal.simek@amd.com
2025-01-14 08:29:45 +01:00
Michal Simek
71db6bf278 arm64: zynqmp: Do not use hardcoded address in do_zynqmp_reboot()
multi_boot is already the part of csu_base structure that's why use it
directly instead of using register offset value.

Fixes: fc001432e5b0 ("arm64: zynqmp: Add u-boot command to boot into recovery image")
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/3e5c6ea426b81cc73b90e6425764e41a98deb2a6.1733735454.git.michal.simek@amd.com
2025-01-14 08:29:45 +01:00
Marek Vasut
2fca3cf799 arm64: Add MIDR entries for Cortex-A57 and Cortex-A76
Add MIDR entries for Cortex-A57 and Cortex-A76 cores.
Those are used on R-Car Gen3 and Gen4 SoCs respectively.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-01-12 23:49:58 +01:00
Marek Vasut
ddb0f26dc4 arm64: Convert core type check macros into inline functions
Turn the core type check macros into inline functions to perform
better type checking on them. The inline functions get optimized
out in case they are not used. Indent the MIDR_PARTNUM_CORTEX_An
macros in preparation for addition of future three-digit cores
and use MIDR_PARTNUM_SHIFT in MIDR_PARTNUM_MASK to be consistent.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
2025-01-12 23:49:58 +01:00
Jonas Karlman
39389cfb3d rockchip: rk3308: Implement checkboard() to print SoC variant
Implement checkboard() to print current SoC variant used by a board,
e.g. one of:

  SoC:   RK3308
  SoC:   RK3308B
  SoC:   RK3308B-S

when U-Boot proper is running.

  U-Boot 2025.01-rc1 (Nov 02 2024 - 20:26:25 +0000)

  Model: Radxa ROCK Pi S
  SoC:   RK3308B
  DRAM:  512 MiB (effective 510 MiB)

Information about the SoC variant is read from GRF.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2025-01-10 18:56:22 -06:00
Jonas Karlman
1c2ffcd5e6 rockchip: rk3588: Implement checkboard() to print SoC variant
Implement checkboard() to print current SoC model used by a board,
e.g. one of:

  SoC:   RK3582
  SoC:   RK3588
  SoC:   RK3588J
  SoC:   RK3588S
  SoC:   RK3588S2

when U-Boot proper is running.

  U-Boot 2025.01-rc1 (Nov 10 2024 - 00:31:29 +0000)

  Model: Generic RK3588S/RK3588
  SoC:   RK3588S2
  DRAM:  8 GiB

Information about the SoC model and variant is read from OTP.

Also update rk3588s-u-boot.dtsi to include OTP in U-Boot pre-reloc phase,
where checkboard() is called.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: FUKAUMI Naoki <naoki@radxa.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:22 -06:00
Jonas Karlman
1a520a9b20 rockchip: rk356x: Implement checkboard() to print SoC variant
Implement checkboard() to print current SoC model used by a board,
e.g. one of:

  SoC:   RK3566
  SoC:   RK3566T
  SoC:   RK3568
  SoC:   RK3568B2
  SoC:   RK3568J

when U-Boot proper is running.

  U-Boot 2025.01-rc1 (Nov 10 2024 - 00:39:37 +0000)

  Model: Generic RK3566/RK3568
  SoC:   RK3568J
  DRAM:  8 GiB (effective 7.7 GiB)

Information about the SoC model and variant is read from OTP.

Also update rk356x-u-boot.dtsi to include OTP in U-Boot pre-reloc phase,
where checkboard() is called.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Tested-by: FUKAUMI Naoki <naoki@radxa.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:22 -06:00
Heiko Stuebner
46e371cd31 clk: rockchip: rk3588: fix mask define for aclk_vop_root
The mask for aclk_vop_root is 3-bit wide, not 2-bit wide according
to the TRM, so set the mask accordingly.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:22 -06:00
Jonas Karlman
dc53e48d17 rockchip: rk3588-nanopc-t6-lts: Add missing board -u-boot.dtsi
The commit 7cec3e701940 ("rockchip: rk3588-nanopc-t6: Add support for
NanoPC-T6 LTS") added support for the LTS variant of NanoPC T6. However,
a board specific -u-boot.dtsi file was never added.

Due to the missing -u-boot.dtsi file the LTS fdt included in the FIT is
never tagged with bootph props.

When ENV_IS_IN_SPI_FLASH is enabled, not enabled in defconfig, the env
can successfully load from SPI flash on the non-LTS variant, something
that does not work on the LTS variant due to missing bootph-some-ram
props in the LTS fdt.

Fix this by adding a LTS -u-boot.dtsi file that just include the non-LTS
-u-boot.dtsi file.

Reported-by: Ricardo Pardini <ricardo@pardini.net>
Fixes: 7cec3e701940 ("rockchip: rk3588-nanopc-t6: Add support for NanoPC-T6 LTS")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:22 -06:00
Jonas Karlman
af518a1dfe rockchip: rk3399: Drop unneeded bob and kevin board specific code
The IO-domain driver will configure io_vsel and always-on/boot-on
regulators will be enabled based on the board device tree now that
required nodes and Kconfig options is enabled for SPL.

Remove the bob and kevin board specific code from the common rk3399.c,
the IO-domain and regulator driver provide similar functionality.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
2025-01-10 18:56:21 -06:00
Jonas Karlman
54fddb9d88 rockchip: rk3399-gru: Include pinctrl and regulators in SPL
Add bootph props and enable related Kconfig options to include vital
regulators in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:21 -06:00
Jonas Karlman
1c34c315e7 rockchip: rk3399-gru: Remove unused nodes from xPL control FDT
The eMMC PHY and SPI flash is not used in all xPL phases.

Change to no longer include emmc_phy and spi_flash in all xPL phases.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:21 -06:00
Jonas Karlman
51b3e46363 rockchip: rk3399: Drop common Kconfig options already implied
The last two RK3399 boards, chromebook bob and kevin, have now migraded
to use common bss and stack addresses.

Cleanup and remove Kconfig options no longer needed in rk3399/Kconfig
when all boards now use common bss and stack addresses.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:21 -06:00
Jonas Karlman
55c9e3e5b2 rockchip: rk3399-gru: Include binman generated FIT in u-boot.rom image
The u-boot.rom image contain u-boot.img FIT instead of the FIT generated
by binman for the u-boot-rockchip.bin image.

Change to include the binman generated FIT for the u-boot.rom image.

This change result in TF-A being included and the use sha256 instead of
crc32 checksum in the u-boot.rom FIT.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:21 -06:00
Jonas Karlman
656892f102 rockchip: rk3399-gru: Fix include of TPL in u-boot.rom image
The chromebook specific u-boot.rom image does not include TPL when
building with TPL=y or ROCKCHIP_EXTERNAL_TPL=y.

Fix this by adding rockchip-tpl and u-boot-tpl nodes to the mkimage node
for the u-boot.rom binman image.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:18 -06:00
Jonas Karlman
01048aa9f8 rockchip: rk3399-gru: Use SYS_SPI_U_BOOT_OFFS value in offset prop
Use the offset configured with SYS_SPI_U_BOOT_OFFS Kconfig option
instead of a hardcoded 0x40000 for the FIT payload offset.

This has no intended impact as SYS_SPI_U_BOOT_OFFS=0x40000.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:18 -06:00
Jonas Karlman
4576e65a5d rockchip: rk3399: Fix TPL build of bob and kevin
Building chromebook_bob/kevin with TPL=y ends with a linking error:

  arch/arm/mach-rockchip/rk3399/rk3399.o: in function `board_debug_uart_init':
  arch/arm/mach-rockchip/rk3399/rk3399.c:148:(.text.board_debug_uart_init+0x34):
    undefined reference to `spl_gpio_output'
  arch/arm/mach-rockchip/rk3399/rk3399.c:148:(.text.board_debug_uart_init+0x34):
    relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `spl_gpio_output'

  make[2]: *** [scripts/Makefile.xpl:542: tpl/u-boot-tpl] Error 1
  make[1]: *** [Makefile:2134: tpl/u-boot-tpl] Error 2
  make: *** [Makefile:568: __build_one_by_one] Error 2

Change to only use spl_gpio functions in SPL to fix this.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:18 -06:00
Johan Jonker
43728edfc2 rockchip: use OF_UPSTREAM for rk3066a/rk3188
The device tree for rk3066a/rk3188 combined is now
available in the /dts/upstream directory.
Use imply OF_UPSTREAM to migrate all rk3066a/rk3188 boards.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:17 -06:00
FUKAUMI Naoki
e1661639d9 rockchip: Add support for Radxa ROCK 5C
Radxa ROCK 5C[1] is a Rockchip RK3588S2 based single board computer.

[1] https://radxa.com/products/rock5/5c

Signed-off-by: FUKAUMI Naoki <naoki@radxa.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:17 -06:00
Tianling Shen
bf4a33e725 board: rockchip: add FriendlyElec NanoPi R3S
The NanoPi R3S(as "R3S") is an open source platform with dual-Gbps
Ethernet ports designed and developed by FriendlyElec for IoT
applications.

Specification:
- Rockchip RK3566
- 2GB LPDDR4X RAM
- optional 32GB eMMC module
- SD card slot
- 2x 1000 Base-T
- 3x LEDs (POWER, LAN, WAN)
- 2x Buttons (Reset, MaskROM)
- 1x USB 3.0 Port
- Type-C 5V 2A Power

Signed-off-by: Tianling Shen <cnsztl@gmail.com>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:16 -06:00
Jonas Karlman
826267d3ea rockchip: rk3288-tinker: Use common bss and stack addresses
Migrate to use common bss, stack and malloc heap size and addresses to
unify memory use in TPL, SPL and pre-reloc.

Ensure SYS_MALLOC_F_LEN and TPL variant stay at 0x2000 and is unaffected
on other boards not changed to use common malloc heap size.

ENV_OFFSET is using the default value of 0x3f8000 and is also dropped.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
dc691ef150 rockchip: rk3288-firefly: Fix slow Ethernet initializion
For some reason the Ethernet PHY reset delay is set to 1 second, this
cause an unneccecery long boot delay.

Firefly-RK3288 use RTL8211 Ethernet PHY, datasheet list an initial 10ms
delay and then a 30-76ms delay before accessing registers.

Change to use 80ms delay instead of a full second to speed up Ethernet
initializion in U-Boot.

Also enable PHY_REALTEK, DM_ETH_PHY and PHY_GIGE to improve Ethernet PHY
support in U-Boot.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
338cfeac31 rockchip: rk3288-firefly: Migrate to OF_UPSTREAM
The device tree for Firefly-RK3288 in dts/upstream can be used as-is by
U-Boot, migrate board to use OF_UPSTREAM.

Add chosen stdout-path prop to board u-boot.dtsi as it is missing in DT
from dts/upstream. Also change to use the upstream power_led symbol.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
5b95daa832 rockchip: rk3288-tinker: Include mmc nodes in pre-reloc for env load
Include mmc related nodes in U-Boot proper pre-reloc phase to ensure
environment can be loaded from mmc devices.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
fcd4949192 rockchip: rk3288-tinker: Drop unused vcc_sd regulator from SPL
The sdmmc power come from vcc33_sd pmic regulator and not from the
vcc_sd fixed regulator, as currently defined in the in-tree DT.

Drop vcc_sd and the related gpio7 and sdmmc_pwr nodes from being
included in SPL along with any related Kconfig option. Also enable
SPL_DM_SEQ_ALIAS to ensure aliases is handled correctly in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
cf84730409 rockchip: rk3288-firefly: Include sdmmc regulator in SPL
Add bootph props and enable related Kconfig options to include the sdmmc
regulator in SPL. Also enable SPL_DM_SEQ_ALIAS to ensure aliases is
handled correctly in SPL.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
7f13ffa280 rockchip: rk3288-tinker: Only include required DT nodes in TPL
Drop the unneeded bootph-all prop from dmc node, it is already defined
in soc u-boot.dtsi.

Remove booth-all prop from gpio7 node, this node is not needed in TPL.

Adjust bootph props to include pinctrl related nodes for UART2.

Remove the explicit bootph-all prop from the pinctrl node, any bootph-
prop will automatically be propagated to the pinctrl node.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
8baa2d8958 rockchip: rk3288-firefly: Include required DT nodes in xPL
Add bootph- props to emmc, sdmmc, uart and related pinctrl nodes to
ensure devices and pinctrl can be used in xPL and U-Boot pre-reloc.

Remove the explicit bootph-all prop from the pinctrl node, any bootph-
prop will automatically be propagated to the pinctrl node.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
cabe2ef766 rockchip: rk3288-tinker: Sort u-boot.dtsi nodes alphabetically
Sort the nodes in rk3288-tinker u-boot.dtsi files in alphabetical order.

This has no intended change to board DTs and only rearrange nodes in
preparation for future changes.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
14c13f295a rockchip: rk3288-firefly: Use common bss and stack addresses
Migrate to use common bss, stack and malloc heap size and addresses to
unify memory use in TPL, SPL and pre-reloc.

ENV_OFFSET is using the default value of 0x3f8000 and is also dropped.

Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
2025-01-10 18:56:15 -06:00
Jonas Karlman
8b6227c229 rockchip: rk3288: Fix bootph prop for vop nodes
The vop nodes does not need to be included in xPL control FDT, they only
need to 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>
2025-01-10 18:56:15 -06:00