diff options
Diffstat (limited to 'arch/arm/mach-s3c2410/cpu.c')
| -rw-r--r-- | arch/arm/mach-s3c2410/cpu.c | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/arch/arm/mach-s3c2410/cpu.c b/arch/arm/mach-s3c2410/cpu.c index 52842e6e86e6..1c3c6adae6c4 100644 --- a/arch/arm/mach-s3c2410/cpu.c +++ b/arch/arm/mach-s3c2410/cpu.c | |||
| @@ -44,6 +44,7 @@ | |||
| 44 | #include "clock.h" | 44 | #include "clock.h" |
| 45 | #include "s3c2400.h" | 45 | #include "s3c2400.h" |
| 46 | #include "s3c2410.h" | 46 | #include "s3c2410.h" |
| 47 | #include "s3c2412.h" | ||
| 47 | #include "s3c244x.h" | 48 | #include "s3c244x.h" |
| 48 | #include "s3c2440.h" | 49 | #include "s3c2440.h" |
| 49 | #include "s3c2442.h" | 50 | #include "s3c2442.h" |
| @@ -62,6 +63,7 @@ struct cpu_table { | |||
| 62 | 63 | ||
| 63 | static const char name_s3c2400[] = "S3C2400"; | 64 | static const char name_s3c2400[] = "S3C2400"; |
| 64 | static const char name_s3c2410[] = "S3C2410"; | 65 | static const char name_s3c2410[] = "S3C2410"; |
| 66 | static const char name_s3c2412[] = "S3C2412"; | ||
| 65 | static const char name_s3c2440[] = "S3C2440"; | 67 | static const char name_s3c2440[] = "S3C2440"; |
| 66 | static const char name_s3c2442[] = "S3C2442"; | 68 | static const char name_s3c2442[] = "S3C2442"; |
| 67 | static const char name_s3c2410a[] = "S3C2410A"; | 69 | static const char name_s3c2410a[] = "S3C2410A"; |
| @@ -114,6 +116,15 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
| 114 | .name = name_s3c2442 | 116 | .name = name_s3c2442 |
| 115 | }, | 117 | }, |
| 116 | { | 118 | { |
| 119 | .idcode = 0x32412001, | ||
| 120 | .idmask = 0xffffffff, | ||
| 121 | .map_io = s3c2412_map_io, | ||
| 122 | .init_clocks = s3c2412_init_clocks, | ||
| 123 | .init_uarts = s3c2412_init_uarts, | ||
| 124 | .init = s3c2412_init, | ||
| 125 | .name = name_s3c2412, | ||
| 126 | }, | ||
| 127 | { | ||
| 117 | .idcode = 0x0, /* S3C2400 doesn't have an idcode */ | 128 | .idcode = 0x0, /* S3C2400 doesn't have an idcode */ |
| 118 | .idmask = 0xffffffff, | 129 | .idmask = 0xffffffff, |
| 119 | .map_io = s3c2400_map_io, | 130 | .map_io = s3c2400_map_io, |
| @@ -171,6 +182,24 @@ void s3c24xx_set_board(struct s3c24xx_board *b) | |||
| 171 | 182 | ||
| 172 | static struct cpu_table *cpu; | 183 | static struct cpu_table *cpu; |
| 173 | 184 | ||
| 185 | static unsigned long s3c24xx_read_idcode_v5(void) | ||
| 186 | { | ||
| 187 | #if defined(CONFIG_CPU_S3C2412) || defined(CONFIG_CPU_S3C2413) | ||
| 188 | return __raw_readl(S3C2412_GSTATUS1); | ||
| 189 | #else | ||
| 190 | return 1UL; /* don't look like an 2400 */ | ||
| 191 | #endif | ||
| 192 | } | ||
| 193 | |||
| 194 | static unsigned long s3c24xx_read_idcode_v4(void) | ||
| 195 | { | ||
| 196 | #ifndef CONFIG_CPU_S3C2400 | ||
| 197 | return __raw_readl(S3C2410_GSTATUS1); | ||
| 198 | #else | ||
| 199 | return 0UL; | ||
| 200 | #endif | ||
| 201 | } | ||
| 202 | |||
| 174 | void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) | 203 | void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) |
| 175 | { | 204 | { |
| 176 | unsigned long idcode = 0x0; | 205 | unsigned long idcode = 0x0; |
| @@ -178,9 +207,11 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) | |||
| 178 | /* initialise the io descriptors we need for initialisation */ | 207 | /* initialise the io descriptors we need for initialisation */ |
| 179 | iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc)); | 208 | iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc)); |
| 180 | 209 | ||
| 181 | #ifndef CONFIG_CPU_S3C2400 | 210 | if (cpu_architecture() >= CPU_ARCH_ARMv5) { |
| 182 | idcode = __raw_readl(S3C2410_GSTATUS1); | 211 | idcode = s3c24xx_read_idcode_v5(); |
| 183 | #endif | 212 | } else { |
| 213 | idcode = s3c24xx_read_idcode_v4(); | ||
| 214 | } | ||
| 184 | 215 | ||
| 185 | cpu = s3c_lookup_cpu(idcode); | 216 | cpu = s3c_lookup_cpu(idcode); |
| 186 | 217 | ||
