blob: e69992488e2e23369e52c6634a35793a02b2a6c6 [file] [log] [blame]
Kukjin Kim209fecd2010-01-14 15:29:17 +09001/* 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>
Kukjin Kim5f7f6a42010-01-29 10:12:14 +090021#include <plat/s5p6442.h>
Kukjin Kim209fecd2010-01-14 15:29:17 +090022
23/* table of supported CPUs */
24
25static const char name_s5p6440[] = "S5P6440";
Kukjin Kim5f7f6a42010-01-29 10:12:14 +090026static const char name_s5p6442[] = "S5P6442";
Kukjin Kim209fecd2010-01-14 15:29:17 +090027
28static struct cpu_table cpu_ids[] __initdata = {
29 {
30 .idcode = 0x56440100,
31 .idmask = 0xffffff00,
32 .map_io = s5p6440_map_io,
33 .init_clocks = s5p6440_init_clocks,
34 .init_uarts = s5p6440_init_uarts,
35 .init = s5p6440_init,
36 .name = name_s5p6440,
Kukjin Kim5f7f6a42010-01-29 10:12:14 +090037 }, {
38 .idcode = 0x36442000,
39 .idmask = 0xffffff00,
40 .map_io = s5p6442_map_io,
41 .init_clocks = s5p6442_init_clocks,
42 .init_uarts = s5p6442_init_uarts,
43 .init = s5p6442_init,
44 .name = name_s5p6442,
Kukjin Kim209fecd2010-01-14 15:29:17 +090045 },
46};
47
48/* minimal IO mapping */
49
Kukjin Kim209fecd2010-01-14 15:29:17 +090050static struct map_desc s5p_iodesc[] __initdata = {
51 {
Kukjin Kim81317962010-01-27 16:57:07 +090052 .virtual = (unsigned long)S5P_VA_CHIPID,
53 .pfn = __phys_to_pfn(S5P_PA_CHIPID),
54 .length = SZ_4K,
55 .type = MT_DEVICE,
56 }, {
57 .virtual = (unsigned long)S3C_VA_SYS,
Kukjin Kim209fecd2010-01-14 15:29:17 +090058 .pfn = __phys_to_pfn(S5P_PA_SYSCON),
59 .length = SZ_64K,
60 .type = MT_DEVICE,
61 }, {
Kukjin Kim81317962010-01-27 16:57:07 +090062 .virtual = (unsigned long)S3C_VA_UART,
63 .pfn = __phys_to_pfn(S3C_PA_UART),
Kukjin Kim209fecd2010-01-14 15:29:17 +090064 .length = SZ_4K,
65 .type = MT_DEVICE,
66 }, {
Kukjin Kim81317962010-01-27 16:57:07 +090067 .virtual = (unsigned long)VA_VIC0,
Kukjin Kim209fecd2010-01-14 15:29:17 +090068 .pfn = __phys_to_pfn(S5P_PA_VIC0),
69 .length = SZ_16K,
70 .type = MT_DEVICE,
71 }, {
Kukjin Kim81317962010-01-27 16:57:07 +090072 .virtual = (unsigned long)VA_VIC1,
Kukjin Kim209fecd2010-01-14 15:29:17 +090073 .pfn = __phys_to_pfn(S5P_PA_VIC1),
74 .length = SZ_16K,
75 .type = MT_DEVICE,
76 }, {
Kukjin Kim81317962010-01-27 16:57:07 +090077 .virtual = (unsigned long)S3C_VA_TIMER,
Kukjin Kim209fecd2010-01-14 15:29:17 +090078 .pfn = __phys_to_pfn(S5P_PA_TIMER),
79 .length = SZ_16K,
80 .type = MT_DEVICE,
81 }, {
82 .virtual = (unsigned long)S5P_VA_GPIO,
83 .pfn = __phys_to_pfn(S5P_PA_GPIO),
84 .length = SZ_4K,
85 .type = MT_DEVICE,
86 },
87};
88
89/* read cpu identification code */
90
91void __init s5p_init_io(struct map_desc *mach_desc,
92 int size, void __iomem *cpuid_addr)
93{
94 unsigned long idcode;
95
96 /* initialize the io descriptors we need for initialization */
97 iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc));
98 if (mach_desc)
99 iotable_init(mach_desc, size);
100
101 idcode = __raw_readl(cpuid_addr);
102 s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids));
103}