--- linux-2.6.15.4/arch/arm/mach-s3c2410/cpu.c 2006-02-10 08:22:48.000000000 +0100 +++ golinux/arch/arm/mach-s3c2410/cpu.c 2006-02-28 10:59:03.000000000 +0100 @@ -41,6 +41,7 @@ #include "cpu.h" #include "clock.h" #include "s3c2410.h" +#include "s3c2412.h" #include "s3c2440.h" struct cpu_table { @@ -58,7 +59,9 @@ static const char name_s3c2410[] = "S3C2410"; static const char name_s3c2440[] = "S3C2440"; static const char name_s3c2410a[] = "S3C2410A"; +static const char name_s3c2412[] = "S3C2412"; static const char name_s3c2440a[] = "S3C2440A"; +static const char name_s3c2442x[] = "S3C2442X"; static struct cpu_table cpu_ids[] __initdata = { { @@ -96,6 +99,27 @@ .init_uarts = s3c2440_init_uarts, .init = s3c2440_init, .name = name_s3c2440a + }, + { + .idcode = 0x32440aaa, + .idmask = 0xffffffff, + .map_io = s3c2440_map_io, + .init_clocks = s3c2440_init_clocks, + .init_uarts = s3c2440_init_uarts, + .init = s3c2440_init, + .name = name_s3c2442x + } +}; + +static struct cpu_table alternative_cpu_ids[] __initdata = { + { + .idcode = 0x32410002, + .idmask = 0xffffffff, + .map_io = s3c2412_map_io, + .init_clocks = s3c2412_init_clocks, + .init_uarts = s3c2412_init_uarts, + .init = s3c2412_init, + .name = name_s3c2412 } }; @@ -110,13 +134,16 @@ static struct cpu_table * -s3c_lookup_cpu(unsigned long idcode) +s3c_lookup_cpu(unsigned long idcode,int alt) { struct cpu_table *tab; int count; + int size; - tab = cpu_ids; - for (count = 0; count < ARRAY_SIZE(cpu_ids); count++, tab++) { + tab = alt?alternative_cpu_ids:cpu_ids; + size = alt?ARRAY_SIZE(alternative_cpu_ids):ARRAY_SIZE(cpu_ids); + + for (count = 0; count < size; count++, tab++) { if ((idcode & tab->idmask) == tab->idcode) return tab; } @@ -154,7 +181,12 @@ iotable_init(s3c_iodesc, ARRAY_SIZE(s3c_iodesc)); idcode = __raw_readl(S3C2410_GSTATUS1); - cpu = s3c_lookup_cpu(idcode); + cpu = s3c_lookup_cpu(idcode,0); + + if (cpu == NULL) { + idcode = __raw_readl(S3C2412_GSTATUS1); + cpu = s3c_lookup_cpu(idcode,1); + } if (cpu == NULL) { printk(KERN_ERR "Unknown CPU type 0x%08lx\n", idcode);