Skip to contentSkip to conversation

rockchip: move ROCKCHIP_STIMER_BASE to Kconfig

PATCH Superseded Johan Jonker 5 participants 19 messages Dec 30, 2021 – Mar 16, 2022

Subsystems (3)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/6 rockchip: move ROCKCHIP_STIMER_BASE to Kconfig

Move ROCKCHIP_STIMER_BASE to Kconfig.

---

Changed V3:
add ROCKCHIP_STIMER

---
 arch/arm/mach-rockchip/Kconfig        | 22 ++++++++++++++++++++++
 arch/arm/mach-rockchip/px30/Kconfig   |  3 +++
 arch/arm/mach-rockchip/rk3036/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3128/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk322x/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3288/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3308/Kconfig | 10 ++++++----
 arch/arm/mach-rockchip/rk3328/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3368/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3399/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3568/Kconfig |  3 +++
 include/configs/px30_common.h         |  1 -
 include/configs/rk3036_common.h       |  1 -
 include/configs/rk3128_common.h       |  1 -
 include/configs/rk322x_common.h       |  1 -
 include/configs/rk3288_common.h       |  1 -
 include/configs/rk3308_common.h       |  1 -
 include/configs/rk3328_common.h       |  1 -
 include/configs/rk3368_common.h       |  1 -
 include/configs/rk3399_common.h       |  1 -
 include/configs/rk3568_common.h       |  1 -
 21 files changed, 55 insertions(+), 14 deletions(-)
arch/arm/mach-rockchip/Kconfig +22 -0
index da6871eb..7a624c64 100644
@@ -343,6 +343,28 @@ config ROCKCHIP_BOOT_MODE_REG
 	  The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h)
 	  according to the value from this register.
 
+config ROCKCHIP_STIMER
+	bool "Rockchip STIMER support"
+	default y
+	depends on (ROCKCHIP_PX30||   \
+		    ROCKCHIP_RK3036|| \
+		    ROCKCHIP_RK3128|| \
+		    ROCKCHIP_RK322X|| \
+		    ROCKCHIP_RK3288|| \
+		    ROCKCHIP_RK3308|| \
+		    ROCKCHIP_RK3328|| \
+		    ROCKCHIP_RK3368|| \
+		    ROCKCHIP_RK3399|| \
+		    ROCKCHIP_RK3568)
+	help
+	  Enable Rockchip STIMER support.
+
+config ROCKCHIP_STIMER_BASE
+	hex "Rockchip secure timer base address"
+	depends on ROCKCHIP_STIMER
+	help
+	  Rockchip secure timer base address.
+
 config ROCKCHIP_SPL_RESERVE_IRAM
 	hex "Size of IRAM reserved in SPL"
 	default 0
arch/arm/mach-rockchip/px30/Kconfig +3 -0
index aa5cc471..42cc111b 100644
@@ -30,6 +30,9 @@ config TARGET_PX30_CORE
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xff010200
 
+config ROCKCHIP_STIMER_BASE
+	default 0xff220020
+
 config SYS_SOC
 	default "px30"
 
arch/arm/mach-rockchip/rk3036/Kconfig +3 -0
index b746795d..111531be 100644
@@ -16,6 +16,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0x200081c8
 
+config ROCKCHIP_STIMER_BASE
+	default 0x200440a0
+
 config SYS_SOC
 	default "rk3036"
 
arch/arm/mach-rockchip/rk3128/Kconfig +3 -0
index b867401c..9cc494eb 100644
@@ -16,6 +16,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0x100a0038
 
+config ROCKCHIP_STIMER_BASE
+	default 0x200440a0
+
 config SYS_SOC
 	default "rk3128"
 
arch/arm/mach-rockchip/rk322x/Kconfig +3 -0
index 6458cd55..058f848d 100644
@@ -8,6 +8,9 @@ config TARGET_EVB_RK3229
 config ROCKCHIP_BOOT_MODE_REG
 	default 0x110005c8
 
+config ROCKCHIP_STIMER_BASE
+	default 0x110d0020
+
 config SYS_SOC
 	default "rk322x"
 
arch/arm/mach-rockchip/rk3288/Kconfig +3 -0
index f37b1bdf..dd8c7826 100644
@@ -148,6 +148,9 @@ config ROCKCHIP_FAST_SPL
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xff730094
 
+config ROCKCHIP_STIMER_BASE
+	default 0xff810020
+
 config SYS_SOC
 	default "rk3288"
 
arch/arm/mach-rockchip/rk3308/Kconfig +6 -4
index 8fa536e1..194353e4 100644
@@ -8,6 +8,12 @@ config TARGET_ROC_RK3308_CC
        bool "Firefly roc-rk3308-cc"
 	select BOARD_LATE_INIT
 
+config ROCKCHIP_BOOT_MODE_REG
+	default 0xff000500
+
+config ROCKCHIP_STIMER_BASE
+	default 0xff1b00a0
+
 config SYS_SOC
 	default "rk3308"
 
@@ -17,10 +23,6 @@ config SYS_MALLOC_F_LEN
 config SPL_SERIAL
 	default y
 
-config ROCKCHIP_BOOT_MODE_REG
-	default 0xff000500
-
-
 source "board/rockchip/evb_rk3308/Kconfig"
 source "board/firefly/firefly-rk3308/Kconfig"
 
arch/arm/mach-rockchip/rk3328/Kconfig +3 -0
index d13a1690..f6f1e06a 100644
@@ -15,6 +15,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xff1005c8
 
+config ROCKCHIP_STIMER_BASE
+	default 0xff1d0020
+
 config SYS_SOC
 	default "rk3328"
 
arch/arm/mach-rockchip/rk3368/Kconfig +3 -0
index 78eb96df..104db367 100644
@@ -45,6 +45,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xff738200
 
+config ROCKCHIP_STIMER_BASE
+	default 0xff830020
+
 config SYS_SOC
 	default "rk3368"
 
arch/arm/mach-rockchip/rk3399/Kconfig +3 -0
index 17628f91..4bc15c1b 100644
@@ -114,6 +114,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xff320300
 
+config ROCKCHIP_STIMER_BASE
+	default 0xff8680a0
+
 config SYS_SOC
 	default "rk3399"
 
arch/arm/mach-rockchip/rk3568/Kconfig +3 -0
index 201c63c2..4e7c02cc 100644
@@ -9,6 +9,9 @@ config TARGET_EVB_RK3568
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xfdc20200
 
