Merge branch 'x86-trampoline-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / arch / arm / plat-s5p / cpu.c
1 /* linux/arch/arm/plat-s5p/cpu.c
2  *
3  * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4  *              http://www.samsung.com/
5  *
6  * S5P CPU Support
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11 */
12
13 #include <linux/init.h>
14 #include <linux/module.h>
15 #include <mach/map.h>
16 #include <asm/mach/arch.h>
17 #include <asm/mach/map.h>
18 #include <mach/regs-clock.h>
19 #include <plat/cpu.h>
20 #include <plat/s5p6440.h>
21 #include <plat/s5p6442.h>
22 #include <plat/s5p6450.h>
23 #include <plat/s5pc100.h>
24 #include <plat/s5pv210.h>
25 #include <plat/s5pv310.h>
26
27 /* table of supported CPUs */
28
29 static const char name_s5p6440[] = "S5P6440";
30 static const char name_s5p6442[] = "S5P6442";
31 static const char name_s5p6450[] = "S5P6450";
32 static const char name_s5pc100[] = "S5PC100";
33 static const char name_s5pv210[] = "S5PV210/S5PC110";
34 static const char name_s5pv310[] = "S5PV310";
35
36 static struct cpu_table cpu_ids[] __initdata = {
37         {
38                 .idcode         = 0x56440100,
39                 .idmask         = 0xffffff00,
40                 .map_io         = s5p6440_map_io,
41                 .init_clocks    = s5p6440_init_clocks,
42                 .init_uarts     = s5p6440_init_uarts,
43                 .init           = s5p64x0_init,
44                 .name           = name_s5p6440,
45         }, {
46                 .idcode         = 0x36442000,
47                 .idmask         = 0xffffff00,
48                 .map_io         = s5p6442_map_io,
49                 .init_clocks    = s5p6442_init_clocks,
50                 .init_uarts     = s5p6442_init_uarts,
51                 .init           = s5p6442_init,
52                 .name           = name_s5p6442,
53         }, {
54                 .idcode         = 0x36450000,
55                 .idmask         = 0xffffff00,
56                 .map_io         = s5p6450_map_io,
57                 .init_clocks    = s5p6450_init_clocks,
58                 .init_uarts     = s5p6450_init_uarts,
59                 .init           = s5p64x0_init,
60                 .name           = name_s5p6450,
61         }, {
62                 .idcode         = 0x43100000,
63                 .idmask         = 0xfffff000,
64                 .map_io         = s5pc100_map_io,
65                 .init_clocks    = s5pc100_init_clocks,
66                 .init_uarts     = s5pc100_init_uarts,
67                 .init           = s5pc100_init,
68                 .name           = name_s5pc100,
69         }, {
70                 .idcode         = 0x43110000,
71                 .idmask         = 0xfffff000,
72                 .map_io         = s5pv210_map_io,
73                 .init_clocks    = s5pv210_init_clocks,
74                 .init_uarts     = s5pv210_init_uarts,
75                 .init           = s5pv210_init,
76                 .name           = name_s5pv210,
77         }, {
78                 .idcode         = 0x43200000,
79                 .idmask         = 0xfffff000,
80                 .map_io         = s5pv310_map_io,
81                 .init_clocks    = s5pv310_init_clocks,
82                 .init_uarts     = s5pv310_init_uarts,
83                 .init           = s5pv310_init,
84                 .name           = name_s5pv310,
85         },
86 };
87
88 /* minimal IO mapping */
89
90 static struct map_desc s5p_iodesc[] __initdata = {
91         {
92                 .virtual        = (unsigned long)S5P_VA_CHIPID,
93                 .pfn            = __phys_to_pfn(S5P_PA_CHIPID),
94                 .length         = SZ_4K,
95                 .type           = MT_DEVICE,
96         }, {
97                 .virtual        = (unsigned long)S3C_VA_SYS,
98                 .pfn            = __phys_to_pfn(S5P_PA_SYSCON),
99                 .length         = SZ_64K,
100                 .type           = MT_DEVICE,
101         }, {
102                 .virtual        = (unsigned long)S3C_VA_TIMER,
103                 .pfn            = __phys_to_pfn(S5P_PA_TIMER),
104                 .length         = SZ_16K,
105                 .type           = MT_DEVICE,
106         }, {
107                 .virtual        = (unsigned long)S3C_VA_WATCHDOG,
108                 .pfn            = __phys_to_pfn(S3C_PA_WDT),
109                 .length         = SZ_4K,
110                 .type           = MT_DEVICE,
111         },
112 };
113
114 /* read cpu identification code */
115
116 void __init s5p_init_io(struct map_desc *mach_desc,
117                         int size, void __iomem *cpuid_addr)
118 {
119         unsigned long idcode;
120
121         /* initialize the io descriptors we need for initialization */
122         iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
123         if (mach_desc)
124                 iotable_init(mach_desc, size);
125
126         idcode = __raw_readl(cpuid_addr);
127         s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
128 }