1 /* linux/arch/arm/plat-s5p/cpu.c
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
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.
13 #include <linux/init.h>
14 #include <linux/module.h>
16 #include <asm/mach/arch.h>
17 #include <asm/mach/map.h>
18 #include <mach/regs-clock.h>
20 #include <plat/s5p6440.h>
21 #include <plat/s5p6442.h>
22 #include <plat/s5pc100.h>
23 #include <plat/s5pv210.h>
24 #include <plat/s5pv310.h>
26 /* table of supported CPUs */
28 static const char name_s5p6440[] = "S5P6440";
29 static const char name_s5p6442[] = "S5P6442";
30 static const char name_s5pc100[] = "S5PC100";
31 static const char name_s5pv210[] = "S5PV210/S5PC110";
32 static const char name_s5pv310[] = "S5PV310";
34 static struct cpu_table cpu_ids[] __initdata = {
38 .map_io = s5p6440_map_io,
39 .init_clocks = s5p6440_init_clocks,
40 .init_uarts = s5p6440_init_uarts,
46 .map_io = s5p6442_map_io,
47 .init_clocks = s5p6442_init_clocks,
48 .init_uarts = s5p6442_init_uarts,
54 .map_io = s5pc100_map_io,
55 .init_clocks = s5pc100_init_clocks,
56 .init_uarts = s5pc100_init_uarts,
62 .map_io = s5pv210_map_io,
63 .init_clocks = s5pv210_init_clocks,
64 .init_uarts = s5pv210_init_uarts,
70 .map_io = s5pv310_map_io,
71 .init_clocks = s5pv310_init_clocks,
72 .init_uarts = s5pv310_init_uarts,
78 /* minimal IO mapping */
80 static struct map_desc s5p_iodesc[] __initdata = {
82 .virtual = (unsigned long)S5P_VA_CHIPID,
83 .pfn = __phys_to_pfn(S5P_PA_CHIPID),
87 .virtual = (unsigned long)S3C_VA_SYS,
88 .pfn = __phys_to_pfn(S5P_PA_SYSCON),
92 .virtual = (unsigned long)S3C_VA_UART,
93 .pfn = __phys_to_pfn(S3C_PA_UART),
98 .virtual = (unsigned long)VA_VIC0,
99 .pfn = __phys_to_pfn(S5P_PA_VIC0),
103 .virtual = (unsigned long)VA_VIC1,
104 .pfn = __phys_to_pfn(S5P_PA_VIC1),
109 .virtual = (unsigned long)S3C_VA_TIMER,
110 .pfn = __phys_to_pfn(S5P_PA_TIMER),
114 .virtual = (unsigned long)S5P_VA_GPIO,
115 .pfn = __phys_to_pfn(S5P_PA_GPIO),
119 .virtual = (unsigned long)S3C_VA_WATCHDOG,
120 .pfn = __phys_to_pfn(S3C_PA_WDT),
126 /* read cpu identification code */
128 void __init s5p_init_io(struct map_desc *mach_desc,
129 int size, void __iomem *cpuid_addr)
131 unsigned long idcode;
133 /* initialize the io descriptors we need for initialization */
134 iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
136 iotable_init(mach_desc, size);
138 idcode = __raw_readl(cpuid_addr);
139 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));