aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-s3c
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2009-03-09 21:02:16 +0000
committerAndy Green <agreen@octopus.localdomain>2009-03-09 21:02:16 +0000
commit84ca90e51953ac15f10b430dfe422896d69c4867 (patch)
tree565a010782c50f0e5d86eb340602e03b4044c7e6 /arch/arm/plat-s3c
parent5cdd4f17f1375a228c4b33e57912ccc057395f68 (diff)
fix-s3c-cpu-detect-make-compatible-atag16.patch
The current version of CPU detection patch from Mark Brown and Kyungmin Park takes a dump on system_rev. This patch changes it to retain the low 16 of system_rev from the bootloader ATAG, and adds access #defines and changes to use them. No doubt they'll issue a better version of the CPU detection patch and then this can be reverted. Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch/arm/plat-s3c')
-rw-r--r--arch/arm/plat-s3c/include/mach/cpu.h3
-rw-r--r--arch/arm/plat-s3c/init.c6
2 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/plat-s3c/include/mach/cpu.h b/arch/arm/plat-s3c/include/mach/cpu.h
index 81571a2da7a..cd260b137f2 100644
--- a/arch/arm/plat-s3c/include/mach/cpu.h
+++ b/arch/arm/plat-s3c/include/mach/cpu.h
@@ -28,6 +28,9 @@
extern unsigned int system_rev;
+#define S3C_SYSTEM_REV_ATAG (system_rev & 0xffff)
+#define S3C_SYSTEM_REV_CPU (system_rev & 0xffff0000)
+
/*
* cpu_is_s3c24xx(): True for s3c2400, s3c2410, s3c2440 and so on
* cpu_is_s3c241x(): True fro s3c2410, s3c2412
diff --git a/arch/arm/plat-s3c/init.c b/arch/arm/plat-s3c/init.c
index f63ff9c86c3..94a3120f561 100644
--- a/arch/arm/plat-s3c/init.c
+++ b/arch/arm/plat-s3c/init.c
@@ -39,14 +39,16 @@ static void __init set_system_rev(unsigned int idcode)
* system_rev & 0xfff00000 -> S3C Sub Class (241x/244x)
* system_rev & 0xffff0000 -> S3C Type (2410/2440/6400/6410)
*
- * Remains[15:0] are reserved
+ * Remaining[15:0] are preserved from the value set by ATAG
*
* Exception:
* Store Revision A to 1 such as
* s3c2410A to s3c2411
* s3c2440A to s3c2441
*/
- system_rev = (idcode & 0x0ffff000) << 4;
+
+ system_rev &= 0xffff;
+ system_rev |= (idcode & 0x0ffff000) << 4;
if (idcode == 0x32410002 || idcode == 0x32440001)
system_rev |= (0x1 << 16);