ARM: SAMSUNG: move S5PC100 support from plat-s5pc1xx to plat-s5p framework
[linux-2.6-block.git] / arch / arm / plat-s5p / cpu.c
CommitLineData
209fecd1
KK
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>
5f7f6a4a 21#include <plat/s5p6442.h>
acc84707 22#include <plat/s5pc100.h>
939d28aa 23#include <plat/s5pv210.h>
209fecd1
KK
24
25/* table of supported CPUs */
26
27static const char name_s5p6440[] = "S5P6440";
5f7f6a4a 28static const char name_s5p6442[] = "S5P6442";
acc84707 29static const char name_s5pc100[] = "S5PC100";
939d28aa 30static const char name_s5pv210[] = "S5PV210/S5PC110";
209fecd1
KK
31
32static struct cpu_table cpu_ids[] __initdata = {
33 {
34 .idcode = 0x56440100,
35 .idmask = 0xffffff00,
36 .map_io = s5p6440_map_io,
37 .init_clocks = s5p6440_init_clocks,
38 .init_uarts = s5p6440_init_uarts,
39 .init = s5p6440_init,
40 .name = name_s5p6440,
5f7f6a4a
KK
41 }, {
42 .idcode = 0x36442000,
43 .idmask = 0xffffff00,
44 .map_io = s5p6442_map_io,
45 .init_clocks = s5p6442_init_clocks,
46 .init_uarts = s5p6442_init_uarts,
47 .init = s5p6442_init,
48 .name = name_s5p6442,
acc84707
MS
49 }, {
50 .idcode = 0x43100000,
51 .idmask = 0xfffff000,
52 .map_io = s5pc100_map_io,
53 .init_clocks = s5pc100_init_clocks,
54 .init_uarts = s5pc100_init_uarts,
55 .init = s5pc100_init,
56 .name = name_s5pc100,
939d28aa
KK
57 }, {
58 .idcode = 0x43110000,
59 .idmask = 0xfffff000,
60 .map_io = s5pv210_map_io,
61 .init_clocks = s5pv210_init_clocks,
62 .init_uarts = s5pv210_init_uarts,
63 .init = s5pv210_init,
64 .name = name_s5pv210,
209fecd1
KK
65 },
66};
67
68/* minimal IO mapping */
69
209fecd1
KK
70static struct map_desc s5p_iodesc[] __initdata = {
71 {
81317960
KK
72 .virtual = (unsigned long)S5P_VA_CHIPID,
73 .pfn = __phys_to_pfn(S5P_PA_CHIPID),
74 .length = SZ_4K,
75 .type = MT_DEVICE,
76 }, {
77 .virtual = (unsigned long)S3C_VA_SYS,
209fecd1
KK
78 .pfn = __phys_to_pfn(S5P_PA_SYSCON),
79 .length = SZ_64K,
80 .type = MT_DEVICE,
81 }, {
81317960
KK
82 .virtual = (unsigned long)S3C_VA_UART,
83 .pfn = __phys_to_pfn(S3C_PA_UART),
209fecd1
KK
84 .length = SZ_4K,
85 .type = MT_DEVICE,
86 }, {
81317960 87 .virtual = (unsigned long)VA_VIC0,
209fecd1
KK
88 .pfn = __phys_to_pfn(S5P_PA_VIC0),
89 .length = SZ_16K,
90 .type = MT_DEVICE,
91 }, {
81317960 92 .virtual = (unsigned long)VA_VIC1,
209fecd1
KK
93 .pfn = __phys_to_pfn(S5P_PA_VIC1),
94 .length = SZ_16K,
95 .type = MT_DEVICE,
96 }, {
81317960 97 .virtual = (unsigned long)S3C_VA_TIMER,
209fecd1
KK
98 .pfn = __phys_to_pfn(S5P_PA_TIMER),
99 .length = SZ_16K,
100 .type = MT_DEVICE,
101 }, {
102 .virtual = (unsigned long)S5P_VA_GPIO,
103 .pfn = __phys_to_pfn(S5P_PA_GPIO),
104 .length = SZ_4K,
105 .type = MT_DEVICE,
106 },
107};
108
109/* read cpu identification code */
110
111void __init s5p_init_io(struct map_desc *mach_desc,
112 int size, void __iomem *cpuid_addr)
113{
114 unsigned long idcode;
115
116 /* initialize the io descriptors we need for initialization */
117 iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
118 if (mach_desc)
119 iotable_init(mach_desc, size);
120
121 idcode = __raw_readl(cpuid_addr);
122 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
123}