Blame view
arch/arm/mach-s5pc100/common.c
5.22 KB
dd4153d9a ARM: 7247/1: S5PC... |
1 2 |
/* * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. |
19a2c0654 ARM: S5P: Moves i... |
3 4 |
* http://www.samsung.com * |
8acd1ade2 ARM: S5PC100: CPU... |
5 6 7 |
* Copyright 2009 Samsung Electronics Co. * Byungho Min <bhmin@samsung.com> * |
dd4153d9a ARM: 7247/1: S5PC... |
8 |
* Common Codes for S5PC100 |
8acd1ade2 ARM: S5PC100: CPU... |
9 10 11 12 |
* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. |
dd4153d9a ARM: 7247/1: S5PC... |
13 |
*/ |
8acd1ade2 ARM: S5PC100: CPU... |
14 15 16 17 18 19 20 21 22 |
#include <linux/kernel.h> #include <linux/types.h> #include <linux/interrupt.h> #include <linux/list.h> #include <linux/timer.h> #include <linux/init.h> #include <linux/clk.h> #include <linux/io.h> |
4a858cfc9 arm: convert sysd... |
23 |
#include <linux/device.h> |
8acd1ade2 ARM: S5PC100: CPU... |
24 25 |
#include <linux/serial_core.h> #include <linux/platform_device.h> |
4341f9b38 ARM: S5P: Bug fix... |
26 |
#include <linux/sched.h> |
8acd1ade2 ARM: S5PC100: CPU... |
27 |
|
dd4153d9a ARM: 7247/1: S5PC... |
28 29 |
#include <asm/irq.h> #include <asm/proc-fns.h> |
8acd1ade2 ARM: S5PC100: CPU... |
30 31 32 |
#include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/irq.h> |
8acd1ade2 ARM: S5PC100: CPU... |
33 |
#include <mach/map.h> |
dd4153d9a ARM: 7247/1: S5PC... |
34 |
#include <mach/hardware.h> |
acc84707d ARM: SAMSUNG: mov... |
35 |
#include <mach/regs-clock.h> |
8acd1ade2 ARM: S5PC100: CPU... |
36 37 38 39 |
#include <plat/cpu.h> #include <plat/devs.h> #include <plat/clock.h> |
acc84707d ARM: SAMSUNG: mov... |
40 |
#include <plat/sdhci.h> |
327b90305 ARM: S5PC100: Add... |
41 |
#include <plat/adc-core.h> |
dd4153d9a ARM: 7247/1: S5PC... |
42 |
#include <plat/ata-core.h> |
eb42b0441 s3c-fb: add devic... |
43 |
#include <plat/fb-core.h> |
dd4153d9a ARM: 7247/1: S5PC... |
44 45 46 |
#include <plat/iic-core.h> #include <plat/onenand-core.h> #include <plat/regs-serial.h> |
5497d2e1d ARM: 7251/1: rest... |
47 |
#include <plat/watchdog-reset.h> |
dd4153d9a ARM: 7247/1: S5PC... |
48 49 |
#include "common.h" |
999304be1 ARM: SAMSUNG: Add... |
50 |
|
dd4153d9a ARM: 7247/1: S5PC... |
51 52 53 54 55 56 57 58 59 60 61 62 63 |
static const char name_s5pc100[] = "S5PC100"; static struct cpu_table cpu_ids[] __initdata = { { .idcode = S5PC100_CPU_ID, .idmask = S5PC100_CPU_MASK, .map_io = s5pc100_map_io, .init_clocks = s5pc100_init_clocks, .init_uarts = s5pc100_init_uarts, .init = s5pc100_init, .name = name_s5pc100, }, }; |
8acd1ade2 ARM: S5PC100: CPU... |
64 65 66 67 |
/* Initial IO mappings */ static struct map_desc s5pc100_iodesc[] __initdata = { |
acc84707d ARM: SAMSUNG: mov... |
68 |
{ |
dd4153d9a ARM: 7247/1: S5PC... |
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
.virtual = (unsigned long)S5P_VA_CHIPID, .pfn = __phys_to_pfn(S5PC100_PA_CHIPID), .length = SZ_4K, .type = MT_DEVICE, }, { .virtual = (unsigned long)S3C_VA_SYS, .pfn = __phys_to_pfn(S5PC100_PA_SYSCON), .length = SZ_64K, .type = MT_DEVICE, }, { .virtual = (unsigned long)S3C_VA_TIMER, .pfn = __phys_to_pfn(S5PC100_PA_TIMER), .length = SZ_16K, .type = MT_DEVICE, }, { .virtual = (unsigned long)S3C_VA_WATCHDOG, .pfn = __phys_to_pfn(S5PC100_PA_WATCHDOG), .length = SZ_4K, .type = MT_DEVICE, }, { .virtual = (unsigned long)S5P_VA_SROMC, .pfn = __phys_to_pfn(S5PC100_PA_SROMC), .length = SZ_4K, .type = MT_DEVICE, }, { |
acc84707d ARM: SAMSUNG: mov... |
94 95 96 97 98 |
.virtual = (unsigned long)S5P_VA_SYSTIMER, .pfn = __phys_to_pfn(S5PC100_PA_SYSTIMER), .length = SZ_16K, .type = MT_DEVICE, }, { |
19a2c0654 ARM: S5P: Moves i... |
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
.virtual = (unsigned long)S5P_VA_GPIO, .pfn = __phys_to_pfn(S5PC100_PA_GPIO), .length = SZ_4K, .type = MT_DEVICE, }, { .virtual = (unsigned long)VA_VIC0, .pfn = __phys_to_pfn(S5PC100_PA_VIC0), .length = SZ_16K, .type = MT_DEVICE, }, { .virtual = (unsigned long)VA_VIC1, .pfn = __phys_to_pfn(S5PC100_PA_VIC1), .length = SZ_16K, .type = MT_DEVICE, }, { |
acc84707d ARM: SAMSUNG: mov... |
114 |
.virtual = (unsigned long)VA_VIC2, |
19a2c0654 ARM: S5P: Moves i... |
115 |
.pfn = __phys_to_pfn(S5PC100_PA_VIC2), |
acc84707d ARM: SAMSUNG: mov... |
116 117 118 |
.length = SZ_16K, .type = MT_DEVICE, }, { |
19a2c0654 ARM: S5P: Moves i... |
119 120 121 122 123 |
.virtual = (unsigned long)S3C_VA_UART, .pfn = __phys_to_pfn(S3C_PA_UART), .length = SZ_512K, .type = MT_DEVICE, }, { |
acc84707d ARM: SAMSUNG: mov... |
124 125 126 127 128 |
.virtual = (unsigned long)S5PC100_VA_OTHERS, .pfn = __phys_to_pfn(S5PC100_PA_OTHERS), .length = SZ_4K, .type = MT_DEVICE, } |
8acd1ade2 ARM: S5PC100: CPU... |
129 |
}; |
c3fcf5d1a ARM: S5PC1XX: add... |
130 131 |
static void s5pc100_idle(void) { |
acc84707d ARM: SAMSUNG: mov... |
132 133 |
if (!need_resched()) cpu_do_idle(); |
c3fcf5d1a ARM: S5PC1XX: add... |
134 |
|
acc84707d ARM: SAMSUNG: mov... |
135 |
local_irq_enable(); |
c3fcf5d1a ARM: S5PC1XX: add... |
136 |
} |
dd4153d9a ARM: 7247/1: S5PC... |
137 138 |
/* * s5pc100_map_io |
8acd1ade2 ARM: S5PC100: CPU... |
139 |
* |
dd4153d9a ARM: 7247/1: S5PC... |
140 141 |
* register the standard CPU IO areas */ |
8acd1ade2 ARM: S5PC100: CPU... |
142 |
|
dd4153d9a ARM: 7247/1: S5PC... |
143 |
void __init s5pc100_init_io(struct map_desc *mach_desc, int size) |
8acd1ade2 ARM: S5PC100: CPU... |
144 |
{ |
dd4153d9a ARM: 7247/1: S5PC... |
145 |
/* initialize the io descriptors we need for initialization */ |
8acd1ade2 ARM: S5PC100: CPU... |
146 |
iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc)); |
dd4153d9a ARM: 7247/1: S5PC... |
147 148 149 150 151 152 153 154 |
if (mach_desc) iotable_init(mach_desc, size); /* detect cpu id and rev. */ s5p_init_cpu(S5P_VA_CHIPID); s3c_init_cpu(samsung_cpu_id, cpu_ids, ARRAY_SIZE(cpu_ids)); } |
8acd1ade2 ARM: S5PC100: CPU... |
155 |
|
dd4153d9a ARM: 7247/1: S5PC... |
156 157 |
void __init s5pc100_map_io(void) { |
8acd1ade2 ARM: S5PC100: CPU... |
158 |
/* initialise device information early */ |
86cd4f5f8 ARM: S5PC1xx: add... |
159 160 161 |
s5pc100_default_sdhci0(); s5pc100_default_sdhci1(); s5pc100_default_sdhci2(); |
5eda288fa ARM: S5PC1xx: add... |
162 |
|
327b90305 ARM: S5PC100: Add... |
163 |
s3c_adc_setname("s3c64xx-adc"); |
5eda288fa ARM: S5PC1xx: add... |
164 165 166 |
/* the i2c devices are directly compatible with s3c2440 */ s3c_i2c0_setname("s3c2440-i2c"); s3c_i2c1_setname("s3c2440-i2c"); |
999304be1 ARM: SAMSUNG: Add... |
167 168 |
s3c_onenand_setname("s5pc100-onenand"); |
eb42b0441 s3c-fb: add devic... |
169 |
s3c_fb_setname("s5pc100-fb"); |
66194a74c ARM: S5PC100: Add... |
170 |
s3c_cfcon_setname("s5pc100-pata"); |
8acd1ade2 ARM: S5PC100: CPU... |
171 172 173 174 |
} void __init s5pc100_init_clocks(int xtal) { |
acc84707d ARM: SAMSUNG: mov... |
175 176 |
printk(KERN_DEBUG "%s: initializing clocks ", __func__); |
8acd1ade2 ARM: S5PC100: CPU... |
177 |
s3c24xx_register_baseclocks(xtal); |
acc84707d ARM: SAMSUNG: mov... |
178 |
s5p_register_clocks(xtal); |
8acd1ade2 ARM: S5PC100: CPU... |
179 180 181 182 183 184 |
s5pc100_register_clocks(); s5pc100_setup_clocks(); } void __init s5pc100_init_irq(void) { |
acc84707d ARM: SAMSUNG: mov... |
185 |
u32 vic[] = {~0, ~0, ~0}; |
8acd1ade2 ARM: S5PC100: CPU... |
186 187 |
/* VIC0, VIC1, and VIC2 are fully populated. */ |
acc84707d ARM: SAMSUNG: mov... |
188 |
s5p_init_irq(vic, ARRAY_SIZE(vic)); |
8acd1ade2 ARM: S5PC100: CPU... |
189 |
} |
4a858cfc9 arm: convert sysd... |
190 191 192 |
static struct bus_type s5pc100_subsys = { .name = "s5pc100-core", .dev_name = "s5pc100-core", |
8acd1ade2 ARM: S5PC100: CPU... |
193 |
}; |
4a858cfc9 arm: convert sysd... |
194 195 |
static struct device s5pc100_dev = { .bus = &s5pc100_subsys, |
8acd1ade2 ARM: S5PC100: CPU... |
196 197 198 199 |
}; static int __init s5pc100_core_init(void) { |
4a858cfc9 arm: convert sysd... |
200 |
return subsys_system_register(&s5pc100_subsys, NULL); |
8acd1ade2 ARM: S5PC100: CPU... |
201 |
} |
8acd1ade2 ARM: S5PC100: CPU... |
202 203 204 205 |
core_initcall(s5pc100_core_init); int __init s5pc100_init(void) { |
acc84707d ARM: SAMSUNG: mov... |
206 207 |
printk(KERN_INFO "S5PC100: Initializing architecture "); |
8acd1ade2 ARM: S5PC100: CPU... |
208 |
|
acc84707d ARM: SAMSUNG: mov... |
209 210 |
/* set idle function */ pm_idle = s5pc100_idle; |
c3fcf5d1a ARM: S5PC1XX: add... |
211 |
|
ea04018e6 arm: fix up some ... |
212 |
return device_register(&s5pc100_dev); |
8acd1ade2 ARM: S5PC100: CPU... |
213 |
} |
dd4153d9a ARM: 7247/1: S5PC... |
214 215 216 217 218 219 220 |
/* uart registration process */ void __init s5pc100_init_uarts(struct s3c2410_uartcfg *cfg, int no) { s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); } |
5497d2e1d ARM: 7251/1: rest... |
221 222 223 224 225 226 227 228 |
void s5pc100_restart(char mode, const char *cmd) { if (mode != 's') arch_wdt_reset(); soft_restart(0); } |