From: Minkyu Kang <mk7.kang@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Exynos: fix cpuinfo and cpu detecting
Date: Thu, 26 Apr 2012 16:55:45 +0900 [thread overview]
Message-ID: <4F98FF81.6050905@samsung.com> (raw)
Since Exynos architecture have new SoCs,
need to fix cpuinfo correctly.
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Tested-by: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Chander Kashyap <chander.kashyap@linaro.org>
---
arch/arm/cpu/armv7/s5p-common/cpu_info.c | 5 ++-
arch/arm/include/asm/arch-exynos/cpu.h | 42 ++++++++++++++++++++----------
arch/arm/include/asm/arch-s5pc1xx/cpu.h | 6 ++++
3 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/arch/arm/cpu/armv7/s5p-common/cpu_info.c b/arch/arm/cpu/armv7/s5p-common/cpu_info.c
index 527f32d..1642733 100644
--- a/arch/arm/cpu/armv7/s5p-common/cpu_info.c
+++ b/arch/arm/cpu/armv7/s5p-common/cpu_info.c
@@ -48,8 +48,9 @@ int print_cpuinfo(void)
{
char buf[32];
- printf("CPU:\tS5P%X@%sMHz\n",
- s5p_cpu_id, strmhz(buf, get_arm_clk()));
+ printf("CPU:\t%s%X@%sMHz\n",
+ s5p_get_cpu_name(), s5p_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 ac4ddc7..b1e22f2 100644
--- a/arch/arm/include/asm/arch-exynos/cpu.h
+++ b/arch/arm/include/asm/arch-exynos/cpu.h
@@ -24,6 +24,7 @@
#define DEVICE_NOT_AVAILABLE 0
+#define EXYNOS_CPU_NAME "Exynos"
#define EXYNOS4_ADDR_BASE 0x10000000
/* EXYNOS4 */
@@ -93,29 +94,42 @@ static inline int s5p_get_cpu_rev(void)
static inline void s5p_set_cpu_id(void)
{
- s5p_cpu_id = readl(EXYNOS4_PRO_ID);
- s5p_cpu_id = (0xC000 | ((s5p_cpu_id & 0x00FFF000) >> 12));
-
- /*
- * 0xC200: EXYNOS4210 EVT0
- * 0xC210: EXYNOS4210 EVT1
- */
- if (s5p_cpu_id == 0xC200) {
- s5p_cpu_id |= 0x10;
+ 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;
- } else if (s5p_cpu_id == 0xC210) {
- s5p_cpu_rev = 1;
+ break;
+ case 0x210:
+ /* Exynos4210 EVT1 */
+ s5p_cpu_id = 0x4210;
+ break;
+ case 0x412:
+ /* Exynos4412 */
+ s5p_cpu_id = 0x4412;
+ break;
+ case 0x520:
+ /* Exynos5250 */
+ s5p_cpu_id = 0x5250;
+ break;
}
}
+static inline char *s5p_get_cpu_name(void)
+{
+ return EXYNOS_CPU_NAME;
+}
+
#define IS_SAMSUNG_TYPE(type, id) \
static inline int cpu_is_##type(void) \
{ \
- return s5p_cpu_id == id ? 1 : 0; \
+ return (s5p_cpu_id >> 12) == id; \
}
-IS_SAMSUNG_TYPE(exynos4, 0xc210)
-IS_SAMSUNG_TYPE(exynos5, 0xc520)
+IS_SAMSUNG_TYPE(exynos4, 0x4)
+IS_SAMSUNG_TYPE(exynos5, 0x5)
#define SAMSUNG_BASE(device, base) \
static inline unsigned int samsung_get_base_##device(void) \
diff --git a/arch/arm/include/asm/arch-s5pc1xx/cpu.h b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
index 510ead4..2362b99 100644
--- a/arch/arm/include/asm/arch-s5pc1xx/cpu.h
+++ b/arch/arm/include/asm/arch-s5pc1xx/cpu.h
@@ -23,6 +23,7 @@
#ifndef _S5PC1XX_CPU_H
#define _S5PC1XX_CPU_H
+#define S5P_CPU_NAME "S5P"
#define S5PC1XX_ADDR_BASE 0xE0000000
/* S5PC100 */
@@ -71,6 +72,11 @@ static inline void s5p_set_cpu_id(void)
s5p_cpu_id = 0xC000 | ((s5p_cpu_id & 0x00FFF000) >> 12);
}
+static inline char *s5p_get_cpu_name(void)
+{
+ return S5P_CPU_NAME;
+}
+
#define IS_SAMSUNG_TYPE(type, id) \
static inline int cpu_is_##type(void) \
{ \
--
1.7.5.4
next reply other threads:[~2012-04-26 7:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-26 7:55 Minkyu Kang [this message]
2012-05-02 7:45 ` [U-Boot] [PATCH] Exynos: fix cpuinfo and cpu detecting Minkyu Kang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F98FF81.6050905@samsung.com \
--to=mk7.kang@samsung.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.