rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
Subsystems (3)
PATCH 1/3 rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
We should a -u-boot.dtsi for those config need by U-Boot only, and other part sync with kernel.
---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 18 ++++++++++++++++++ arch/arm/dts/rk3188-radxarock.dts | 6 +----- arch/arm/dts/rk3188.dtsi | 2 -- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 arch/arm/dts/rk3188-radxarock-u-boot.dtsi
arch/arm/dts/rk3188-radxarock-u-boot.dtsi new file +18 -0
@@ -0,0 +1,18 @@ +/* + * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd. + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +&cru { + u-boot,dm-spl; +}; + +&pinctrl { + u-boot,dm-spl; +}; + +&uart2 { + status = "okay"; + u-boot,dm-spl; +};
arch/arm/dts/rk3188-radxarock.dts +1 -5
@@ -7,6 +7,7 @@ /dts-v1/; #include <dt-bindings/input/input.h> #include "rk3188.dtsi" +#include "rk3188-radxarock-u-boot.dtsi" / { model = "Radxa Rock";
@@ -356,11 +357,6 @@ status = "okay"; }; -&uart2 { - status = "okay"; - u-boot,dm-spl; -}; - &uart3 { status = "okay"; };
arch/arm/dts/rk3188.dtsi +0 -2
@@ -105,7 +105,6 @@ compatible = "rockchip,rk3188-cru"; reg = <0x20000000 0x1000>; rockchip,grf = <&grf>; - u-boot,dm-spl; #clock-cells = <1>; #reset-cells = <1>;
@@ -156,7 +155,6 @@ #address-cells = <1>; #size-cells = <1>; ranges; - u-boot,dm-spl; gpio0: gpio0 at 2000a000 { compatible = "rockchip,gpio-bank";
Signature · 1 line
1.9.1
PATCH 2/3 rockchip: rk3188: add timer3 node
Add dts node for timer3.
Because of the rockchip timer can only KNOWN "dtd_rockchip_rk3368_timer" with OF_PLATDATA enable, so we override its compatible to "rockchip,rk3368-timer".
---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 6 ++++++ arch/arm/dts/rk3188.dtsi | 6 ++++++ 2 files changed, 12 insertions(+)
arch/arm/dts/rk3188-radxarock-u-boot.dtsi +6 -0
@@ -16,3 +16,9 @@ status = "okay"; u-boot,dm-spl; }; + +&timer3 { + compatible = "rockchip,rk3368-timer", "rockchip,rk3288-timer"; + u-boot,dm-spl; + clock-frequency = <24000000>; +};
arch/arm/dts/rk3188.dtsi +6 -0
@@ -123,6 +123,12 @@ }; }; + timer3: timer at 2000e000 { + compatible = "rockchip,rk3188-timer", "rockchip,rk3288-timer"; + reg = <0x2000e000 0x20>; + interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; + }; + usbphy: phy { compatible = "rockchip,rk3188-usb-phy", "rockchip,rk3288-usb-phy"; rockchip,grf = <&grf>;
Signature · 1 line
1.9.1
PATCH 2/3 rockchip: rk3188: add timer3 node
Quoted 5 lines
Add dts node for timer3.
Because of the rockchip timer can only KNOWN "dtd_rockchip_rk3368_timer" withOF_PLATDATAenable, so we override its compatible to "rockchip,rk3368-timer".
Quoted 7 lines
Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 6 ++++++ arch/arm/dts/rk3188.dtsi | 6 ++++++ 2 files changed, 12 insertions(+)
PATCH 2/3 rockchip: rk3188: add timer3 node
Kever,
Quoted 10 lines · Philipp Tomsich
Quoted 9 lines
Add dts node for timer3.
Because of the rockchip timer can only KNOWN "dtd_rockchip_rk3368_timer" withOF_PLATDATAenable, so we override its compatible to "rockchip,rk3368-timer".Signed-off-by Kever Yang <[email protected]>---
Quoted 6 lines
Quoted 4 lines
arch/arm/dts/rk3188-radxarock-u-boot.dtsi| 6 ++++++arch/arm/dts/rk3188.dtsi| 6 ++++++2 files changed, 12 insertions(+)Acked-by Philipp Tomsich <[email protected]>
This looks like a work-around that we’ll have to revert eventually. I would instead extend the driver to recognise the ‘rockchip,rk3188-timer’ and ‘rockchip,rk3288-timer’ as well.
Please confirm that both these .compatible strings should also be handled by the same driver and I’ll make the change when applying this series.
Thanks,
Philipp.
PATCH 2/3 rockchip: rk3188: add timer3 node
Hi Philipp,
Quoted 16 lines · Dr. Philipp Tomsich
Kever,
Quoted 14 lines · Philipp Tomsich
Quoted 13 lines
Add dts node for timer3.
Because of the rockchip timer can only KNOWN "dtd_rockchip_rk3368_timer" withOF_PLATDATAenable, so we override its compatible to "rockchip,rk3368-timer".Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi| 6 ++++++arch/arm/dts/rk3188.dtsi| 6 ++++++2 files changed, 12 insertions(+)
Quoted 7 lines
Quoted 1 line
Acked-by Philipp Tomsich <[email protected]>This looks like a work-around that we’ll have to revert eventually. I would instead extend the driver to recognise the ‘rockchip,rk3188-timer’ and ‘rockchip,rk3288-timer’ as well.
Please confirm that both these .compatible strings should also be handled by the same driver and I’ll make the change when applying this series.
Do you mean you want patch like this? I do not like add lots #ifdef/#elif like this.
+++ b/drivers/timer/rockchip_timer.c
@@ -17,7 +17,11 @@ DECLARE_GLOBAL_DATA_PTR;
#if CONFIG_IS_ENABLED(OF_PLATDATA)
struct rockchip_timer_plat {
+#ifdef CONFIG_ROCKCHIP_RK3368
struct dtd_rockchip_rk3368_timer dtd;
+#elif CONFIG_ROCKCHIP_RK3188
+ struct dtd_rockchip_rk3188_timer dtd;
+#endif
};
#endif
@@ -153,6 +157,7 @@ static const struct timer_ops rockchip_timer_ops = {
static const struct udevice_id rockchip_timer_ids[] = {
{ .compatible = "rockchip,rk3368-timer" },
+ { .compatible = "rockchip,rk3188-timer" },
{}
};
Thanks,
- Kever
Quoted 3 lines
Thanks,
Philipp.
PATCH 2/3 rockchip: rk3188: add timer3 node
Quoted 34 lines · Kever Yang
Hi Philipp,
Quoted 16 lines · Dr. Philipp Tomsich
Kever,
Quoted 14 lines · Philipp Tomsich
Quoted 13 lines
Add dts node for timer3.
Because of the rockchip timer can only KNOWN "dtd_rockchip_rk3368_timer" withOF_PLATDATAenable, so we override its compatible to "rockchip,rk3368-timer".Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi| 6 ++++++arch/arm/dts/rk3188.dtsi| 6 ++++++2 files changed, 12 insertions(+)Quoted 7 lines
Quoted 1 line
Acked-by Philipp Tomsich <[email protected]>This looks like a work-around that we’ll have to revert eventually. I would instead extend the driver to recognise the ‘rockchip,rk3188-timer’ and ‘rockchip,rk3288-timer’ as well.
Please confirm that both these .compatible strings should also be handled by the same driver and I’ll make the change when applying this series.
Do you mean you want patch like this? I do not like add lots #ifdef/#elif like this.
+++b/drivers/timer/rockchip_timer.c
Review DECLARE_GLOBAL_DATA_PTR; · line 26
Quoted 10 lines
(quoted diff) +4
-0@@ -17,7 +17,11 @@ DECLARE_GLOBAL_DATA_PTR; #if CONFIG_IS_ENABLED(OF_PLATDATA) struct rockchip_timer_plat { +#ifdef CONFIG_ROCKCHIP_RK3368 struct dtd_rockchip_rk3368_timer dtd; +#elif CONFIG_ROCKCHIP_RK3188 + struct dtd_rockchip_rk3188_timer dtd; +#endif }; #endif
The OF_PLATDATA implementation is really broken in this regard: the only fix I can think of would be to emit "struct dtd_…” for every compatible listed in the DTS.
Review static const struct timer_ops rockchip_timer_ops = { · line 162
Quoted 7 lines
(quoted diff) +1
-0@@ -153,6 +157,7 @@ static const struct timer_ops rockchip_timer_ops = { static const struct udevice_id rockchip_timer_ids[] = { { .compatible = "rockchip,rk3368-timer" }, + { .compatible = "rockchip,rk3188-timer" }, {} };
I actually referred only to this part (i.e. adding the .compatible).
PATCH 2/3 rockchip: rk3188: add timer3 node
Quoted 38 lines · Dr. Philipp Tomsich
Quoted 36 lines · Kever Yang
Hi Philipp,
Quoted 16 lines · Dr. Philipp Tomsich
Kever,
Quoted 14 lines · Philipp Tomsich
Quoted 13 lines
Add dts node for timer3.
Because of the rockchip timer can only KNOWN "dtd_rockchip_rk3368_timer" withOF_PLATDATAenable, so we override its compatible to "rockchip,rk3368-timer".Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi| 6 ++++++arch/arm/dts/rk3188.dtsi| 6 ++++++2 files changed, 12 insertions(+)Quoted 7 lines
Quoted 1 line
Acked-by Philipp Tomsich <[email protected]>This looks like a work-around that we’ll have to revert eventually. I would instead extend the driver to recognise the ‘rockchip,rk3188-timer’ and ‘rockchip,rk3288-timer’ as well.
Please confirm that both these .compatible strings should also be handled by the same driver and I’ll make the change when applying this series.
Do you mean you want patch like this? I do not like add lots #ifdef/#elif like this.
+++b/drivers/timer/rockchip_timer.c(quoted diff) +0
-0@@ -17,7 +17,11 @@ DECLARE_GLOBAL_DATA_PTR;
Quoted 13 lines
Review DECLARE_GLOBAL_DATA_PTR; · line 26
Quoted 9 lines
(quoted diff) +4
-0#if CONFIG_IS_ENABLED(OF_PLATDATA) struct rockchip_timer_plat { +#ifdef CONFIG_ROCKCHIP_RK3368 struct dtd_rockchip_rk3368_timer dtd; +#elif CONFIG_ROCKCHIP_RK3188 + struct dtd_rockchip_rk3188_timer dtd; +#endif }; #endifThe
OF_PLATDATAimplementation is really broken in this regard: the only fix I can think of would be to emit "struct dtd_…” for every compatible listed in the DTS.
I stand corrected: the OF_PLATDATA implementation (i.e. dtoc) already created #define entries for all aliases in the compatible-list of a DTS node.
We’ll have to clean up our DTS files and this driver in the next release cycle and simply need to make sure that a common compatible is found across all devices (and the driver expects that common structure name).
—Philipp.
PATCH 2/3 rockchip: rk3188: add timer3 node
In reply to Kever YangQuoted 5 lines
Add dts node for timer3.
Because of the rockchip timer can only KNOWN "dtd_rockchip_rk3368_timer" withOF_PLATDATAenable, so we override its compatible to "rockchip,rk3368-timer".
Quoted 8 lines
Signed-off-by Kever Yang <[email protected]>Acked-by Philipp Tomsich <[email protected]>---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 6 ++++++ arch/arm/dts/rk3188.dtsi | 6 ++++++ 2 files changed, 12 insertions(+)
Applied to u-boot-rockchip, thanks!
PATCH 3/3 rockchip: rk3188: use DM timer instead of rk_timer
In reply to Kever YangDisable rk_timer as SYS timer and use DM timer instead, so that we can get a better timer framework, the rk_timer is going to be clean after we conver to use DM timer or ARM arch/generic timer.
---
arch/arm/mach-rockchip/Makefile | 2 ++ arch/arm/mach-rockchip/rk3188-board-spl.c | 2 -- configs/rock_defconfig | 3 +++ include/configs/rk3188_common.h | 5 ----- 4 files changed, 5 insertions(+), 7 deletions(-)
arch/arm/mach-rockchip/Makefile +2 -0
@@ -40,8 +40,10 @@ endif obj-$(CONFIG_$(SPL_TPL_)RAM) += sdram_common.o ifndef CONFIG_ARM64 +ifndef CONFIG_ROCKCHIP_RK3188 obj-y += rk_timer.o endif +endif obj-$(CONFIG_ROCKCHIP_RK3036) += rk3036/ obj-$(CONFIG_ROCKCHIP_RK3128) += rk3128/
arch/arm/mach-rockchip/rk3188-board-spl.c +0 -2
@@ -131,8 +131,6 @@ void board_init_f(ulong dummy)hang (); } -rockchip_timer_init (); - ret =rockchip_get_clk (&dev);if (ret) {debug ("CLK init failed: %d\n" , ret);
configs/rock_defconfig +3 -0
@@ -5,6 +5,9 @@ CONFIG_ARCH_ROCKCHIP=y CONFIG_SYS_TEXT_BASE=0x60000000 CONFIG_SYS_MALLOC_F_LEN=0x2000 CONFIG_ROCKCHIP_RK3188=y +CONFIG_TIMER=y +CONFIG_SPL_TIMER=y +CONFIG_ROCKCHIP_TIMER=y CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y CONFIG_TARGET_ROCK=y CONFIG_SPL_STACK_R_ADDR=0x60080000
include/configs/rk3188_common.h +0 -5
@@ -17,11 +17,6 @@#define CONFIG_SYS_MALLOC_LEN (32 << 20)#define CONFIG_SYS_CBSIZE 1024 -#define CONFIG_SYS_TIMER_RATE (24 * 1000 * 1000) -#define CONFIG_SYS_TIMER_BASE 0x2000e000/* TIMER3 */ -#define CONFIG_SYS_TIMER_COUNTER (CONFIG_SYS_TIMER_BASE + 8) -#define CONFIG_SYS_TIMER_COUNTS_DOWN -#define CONFIG_SYS_NS16550_MEM32 #ifdef CONFIG_SPL_ROCKCHIP_BACK_TO_BROM
Signature · 1 line
1.9.1
PATCH 3/3 rockchip: rk3188: use DM timer instead of rk_timer
Quoted 5 lines
Disable
rk_timeras SYS timer and use DM timer instead, so that we can get a better timer framework, therk_timeris going to be clean after we conver to use DM timer or ARMarch/generictimer.
Quoted 9 lines
Signed-off-by Kever Yang <[email protected]>---
arch/arm/mach-rockchip/Makefile | 2 ++ arch/arm/mach-rockchip/rk3188-board-spl.c | 2 -- configs/rock_defconfig | 3 +++ include/configs/rk3188_common.h | 5 ----- 4 files changed, 5 insertions(+), 7 deletions(-)
PATCH 3/3 rockchip: rk3188: use DM timer instead of rk_timer
In reply to Kever YangQuoted 5 lines
Disable
rk_timeras SYS timer and use DM timer instead, so that we can get a better timer framework, therk_timeris going to be clean after we conver to use DM timer or ARMarch/generictimer.
Quoted 9 lines
Signed-off-by Kever Yang <[email protected]>---
arch/arm/mach-rockchip/Makefile | 2 ++ arch/arm/mach-rockchip/rk3188-board-spl.c | 2 -- configs/rock_defconfig | 3 +++ include/configs/rk3188_common.h | 5 ----- 4 files changed, 5 insertions(+), 7 deletions(-)
PATCH 3/3 rockchip: rk3188: use DM timer instead of rk_timer
In reply to Kever YangQuoted 8 lines
Disable
rk_timeras SYS timer and use DM timer instead, so that we can get a better timer framework, therk_timeris going to be clean after we conver to use DM timer or ARMarch/generictimer.Signed-off-by Kever Yang <[email protected]>Acked-by Philipp Tomsich <[email protected]>Reviewed-by Philipp Tomsich <[email protected]>
Quoted 8 lines
---
arch/arm/mach-rockchip/Makefile | 2 ++ arch/arm/mach-rockchip/rk3188-board-spl.c | 2 -- configs/rock_defconfig | 3 +++ include/configs/rk3188_common.h | 5 ----- 4 files changed, 5 insertions(+), 7 deletions(-)
Applied to u-boot-rockchip, thanks!
PATCH 1/3 rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
In reply to Kever YangQuoted 12 lines
We should a
-u-boot.dtsifor those config need by U-Boot only, and other part sync with kernel.Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 18 ++++++++++++++++++ arch/arm/dts/rk3188-radxarock.dts | 6 +----- arch/arm/dts/rk3188.dtsi | 2 -- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 arch/arm/dts/rk3188-radxarock-u-boot.dtsi
PATCH 1/3 rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
In reply to Kever YangQuoted 12 lines
We should a
-u-boot.dtsifor those config need by U-Boot only, and other part sync with kernel.Signed-off-by Kever Yang <[email protected]>---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 18 ++++++++++++++++++ arch/arm/dts/rk3188-radxarock.dts | 6 +----- arch/arm/dts/rk3188.dtsi | 2 -- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 arch/arm/dts/rk3188-radxarock-u-boot.dtsi
PATCH 1/3 rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
In reply to Kever YangQuoted 6 lines
We should a
-u-boot.dtsifor those config need by U-Boot only, and other part sync with kernel.Signed-off-by Kever Yang <[email protected]>Acked-by Philipp Tomsich <[email protected]>Reviewed-by Philipp Tomsich <[email protected]>
Quoted 8 lines
---
arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 18 ++++++++++++++++++ arch/arm/dts/rk3188-radxarock.dts | 6 +----- arch/arm/dts/rk3188.dtsi | 2 -- 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 arch/arm/dts/rk3188-radxarock-u-boot.dtsi
Applied to u-boot-rockchip, thanks!