1 /* linux/arch/arm/mach-s5pv310/cpu.c
3 * Copyright (c) 2010 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
11 #include <linux/sched.h>
12 #include <linux/sysdev.h>
14 #include <asm/mach/map.h>
15 #include <asm/mach/irq.h>
17 #include <asm/proc-fns.h>
20 #include <plat/clock.h>
21 #include <plat/s5pv310.h>
23 #include <mach/regs-irq.h>
25 void __iomem *gic_cpu_base_addr;
27 extern int combiner_init(unsigned int combiner_nr, void __iomem *base,
28 unsigned int irq_start);
29 extern void combiner_cascade_irq(unsigned int combiner_nr, unsigned int irq);
31 /* Initial IO mappings */
32 static struct map_desc s5pv310_iodesc[] __initdata = {
34 .virtual = (unsigned long)S5P_VA_COREPERI_BASE,
35 .pfn = __phys_to_pfn(S5PV310_PA_COREPERI),
39 .virtual = (unsigned long)S5P_VA_COMBINER_BASE,
40 .pfn = __phys_to_pfn(S5PV310_PA_COMBINER),
44 .virtual = (unsigned long)S5P_VA_L2CC,
45 .pfn = __phys_to_pfn(S5PV310_PA_L2CC),
49 .virtual = (unsigned long)S5P_VA_CMU,
50 .pfn = __phys_to_pfn(S5PV310_PA_CMU),
56 static void s5pv310_idle(void)
66 * register the standard cpu IO areas
68 void __init s5pv310_map_io(void)
70 iotable_init(s5pv310_iodesc, ARRAY_SIZE(s5pv310_iodesc));
73 void __init s5pv310_init_clocks(int xtal)
75 printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
77 s3c24xx_register_baseclocks(xtal);
78 s5p_register_clocks(xtal);
79 s5pv310_register_clocks();
80 s5pv310_setup_clocks();
83 void __init s5pv310_init_irq(void)
87 gic_cpu_base_addr = S5P_VA_GIC_CPU;
88 gic_dist_init(0, S5P_VA_GIC_DIST, IRQ_LOCALTIMER);
89 gic_cpu_init(0, S5P_VA_GIC_CPU);
91 for (irq = 0; irq < MAX_COMBINER_NR; irq++) {
92 combiner_init(irq, (void __iomem *)S5P_VA_COMBINER(irq),
93 COMBINER_IRQ(irq, 0));
94 combiner_cascade_irq(irq, IRQ_SPI(irq));
97 /* The parameters of s5p_init_irq() are for VIC init.
98 * Theses parameters should be NULL and 0 because S5PV310
99 * uses GIC instead of VIC.
101 s5p_init_irq(NULL, 0);
104 struct sysdev_class s5pv310_sysclass = {
105 .name = "s5pv310-core",
108 static struct sys_device s5pv310_sysdev = {
109 .cls = &s5pv310_sysclass,
112 static int __init s5pv310_core_init(void)
114 return sysdev_class_register(&s5pv310_sysclass);
117 core_initcall(s5pv310_core_init);
119 int __init s5pv310_init(void)
121 printk(KERN_INFO "S5PV310: Initializing architecture\n");
123 /* set idle function */
124 pm_idle = s5pv310_idle;
126 return sysdev_register(&s5pv310_sysdev);