All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
@ 2021-12-30 16:48 Johan Jonker
  2021-12-30 16:48 ` [PATCH v3 2/6] rockchip: move CONFIG_SYS_ARCH_TIMER " Johan Jonker
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Johan Jonker @ 2021-12-30 16:48 UTC (permalink / raw)
  To: kever.yang; +Cc: sjg, philipp.tomsich, u-boot

Move ROCKCHIP_STIMER_BASE to Kconfig.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---

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(-)

diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
index da6871eb..7a624c64 100644
--- a/arch/arm/mach-rockchip/Kconfig
+++ b/arch/arm/mach-rockchip/Kconfig
@@ -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
diff --git a/arch/arm/mach-rockchip/px30/Kconfig b/arch/arm/mach-rockchip/px30/Kconfig
index aa5cc471..42cc111b 100644
--- a/arch/arm/mach-rockchip/px30/Kconfig
+++ b/arch/arm/mach-rockchip/px30/Kconfig
@@ -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"
 
diff --git a/arch/arm/mach-rockchip/rk3036/Kconfig b/arch/arm/mach-rockchip/rk3036/Kconfig
index b746795d..111531be 100644
--- a/arch/arm/mach-rockchip/rk3036/Kconfig
+++ b/arch/arm/mach-rockchip/rk3036/Kconfig
@@ -16,6 +16,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0x200081c8
 
+config ROCKCHIP_STIMER_BASE
+	default 0x200440a0
+
 config SYS_SOC
 	default "rk3036"
 
diff --git a/arch/arm/mach-rockchip/rk3128/Kconfig b/arch/arm/mach-rockchip/rk3128/Kconfig
index b867401c..9cc494eb 100644
--- a/arch/arm/mach-rockchip/rk3128/Kconfig
+++ b/arch/arm/mach-rockchip/rk3128/Kconfig
@@ -16,6 +16,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0x100a0038
 
+config ROCKCHIP_STIMER_BASE
+	default 0x200440a0
+
 config SYS_SOC
 	default "rk3128"
 
diff --git a/arch/arm/mach-rockchip/rk322x/Kconfig b/arch/arm/mach-rockchip/rk322x/Kconfig
index 6458cd55..058f848d 100644
--- a/arch/arm/mach-rockchip/rk322x/Kconfig
+++ b/arch/arm/mach-rockchip/rk322x/Kconfig
@@ -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"
 
diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig
index f37b1bdf..dd8c7826 100644
--- a/arch/arm/mach-rockchip/rk3288/Kconfig
+++ b/arch/arm/mach-rockchip/rk3288/Kconfig
@@ -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"
 
diff --git a/arch/arm/mach-rockchip/rk3308/Kconfig b/arch/arm/mach-rockchip/rk3308/Kconfig
index 8fa536e1..194353e4 100644
--- a/arch/arm/mach-rockchip/rk3308/Kconfig
+++ b/arch/arm/mach-rockchip/rk3308/Kconfig
@@ -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"
 
diff --git a/arch/arm/mach-rockchip/rk3328/Kconfig b/arch/arm/mach-rockchip/rk3328/Kconfig
index d13a1690..f6f1e06a 100644
--- a/arch/arm/mach-rockchip/rk3328/Kconfig
+++ b/arch/arm/mach-rockchip/rk3328/Kconfig
@@ -15,6 +15,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xff1005c8
 
+config ROCKCHIP_STIMER_BASE
+	default 0xff1d0020
+
 config SYS_SOC
 	default "rk3328"
 
diff --git a/arch/arm/mach-rockchip/rk3368/Kconfig b/arch/arm/mach-rockchip/rk3368/Kconfig
index 78eb96df..104db367 100644
--- a/arch/arm/mach-rockchip/rk3368/Kconfig
+++ b/arch/arm/mach-rockchip/rk3368/Kconfig
@@ -45,6 +45,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xff738200
 
+config ROCKCHIP_STIMER_BASE
+	default 0xff830020
+
 config SYS_SOC
 	default "rk3368"
 
diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig
index 17628f91..4bc15c1b 100644
--- a/arch/arm/mach-rockchip/rk3399/Kconfig
+++ b/arch/arm/mach-rockchip/rk3399/Kconfig
@@ -114,6 +114,9 @@ endchoice
 config ROCKCHIP_BOOT_MODE_REG
 	default 0xff320300
 
+config ROCKCHIP_STIMER_BASE
+	default 0xff8680a0
+
 config SYS_SOC
 	default "rk3399"
 
diff --git a/arch/arm/mach-rockchip/rk3568/Kconfig b/arch/arm/mach-rockchip/rk3568/Kconfig
index 201c63c2..4e7c02cc 100644
--- a/arch/arm/mach-rockchip/rk3568/Kconfig
+++ b/arch/arm/mach-rockchip/rk3568/Kconfig
@@ -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"
 
diff --git a/include/configs/px30_common.h b/include/configs/px30_common.h
index 09923871..dc609013 100644
--- a/include/configs/px30_common.h
+++ b/include/configs/px30_common.h
@@ -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 */
diff --git a/include/configs/rk3036_common.h b/include/configs/rk3036_common.h
index b133d8ec..10cba727 100644
--- a/include/configs/rk3036_common.h
+++ b/include/configs/rk3036_common.h
@@ -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
diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h
index 8b7a0bbb..71f66d57 100644
--- a/include/configs/rk3128_common.h
+++ b/include/configs/rk3128_common.h
@@ -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
diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h
index a46b1ffe..aff24018 100644
--- a/include/configs/rk322x_common.h
+++ b/include/configs/rk322x_common.h
@@ -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
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h
index abbb2739..c781bc7e 100644
--- a/include/configs/rk3288_common.h
+++ b/include/configs/rk3288_common.h
@@ -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
diff --git a/include/configs/rk3308_common.h b/include/configs/rk3308_common.h
index 496f4628..edc535fe 100644
--- a/include/configs/rk3308_common.h
+++ b/include/configs/rk3308_common.h
@@ -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
diff --git a/include/configs/rk3328_common.h b/include/configs/rk3328_common.h
index c1e26a01..8a5f0c89 100644
--- a/include/configs/rk3328_common.h
+++ b/include/configs/rk3328_common.h
@@ -10,7 +10,6 @@
 
 #define CONFIG_IRAM_BASE		0xff090000
 
-#define CONFIG_ROCKCHIP_STIMER_BASE    0xff1d0020
 #define COUNTER_FREQUENCY		24000000
 
 #define CONFIG_SYS_CBSIZE		1024
diff --git a/include/configs/rk3368_common.h b/include/configs/rk3368_common.h
index 8b239ca0..239296c1 100644
--- a/include/configs/rk3368_common.h
+++ b/include/configs/rk3368_common.h
@@ -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
diff --git a/include/configs/rk3399_common.h b/include/configs/rk3399_common.h
index ed72c8bb..4037dba5 100644
--- a/include/configs/rk3399_common.h
+++ b/include/configs/rk3399_common.h
@@ -11,7 +11,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 
 #define COUNTER_FREQUENCY               24000000
-#define CONFIG_ROCKCHIP_STIMER_BASE	0xff8680a0
 
 #define CONFIG_IRAM_BASE		0xff8c0000
 
diff --git a/include/configs/rk3568_common.h b/include/configs/rk3568_common.h
index afe5050e..705c3454 100644
--- a/include/configs/rk3568_common.h
+++ b/include/configs/rk3568_common.h
@@ -11,7 +11,6 @@
 #define CONFIG_SYS_CBSIZE		1024
 
 #define COUNTER_FREQUENCY               24000000
-#define CONFIG_ROCKCHIP_STIMER_BASE	0xfdd1c020
 
 #define CONFIG_IRAM_BASE		0xfdcc0000
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 2/6] rockchip: move CONFIG_SYS_ARCH_TIMER to Kconfig
  2021-12-30 16:48 [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Johan Jonker
@ 2021-12-30 16:48 ` Johan Jonker
  2022-01-12 20:03   ` Simon Glass
  2021-12-30 16:48 ` [PATCH v3 3/6] rockchip: spl: change call condition rockchip_stimer_init() Johan Jonker
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Johan Jonker @ 2021-12-30 16:48 UTC (permalink / raw)
  To: kever.yang; +Cc: sjg, philipp.tomsich, u-boot

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.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 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(-)

