blob: cb37ffee05b27b51fdb39755da984d6b36185b65 [file] [log] [blame]
Byungho Min8acd1ad2009-06-23 21:40:15 +09001/* linux/arch/arm/mach-s5pc100/cpu.c
2 *
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
5 *
6 * Based on mach-s3c6410/cpu.c
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/kernel.h>
14#include <linux/types.h>
15#include <linux/interrupt.h>
16#include <linux/list.h>
17#include <linux/timer.h>
18#include <linux/init.h>
19#include <linux/clk.h>
20#include <linux/io.h>
21#include <linux/sysdev.h>
22#include <linux/serial_core.h>
23#include <linux/platform_device.h>
24
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +010025#include <asm/proc-fns.h>
26
Byungho Min8acd1ad2009-06-23 21:40:15 +090027#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <asm/mach/irq.h>
30
31#include <mach/hardware.h>
32#include <mach/map.h>
33#include <asm/irq.h>
34
35#include <plat/cpu-freq.h>
36#include <plat/regs-serial.h>
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +010037#include <plat/regs-power.h>
Byungho Min8acd1ad2009-06-23 21:40:15 +090038
39#include <plat/cpu.h>
40#include <plat/devs.h>
41#include <plat/clock.h>
42#include <plat/sdhci.h>
43#include <plat/iic-core.h>
Marek Szyprowski999304b2010-05-20 08:59:05 +020044#include <plat/onenand-core.h>
45
Byungho Min8acd1ad2009-06-23 21:40:15 +090046#include <plat/s5pc100.h>
47
48/* Initial IO mappings */
49
50static struct map_desc s5pc100_iodesc[] __initdata = {
51};
52
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +010053static void s5pc100_idle(void)
54{
55 unsigned long tmp;
56
57 tmp = __raw_readl(S5PC100_PWR_CFG);
58 tmp &= ~S5PC100_PWRCFG_CFG_DEEP_IDLE;
59 tmp &= ~S5PC100_PWRCFG_CFG_WFI_MASK;
60 tmp |= S5PC100_PWRCFG_CFG_WFI_DEEP_IDLE;
61 __raw_writel(tmp, S5PC100_PWR_CFG);
62
63 tmp = __raw_readl(S5PC100_OTHERS);
64 tmp |= S5PC100_PMU_INT_DISABLE;
65 __raw_writel(tmp, S5PC100_OTHERS);
66
67 cpu_do_idle();
68}
69
Byungho Min8acd1ad2009-06-23 21:40:15 +090070/* s5pc100_map_io
71 *
72 * register the standard cpu IO areas
73*/
74
75void __init s5pc100_map_io(void)
76{
77 iotable_init(s5pc100_iodesc, ARRAY_SIZE(s5pc100_iodesc));
78
79 /* initialise device information early */
Kyungmin Park86cd4f52009-11-17 08:41:23 +010080 s5pc100_default_sdhci0();
81 s5pc100_default_sdhci1();
82 s5pc100_default_sdhci2();
Kyungmin Park5eda2882009-11-17 08:41:21 +010083
84 /* the i2c devices are directly compatible with s3c2440 */
85 s3c_i2c0_setname("s3c2440-i2c");
86 s3c_i2c1_setname("s3c2440-i2c");
Marek Szyprowski999304b2010-05-20 08:59:05 +020087
88 s3c_onenand_setname("s5pc100-onenand");
Byungho Min8acd1ad2009-06-23 21:40:15 +090089}
90
91void __init s5pc100_init_clocks(int xtal)
92{
93 printk(KERN_DEBUG "%s: initialising clocks\n", __func__);
94 s3c24xx_register_baseclocks(xtal);
95 s5pc1xx_register_clocks();
96 s5pc100_register_clocks();
97 s5pc100_setup_clocks();
98}
99
100void __init s5pc100_init_irq(void)
101{
102 u32 vic_valid[] = {~0, ~0, ~0};
103
104 /* VIC0, VIC1, and VIC2 are fully populated. */
105 s5pc1xx_init_irq(vic_valid, ARRAY_SIZE(vic_valid));
106}
107
108struct sysdev_class s5pc100_sysclass = {
109 .name = "s5pc100-core",
110};
111
112static struct sys_device s5pc100_sysdev = {
113 .cls = &s5pc100_sysclass,
114};
115
116static int __init s5pc100_core_init(void)
117{
118 return sysdev_class_register(&s5pc100_sysclass);
119}
120
121core_initcall(s5pc100_core_init);
122
123int __init s5pc100_init(void)
124{
125 printk(KERN_DEBUG "S5PC100: Initialising architecture\n");
126
Kyungmin Parkc3fcf5d2009-11-17 08:41:17 +0100127 s5pc1xx_idle = s5pc100_idle;
128
Byungho Min8acd1ad2009-06-23 21:40:15 +0900129 return sysdev_register(&s5pc100_sysdev);
130}