| cpu-id.patch | | Files affected: | arch/arm/mach-s3c2410/cpu.c | 27 27 + 0 - 0 ! | include/asm-arm/arch-s3c2410/cpu.h | 67 67 + 0 - 0 ! | 2 files changed, 94 insertions(+) | | Ben Dooks, Mon, 25 Oct 2004 12:37:42 +0100 --- linux-2.6.10-rc1-bk2-set1/include/asm-arm/arch-s3c2410/cpu.h 1970-01-01 01:00:00.000000000 +0100 +++ linux-2.6.10-rc1-bk2-set1-work/include/asm-arm/arch-s3c2410/cpu.h 2004-10-25 11:51:11.000000000 +0100 @@ -0,0 +1,67 @@ +/* linux/include/asm-arm/arch-s3c2410/cpu.h + * + * Copyright (c) 2004 Simtec Electronics + * http://www.simtec.co.uk/products/SWLINUX/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * S3C2410 CPU identification code + * + * Changelog: + * 21-Oct-2004 BJD Initial version + * +*/ + +#ifndef __ASM_ARCH_CPU_H +#define __ASM_ARCH_CPU_H __FILE__ + +typedef enum s3c24xx_cpu_type { + CPU_S3C2410, + CPU_S3C2410A, + CPU_S3C2440X, + CPU_S3C2440A, +} s3c24xx_cpu_t; + +extern enum s3c24xx_cpu_type s3c24xx_cpu_type; +extern const char *s3c24xx_cpu_name; + +/* over-all type of the cpu, s3c2410 or s3c2440 without + * worrying about the revisions that are available of + * each of them +*/ + +#ifdef CONFIG_CPU_S3C2410 +# ifdef arch_cpu_type +# undef arch_cpu_type +# define arch_cpu_type s3c24xx_cpu_type +# else +# define arch_cpu_type CPU_S3C2410 +# endif +# define cpu_is_s3c2410() (arch_cpu_type == CPU_S3C2410 \ + || arch_cpu_type == CPU_S3C2410A) +#else +#define cpu_is_s3c2410() 0 +#endif + +#ifdef CONFIG_CPU_S3C2440 +# ifdef arch_cpu_type +# undef arch_cpu_type +# define arch_cpu_type s3c24xx_cpu_type +# else +# define arch_cpu_type CPU_S3C2410 +# endif +# define cpu_is_s3c2440() (arch_cpu_type == CPU_S3C2440X \ + || arch_cpu_type == CPU_S3C2440A) +#else +#define cpu_is_s3c2440() 0 +#endif + +/* cpu types which are specific to the id-code of the cpu */ + +#define cpu_is_s3c2410a() (s3c24xx_cpu_type == CPU_S3C2410A) +#define cpu_is_s3c2440x() (s3c24xx_cpu_type == CPU_S3C2440X) +#define cpu_is_s3c2440a() (s3c24xx_cpu_type == CPU_S3C2440A) + +#endif /* __ASM_ARCH_CPU_H */ --- linux-2.6.10-rc1-bk2-set1/arch/arm/mach-s3c2410/cpu.c 2004-10-25 10:00:43.000000000 +0100 +++ linux-2.6.10-rc1-bk2-set1-work/arch/arm/mach-s3c2410/cpu.c 2004-10-25 11:49:59.000000000 +0100 @@ -36,14 +36,23 @@ #include #include +#include #include "cpu.h" #include "s3c2410.h" #include "s3c2440.h" +/* cpu type export */ + +enum s3c24xx_cpu_type s3c24xx_cpu_type; + +const char *s3c24xx_cpu_name; + + struct cpu_table { unsigned long idcode; unsigned long idmask; + s3c24xx_cpu_t type; void (*map_io)(struct map_desc *mach_desc, int size); int (*init)(void); const char *name; @@ -60,6 +69,18 @@ { .idcode = 0x32410000, .idmask = 0xffffffff, + .type = CPU_S3C2410, + .map_io = s3c2410_map_io, + .init = s3c2410_init, + .name = name_s3c2410 + }, + { + /* we assume there is an IDCODE of 0x32410001 out there, but + * we have yet to see it in practise... */ + + .idcode = 0x32410001, + .idmask = 0xffffffff, + .type = CPU_S3C2410, .map_io = s3c2410_map_io, .init = s3c2410_init, .name = name_s3c2410 @@ -67,6 +88,7 @@ { .idcode = 0x3241002, .idmask = 0xffffffff, + .type = CPU_S3C2410A, .map_io = s3c2410_map_io, .init = s3c2410_init, .name = name_s3c2410a @@ -74,6 +96,7 @@ { .idcode = 0x32440000, .idmask = 0xffffffff, + .type = CPU_S3C2440X, .map_io = s3c2440_map_io, .init = s3c2440_init, .name = name_s3c2440 @@ -81,6 +104,7 @@ { .idcode = 0x32440001, .idmask = 0xffffffff, + .type = CPU_S3C2440A, .map_io = s3c2440_map_io, .init = s3c2440_init, .name = name_s3c2440a @@ -147,6 +171,9 @@ printk("CPU %s (id 0x%08lx)\n", cpu->name, idcode); + s3c24xx_cpu_type = cpu->type; + s3c24xx_cpu_name = cpu->name; + (cpu->map_io)(mach_desc, size); }