diff --git a/arch/arm/mach-rockchip/rk3036/Kconfig b/arch/arm/mach-rockchip/rk3036/Kconfig
index 111531be..99754138 100644
--- a/arch/arm/mach-rockchip/rk3036/Kconfig
+++ b/arch/arm/mach-rockchip/rk3036/Kconfig
@@ -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"
 
diff --git a/arch/arm/mach-rockchip/rk3128/Kconfig b/arch/arm/mach-rockchip/rk3128/Kconfig
index 9cc494eb..f6f7de1c 100644
--- a/arch/arm/mach-rockchip/rk3128/Kconfig
+++ b/arch/arm/mach-rockchip/rk3128/Kconfig
@@ -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"
 
diff --git a/arch/arm/mach-rockchip/rk322x/Kconfig b/arch/arm/mach-rockchip/rk322x/Kconfig
index 058f848d..7d74b2cc 100644
--- a/arch/arm/mach-rockchip/rk322x/Kconfig
+++ b/arch/arm/mach-rockchip/rk322x/Kconfig
@@ -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"
 
diff --git a/arch/arm/mach-rockchip/rk3288/Kconfig b/arch/arm/mach-rockchip/rk3288/Kconfig
index dd8c7826..35d471d5 100644
--- a/arch/arm/mach-rockchip/rk3288/Kconfig
+++ b/arch/arm/mach-rockchip/rk3288/Kconfig
@@ -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"
 
