All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
@ 2018-04-18  3:13 Kever Yang
  2018-04-18  3:13 ` [U-Boot] [PATCH 2/3] rockchip: rk3188: add timer3 node Kever Yang
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Kever Yang @ 2018-04-18  3:13 UTC (permalink / raw)
  To: u-boot

We should a -u-boot.dtsi for those config need by U-Boot only,
and other part sync with kernel.

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 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

diff --git a/arch/arm/dts/rk3188-radxarock-u-boot.dtsi b/arch/arm/dts/rk3188-radxarock-u-boot.dtsi
new file mode 100644
index 0000000..5d650b1
--- /dev/null
+++ b/arch/arm/dts/rk3188-radxarock-u-boot.dtsi
@@ -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;
+};
diff --git a/arch/arm/dts/rk3188-radxarock.dts b/arch/arm/dts/rk3188-radxarock.dts
index 5f5b5e9..0fc4f54 100644
--- a/arch/arm/dts/rk3188-radxarock.dts
+++ b/arch/arm/dts/rk3188-radxarock.dts
@@ -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";
 };
diff --git a/arch/arm/dts/rk3188.dtsi b/arch/arm/dts/rk3188.dtsi
index f4d438e..1a06843 100644
--- a/arch/arm/dts/rk3188.dtsi
+++ b/arch/arm/dts/rk3188.dtsi
@@ -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";
-- 
1.9.1

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

* [U-Boot] [PATCH 2/3] rockchip: rk3188: add timer3 node
  2018-04-18  3:13 [U-Boot] [PATCH 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188 Kever Yang
@ 2018-04-18  3:13 ` Kever Yang
  2018-04-25 10:04   ` [U-Boot] [U-Boot,2/3] " Philipp Tomsich
  2018-04-26  7:05   ` Philipp Tomsich
  2018-04-18  3:13 ` [U-Boot] [PATCH 3/3] rockchip: rk3188: use DM timer instead of rk_timer Kever Yang
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 15+ messages in thread
From: Kever Yang @ 2018-04-18  3:13 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

 arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 6 ++++++
 arch/arm/dts/rk3188.dtsi                  | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/arch/arm/dts/rk3188-radxarock-u-boot.dtsi b/arch/arm/dts/rk3188-radxarock-u-boot.dtsi
index 5d650b1..26f5707 100644
--- a/arch/arm/dts/rk3188-radxarock-u-boot.dtsi
+++ b/arch/arm/dts/rk3188-radxarock-u-boot.dtsi
@@ -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>;
+};
diff --git a/arch/arm/dts/rk3188.dtsi b/arch/arm/dts/rk3188.dtsi
index 1a06843..aeb5b80 100644
--- a/arch/arm/dts/rk3188.dtsi
+++ b/arch/arm/dts/rk3188.dtsi
@@ -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>;
-- 
1.9.1

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

* [U-Boot] [PATCH 3/3] rockchip: rk3188: use DM timer instead of rk_timer
  2018-04-18  3:13 [U-Boot] [PATCH 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188 Kever Yang
  2018-04-18  3:13 ` [U-Boot] [PATCH 2/3] rockchip: rk3188: add timer3 node Kever Yang