+config ROCKCHIP_STIMER_BASE
+	default 0xfdd1c020
+
 config SYS_SOC
 	default "rk3568"
 
include/configs/px30_common.h +0 -1
index 09923871..dc609013 100644
@@ -12,7 +12,6 @@
 
 #define CONFIG_SYS_NS16550_MEM32
 
-#define CONFIG_ROCKCHIP_STIMER_BASE	0xff220020
 #define COUNTER_FREQUENCY		24000000
 
 /* FIXME: ff020000 is pmu_mem (10k), while ff0e0000 is regular int_mem */
include/configs/rk3036_common.h +0 -1
index b133d8ec..10cba727 100644
@@ -10,7 +10,6 @@
 
 #define CONFIG_SYS_CBSIZE		1024
 
-#define CONFIG_ROCKCHIP_STIMER_BASE	0x200440a0
 #define COUNTER_FREQUENCY		24000000
 #define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ_CLOCK		24000000
include/configs/rk3128_common.h +0 -1
index 8b7a0bbb..71f66d57 100644
@@ -11,7 +11,6 @@
 #define CONFIG_SYS_MAXARGS		16
 #define CONFIG_SYS_CBSIZE		1024
 
-#define CONFIG_ROCKCHIP_STIMER_BASE	0x200440a0
 #define COUNTER_FREQUENCY		24000000
 #define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ_CLOCK		24000000
include/configs/rk322x_common.h +0 -1
index a46b1ffe..aff24018 100644
@@ -11,7 +11,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 #define CONFIG_SYS_BOOTM_LEN	(64 << 20)	/*  64M */
 
-#define CONFIG_ROCKCHIP_STIMER_BASE	0x110d0020
 #define COUNTER_FREQUENCY		24000000
 #define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ_CLOCK		24000000
include/configs/rk3288_common.h +0 -1
index abbb2739..c781bc7e 100644
@@ -13,7 +13,6 @@
 
 #define CONFIG_SYS_CBSIZE		1024
 
-#define CONFIG_ROCKCHIP_STIMER_BASE	0xff810020
 #define COUNTER_FREQUENCY		24000000
 #define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ_CLOCK		24000000
include/configs/rk3308_common.h +0 -1
index 496f4628..edc535fe 100644
@@ -16,7 +16,6 @@
 
 #define CONFIG_SYS_NS16550_MEM32
 
-#define CONFIG_ROCKCHIP_STIMER_BASE	0xff1b00a0
 #define CONFIG_IRAM_BASE		0xfff80000
 #define CONFIG_SYS_INIT_SP_ADDR		0x00800000
 #define CONFIG_SPL_STACK		0x00400000
include/configs/rk3328_common.h +0 -1
index c1e26a01..8a5f0c89 100644
@@ -10,7 +10,6 @@
 
 #define CONFIG_IRAM_BASE		0xff090000
 
-#define CONFIG_ROCKCHIP_STIMER_BASE    0xff1d0020
 #define COUNTER_FREQUENCY		24000000
 
 #define CONFIG_SYS_CBSIZE		1024
include/configs/rk3368_common.h +0 -1
index 8b239ca0..239296c1 100644
@@ -15,7 +15,6 @@
 #define SDRAM_MAX_SIZE			0xff000000
 #define CONFIG_SYS_CBSIZE		1024
 
-#define CONFIG_ROCKCHIP_STIMER_BASE	0xff830020
 #define COUNTER_FREQUENCY		24000000
 
 #define CONFIG_IRAM_BASE		0xff8c0000
include/configs/rk3399_common.h +0 -1
index ed72c8bb..4037dba5 100644
@@ -11,7 +11,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 
 #define COUNTER_FREQUENCY               24000000
-#define CONFIG_ROCKCHIP_STIMER_BASE	0xff8680a0
 
 #define CONFIG_IRAM_BASE		0xff8c0000
 
include/configs/rk3568_common.h +0 -1
index afe5050e..705c3454 100644
@@ -11,7 +11,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 
 #define COUNTER_FREQUENCY               24000000
-#define CONFIG_ROCKCHIP_STIMER_BASE	0xfdd1c020
 
 #define CONFIG_IRAM_BASE		0xfdcc0000
 
Signature · 1 line
2.20.1
#1 lore raw

PATCH v3 2/6 rockchip: move CONFIG_SYS_ARCH_TIMER to Kconfig

The config item SYS_ARCH_TIMER is default y if ARM64. Move CONFIG_SYS_ARCH_TIMER to Kconfig for the Rockchip CPU_V7A SoCs that have ARM Generic Timer support.

---
 arch/arm/mach-rockchip/rk3036/Kconfig | 3 +++
 arch/arm/mach-rockchip/rk3128/Kconfig | 3 +++
 arch/arm/mach-rockchip/rk322x/Kconfig | 3 +++
 arch/arm/mach-rockchip/rk3288/Kconfig | 3 +++
 include/configs/rk3036_common.h       | 1 -
 include/configs/rk3128_common.h       | 1 -
 include/configs/rk322x_common.h       | 1 -
 include/configs/rk3288_common.h       | 1 -
 8 files changed, 12 insertions(+), 4 deletions(-)
arch/arm/mach-rockchip/rk3036/Kconfig +3 -0
index 111531be..99754138 100644
@@ -19,6 +19,9 @@ config ROCKCHIP_BOOT_MODE_REG
 config ROCKCHIP_STIMER_BASE
 	default 0x200440a0
 
+config SYS_ARCH_TIMER
+	default y
+
 config SYS_SOC
 	default "rk3036"
 
arch/arm/mach-rockchip/rk3128/Kconfig +3 -0
index 9cc494eb..f6f7de1c 100644
@@ -19,6 +19,9 @@ config ROCKCHIP_BOOT_MODE_REG
 config ROCKCHIP_STIMER_BASE
 	default 0x200440a0
 
+config SYS_ARCH_TIMER
+	default y
+
 config SYS_SOC
 	default "rk3128"
 
arch/arm/mach-rockchip/rk322x/Kconfig +3 -0
index 058f848d..7d74b2cc 100644
@@ -11,6 +11,9 @@ config ROCKCHIP_BOOT_MODE_REG
 config ROCKCHIP_STIMER_BASE
 	default 0x110d0020
 
+config SYS_ARCH_TIMER
+	default y
+
 config SYS_SOC
 	default "rk322x"
 