diff --git a/include/configs/rk3036_common.h b/include/configs/rk3036_common.h
index 10cba727..5905518e 100644
--- a/include/configs/rk3036_common.h
+++ b/include/configs/rk3036_common.h
@@ -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
diff --git a/include/configs/rk3128_common.h b/include/configs/rk3128_common.h
index 71f66d57..d77a7d7b 100644
--- a/include/configs/rk3128_common.h
+++ b/include/configs/rk3128_common.h
@@ -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
diff --git a/include/configs/rk322x_common.h b/include/configs/rk322x_common.h
index aff24018..3258820f 100644
--- a/include/configs/rk322x_common.h
+++ b/include/configs/rk322x_common.h
@@ -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
diff --git a/include/configs/rk3288_common.h b/include/configs/rk3288_common.h
index c781bc7e..e2e0f70a 100644
--- a/include/configs/rk3288_common.h
+++ b/include/configs/rk3288_common.h
@@ -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
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 3/6] rockchip: spl: change call condition rockchip_stimer_init()
  2021-12-30 16:48 [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Johan Jonker
  2021-12-30 16:48 ` [PATCH v3 2/6] rockchip: move CONFIG_SYS_ARCH_TIMER " Johan Jonker
@ 2021-12-30 16:48 ` Johan Jonker
  2022-01-12 20:03   ` Simon Glass
  2021-12-30 16:48 ` [PATCH v3 4/6] rockchip: tpl: " Johan Jonker
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Johan Jonker @ 2021-12-30 16:48 UTC (permalink / raw)
  To: kever.yang; +Cc: sjg, philipp.tomsich, u-boot

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.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---

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(-)

diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
index 02c40fb3..1dac3805 100644
--- a/arch/arm/mach-rockchip/spl.c
+++ b/arch/arm/mach-rockchip/spl.c
@@ -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();
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 4/6] rockchip: tpl: change call condition rockchip_stimer_init()
  2021-12-30 16:48 [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Johan Jonker
  2021-12-30 16:48 ` [PATCH v3 2/6] rockchip: move CONFIG_SYS_ARCH_TIMER " Johan Jonker
  2021-12-30 16:48 ` [PATCH v3 3/6] rockchip: spl: change call condition rockchip_stimer_init() Johan Jonker
@ 2021-12-30 16:48 ` Johan Jonker
  2022-01-12 20:03   ` Simon Glass
  2021-12-30 16:48 ` [PATCH v3 5/6] rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition Johan Jonker
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Johan Jonker @ 2021-12-30 16:48 UTC (permalink / raw)
  To: kever.yang; +Cc: sjg, philipp.tomsich, u-boot

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.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---

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(-)

diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
index 3c007bb4..2b561264 100644
--- a/arch/arm/mach-rockchip/tpl.c
+++ b/arch/arm/mach-rockchip/tpl.c
@@ -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();
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 5/6] rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition
  2021-12-30 16:48 [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Johan Jonker
                   ` (2 preceding siblings ...)
  2021-12-30 16:48 ` [PATCH v3 4/6] rockchip: tpl: " Johan Jonker
@ 2021-12-30 16:48 ` Johan Jonker
  2022-01-12 20:03   ` Simon Glass
  2021-12-30 16:48 ` [PATCH v3 6/6] rockchip: tpl: use " Johan Jonker
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 21+ messages in thread
From: Johan Jonker @ 2021-12-30 16:48 UTC (permalink / raw)
  To: kever.yang; +Cc: sjg, philipp.tomsich, u-boot

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.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 arch/arm/mach-rockchip/spl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-rockchip/spl.c b/arch/arm/mach-rockchip/spl.c
index 1dac3805..95db7557 100644
--- a/arch/arm/mach-rockchip/spl.c
+++ b/arch/arm/mach-rockchip/spl.c
@@ -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();
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH v3 6/6] rockchip: tpl: use IS_ENABLED for timer_init() call condition
  2021-12-30 16:48 [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Johan Jonker
                   ` (3 preceding siblings ...)
  2021-12-30 16:48 ` [PATCH v3 5/6] rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition Johan Jonker
@ 2021-12-30 16:48 ` Johan Jonker
  2022-01-12 20:03   ` Simon Glass
  2022-01-12 20:03 ` [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Simon Glass
  2022-03-12  8:51 ` Jagan Teki
  6 siblings, 1 reply; 21+ messages in thread
From: Johan Jonker @ 2021-12-30 16:48 UTC (permalink / raw)
  To: kever.yang; +Cc: sjg, philipp.tomsich, u-boot

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.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 arch/arm/mach-rockchip/tpl.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
index 2b561264..05deba3f 100644
--- a/arch/arm/mach-rockchip/tpl.c
+++ b/arch/arm/mach-rockchip/tpl.c
@@ -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) {
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
  2021-12-30 16:48 [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Johan Jonker
                   ` (4 preceding siblings ...)
  2021-12-30 16:48 ` [PATCH v3 6/6] rockchip: tpl: use " Johan Jonker
@ 2022-01-12 20:03 ` Simon Glass
  2022-03-12  8:51 ` Jagan Teki
  6 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2022-01-12 20:03 UTC (permalink / raw)
  To: Johan Jonker; +Cc: Kever Yang, Philipp Tomsich, U-Boot Mailing List

On Thu, 30 Dec 2021 at 09:48, Johan Jonker <jbx6244@gmail.com> wrote:
>
> Move ROCKCHIP_STIMER_BASE to Kconfig.
>
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>
> 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(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 2/6] rockchip: move CONFIG_SYS_ARCH_TIMER to Kconfig
  2021-12-30 16:48 ` [PATCH v3 2/6] rockchip: move CONFIG_SYS_ARCH_TIMER " Johan Jonker
@ 2022-01-12 20:03   ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2022-01-12 20:03 UTC (permalink / raw)
  To: Johan Jonker; +Cc: Kever Yang, Philipp Tomsich, U-Boot Mailing List

On Thu, 30 Dec 2021 at 09:48, Johan Jonker <jbx6244@gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  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(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 4/6] rockchip: tpl: change call condition rockchip_stimer_init()
  2021-12-30 16:48 ` [PATCH v3 4/6] rockchip: tpl: " Johan Jonker
@ 2022-01-12 20:03   ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2022-01-12 20:03 UTC (permalink / raw)
  To: Johan Jonker; +Cc: Kever Yang, Philipp Tomsich, U-Boot Mailing List

On Thu, 30 Dec 2021 at 09:48, Johan Jonker <jbx6244@gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>
> 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(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 3/6] rockchip: spl: change call condition rockchip_stimer_init()
  2021-12-30 16:48 ` [PATCH v3 3/6] rockchip: spl: change call condition rockchip_stimer_init() Johan Jonker
@ 2022-01-12 20:03   ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2022-01-12 20:03 UTC (permalink / raw)
  To: Johan Jonker; +Cc: Kever Yang, Philipp Tomsich, U-Boot Mailing List

On Thu, 30 Dec 2021 at 09:48, Johan Jonker <jbx6244@gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>
> 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(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 5/6] rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition
  2021-12-30 16:48 ` [PATCH v3 5/6] rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition Johan Jonker
@ 2022-01-12 20:03   ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2022-01-12 20:03 UTC (permalink / raw)
  To: Johan Jonker; +Cc: Kever Yang, Philipp Tomsich, U-Boot Mailing List

On Thu, 30 Dec 2021 at 09:48, Johan Jonker <jbx6244@gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  arch/arm/mach-rockchip/spl.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 6/6] rockchip: tpl: use IS_ENABLED for timer_init() call condition
  2021-12-30 16:48 ` [PATCH v3 6/6] rockchip: tpl: use " Johan Jonker
@ 2022-01-12 20:03   ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2022-01-12 20:03 UTC (permalink / raw)
  To: Johan Jonker; +Cc: Kever Yang, Philipp Tomsich, U-Boot Mailing List

On Thu, 30 Dec 2021 at 09:48, Johan Jonker <jbx6244@gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>  arch/arm/mach-rockchip/tpl.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
  2021-12-30 16:48 [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Johan Jonker
                   ` (5 preceding siblings ...)
  2022-01-12 20:03 ` [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Simon Glass
@ 2022-03-12  8:51 ` Jagan Teki
  2022-03-12 10:01   ` Johan Jonker
  6 siblings, 1 reply; 21+ messages in thread
From: Jagan Teki @ 2022-03-12  8:51 UTC (permalink / raw)
  To: Johan Jonker; +Cc: kever.yang, sjg, philipp.tomsich, u-boot

On Thu, Dec 30, 2021 at 10:18 PM Johan Jonker <jbx6244@gmail.com> wrote:
>
> Move ROCKCHIP_STIMER_BASE to Kconfig.
>
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> ---
>
> 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(-)
>
> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
> index da6871eb..7a624c64 100644
> --- a/arch/arm/mach-rockchip/Kconfig
> +++ b/arch/arm/mach-rockchip/Kconfig
> @@ -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)

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

Jagan.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
  2022-03-12  8:51 ` Jagan Teki
@ 2022-03-12 10:01   ` Johan Jonker
  2022-03-12 14:39     ` Kever Yang
  0 siblings, 1 reply; 21+ messages in thread
From: Johan Jonker @ 2022-03-12 10:01 UTC (permalink / raw)
  To: Jagan Teki; +Cc: kever.yang, sjg, philipp.tomsich, u-boot



On 3/12/22 09:51, Jagan Teki wrote:
> On Thu, Dec 30, 2021 at 10:18 PM Johan Jonker <jbx6244@gmail.com> wrote:
>>
>> Move ROCKCHIP_STIMER_BASE to Kconfig.
>>
>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>> ---
>>
>> 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(-)
>>
>> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
>> index da6871eb..7a624c64 100644
>> --- a/arch/arm/mach-rockchip/Kconfig
>> +++ b/arch/arm/mach-rockchip/Kconfig
>> @@ -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)
> 

