diff mbox series

[U-Boot,32/36] rockchip: remove rk_timer

Message ID 1522142971-20739-33-git-send-email-kever.yang@rock-chips.com
State Changes Requested
Delegated to: Philipp Tomsich
Headers show
Series rockchip: clean up board file for rockchip SoCs | expand

Commit Message

Kever Yang March 27, 2018, 9:29 a.m. UTC
We do not use rk_timer.c now, remove it.

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

 arch/arm/mach-rockchip/rk_timer.c | 48 ---------------------------------------
 1 file changed, 48 deletions(-)
 delete mode 100644 arch/arm/mach-rockchip/rk_timer.c

Comments

Philipp Tomsich April 1, 2018, 8:21 p.m. UTC | #1
> We do not use rk_timer.c now, remove it.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
> 
>  arch/arm/mach-rockchip/rk_timer.c | 48 ---------------------------------------
>  1 file changed, 48 deletions(-)
>  delete mode 100644 arch/arm/mach-rockchip/rk_timer.c
> 

Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Philipp Tomsich April 1, 2018, 8:40 p.m. UTC | #2
> We do not use rk_timer.c now, remove it.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
> ---
> 
>  arch/arm/mach-rockchip/rk_timer.c | 48 ---------------------------------------
>  1 file changed, 48 deletions(-)
>  delete mode 100644 arch/arm/mach-rockchip/rk_timer.c
> 

Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Alexander Kochetkov March 29, 2019, 8:35 a.m. UTC | #3
Hello, Kever!

Please keep rk_timer.c for rk3188 and other legacy chips. There is no ARM generic timer in
this SoC. This SoC only have private timers.

see https://community.arm.com/developer/ip-products/processors/f/cortex-a-forum/1449/generic-timer-on-cortex-a7-cortex-a9

> 27 марта 2018 г., в 12:29, Kever Yang <kever.yang@rock-chips.com> написал(а):
> 
> We do not use rk_timer.c now, remove it.
> 
> Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
> ---
Kever Yang March 29, 2019, 11:13 a.m. UTC | #4
Hi Alexander,

    Thanks for your comment, don't worry, I got this info and have
solution for it.

    rk3188 has moved to use DM timer instead of rk_timer.c, the patch
has been mered at last April and works pretty well, see:

fd9e0fe0e3 rockchip: rk3188: use DM timer instead of rk_timer
f9ef544786 rockchip: rk3188: add timer3 node
7abb7e8fcb rockchip: rk3188: add -u-boot.dtsi for rock-rk3188
e0e1d3f98c rockchip: timer: add compatible strings for rk3188 and rk3288

Thanks,
- Kever
On 03/29/2019 04:35 PM, Alexander Kochetkov wrote:
> Hello, Kever!
>
> Please keep rk_timer.c for rk3188 and other legacy chips. There is
> no ARM generic timer in
> this SoC. This SoC only have private timers.
>
> see https://community.arm.com/developer/ip-products/processors/f/cortex-a-forum/1449/generic-timer-on-cortex-a7-cortex-a9
>
>> 27 марта 2018 г., в 12:29, Kever Yang <kever.yang@rock-chips.com
>> <mailto:kever.yang@rock-chips.com>> написал(а):
>>
>> We do not use rk_timer.c now, remove it.
>>
>> Signed-off-by: Kever Yang <kever.yang@rock-chips.com
>> <mailto:kever.yang@rock-chips.com>>
>> ---
>
diff mbox series

Patch

diff --git a/arch/arm/mach-rockchip/rk_timer.c b/arch/arm/mach-rockchip/rk_timer.c
deleted file mode 100644
index 853b986..0000000
--- a/arch/arm/mach-rockchip/rk_timer.c
+++ /dev/null
@@ -1,48 +0,0 @@ 
-/*
- * (C) Copyright 2015 Rockchip Electronics Co., Ltd
- *
- * SPDX-License-Identifier:     GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/arch/timer.h>
-#include <asm/io.h>
-#include <linux/types.h>
-
-struct rk_timer * const timer_ptr = (void *)CONFIG_SYS_TIMER_BASE;
-
-static uint64_t rockchip_get_ticks(void)
-{
-	uint64_t timebase_h, timebase_l;
-
-	timebase_l = readl(&timer_ptr->timer_curr_value0);
-	timebase_h = readl(&timer_ptr->timer_curr_value1);
-
-	return timebase_h << 32 | timebase_l;
-}
-
-static uint64_t usec_to_tick(unsigned int usec)
-{
-	uint64_t tick = usec;
-	tick *= CONFIG_SYS_TIMER_RATE / (1000 * 1000);
-	return tick;
-}
-
-void rockchip_udelay(unsigned int usec)
-{
-	uint64_t tmp;
-
-	/* get timestamp */
-	tmp = rockchip_get_ticks() + usec_to_tick(usec);
-
-	/* loop till event */
-	while (rockchip_get_ticks() < tmp+1)
-		;
-}
-
-void rockchip_timer_init(void)
-{
-	writel(0xffffffff, &timer_ptr->timer_load_count0);
-	writel(0xffffffff, &timer_ptr->timer_load_count1);
-	writel(1, &timer_ptr->timer_ctrl_reg);
-}