arch/arm/mach-rockchip/rk3288/Kconfig +3 -0
index dd8c7826..35d471d5 100644
@@ -151,6 +151,9 @@ config ROCKCHIP_BOOT_MODE_REG
 config ROCKCHIP_STIMER_BASE
 	default 0xff810020
 
+config SYS_ARCH_TIMER
+	default y
+
 config SYS_SOC
 	default "rk3288"
 
include/configs/rk3036_common.h +0 -1
index 10cba727..5905518e 100644
@@ -11,7 +11,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 
 #define COUNTER_FREQUENCY		24000000
-#define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ_CLOCK		24000000
 
 #define CONFIG_SYS_INIT_SP_ADDR		0x60100000
include/configs/rk3128_common.h +0 -1
index 71f66d57..d77a7d7b 100644
@@ -12,7 +12,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 
 #define COUNTER_FREQUENCY		24000000
-#define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ_CLOCK		24000000
 
 #define CONFIG_IRAM_BASE		0x10080000
include/configs/rk322x_common.h +0 -1
index aff24018..3258820f 100644
@@ -12,7 +12,6 @@
 #define CONFIG_SYS_BOOTM_LEN	(64 << 20)	/*  64M */
 
 #define COUNTER_FREQUENCY		24000000
-#define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ_CLOCK		24000000
 
 #define CONFIG_SYS_INIT_SP_ADDR		0x61100000
include/configs/rk3288_common.h +0 -1
index c781bc7e..e2e0f70a 100644
@@ -14,7 +14,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 
 #define COUNTER_FREQUENCY		24000000
-#define CONFIG_SYS_ARCH_TIMER
 #define CONFIG_SYS_HZ_CLOCK		24000000
 
 #ifdef CONFIG_SPL_ROCKCHIP_BACK_TO_BROM
Signature · 1 line
2.20.1
Reviewed-by on v3 2/6
#2 lore raw

Re: [PATCH v3 2/6] rockchip: move CONFIG_SYS_ARCH_TIMER to Kconfig

Quoted 6 lines · Johan Jonker

The config item SYS_ARCH_TIMER is default y if ARM64. Move CONFIG_SYS_ARCH_TIMER to Kconfig for the Rockchip CPU_V7A SoCs that have ARM Generic Timer support.

Quoted 10 lines
---
 arch/arm/mach-rockchip/rk3036/Kconfig | 3 +++
 arch/arm/mach-rockchip/rk3128/Kconfig | 3 +++
 arch/arm/mach-rockchip/rk322x/Kconfig | 3 +++
 arch/arm/mach-rockchip/rk3288/Kconfig | 3 +++
 include/configs/rk3036_common.h       | 1 -
 include/configs/rk3128_common.h       | 1 -
 include/configs/rk322x_common.h       | 1 -
 include/configs/rk3288_common.h       | 1 -
 8 files changed, 12 insertions(+), 4 deletions(-)
#3 lore raw

PATCH v3 3/6 rockchip: spl: change call condition rockchip_stimer_init()

In reply to Johan Jonker

The Rockchip SoCs rk3066/rk3188 have no CONFIG_ROCKCHIP_STIMER_BASE defined. Currently only rk3188 has an exception. Make this more generic and call the function rockchip_stimer_init() only when CONFIG_ROCKCHIP_STIMER_BASE is available.

---

Changed V3:
use CONFIG_ROCKCHIP_STIMER

Changed V2:
use IS_ENABLED
add include kconfig.h
move define location so that rockchip_stimer_init() is always visible to the compiler

---
 arch/arm/mach-rockchip/spl.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
arch/arm/mach-rockchip/spl.c +8 -5
index 02c40fb3..1dac3805 100644
@@ -16,6 +16,7 @@
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <linux/bitops.h>
+#include <linux/kconfig.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -70,7 +71,6 @@ u32 spl_mmc_boot_mode(const u32 boot_device)
 	return MMCSD_MODE_RAW;
 }
 
-#if !defined(CONFIG_ROCKCHIP_RK3188)
 #define TIMER_LOAD_COUNT_L	0x00
 #define TIMER_LOAD_COUNT_H	0x04
 #define TIMER_CONTROL_REG	0x10
@@ -80,6 +80,7 @@ u32 spl_mmc_boot_mode(const u32 boot_device)
 
 __weak void rockchip_stimer_init(void)
 {
+#if defined(CONFIG_ROCKCHIP_STIMER_BASE)
 	/* If Timer already enabled, don't re-init it */
 	u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
 
@@ -94,8 +95,8 @@ __weak void rockchip_stimer_init(void)
 	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4);
 	writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE +
 	       TIMER_CONTROL_REG);
-}
 #endif
+}
 
 __weak int board_early_init_f(void)
 {
@@ -132,9 +133,11 @@ void board_init_f(ulong dummy)
 		hang();
 	}
 	arch_cpu_init();
-#if !defined(CONFIG_ROCKCHIP_RK3188)
-	rockchip_stimer_init();
-#endif
+
+	/* Init secure timer */
+	if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER))
+		rockchip_stimer_init();
+
 #ifdef CONFIG_SYS_ARCH_TIMER
 	/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
 	timer_init();
Signature · 1 line
2.20.1
Reviewed-by on v3 3/6
#4 lore raw

Re: [PATCH v3 3/6] rockchip: spl: change call condition rockchip_stimer_init()

Quoted 12 lines · Johan Jonker

The Rockchip SoCs rk3066/rk3188 have no CONFIG_ROCKCHIP_STIMER_BASE defined. Currently only rk3188 has an exception. Make this more generic and call the function rockchip_stimer_init() only when CONFIG_ROCKCHIP_STIMER_BASE is available.

---

Changed V3:
use CONFIG_ROCKCHIP_STIMER

Quoted 9 lines

Changed V2:
use IS_ENABLED
add include kconfig.h
move define location so that rockchip_stimer_init() is always visible to the compiler

---
 arch/arm/mach-rockchip/spl.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
#5 lore raw

PATCH v3 4/6 rockchip: tpl: change call condition rockchip_stimer_init()

In reply to Johan Jonker

The Rockchip SoCs rk3066/rk3188 have no CONFIG_ROCKCHIP_STIMER_BASE defined. Currently only rk3188 has an exception. Make this more generic and call the function rockchip_stimer_init() only when CONFIG_ROCKCHIP_STIMER_BASE is available.

---

Changed V3:
use CONFIG_ROCKCHIP_STIMER