> 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

> 
> Jagan.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
  2022-03-12 10:01   ` Johan Jonker
@ 2022-03-12 14:39     ` Kever Yang
  2022-03-13 12:41       ` Paweł Jarosz
  2022-03-14 15:36         ` Johan Jonker
  0 siblings, 2 replies; 21+ messages in thread
From: Kever Yang @ 2022-03-12 14:39 UTC (permalink / raw)
  To: Johan Jonker, Jagan Teki; +Cc: sjg, philipp.tomsich, u-boot

Hi Johan,

On 2022/3/12 18:01, Johan Jonker wrote:
>
> On 3/12/22 09:51, Jagan Teki wrote:
>> On Thu, Dec 30, 2021 at 10:18 PM Johan Jonker<jbx6244@gmail.com>  wrote:
>>> Move ROCKCHIP_STIMER_BASE to Kconfig.
>>>
>>> Signed-off-by: Johan Jonker<jbx6244@gmail.com>
>>> ---
>>>
>>> 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(-)
>>>
>>> diff --git a/arch/arm/mach-rockchip/Kconfig b/arch/arm/mach-rockchip/Kconfig
>>> index da6871eb..7a624c64 100644
>>> --- a/arch/arm/mach-rockchip/Kconfig
>>> +++ b/arch/arm/mach-rockchip/Kconfig
>>> @@ -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)
>> 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.
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
> Johan
>
>> Jagan.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
  2022-03-12 14:39     ` Kever Yang
@ 2022-03-13 12:41       ` Paweł Jarosz
  2022-03-13 22:23         ` Simon Glass
  2022-03-14 15:36         ` Johan Jonker
  1 sibling, 1 reply; 21+ messages in thread
