From 84ca90e51953ac15f10b430dfe422896d69c4867 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 9 Mar 2009 21:02:16 +0000 Subject: 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 --- arch/arm/plat-s3c/include/mach/cpu.h | 3 +++ arch/arm/plat-s3c/init.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'arch/arm/plat-s3c') 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); -- cgit v1.2.3