[U-Boot] [PATCH] arm:samsung:cpu_info: Rename s5p_* to samsung_*

Lukasz Majewski l.majewski at majess.pl
Thu Jul 25 23:47:08 CEST 2013


Common CPU info code has been refactored to use more generic name - namely
samsung_* instead of s5p_*.
This change will prevent code duplication for non armv7a based SoCs (e.g.
s3c64xx).

Signed-off-by: Lukasz Majewski <l.majewski at majess.pl>

---
This patch depends on:
1. arm:samsung:serial Extract common UART code
	http://patchwork.ozlabs.org/patch/260550/
2. arm:samsung: Move common code from ./s5p-common to ./samsung-common/
	http://patchwork.ozlabs.org/patch/260554/
---
 arch/arm/cpu/samsung-common/cpu_info.c  |   10 +++++-----
 arch/arm/include/asm/arch-exynos/cpu.h  |   24 ++++++++++++------------
 arch/arm/include/asm/arch-s5pc1xx/cpu.h |   12 ++++++------
 3 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/arch/arm/cpu/samsung-common/cpu_info.c b/arch/arm/cpu/samsung-common/cpu_info.c
index 88743b9..1089829 100644
--- a/arch/arm/cpu/samsung-common/cpu_info.c
+++ b/arch/arm/cpu/samsung-common/cpu_info.c
@@ -25,14 +25,14 @@
 #include <asm/arch/clk.h>
 
 /* Default is s5pc100 */
-unsigned int s5p_cpu_id = 0xC100;
+unsigned int samsung_cpu_id = 0xC100;
 /* Default is EVT1 */
-unsigned int s5p_cpu_rev = 1;
+unsigned int samsung_cpu_rev = 1;
 
 #ifdef CONFIG_ARCH_CPU_INIT
 int arch_cpu_init(void)
 {
-	s5p_set_cpu_id();
+	samsung_set_cpu_id();
 
 	return 0;
 }
@@ -40,7 +40,7 @@ int arch_cpu_init(void)
 
 u32 get_device_type(void)
 {
-	return s5p_cpu_id;
+	return samsung_cpu_id;
 }
 
 #ifdef CONFIG_DISPLAY_CPUINFO
@@ -48,7 +48,7 @@ int print_cpuinfo(void)
 {
 	char buf[32];
 
-	printf("CPU:\t%s%X@%sMHz\n", s5p_get_cpu_name(), s5p_cpu_id,
+	printf("CPU:\t%s%X@%sMHz\n", samsung_get_cpu_name(), samsung_cpu_id,
 	       strmhz(buf, get_arm_clk()));
 
 	return 0;
diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h
index 1ff231b..b0be261 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -138,40 +138,40 @@
 #ifndef __ASSEMBLY__
 #include <asm/io.h>
 /* CPU detection macros */
-extern unsigned int s5p_cpu_id;
-extern unsigned int s5p_cpu_rev;
+extern unsigned int samsung_cpu_id;
+extern unsigned int samsung_cpu_rev;
 
 static inline int s5p_get_cpu_rev(void)
 {
-	return s5p_cpu_rev;
+	return samsung_cpu_rev;
 }
 
-static inline void s5p_set_cpu_id(void)
+static inline void samsung_set_cpu_id(void)
 {
 	unsigned int pro_id = (readl(EXYNOS4_PRO_ID) & 0x00FFF000) >> 12;
 
 	switch (pro_id) {
 	case 0x200:
 		/* Exynos4210 EVT0 */
-		s5p_cpu_id = 0x4210;
-		s5p_cpu_rev = 0;
+		samsung_cpu_id = 0x4210;
+		samsung_cpu_rev = 0;
 		break;
 	case 0x210:
 		/* Exynos4210 EVT1 */
-		s5p_cpu_id = 0x4210;
+		samsung_cpu_id = 0x4210;
 		break;
 	case 0x412:
 		/* Exynos4412 */
-		s5p_cpu_id = 0x4412;
+		samsung_cpu_id = 0x4412;
 		break;
 	case 0x520:
 		/* Exynos5250 */
-		s5p_cpu_id = 0x5250;
+		samsung_cpu_id = 0x5250;
 		break;
 	}
 }
 
-static inline char *s5p_get_cpu_name(void)
+static inline char *samsung_get_cpu_name(void)
 {
 	return EXYNOS_CPU_NAME;
 }
@@ -179,7 +179,7 @@ static inline char *s5p_get_cpu_name(void)
 #define IS_SAMSUNG_TYPE(type, id)			\
 static inline int __attribute__((no_instrument_function)) cpu_is_##type(void) \
 {							\
-	return (s5p_cpu_id >> 12) == id;		\
+	return (samsung_cpu_id >> 12) == id;		\
 }
 
 IS_SAMSUNG_TYPE(exynos4, 0x4)
@@ -189,7 +189,7 @@ IS_SAMSUNG_TYPE(exynos5, 0x5)
 static inline int __attribute__((no_instrument_function)) \
 	proid_is_##type(void)				\
 {							\
-	return s5p_cpu_id == id;			\
+	return samsung_cpu_id == id;			\
 }
 
 IS_EXYNOS_TYPE(exynos4210, 0x4210)
diff --git a/arch/arm/include/asm/arch-s5pc1xx/cpu.h b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
index 2362b99..8ab71ea 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/cpu.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
@@ -64,15 +64,15 @@
 #ifndef __ASSEMBLY__
 #include <asm/io.h>
 /* CPU detection macros */
-extern unsigned int s5p_cpu_id;
+extern unsigned int samsung_cpu_id;
 
-static inline void s5p_set_cpu_id(void)
+static inline void samsung_set_cpu_id(void)
 {
-	s5p_cpu_id = readl(S5PC100_PRO_ID);
-	s5p_cpu_id = 0xC000 | ((s5p_cpu_id & 0x00FFF000) >> 12);
+	samsung_cpu_id = readl(S5PC100_PRO_ID);
+	samsung_cpu_id = 0xC000 | ((samsung_cpu_id & 0x00FFF000) >> 12);
 }
 
-static inline char *s5p_get_cpu_name(void)
+static inline char *samsung_get_cpu_name(void)
 {
 	return S5P_CPU_NAME;
 }
@@ -80,7 +80,7 @@ static inline char *s5p_get_cpu_name(void)
 #define IS_SAMSUNG_TYPE(type, id)			\
 static inline int cpu_is_##type(void)			\
 {							\
-	return s5p_cpu_id == id ? 1 : 0;		\
+	return samsung_cpu_id == id ? 1 : 0;		\
 }
 
 IS_SAMSUNG_TYPE(s5pc100, 0xc100)
-- 
1.7.10.4



More information about the U-Boot mailing list