From: Paweł Jarosz @ 2022-03-13 12:41 UTC (permalink / raw)
  To: Kever Yang, Johan Jonker; +Cc: sjg, philipp.tomsich, u-boot

Hi Kever,


> 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/

> 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ł

> 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


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
  2022-03-13 12:41       ` Paweł Jarosz
@ 2022-03-13 22:23         ` Simon Glass
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Glass @ 2022-03-13 22:23 UTC (permalink / raw)
  To: 20211230164825.6489-1-jbx6244
  Cc: Kever Yang, Johan Jonker, Philipp Tomsich, U-Boot Mailing List

Hi,

On Sun, 13 Mar 2022 at 06:41, Paweł Jarosz <paweljarosz3691@gmail.com> wrote:
>
> Hi Kever,
>
>
> > 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/
>
> > 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ł
>
> > 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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
  2022-03-12 14:39     ` Kever Yang
@ 2022-03-14 15:36         ` Johan Jonker
  2022-03-14 15:36         ` Johan Jonker
  1 sibling, 0 replies; 21+ messages in thread
From: Johan Jonker @ 2022-03-14 15:36 UTC (permalink / raw)
  To: Kever Yang, Jagan Teki
  Cc: sjg, philipp.tomsich, u-boot, Paweł Jarosz, Heiko Stuebner,
	open list:ARM/Rockchip SoC support



On 3/12/22 15:39, Kever Yang wrote:
> Hi Johan,
>
> On 2022/3/12 18:01, Johan Jonker wrote:
>> On 3/12/22 09:51, Jagan Teki wrote:
>>> On Thu, Dec 30, 2021 at 10:18 PM Johan Jonker <jbx6244@gmail.com> wrote:
>>>> Move ROCKCHIP_STIMER_BASE to Kconfig.
>>>>
>>>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>>>> ---
>>>>
>>>> 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(-)
>>>>
>>>> diff --git a/arch/arm/mach-rockchip/Kconfig
b/arch/arm/mach-rockchip/Kconfig
>>>> index da6871eb..7a624c64 100644
>>>> --- a/arch/arm/mach-rockchip/Kconfig
>>>> +++ b/arch/arm/mach-rockchip/Kconfig
>>>> @@ -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)
>>> 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.

> 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.

>
>
> 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.

>
>

> 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

> 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.


> 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



>
> Thanks,
> - Kever
>> Johan
>>
>>> Jagan.

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
@ 2022-03-14 15:36         ` Johan Jonker
  0 siblings, 0 replies; 21+ messages in thread