Changed V2:
use IS_ENABLED
add include kconfig.h
move define location so that rockchip_stimer_init() is always visible to the compiler

---
 arch/arm/mach-rockchip/tpl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/mach-rockchip/tpl.c +6 -1
index 3c007bb4..2b561264 100644
@@ -15,6 +15,7 @@
 #include <asm/io.h>
 #include <asm/arch-rockchip/bootrom.h>
 #include <linux/bitops.h>
+#include <linux/kconfig.h>
 
 #if CONFIG_IS_ENABLED(BANNER_PRINT)
 #include <timestamp.h>
@@ -29,6 +30,7 @@
 
 __weak void rockchip_stimer_init(void)
 {
+#if defined(CONFIG_ROCKCHIP_STIMER_BASE)
 	/* If Timer already enabled, don't re-init it */
 	u32 reg = readl(CONFIG_ROCKCHIP_STIMER_BASE + TIMER_CONTROL_REG);
 
@@ -45,6 +47,7 @@ __weak void rockchip_stimer_init(void)
 	writel(0xffffffff, CONFIG_ROCKCHIP_STIMER_BASE + 4);
 	writel(TIMER_EN | TIMER_FMODE, CONFIG_ROCKCHIP_STIMER_BASE +
 	       TIMER_CONTROL_REG);
+#endif
 }
 
 void board_init_f(ulong dummy)
@@ -74,7 +77,9 @@ void board_init_f(ulong dummy)
 	}
 
 	/* Init secure timer */
-	rockchip_stimer_init();
+	if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER))
+		rockchip_stimer_init();
+
 	/* Init ARM arch timer in arch/arm/cpu/ */
 	timer_init();
 
Signature · 1 line
2.20.1
Reviewed-by on v3 4/6
#6 lore raw

Re: [PATCH v3 4/6] rockchip: tpl: change call condition rockchip_stimer_init()

Quoted 12 lines · Johan Jonker

The Rockchip SoCs rk3066/rk3188 have no CONFIG_ROCKCHIP_STIMER_BASE defined. Currently only rk3188 has an exception. Make this more generic and call the function rockchip_stimer_init() only when CONFIG_ROCKCHIP_STIMER_BASE is available.

---

Changed V3:
use CONFIG_ROCKCHIP_STIMER

Quoted 8 lines

Changed V2:
use IS_ENABLED
add include kconfig.h
move define location so that rockchip_stimer_init() is always visible to the compiler

---
 arch/arm/mach-rockchip/tpl.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
#7 lore raw

PATCH v3 5/6 rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition

In reply to Johan Jonker

Not all Rockchip SoC models use the ARM arch timer. Call the function timer_init() only when CONFIG_SYS_ARCH_TIMER is available.
Replace the ifdef call condition by IS_ENABLED
to increase build coverage and make the code easier to read.

---
 arch/arm/mach-rockchip/spl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/mach-rockchip/spl.c +4 -4
index 1dac3805..95db7557 100644
@@ -138,10 +138,10 @@ void board_init_f(ulong dummy)
 	if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER))
 		rockchip_stimer_init();
 
-#ifdef CONFIG_SYS_ARCH_TIMER
-	/* Init ARM arch timer in arch/arm/cpu/armv7/arch_timer.c */
-	timer_init();
-#endif
+	/* Init ARM arch timer */
+	if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER))
+		timer_init();
+
 #if !defined(CONFIG_TPL) || defined(CONFIG_SPL_RAM)
 	debug("\nspl:init dram\n");
 	ret = dram_init();
Signature · 1 line
2.20.1
Reviewed-by on v3 5/6
#8 lore raw

Re: [PATCH v3 5/6] rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition

Quoted 11 lines · Johan Jonker

Not all Rockchip SoC models use the ARM arch timer. Call the function timer_init() only when CONFIG_SYS_ARCH_TIMER is available.
Replace the ifdef call condition by IS_ENABLED
to increase build coverage and make the code easier to read.

---
 arch/arm/mach-rockchip/spl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
#9 lore raw

PATCH v3 6/6 rockchip: tpl: use IS_ENABLED for timer_init() call condition

In reply to Johan Jonker

Not all Rockchip SoC models use the ARM arch timer. Call the function timer_init() only when CONFIG_SYS_ARCH_TIMER is available.
Use the call condition IS_ENABLED to increase build coverage and make the code easier to read.

---
 arch/arm/mach-rockchip/tpl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm/mach-rockchip/tpl.c +3 -2
index 2b561264..05deba3f 100644
@@ -80,8 +80,9 @@ void board_init_f(ulong dummy)
 	if (IS_ENABLED(CONFIG_ROCKCHIP_STIMER))
 		rockchip_stimer_init();
 