@ 2018-04-18  3:13 ` Kever Yang
  2018-04-25 10:04   ` [U-Boot] [U-Boot, " Philipp Tomsich
                     ` (2 more replies)
  2018-04-25 10:04 ` [U-Boot] [U-Boot, 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188 Philipp Tomsich
                   ` (2 subsequent siblings)
  4 siblings, 3 replies; 15+ messages in thread
From: Kever Yang @ 2018-04-18  3:13 UTC (permalink / raw)
  To: u-boot

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

Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
---

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

diff --git a/arch/arm/mach-rockchip/Makefile b/arch/arm/mach-rockchip/Makefile
index e1b0519..096dbac 100644
--- a/arch/arm/mach-rockchip/Makefile
+++ b/arch/arm/mach-rockchip/Makefile
@@ -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/
diff --git a/arch/arm/mach-rockchip/rk3188-board-spl.c b/arch/arm/mach-rockchip/rk3188-board-spl.c
index 74771d3..3ccc4f1 100644
--- a/arch/arm/mach-rockchip/rk3188-board-spl.c
+++ b/arch/arm/mach-rockchip/rk3188-board-spl.c
@@ -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);
diff --git a/configs/rock_defconfig b/configs/rock_defconfig
index f4882a8..e46cc29 100644
--- a/configs/rock_defconfig
+++ b/configs/rock_defconfig
@@ -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
diff --git a/include/configs/rk3188_common.h b/include/configs/rk3188_common.h
index 94f8cda..e07facd 100644
--- a/include/configs/rk3188_common.h
+++ b/include/configs/rk3188_common.h
@@ -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
-- 
1.9.1

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

* [U-Boot] [U-Boot, 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
  2018-04-18  3:13 [U-Boot] [PATCH 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188 Kever Yang
  2018-04-18  3:13 ` [U-Boot] [PATCH 2/3] rockchip: rk3188: add timer3 node Kever Yang
  2018-04-18  3:13 ` [U-Boot] [PATCH 3/3] rockchip: rk3188: use DM timer instead of rk_timer Kever Yang
@ 2018-04-25 10:04 ` Philipp Tomsich
  2018-04-25 10:04 ` Philipp Tomsich
  2018-04-26  7:05 ` Philipp Tomsich
  4 siblings, 0 replies; 15+ messages in thread
From: Philipp Tomsich @ 2018-04-25 10:04 UTC (permalink / raw)
  To: u-boot

> We should a -u-boot.dtsi for those config need by U-Boot only,
> and other part sync with kernel.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
>  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
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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

* [U-Boot] [U-Boot,2/3] rockchip: rk3188: add timer3 node
  2018-04-18  3:13 ` [U-Boot] [PATCH 2/3] rockchip: rk3188: add timer3 node Kever Yang
@ 2018-04-25 10:04   ` Philipp Tomsich
  2018-04-25 10:17     ` Dr. Philipp Tomsich
  2018-04-26  7:05   ` Philipp Tomsich
  1 sibling, 1 reply; 15+ messages in thread
From: Philipp Tomsich @ 2018-04-25 10:04 UTC (permalink / raw)
  To: u-boot

> 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".
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
>  arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 6 ++++++
>  arch/arm/dts/rk3188.dtsi                  | 6 ++++++
>  2 files changed, 12 insertions(+)
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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

* [U-Boot] [U-Boot, 3/3] rockchip: rk3188: use DM timer instead of rk_timer
  2018-04-18  3:13 ` [U-Boot] [PATCH 3/3] rockchip: rk3188: use DM timer instead of rk_timer Kever Yang
@ 2018-04-25 10:04   ` Philipp Tomsich
  2018-04-25 10:04   ` Philipp Tomsich
  2018-04-26  7:05   ` Philipp Tomsich
  2 siblings, 0 replies; 15+ messages in thread
From: Philipp Tomsich @ 2018-04-25 10:04 UTC (permalink / raw)
  To: u-boot

> Disable 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.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
>  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(-)
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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

* [U-Boot] [U-Boot, 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
  2018-04-18  3:13 [U-Boot] [PATCH 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188 Kever Yang
                   ` (2 preceding siblings ...)
  2018-04-25 10:04 ` [U-Boot] [U-Boot, 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188 Philipp Tomsich
@ 2018-04-25 10:04 ` Philipp Tomsich
  2018-04-26  7:05 ` Philipp Tomsich
  4 siblings, 0 replies; 15+ messages in thread
From: Philipp Tomsich @ 2018-04-25 10:04 UTC (permalink / raw)
  To: u-boot

> We should a -u-boot.dtsi for those config need by U-Boot only,
> and other part sync with kernel.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
>  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
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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

* [U-Boot] [U-Boot, 3/3] rockchip: rk3188: use DM timer instead of rk_timer
  2018-04-18  3:13 ` [U-Boot] [PATCH 3/3] rockchip: rk3188: use DM timer instead of rk_timer Kever Yang
  2018-04-25 10:04   ` [U-Boot] [U-Boot, " Philipp Tomsich
@ 2018-04-25 10:04   ` Philipp Tomsich
  2018-04-26  7:05   ` Philipp Tomsich
  2 siblings, 0 replies; 15+ messages in thread
From: Philipp Tomsich @ 2018-04-25 10:04 UTC (permalink / raw)
  To: u-boot

> Disable 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.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
>  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(-)
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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

* [U-Boot] [U-Boot,2/3] rockchip: rk3188: add timer3 node
  2018-04-25 10:04   ` [U-Boot] [U-Boot,2/3] " Philipp Tomsich
@ 2018-04-25 10:17     ` Dr. Philipp Tomsich
  2018-04-26  2:50       ` Kever Yang
  0 siblings, 1 reply; 15+ messages in thread
From: Dr. Philipp Tomsich @ 2018-04-25 10:17 UTC (permalink / raw)
  To: u-boot

Kever,

> On 25 Apr 2018, at 12:04, Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
> 
>> 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".
>> 
>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>> ---
>> 
>> arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 6 ++++++
>> arch/arm/dts/rk3188.dtsi                  | 6 ++++++
>> 2 files changed, 12 insertions(+)
>> 
> 
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>

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.

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

* [U-Boot] [U-Boot,2/3] rockchip: rk3188: add timer3 node
  2018-04-25 10:17     ` Dr. Philipp Tomsich
@ 2018-04-26  2:50       ` Kever Yang
  2018-04-26  7:14         ` Dr. Philipp Tomsich
  0 siblings, 1 reply; 15+ messages in thread
From: Kever Yang @ 2018-04-26  2:50 UTC (permalink / raw)
  To: u-boot

Hi Philipp,

On 04/25/2018 06:17 PM, Dr. Philipp Tomsich wrote:
> Kever,
>
>> On 25 Apr 2018, at 12:04, Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
>>
>>> 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".
>>>
>>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>>> ---
>>>
>>> arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 6 ++++++
>>> arch/arm/dts/rk3188.dtsi                  | 6 ++++++
>>> 2 files changed, 12 insertions(+)
>>>
>> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> 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
>
> Thanks,
> Philipp.

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

* [U-Boot] [U-Boot,2/3] rockchip: rk3188: add timer3 node
  2018-04-18  3:13 ` [U-Boot] [PATCH 2/3] rockchip: rk3188: add timer3 node Kever Yang
  2018-04-25 10:04   ` [U-Boot] [U-Boot,2/3] " Philipp Tomsich
@ 2018-04-26  7:05   ` Philipp Tomsich
  1 sibling, 0 replies; 15+ messages in thread
From: Philipp Tomsich @ 2018-04-26  7:05 UTC (permalink / raw)
  To: u-boot

> 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".
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> 
>  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!

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

* [U-Boot] [U-Boot, 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
  2018-04-18  3:13 [U-Boot] [PATCH 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188 Kever Yang
                   ` (3 preceding siblings ...)
  2018-04-25 10:04 ` Philipp Tomsich
@ 2018-04-26  7:05 ` Philipp Tomsich
  4 siblings, 0 replies; 15+ messages in thread
From: Philipp Tomsich @ 2018-04-26  7:05 UTC (permalink / raw)
  To: u-boot

> We should a -u-boot.dtsi for those config need by U-Boot only,
> and other part sync with kernel.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> 
>  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!

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

* [U-Boot] [U-Boot, 3/3] rockchip: rk3188: use DM timer instead of rk_timer
  2018-04-18  3:13 ` [U-Boot] [PATCH 3/3] rockchip: rk3188: use DM timer instead of rk_timer Kever Yang
  2018-04-25 10:04   ` [U-Boot] [U-Boot, " Philipp Tomsich
  2018-04-25 10:04   ` Philipp Tomsich
@ 2018-04-26  7:05   ` Philipp Tomsich
  2 siblings, 0 replies; 15+ messages in thread
From: Philipp Tomsich @ 2018-04-26  7:05 UTC (permalink / raw)
  To: u-boot

> Disable 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.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> 
>  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!

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

* [U-Boot] [U-Boot,2/3] rockchip: rk3188: add timer3 node
  2018-04-26  2:50       ` Kever Yang
@ 2018-04-26  7:14         ` Dr. Philipp Tomsich
  2018-04-26  7:37           ` Dr. Philipp Tomsich
  0 siblings, 1 reply; 15+ messages in thread
From: Dr. Philipp Tomsich @ 2018-04-26  7:14 UTC (permalink / raw)
  To: u-boot


> On 26 Apr 2018, at 04:50, Kever Yang <kever.yang@rock-chips.com> wrote:
> 
> Hi Philipp,
> 
> On 04/25/2018 06:17 PM, Dr. Philipp Tomsich wrote:
>> Kever,
>> 
>>> On 25 Apr 2018, at 12:04, Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
>>> 
>>>> 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".
>>>> 
>>>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>>>> ---
>>>> 
>>>> arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 6 ++++++
>>>> arch/arm/dts/rk3188.dtsi                  | 6 ++++++
>>>> 2 files changed, 12 insertions(+)
>>>> 
>>> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>> 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

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.

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

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

* [U-Boot] [U-Boot,2/3] rockchip: rk3188: add timer3 node
  2018-04-26  7:14         ` Dr. Philipp Tomsich
@ 2018-04-26  7:37           ` Dr. Philipp Tomsich
  0 siblings, 0 replies; 15+ messages in thread
From: Dr. Philipp Tomsich @ 2018-04-26  7:37 UTC (permalink / raw)
  To: u-boot


> On 26 Apr 2018, at 09:14, Dr. Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
> 
> 
>> On 26 Apr 2018, at 04:50, Kever Yang <kever.yang@rock-chips.com> wrote:
>> 
>> Hi Philipp,
>> 
>> On 04/25/2018 06:17 PM, Dr. Philipp Tomsich wrote:
>>> Kever,
>>> 
>>>> On 25 Apr 2018, at 12:04, Philipp Tomsich <philipp.tomsich@theobroma-systems.com> wrote:
>>>> 
>>>>> 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".
>>>>> 
>>>>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
>>>>> ---
>>>>> 
>>>>> arch/arm/dts/rk3188-radxarock-u-boot.dtsi | 6 ++++++
>>>>> arch/arm/dts/rk3188.dtsi                  | 6 ++++++
>>>>> 2 files changed, 12 insertions(+)
>>>>> 
>>>> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
>>> 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
> 
> 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.

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.

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

end of thread, other threads:[~2018-04-26  7:37 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18  3:13 [U-Boot] [PATCH 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188 Kever Yang
2018-04-18  3:13 ` [U-Boot] [PATCH 2/3] rockchip: rk3188: add timer3 node Kever Yang
2018-04-25 10:04   ` [U-Boot] [U-Boot,2/3] " Philipp Tomsich
2018-04-25 10:17     ` Dr. Philipp Tomsich
2018-04-26  2:50       ` Kever Yang
2018-04-26  7:14         ` Dr. Philipp Tomsich
2018-04-26  7:37           ` Dr. Philipp Tomsich
2018-04-26  7:05   ` Philipp Tomsich
2018-04-18  3:13 ` [U-Boot] [PATCH 3/3] rockchip: rk3188: use DM timer instead of rk_timer Kever Yang
2018-04-25 10:04   ` [U-Boot] [U-Boot, " Philipp Tomsich
2018-04-25 10:04   ` Philipp Tomsich
2018-04-26  7:05   ` Philipp Tomsich
2018-04-25 10:04 ` [U-Boot] [U-Boot, 1/3] rockchip: rk3188: add -u-boot.dtsi for rock-rk3188 Philipp Tomsich
2018-04-25 10:04 ` Philipp Tomsich
2018-04-26  7:05 ` Philipp Tomsich

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.