From: Johan Jonker @ 2022-03-14 15:36 UTC (permalink / raw)
  To: Kever Yang, Jagan Teki
  Cc: sjg, philipp.tomsich, u-boot, Paweł Jarosz, Heiko Stuebner,
	open list:ARM/Rockchip SoC support



On 3/12/22 15:39, Kever Yang wrote:
> Hi Johan,
>
> On 2022/3/12 18:01, Johan Jonker wrote:
>> On 3/12/22 09:51, Jagan Teki wrote:
>>> On Thu, Dec 30, 2021 at 10:18 PM Johan Jonker <jbx6244@gmail.com> wrote:
>>>> Move ROCKCHIP_STIMER_BASE to Kconfig.
>>>>
>>>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>>>> ---
>>>>
>>>> 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(-)
>>>>
>>>> diff --git a/arch/arm/mach-rockchip/Kconfig
b/arch/arm/mach-rockchip/Kconfig
>>>> index da6871eb..7a624c64 100644
>>>> --- a/arch/arm/mach-rockchip/Kconfig
>>>> +++ b/arch/arm/mach-rockchip/Kconfig
>>>> @@ -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)
>>> 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.

> 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.

>
>
> 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.

>
>

> 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

> 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.


> 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



>
> Thanks,
> - Kever
>> Johan
>>
>>> Jagan.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
  2022-03-14 15:36         ` Johan Jonker
@ 2022-03-16  7:06           ` Kever Yang
  -1 siblings, 0 replies; 21+ messages in thread
From: Kever Yang @ 2022-03-16  7:06 UTC (permalink / raw)
  To: Johan Jonker, Jagan Teki
  Cc: sjg, philipp.tomsich, u-boot, Paweł Jarosz, Heiko Stuebner,
	open list:ARM/Rockchip SoC support