-	/* Init ARM arch timer in arch/arm/cpu/ */
-	timer_init();
+	/* Init ARM arch timer */
+	if (IS_ENABLED(CONFIG_SYS_ARCH_TIMER))
+		timer_init();
 
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret) {
Signature · 1 line
2.20.1
Reviewed-by on v3 6/6
#10 lore raw

Re: [PATCH v3 6/6] rockchip: tpl: use IS_ENABLED for timer_init() call condition

Quoted 11 lines · Johan Jonker

Not all Rockchip SoC models use the ARM arch timer. Call the function timer_init() only when CONFIG_SYS_ARCH_TIMER is available.
Use the call condition IS_ENABLED to increase build coverage and make the code easier to read.

---
 arch/arm/mach-rockchip/tpl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
Reviewed-by on v3 1/6
#11 lore raw
In reply to Johan Jonker
Quoted 23 lines · Johan Jonker

Move ROCKCHIP_STIMER_BASE to Kconfig.

---

Changed V3:
add ROCKCHIP_STIMER

---
 arch/arm/mach-rockchip/Kconfig        | 22 ++++++++++++++++++++++
 arch/arm/mach-rockchip/px30/Kconfig   |  3 +++
 arch/arm/mach-rockchip/rk3036/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3128/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk322x/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3288/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3308/Kconfig | 10 ++++++----
 arch/arm/mach-rockchip/rk3328/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3368/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3399/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3568/Kconfig |  3 +++
 include/configs/px30_common.h         |  1 -
 include/configs/rk3036_common.h       |  1 -
 include/configs/rk3128_common.h       |  1 -
Quoted 8 lines
 include/configs/rk322x_common.h       |  1 -
 include/configs/rk3288_common.h       |  1 -
 include/configs/rk3308_common.h       |  1 -
 include/configs/rk3328_common.h       |  1 -
 include/configs/rk3368_common.h       |  1 -
 include/configs/rk3399_common.h       |  1 -
 include/configs/rk3568_common.h       |  1 -
 21 files changed, 55 insertions(+), 14 deletions(-)
#12 lore raw
In reply to Johan Jonker
Quoted 43 lines · Johan Jonker

Move ROCKCHIP_STIMER_BASE to Kconfig.

---

Changed V3:
add ROCKCHIP_STIMER

---
 arch/arm/mach-rockchip/Kconfig        | 22 ++++++++++++++++++++++
 arch/arm/mach-rockchip/px30/Kconfig   |  3 +++
 arch/arm/mach-rockchip/rk3036/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3128/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk322x/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3288/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3308/Kconfig | 10 ++++++----
 arch/arm/mach-rockchip/rk3328/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3368/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3399/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3568/Kconfig |  3 +++
 include/configs/px30_common.h         |  1 -
 include/configs/rk3036_common.h       |  1 -
 include/configs/rk3128_common.h       |  1 -
 include/configs/rk322x_common.h       |  1 -
 include/configs/rk3288_common.h       |  1 -
 include/configs/rk3308_common.h       |  1 -
 include/configs/rk3328_common.h       |  1 -
 include/configs/rk3368_common.h       |  1 -
 include/configs/rk3399_common.h       |  1 -
 include/configs/rk3568_common.h       |  1 -
 21 files changed, 55 insertions(+), 14 deletions(-)
arch/arm/mach-rockchip/Kconfig +3 -0
index da6871eb..7a624c64 100644
@@ -343,6 +343,28 @@ config ROCKCHIP_BOOT_MODE_REG
          The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h)
          according to the value from this register.
 
+config ROCKCHIP_STIMER
+       bool "Rockchip STIMER support"
+       default y

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_BOOT_MODE_REG · line 358

Quoted 10 lines
arch/arm/mach-rockchip/Kconfig +10 -0
+       depends on (ROCKCHIP_PX30||   \
+                   ROCKCHIP_RK3036|| \
+                   ROCKCHIP_RK3128|| \
+                   ROCKCHIP_RK322X|| \
+                   ROCKCHIP_RK3288|| \
+                   ROCKCHIP_RK3308|| \
+                   ROCKCHIP_RK3328|| \
+                   ROCKCHIP_RK3368|| \
+                   ROCKCHIP_RK3399|| \
+                   ROCKCHIP_RK3568)

What if we select !(SOC-Which-don't-support-stimer). I believe the condition check here is much simpler.

Jagan.

#13 lore raw
Quoted 50 lines · Jagan Teki
Quoted 49 lines · Johan Jonker

Move ROCKCHIP_STIMER_BASE to Kconfig.

---

Changed V3:
add ROCKCHIP_STIMER

---
 arch/arm/mach-rockchip/Kconfig        | 22 ++++++++++++++++++++++
 arch/arm/mach-rockchip/px30/Kconfig   |  3 +++
 arch/arm/mach-rockchip/rk3036/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3128/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk322x/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3288/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3308/Kconfig | 10 ++++++----
 arch/arm/mach-rockchip/rk3328/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3368/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3399/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3568/Kconfig |  3 +++
 include/configs/px30_common.h         |  1 -
 include/configs/rk3036_common.h       |  1 -
 include/configs/rk3128_common.h       |  1 -
 include/configs/rk322x_common.h       |  1 -
 include/configs/rk3288_common.h       |  1 -
 include/configs/rk3308_common.h       |  1 -
 include/configs/rk3328_common.h       |  1 -
 include/configs/rk3368_common.h       |  1 -
 include/configs/rk3399_common.h       |  1 -
 include/configs/rk3568_common.h       |  1 -
 21 files changed, 55 insertions(+), 14 deletions(-)
arch/arm/mach-rockchip/Kconfig +9 -0
index da6871eb..7a624c64 100644
@@ -343,6 +343,28 @@ config ROCKCHIP_BOOT_MODE_REG
          The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h)
          according to the value from this register.
 
+config ROCKCHIP_STIMER
+       bool "Rockchip STIMER support"
+       default y
+       depends on (ROCKCHIP_PX30||   \
+                   ROCKCHIP_RK3036|| \
+                   ROCKCHIP_RK3128|| \
+                   ROCKCHIP_RK322X|| \
+                   ROCKCHIP_RK3288|| \
+                   ROCKCHIP_RK3308|| \
Quoted 8 lines

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_BOOT_MODE_REG · line 358

Quoted 4 lines
arch/arm/mach-rockchip/Kconfig +4 -0
+                   ROCKCHIP_RK3328|| \
+                   ROCKCHIP_RK3368|| \
+                   ROCKCHIP_RK3399|| \
+                   ROCKCHIP_RK3568)

