Skip to contentSkip to conversation

arm: ls102xa: Remove reduplicate definition for Generic Timer frequency

PATCH New Alison Wang 2 participants 2 messages Sep 23, 2016 – Oct 5, 2016 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: ls102xa: Remove reduplicate definition for Generic Timer frequency

GENERIC_TIMER_CLK and CONFIG_TIMER_CLK_FREQ are both used to define Generic Timer frequency. It is reduplicate. This patch will remove GENERIC_TIMER_CLK macro.

---
 arch/arm/cpu/armv7/ls102xa/psci.S  | 2 +-
 arch/arm/cpu/armv7/ls102xa/timer.c | 2 +-
 include/configs/ls1021aqds.h       | 5 -----
 include/configs/ls1021atwr.h       | 5 -----
 4 files changed, 2 insertions(+), 12 deletions(-)
arch/arm/cpu/armv7/ls102xa/psci.S +1 -1
index 8f38680..9efb6d8 100644
@@ -36,7 +36,7 @@
 
 	.align	5
 
-#define	ONE_MS		(GENERIC_TIMER_CLK / 1000)
+#define	ONE_MS		(CONFIG_TIMER_CLK_FREQ / 1000)
 #define	RESET_WAIT	(30 * ONE_MS)
 
 .globl	psci_version
arch/arm/cpu/armv7/ls102xa/timer.c +1 -1
index e6a32ca..c926877 100644
@@ -62,7 +62,7 @@ int timer_init(void)
 	/* Enable System Counter */
 	writel(SYS_COUNTER_CTRL_ENABLE, &sctr->cntcr);
 
-	freq = GENERIC_TIMER_CLK;
+	freq = CONFIG_TIMER_CLK_FREQ;
 	asm("mcr p15, 0, %0, c14, c0, 0" : : "r" (freq));
 
 	/* Set PL1 Physical Timer Ctrl */
include/configs/ls1021aqds.h +0 -5
index 554c13c..374c705 100644
@@ -34,11 +34,6 @@
 #define CONFIG_SYS_INIT_RAM_ADDR	OCRAM_BASE_ADDR
 #define CONFIG_SYS_INIT_RAM_SIZE	OCRAM_SIZE
 
-/*
- * Generic Timer Definitions
- */
-#define GENERIC_TIMER_CLK		12500000
-
 #ifndef __ASSEMBLY__
 unsigned long get_board_sys_clk(void);
 unsigned long get_board_ddr_clk(void);
include/configs/ls1021atwr.h +0 -5
index e5ac50e..af9d08b 100644
@@ -63,11 +63,6 @@
 #define CONFIG_SYS_USB_XHCI_MAX_ROOT_PORTS     2
 #endif
 
-/*
- * Generic Timer Definitions
- */
-#define GENERIC_TIMER_CLK		12500000
-
 #define CONFIG_SYS_CLK_FREQ		100000000
 #define CONFIG_DDR_CLK_FREQ		100000000
 
Signature · 1 line
2.1.0.27.g96db324
#1 lore raw

PATCH 1/1 arm: ls102xa: Remove reduplicate definition for Generic Timer frequency

Quoted 17 lines · Alison Wang

GENERIC_TIMER_CLK and CONFIG_TIMER_CLK_FREQ are both used to define Generic Timer frequency. It is reduplicate. This patch will remove GENERIC_TIMER_CLK macro.

---
 arch/arm/cpu/armv7/ls102xa/psci.S  | 2 +-
 arch/arm/cpu/armv7/ls102xa/timer.c | 2 +-
 include/configs/ls1021aqds.h       | 5 -----
 include/configs/ls1021atwr.h       | 5 -----
 4 files changed, 2 insertions(+), 12 deletions(-)
arch/arm/cpu/armv7/ls102xa/psci.S +0 -0
index 8f38680..9efb6d8 100644

arch/arm/cpu/armv7/ls102xa/psci.S line 41

Quoted 7 lines
arch/arm/cpu/armv7/ls102xa/psci.S +1 -1
@@ -36,7 +36,7 @@
 
 	.align	5
 
-#define	ONE_MS		(GENERIC_TIMER_CLK / 1000)
+#define	ONE_MS		(CONFIG_TIMER_CLK_FREQ / 1000)
 #define	RESET_WAIT	(30 * ONE_MS)
 

Alison,

Can you use GENERIC_TIMER_CLK? Recent change in U-Boot doesn't favor using CONFIG_* macros.

York