Hi Johan, Pawel,

On 2022/3/14 23:36, Johan Jonker wrote:
>
> On 3/12/22 15:39, Kever Yang wrote:
>> Hi Johan,
>>
>> On 2022/3/12 18:01, Johan Jonker wrote:
>>> On 3/12/22 09:51, Jagan Teki wrote:
>>>> On Thu, Dec 30, 2021 at 10:18 PM Johan Jonker <jbx6244@gmail.com> wrote:
>>>>> Move ROCKCHIP_STIMER_BASE to Kconfig.
>>>>>
>>>>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>>>>> ---
>>>>>
>>>>> 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(-)
>>>>>
>>>>> diff --git a/arch/arm/mach-rockchip/Kconfig
> b/arch/arm/mach-rockchip/Kconfig
>>>>> index da6871eb..7a624c64 100644
>>>>> --- a/arch/arm/mach-rockchip/Kconfig
>>>>> +++ b/arch/arm/mach-rockchip/Kconfig
>>>>> @@ -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)
>>>> 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.
>> 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.
>
>>
>> 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

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig
@ 2022-03-16  7:06           ` Kever Yang
  0 siblings, 0 replies; 21+ messages in thread
From: Kever Yang @ 2022-03-16  7:06 UTC (permalink / raw)
  To: Johan Jonker, Jagan Teki
  Cc: sjg, philipp.tomsich, u-boot, Paweł Jarosz, Heiko Stuebner,
	open list:ARM/Rockchip SoC support

Hi Johan, Pawel,

On 2022/3/14 23:36, Johan Jonker wrote:
>
> On 3/12/22 15:39, Kever Yang wrote:
>> Hi Johan,
>>
>> On 2022/3/12 18:01, Johan Jonker wrote:
>>> On 3/12/22 09:51, Jagan Teki wrote:
>>>> On Thu, Dec 30, 2021 at 10:18 PM Johan Jonker <jbx6244@gmail.com> wrote:
>>>>> Move ROCKCHIP_STIMER_BASE to Kconfig.
>>>>>
>>>>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
>>>>> ---
>>>>>
>>>>> 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(-)
>>>>>
>>>>> diff --git a/arch/arm/mach-rockchip/Kconfig
> b/arch/arm/mach-rockchip/Kconfig
>>>>> index da6871eb..7a624c64 100644
>>>>> --- a/arch/arm/mach-rockchip/Kconfig
>>>>> +++ b/arch/arm/mach-rockchip/Kconfig
>>>>> @@ -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)
>>>> 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.
>> 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.
>
>>
>> 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

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2022-03-16  7:23 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-30 16:48 [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Johan Jonker
2021-12-30 16:48 ` [PATCH v3 2/6] rockchip: move CONFIG_SYS_ARCH_TIMER " Johan Jonker
2022-01-12 20:03   ` Simon Glass
2021-12-30 16:48 ` [PATCH v3 3/6] rockchip: spl: change call condition rockchip_stimer_init() Johan Jonker
2022-01-12 20:03   ` Simon Glass
2021-12-30 16:48 ` [PATCH v3 4/6] rockchip: tpl: " Johan Jonker
2022-01-12 20:03   ` Simon Glass
2021-12-30 16:48 ` [PATCH v3 5/6] rockchip: spl: replace ifdef by IS_ENABLED for timer_init() call condition Johan Jonker
2022-01-12 20:03   ` Simon Glass
2021-12-30 16:48 ` [PATCH v3 6/6] rockchip: tpl: use " Johan Jonker
2022-01-12 20:03   ` Simon Glass
2022-01-12 20:03 ` [PATCH v3 1/6] rockchip: move ROCKCHIP_STIMER_BASE to Kconfig Simon Glass
2022-03-12  8:51 ` Jagan Teki
2022-03-12 10:01   ` Johan Jonker
2022-03-12 14:39     ` Kever Yang
2022-03-13 12:41       ` Paweł Jarosz
2022-03-13 22:23         ` Simon Glass
2022-03-14 15:36       ` Johan Jonker
2022-03-14 15:36         ` Johan Jonker
2022-03-16  7:06         ` Kever Yang
2022-03-16  7:06           ` Kever Yang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.