What if we select !(SOC-Which-don't-support-stimer). I believe the condition check here is much simpler.

The condition would be simpler that's correct, but this patch is made with rk3066 in mind and there's no ROCKCHIP_RK3066 available yet. The right approach is to only include SoC's that have a specific property/functionality linked to there specific config tag. U-boot should be generic. And we should not have to fix all dependencies all over the place when a SoC doesn't have something.

Please advise how to support other SoC's like rk3066.

Johan

Quoted 2 lines

Jagan.

#14 lore raw

Hi Johan,

Quoted 57 lines · Johan Jonker
Quoted 40 lines · Jagan Teki
Quoted 39 lines · Johan Jonker

Move ROCKCHIP_STIMER_BASE to Kconfig.

---

Changed V3:
add ROCKCHIP_STIMER

---
  arch/arm/mach-rockchip/Kconfig        | 22 ++++++++++++++++++++++
  arch/arm/mach-rockchip/px30/Kconfig   |  3 +++
  arch/arm/mach-rockchip/rk3036/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3128/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk322x/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3288/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3308/Kconfig | 10 ++++++----
  arch/arm/mach-rockchip/rk3328/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3368/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3399/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3568/Kconfig |  3 +++
  include/configs/px30_common.h         |  1 -
  include/configs/rk3036_common.h       |  1 -
  include/configs/rk3128_common.h       |  1 -
  include/configs/rk322x_common.h       |  1 -
  include/configs/rk3288_common.h       |  1 -
  include/configs/rk3308_common.h       |  1 -
  include/configs/rk3328_common.h       |  1 -
  include/configs/rk3368_common.h       |  1 -
  include/configs/rk3399_common.h       |  1 -
  include/configs/rk3568_common.h       |  1 -
  21 files changed, 55 insertions(+), 14 deletions(-)
arch/arm/mach-rockchip/Kconfig +0 -0
index da6871eb..7a624c64 100644
@@ -343,6 +343,28 @@ config ROCKCHIP_BOOT_MODE_REG
           The Soc will enter to different boot mode(defined in asm/arch-rockchip/boot_mode.h)
           according to the value from this register.
 
Quoted 15 lines

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_BOOT_MODE_REG · line 358

Quoted 13 lines
arch/arm/mach-rockchip/Kconfig +13 -0
+config ROCKCHIP_STIMER
+       bool "Rockchip STIMER support"
+       default y
+       depends on (ROCKCHIP_PX30||   \
+                   ROCKCHIP_RK3036|| \
+                   ROCKCHIP_RK3128|| \
+                   ROCKCHIP_RK322X|| \
+                   ROCKCHIP_RK3288|| \
+                   ROCKCHIP_RK3308|| \
+                   ROCKCHIP_RK3328|| \
+                   ROCKCHIP_RK3368|| \
+                   ROCKCHIP_RK3399|| \
+                   ROCKCHIP_RK3568)

What if we select !(SOC-Which-don't-support-stimer). I believe the condition check here is much simpler.

Quoted 8 lines

The condition would be simpler that's correct, but this patch is made with rk3066 in mind and there's no ROCKCHIP_RK3066 available yet. The right approach is to only include SoC's that have a specific property/functionality linked to there specific config tag. U-boot should be generic. And we should not have to fix all dependencies all over the place when a SoC doesn't have something.

Please advise how to support other SoC's like rk3066.

Thanks for you hard working on this, would you mind to share what's the motivation for support rk3066 and MK808 board? RK3066 is an SoC release at 2012, which has been EOL for a long time, and MK808 is a product at 2013, almost 10 years ago.

I'm not object for enable more SoC support on the mainline, and I know you have spend a lot
of time on this, I have do something like this before, but to be honest I don't think it's a good idea to add support for rk3066 on mainline now.

I merge the patches from Paweł Jarosz many years ago into rockchip local u-boot and make it work,
I want to make the branch support as much SoCs as possible at that time. But later I found there is no people to use it, and the U-Boot is getting more and more heavy, old SoC support is the one part people want to clean, for it always bring in more '#if, #else' or something like this clean up series patches, and more terrible thing is how to always maintain the source code works on the old hardware. I do make everything work for a long time at first, but one day my only rk3066 board is broken, and I'm not able to do it anymore.

Thanks,
- Kever

Quoted 3 lines

Johan

Quoted 1 line

Jagan.

#15 lore raw

Hi Kever,

Quoted 4 lines

Thanks for you hard working on this, would you mind to share what's the motivation for support rk3066 and MK808 board?
RK3066 is an SoC release at 2012, which has been EOL for a long time, and MK808 is a product at 2013, almost 10 years ago.

That is true but at least here at Poland there are still rk3066 devices which you can buy. And i don't think it's an exception. There are known cases in opensource community of support for hardware much older than 10 years. I.e. thanks to Linus Torwalds linux still supports EISA FDDI [1]. There are at least a few rk3066a SOC users and in the spirit of Linus Torvalds' open source principles, adding support for this platform is the correct step.

RK3066 is a great soc to play with.
I use my MK808 for three years now to keep my 3d printer in contact with my local network.
I have been using the URZ0350 as a wifi camera for a long time. And guess what! They don't want to break down.

[1] https://blog.desdelinux.net/en/linus-supports-a-device-by-a-user/

Quoted 5 lines

I'm not object for enable more SoC support on the mainline, and I know you have spend a lot
of time on this, I have do something like this before, but to be honest I don't think it's a good idea to add support for
rk3066 on mainline now.

I do not agree.

As long as the world is using armv7 architecture adding support for SOC rk3066a is a great and noble idea.
I personally am working on following up on my and Johan's patches by adding support for writing firmware to these devices, using only opensource tools like u-boot and rkflashtool. This support can be extended to other devices such as rk3399, rk3568 and others. So other SOCs can also benefit from adding support for rk3066a.

I also want to add that Linux actively supports rk3066a [2]. So if linux supports it, U-BOOT SHOULD ALSO!

[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?qt=grep&q=rk3066

I appeal to you Kever Yang in the spirit of opensource, don't give up on rk3066a yet. These devices are there and they work!

Thanks
-Paweł

Quoted 15 lines

I merge the patches from Paweł Jarosz many years ago into rockchip local u-boot and make it work,
I want to make the branch support as much SoCs as possible at that time. But later I found there is no people to use
it, and the U-Boot is getting more and more heavy, old SoC support is the one part people want to clean,
for it always bring in more '#if, #else' or something like this clean up series patches, and more terrible thing is how to
always maintain the source code works on the old hardware. I do make everything work for a long time at first,
but one day my only rk3066 board is broken, and I'm not able to do it anymore.

Thanks,
- Kever

#16 lore raw

Hi,

Quoted 46 lines · Paweł Jarosz

Hi Kever,

Quoted 4 lines

Thanks for you hard working on this, would you mind to share what's the motivation for support rk3066 and MK808 board?
RK3066 is an SoC release at 2012, which has been EOL for a long time, and MK808 is a product at 2013, almost 10 years ago.

That is true but at least here at Poland there are still rk3066 devices which you can buy. And i don't think it's an exception. There are known cases in opensource community of support for hardware much older than 10 years. I.e. thanks to Linus Torwalds linux still supports EISA FDDI [1]. There are at least a few rk3066a SOC users and in the spirit of Linus Torvalds' open source principles, adding support for this platform is the correct step.

RK3066 is a great soc to play with.
I use my MK808 for three years now to keep my 3d printer in contact with my local network.
I have been using the URZ0350 as a wifi camera for a long time. And guess what! They don't want to break down.

[1] https://blog.desdelinux.net/en/linus-supports-a-device-by-a-user/

Quoted 5 lines

I'm not object for enable more SoC support on the mainline, and I know you have spend a lot
of time on this, I have do something like this before, but to be honest I don't think it's a good idea to add support for
rk3066 on mainline now.

I do not agree.

As long as the world is using armv7 architecture adding support for SOC rk3066a is a great and noble idea.
I personally am working on following up on my and Johan's patches by adding support for writing firmware to these devices, using only opensource tools like u-boot and rkflashtool. This support can be extended to other devices such as rk3399, rk3568 and others. So other SOCs can also benefit from adding support for rk3066a.

I also want to add that Linux actively supports rk3066a [2]. So if linux supports it, U-BOOT SHOULD ALSO!

Quoted 21 lines

[2] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/?qt=grep&q=rk3066

I appeal to you Kever Yang in the spirit of opensource, don't give up on rk3066a yet. These devices are there and they work!

Thanks
-Paweł

Quoted 12 lines

I merge the patches from Paweł Jarosz many years ago into rockchip local u-boot and make it work,
I want to make the branch support as much SoCs as possible at that time. But later I found there is no people to use
it, and the U-Boot is getting more and more heavy, old SoC support is the one part people want to clean,
for it always bring in more '#if, #else' or something like this clean up series patches, and more terrible thing is how to
always maintain the source code works on the old hardware. I do make everything work for a long time at first,
but one day my only rk3066 board is broken, and I'm not able to do it anymore.

Actually we have much older devices in U-Boot than that! The key thing is to have someone maintaining the board.

Regards,
SImon

#17 lore raw
In reply to Kever Yang
Quoted 36 lines · Kever Yang

Hi Johan,

Quoted 33 lines · Johan Jonker
Quoted 32 lines · Jagan Teki
Quoted 31 lines · Johan Jonker

Move ROCKCHIP_STIMER_BASE to Kconfig.

---

Changed V3:
add ROCKCHIP_STIMER

---
 arch/arm/mach-rockchip/Kconfig        | 22 ++++++++++++++++++++++
 arch/arm/mach-rockchip/px30/Kconfig   |  3 +++
 arch/arm/mach-rockchip/rk3036/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3128/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk322x/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3288/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3308/Kconfig | 10 ++++++----
 arch/arm/mach-rockchip/rk3328/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3368/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3399/Kconfig |  3 +++
 arch/arm/mach-rockchip/rk3568/Kconfig |  3 +++
 include/configs/px30_common.h         |  1 -
 include/configs/rk3036_common.h       |  1 -
 include/configs/rk3128_common.h       |  1 -
 include/configs/rk322x_common.h       |  1 -
 include/configs/rk3288_common.h       |  1 -
 include/configs/rk3308_common.h       |  1 -
 include/configs/rk3328_common.h       |  1 -
 include/configs/rk3368_common.h       |  1 -
 include/configs/rk3399_common.h       |  1 -
 include/configs/rk3568_common.h       |  1 -
 21 files changed, 55 insertions(+), 14 deletions(-)
Quoted 1 line
Quoted 1 line
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/mach-rockchip/Kconfig

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_BOOT_MODE_REG · line 343

Quoted 5 lines

index da6871eb..7a624c64 100644

arch/arm/mach-rockchip/Kconfig +0 -0
@@ -343,6 +343,28 @@ config ROCKCHIP_BOOT_MODE_REG
          The Soc will enter to different boot mode(defined in

asm/arch-rockchip/boot_mode.h)

Quoted 24 lines
Quoted 24 lines
Quoted 15 lines
Quoted 5 lines
arch/arm/mach-rockchip/Kconfig +3 -0
          according to the value from this register.
 
+config ROCKCHIP_STIMER
+       bool "Rockchip STIMER support"
+       default y

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_BOOT_MODE_REG · line 358

Quoted 10 lines
arch/arm/mach-rockchip/Kconfig +10 -0
+       depends on (ROCKCHIP_PX30||   \
+                   ROCKCHIP_RK3036|| \
+                   ROCKCHIP_RK3128|| \
+                   ROCKCHIP_RK322X|| \
+                   ROCKCHIP_RK3288|| \
+                   ROCKCHIP_RK3308|| \
+                   ROCKCHIP_RK3328|| \
+                   ROCKCHIP_RK3368|| \
+                   ROCKCHIP_RK3399|| \
+                   ROCKCHIP_RK3568)
Quoted 2 lines

What if we select !(SOC-Which-don't-support-stimer). I believe the condition check here is much simpler.

The condition would be simpler that's correct, but this patch is made with rk3066 in mind and there's no ROCKCHIP_RK3066 available yet. The right approach is to only include SoC's that have a specific property/functionality linked to there specific config tag. U-boot should be generic. And we should not have to fix all dependencies all over the place when a SoC doesn't have something.

Quoted 6 lines
Quoted 1 line

Please advise how to support other SoC's like rk3066.

Thanks for you hard working on this, would you mind to share what's the motivation for support rk3066 and MK808 board?
RK3066 is an SoC release at 2012, which has been EOL for a long time, and MK808 is a product at 2013, almost 10 years ago.

One of the advantages of open source is that a manufacturer doesn't dictate where,
when and how long a product can be used.
It's about freedom of choice. No matter how many obstacles are put in the way.
It works in two ways. Rockchip make use of free open source for there products.
Users can add there own ideas/support based on manufacturer sources. If that's not your thing then join a group of monopolists for software, but don't sabotage things here.
It's part of the game.

MK808 was one of the first products with a Rockchip SoC that hobbyists where able
to run there own kernel on and still does, so we keep that heritage alive.

Quoted 7 lines

I'm not object for enable more SoC support on the mainline, and I know you have spend a lot
of time on this, I have do something like this before, but to be honest I don't think it's a good idea to add support for
rk3066 on mainline now.

If Linux is able to support the full product range then U-boot can do that too.
The last 2 years were spent with upgrading and fixing the Linux Device tree. It would be nice if that was synced standard automatically for the Rockchip branch on a regular base.
The more you neglect the more outdated it becomes. See rk3288 DT.

Quoted 8 lines

I merge the patches from Paweł Jarosz many years ago into rockchip local u-boot and make it work,
I want to make the branch support as much SoCs as possible at that time. But later I found there is no people to use
it,

No wonder, no serious person would concern the Rockchip Linux and U-boot tree a usable option given it's current state.
It's official kernel tree hasn't been updated for some while and based on LT versions that are outdated.
Current Rockchip activity must be checked elsewhere. Documentation and TRM's must be obtained through other sources.

https://github.com/rockchip-linux/

https://github.com/JeffyCN/rockchip_mirrors
https://github.com/Caesar-github

https://github.com/Poco-Ye/rk-datasheet

Quoted 3 lines

and the U-Boot is getting more and more heavy, old SoC support is the one part people want to clean,
for it always bring in more '#if, #else' or something like this clean up

Proper written code isn't a problem.
The lack of regular maintenance creates a stock pile and then wait/hope for others to fix.
Don't blame that on a new rk3066 SoC.
With the addition of rk3066 a number of these spots are identified. More Kconfigs must be moved. Often DT sync from Linux. Common board TPL/SPL file fix. Nothing special.

===

Also apply subsets of a patch series when ready.
That helps to get the flow going.
Don't let people have to send them over and over again for years like with rk3066.

===

Move all Rockchip board maintainers in one central file, so that can be parsed be scripts.
Verify that these maintainers are still active. (See rk3288 DT)

===

Reduce the DM footprint for TPL/SPL. We know for example what TPL/SPL sram driver to use (see dtoc) then "short cut"/"direct link" to select the driver in use without 10k+ of DM bloat ware. It leafs us more room for usbplug related staff for example.

Quoted 5 lines

series patches, and more terrible thing is how to
always maintain the source code works on the old hardware. I do make everything work for a long time at first,
but one day my only rk3066 board is broken, and I'm not able to do it anymore.

The world wide web is your friend to find a replacement. It's not an excuse for a maintainer to not add another rk3066 device to his collection. ;)

===

As for MK808 it can live out of tree, free of limits.
For basic convenience a place inside is preferred, but not necessary. Up to you.

Johan

Quoted 6 lines

Thanks,
- Kever

Quoted 3 lines

Johan

Quoted 1 line

Jagan.

#18 lore raw

Hi Johan, Pawel,

Quoted 92 lines · Johan Jonker
Quoted 36 lines · Kever Yang

Hi Johan,

Quoted 33 lines · Johan Jonker
Quoted 32 lines · Jagan Teki
Quoted 31 lines · Johan Jonker

Move ROCKCHIP_STIMER_BASE to Kconfig.

---

Changed V3:
add ROCKCHIP_STIMER

---
  arch/arm/mach-rockchip/Kconfig        | 22 ++++++++++++++++++++++
  arch/arm/mach-rockchip/px30/Kconfig   |  3 +++
  arch/arm/mach-rockchip/rk3036/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3128/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk322x/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3288/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3308/Kconfig | 10 ++++++----
  arch/arm/mach-rockchip/rk3328/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3368/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3399/Kconfig |  3 +++
  arch/arm/mach-rockchip/rk3568/Kconfig |  3 +++
  include/configs/px30_common.h         |  1 -
  include/configs/rk3036_common.h       |  1 -
  include/configs/rk3128_common.h       |  1 -
  include/configs/rk322x_common.h       |  1 -
  include/configs/rk3288_common.h       |  1 -
  include/configs/rk3308_common.h       |  1 -
  include/configs/rk3328_common.h       |  1 -
  include/configs/rk3368_common.h       |  1 -
  include/configs/rk3399_common.h       |  1 -
  include/configs/rk3568_common.h       |  1 -
  21 files changed, 55 insertions(+), 14 deletions(-)
Quoted 1 line
Quoted 1 line
Quoted 1 line

Review

Quoted 1 line
(quoted diff) +0 -0

b/arch/arm/mach-rockchip/Kconfig

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_BOOT_MODE_REG · line 343

Quoted 5 lines

index da6871eb..7a624c64 100644

arch/arm/mach-rockchip/Kconfig +0 -0
@@ -343,6 +343,28 @@ config ROCKCHIP_BOOT_MODE_REG
           The Soc will enter to different boot mode(defined in

asm/arch-rockchip/boot_mode.h)

Quoted 24 lines
Quoted 24 lines
Quoted 15 lines
Quoted 5 lines
arch/arm/mach-rockchip/Kconfig +3 -0
           according to the value from this register.
 
+config ROCKCHIP_STIMER
+       bool "Rockchip STIMER support"
+       default y

arch/arm/mach-rockchip/Kconfig config ROCKCHIP_BOOT_MODE_REG · line 358

Quoted 10 lines
arch/arm/mach-rockchip/Kconfig +10 -0
+       depends on (ROCKCHIP_PX30||   \
+                   ROCKCHIP_RK3036|| \
+                   ROCKCHIP_RK3128|| \
+                   ROCKCHIP_RK322X|| \
+                   ROCKCHIP_RK3288|| \
+                   ROCKCHIP_RK3308|| \
+                   ROCKCHIP_RK3328|| \
+                   ROCKCHIP_RK3368|| \
+                   ROCKCHIP_RK3399|| \
+                   ROCKCHIP_RK3568)
Quoted 2 lines

What if we select !(SOC-Which-don't-support-stimer). I believe the condition check here is much simpler.

The condition would be simpler that's correct, but this patch is made with rk3066 in mind and there's no ROCKCHIP_RK3066 available yet. The right approach is to only include SoC's that have a specific property/functionality linked to there specific config tag. U-boot should be generic. And we should not have to fix all dependencies all over the place when a SoC doesn't have something.

Quoted 5 lines
Quoted 1 line

Please advise how to support other SoC's like rk3066.

Thanks for you hard working on this, would you mind to share what's the motivation for support rk3066 and MK808 board?
RK3066 is an SoC release at 2012, which has been EOL for a long time, and MK808 is a product at 2013, almost 10 years ago.

One of the advantages of open source is that a manufacturer doesn't dictate where,
when and how long a product can be used.
It's about freedom of choice. No matter how many obstacles are put in the way.
It works in two ways. Rockchip make use of free open source for there products.
Users can add there own ideas/support based on manufacturer sources. If that's not your thing then join a group of monopolists for software, but don't sabotage things here.
It's part of the game.

MK808 was one of the first products with a Rockchip SoC that hobbyists where able
to run there own kernel on and still does, so we keep that heritage alive.

Quoted 1 line
Quoted 7 lines
Quoted 5 lines

I'm not object for enable more SoC support on the mainline, and I know you have spend a lot
of time on this, I have do something like this before, but to be honest I don't think it's a good idea to add support for
rk3066 on mainline now.

If Linux is able to support the full product range then U-boot can do that too.

I agree with this point, my concern is the maintain of the source code and the lifecycle after we add it.
Since both Powel and you declare that still RK3066 device on the market and some developers are working on it, I'm happy to get them in tree, I will land patches after verify no broken for other platform.

Thanks,
- Kever