[U-Boot] [PATCH] EXYNOS: Detect cpuid based on Exynos product codes

Chander Kashyap chander.kashyap at linaro.org
Wed Mar 14 07:42:12 CET 2012


Exynos based SoC's have two different naming conventions.
One is S5PC_XXXX and other is EXXX_XXXX. This patch adds
generic code to handle EXXX_XXXX connvention.

Signed-off-by: Chander Kashyap <chander.kashyap at linaro.org>
---
 arch/arm/include/asm/arch-exynos/cpu.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/arch/arm/include/asm/arch-exynos/cpu.h b/arch/arm/include/asm/arch-exynos/cpu.h
index 89f2c2e..da89ccf 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -105,10 +105,13 @@ static inline void s5p_set_cpu_id(void)
 	}
 }
 
+#define EXYNOS_ID	((readl(EXYNOS4_PRO_ID) & (0xF << 24)) >> 24)
 #define IS_SAMSUNG_TYPE(type, id)			\
 static inline int cpu_is_##type(void)			\
 {							\
-	return s5p_cpu_id == id ? 1 : 0;		\
+	return ((s5p_cpu_id == id)			\
+		|| (EXYNOS_ID == (#type[sizeof(#type) - 2] - '0'))) \
+		? 1 : 0;				\
 }
 
 IS_SAMSUNG_TYPE(exynos4, 0xc210)
-- 
1.7.5.4



More information about the U-Boot mailing list