summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-12-15 11:20:43 -0600
committerTom Rini <[email protected]>2025-12-15 11:20:43 -0600
commit41eddd89235303309ea4e8f2d1f5a076605ee8ce (patch)
treea186ea2a6d40ebac338fc67b61947caa5ba655b5 /arch
parent87d85139a96a39429120cca838e739408ef971a2 (diff)
parent0ed7abc85d1664a3d7432795a7126ff6a1d01147 (diff)
Merge tag 'u-boot-rockchip-20251214' of https://source.denx.de/u-boot/custodians/u-boot-rockchip
CI: https://source.denx.de/u-boot/custodians/u-boot-rockchip/-/pipelines/28748 Please pull the updates for rockchip platform: - New Board support: rk3588 Radxa ROCK 5T, ROCK 5B+; - I2C Fixes; - RAM boot from maskrom;
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/dts/rk3588-rock-5b-plus-u-boot.dtsi3
-rw-r--r--arch/arm/dts/rk3588-rock-5b-u-boot.dtsi5
-rw-r--r--arch/arm/dts/rk3588-rock-5t-u-boot.dtsi3
-rw-r--r--arch/arm/dts/rockchip-u-boot.dtsi33
-rw-r--r--arch/arm/include/asm/arch-rockchip/sdram.h3
-rw-r--r--arch/arm/mach-rockchip/Kconfig14
-rw-r--r--arch/arm/mach-rockchip/rk3308/Kconfig3
-rw-r--r--arch/arm/mach-rockchip/rk3568/Kconfig3
-rw-r--r--arch/arm/mach-rockchip/rk3588/Kconfig3
-rw-r--r--arch/arm/mach-rockchip/sdram.c15
-rw-r--r--arch/arm/mach-rockchip/spl-boot-order.c14
11 files changed, 84 insertions, 15 deletions
diff --git a/arch/arm/dts/rk3588-rock-5b-plus-u-boot.dtsi b/arch/arm/dts/rk3588-rock-5b-plus-u-boot.dtsi
new file mode 100644
index 00000000000..c07696c8391
--- /dev/null
+++ b/arch/arm/dts/rk3588-rock-5b-plus-u-boot.dtsi
@@ -0,0 +1,3 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "rk3588-rock-5b-u-boot.dtsi"
diff --git a/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi b/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi
index d51fbf51cb8..e07b549c767 100644
--- a/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi
+++ b/arch/arm/dts/rk3588-rock-5b-u-boot.dtsi
@@ -46,6 +46,11 @@
};
};
+&saradc {
+ bootph-pre-ram;
+ vdd-microvolts = <1800000>;
+};
+
&sdhci {
cap-mmc-highspeed;
mmc-hs200-1_8v;
diff --git a/arch/arm/dts/rk3588-rock-5t-u-boot.dtsi b/arch/arm/dts/rk3588-rock-5t-u-boot.dtsi
new file mode 100644
index 00000000000..c07696c8391
--- /dev/null
+++ b/arch/arm/dts/rk3588-rock-5t-u-boot.dtsi
@@ -0,0 +1,3 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include "rk3588-rock-5b-u-boot.dtsi"
diff --git a/arch/arm/dts/rockchip-u-boot.dtsi b/arch/arm/dts/rockchip-u-boot.dtsi
index cc2feed6464..71d7623fe2c 100644
--- a/arch/arm/dts/rockchip-u-boot.dtsi
+++ b/arch/arm/dts/rockchip-u-boot.dtsi
@@ -226,5 +226,38 @@
};
};
#endif /* CONFIG_ROCKCHIP_SPI_IMAGE */
+
+#ifdef CONFIG_ROCKCHIP_MASKROM_IMAGE
+ simple-bin-usb471 {
+ filename = "u-boot-rockchip-usb471.bin";
+
+#ifdef CONFIG_ROCKCHIP_EXTERNAL_TPL
+ rockchip-tpl {
+ };
+#elif defined(CONFIG_TPL)
+ u-boot-tpl {
+ no-write-symbols;
+ };
+#endif
+ };
+
+ simple-bin-usb472 {
+ filename = "u-boot-rockchip-usb472.bin";
+ pad-byte = <0x00>;
+
+ u-boot-spl {
+ no-write-symbols;
+ };
+
+#ifdef HAS_FIT
+ fit {
+ insert-template = <&fit_template>;
+#else
+ u-boot-img {
+#endif
+ offset = <(CONFIG_SPL_LOAD_FIT_ADDRESS - CFG_SYS_SDRAM_BASE)>;
+ };
+ };
+#endif /* CONFIG_ROCKCHIP_MASKROM_IMAGE */
};
#endif /* CONFIG_SPL */
diff --git a/arch/arm/include/asm/arch-rockchip/sdram.h b/arch/arm/include/asm/arch-rockchip/sdram.h
index 4fb45ac5c76..476fc1c4ee3 100644
--- a/arch/arm/include/asm/arch-rockchip/sdram.h
+++ b/arch/arm/include/asm/arch-rockchip/sdram.h
@@ -87,6 +87,9 @@ enum {
#define SYS_REG_CS1_COL_SHIFT(ch) (0 + (ch) * 2)
#define SYS_REG_CS1_COL_MASK 3
+/* Get sdram type decode from reg */
+u8 rockchip_sdram_type(phys_addr_t reg);
+
/* Get sdram size decode from reg */
size_t rockchip_sdram_size(phys_addr_t reg);
diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index 342933ca509..e32e49ff59a 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -706,6 +706,14 @@ config ROCKCHIP_SPI_IMAGE
option to produce a SPI-flash image containing U-Boot. The image
is built by binman. U-Boot sits near the start of the image.
+config ROCKCHIP_MASKROM_IMAGE
+ bool "Build a maskrom mode image for Rockchip"
+ depends on TPL || ROCKCHIP_EXTERNAL_TPL
+ select SPL_RAM_DEVICE
+ help
+ Rockchip SoCs support maskrom mode boot over USB. Enable this
+ option to produce maskrom mode boot images containing U-Boot.
+
config LNX_KRNL_IMG_TEXT_OFFSET_BASE
default TEXT_BASE
@@ -768,9 +776,9 @@ config TPL_SYS_MALLOC_F_LEN
default 0x4000 if CUSTOM_SYS_INIT_SP_ADDR = 0x03f00000
config TEXT_BASE
- default 0x60200000 if SPL_TEXT_BASE = 0x60000000
- default 0x40200000 if SPL_TEXT_BASE = 0x40000000
- default 0x00200000 if SPL_TEXT_BASE = 0x00000000
+ default 0x60800000 if SPL_TEXT_BASE = 0x60000000
+ default 0x40800000 if SPL_TEXT_BASE = 0x40000000
+ default 0x00800000 if SPL_TEXT_BASE = 0x00000000
config SPL_TEXT_BASE
default 0x60000000 if ROCKCHIP_RK3036 || ROCKCHIP_RK3066 || \
diff --git a/arch/arm/mach-rockchip/rk3308/Kconfig b/arch/arm/mach-rockchip/rk3308/Kconfig
index 06572d545f6..b8d25c52542 100644
--- a/arch/arm/mach-rockchip/rk3308/Kconfig
+++ b/arch/arm/mach-rockchip/rk3308/Kconfig
@@ -17,9 +17,6 @@ config ROCKCHIP_STIMER_BASE
config SYS_SOC
default "rk3308"
-config TEXT_BASE
- default 0x00600000
-
source "board/rockchip/evb_rk3308/Kconfig"
source "board/firefly/firefly-rk3308/Kconfig"
diff --git a/arch/arm/mach-rockchip/rk3568/Kconfig b/arch/arm/mach-rockchip/rk3568/Kconfig
index 01b53a47ddb..2730220a18e 100644
--- a/arch/arm/mach-rockchip/rk3568/Kconfig
+++ b/arch/arm/mach-rockchip/rk3568/Kconfig
@@ -70,9 +70,6 @@ config ROCKCHIP_STIMER_BASE
config SYS_SOC
default "rk3568"
-config TEXT_BASE
- default 0x00a00000
-
source "board/rockchip/evb_rk3568/Kconfig"
source "board/anbernic/rgxx3_rk3566/Kconfig"
source "board/hardkernel/odroid_m1/Kconfig"
diff --git a/arch/arm/mach-rockchip/rk3588/Kconfig b/arch/arm/mach-rockchip/rk3588/Kconfig
index 9fbe3f225aa..60c16d2f32d 100644
--- a/arch/arm/mach-rockchip/rk3588/Kconfig
+++ b/arch/arm/mach-rockchip/rk3588/Kconfig
@@ -417,9 +417,6 @@ config ROCKCHIP_STIMER_BASE
config SYS_SOC
default "rk3588"
-config TEXT_BASE
- default 0x00a00000
-
source "board/armsom/sige7-rk3588/Kconfig"
source "board/coolpi/genbook_cm5_rk3588/Kconfig"
source "board/edgeble/neural-compute-module-6/Kconfig"
diff --git a/arch/arm/mach-rockchip/sdram.c b/arch/arm/mach-rockchip/sdram.c
index 3bc482331c7..d560f90e873 100644
--- a/arch/arm/mach-rockchip/sdram.c
+++ b/arch/arm/mach-rockchip/sdram.c
@@ -345,6 +345,21 @@ int dram_init_banksize(void)
return 0;
}
+u8 rockchip_sdram_type(phys_addr_t reg)
+{
+ u32 dram_type, version;
+ u32 sys_reg2 = readl(reg);
+ u32 sys_reg3 = readl(reg + 4);
+
+ dram_type = (sys_reg2 >> SYS_REG_DDRTYPE_SHIFT) & SYS_REG_DDRTYPE_MASK;
+ version = (sys_reg3 >> SYS_REG_VERSION_SHIFT) & SYS_REG_VERSION_MASK;
+ if (version >= 3)
+ dram_type |= ((sys_reg3 >> SYS_REG_EXTEND_DDRTYPE_SHIFT) &
+ SYS_REG_EXTEND_DDRTYPE_MASK) << 3;
+
+ return dram_type;
+}
+
size_t rockchip_sdram_size(phys_addr_t reg)
{
u32 rank, cs0_col, bk, cs0_row, cs1_row, bw, row_3_4;
diff --git a/arch/arm/mach-rockchip/spl-boot-order.c b/arch/arm/mach-rockchip/spl-boot-order.c
index 1ea1033b5ea..6572dde29f6 100644
--- a/arch/arm/mach-rockchip/spl-boot-order.c
+++ b/arch/arm/mach-rockchip/spl-boot-order.c
@@ -8,6 +8,7 @@
#include <log.h>
#include <mmc.h>
#include <spl.h>
+#include <asm/arch-rockchip/bootrom.h>
#include <asm/global_data.h>
#include <dm/uclass-internal.h>
@@ -98,15 +99,22 @@ __weak const char *board_spl_was_booted_from(void)
void board_boot_order(u32 *spl_boot_list)
{
+ int idx = 0;
+
+ /* Add RAM boot for maskrom mode boot over USB */
+ if (BROM_BOOTSOURCE_ID_ADDR && CONFIG_IS_ENABLED(RAM_DEVICE) &&
+ read_brom_bootsource_id() == BROM_BOOTSOURCE_USB) {
+ spl_boot_list[idx++] = BOOT_DEVICE_RAM;
+ }
+
/* In case of no fdt (or only plat), use spl_boot_device() */
if (!CONFIG_IS_ENABLED(OF_CONTROL) || CONFIG_IS_ENABLED(OF_PLATDATA)) {
- spl_boot_list[0] = spl_boot_device();
+ spl_boot_list[idx++] = spl_boot_device();
return;
}
const void *blob = gd->fdt_blob;
int chosen_node = fdt_path_offset(blob, "/chosen");
- int idx = 0;
int elem;
int boot_device;
int node;
@@ -115,7 +123,7 @@ void board_boot_order(u32 *spl_boot_list)
if (chosen_node < 0) {
debug("%s: /chosen not found, using spl_boot_device()\n",
__func__);
- spl_boot_list[0] = spl_boot_device();
+ spl_boot_list[idx++] = spl_boot_device();
return;
}