• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/arch/arm/mach-s5p6440/
1/* linux/arch/arm/mach-s5p6440/cpu.c
2 *
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 *		http://www.samsung.com/
5 *
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.
9*/
10
11#include <linux/kernel.h>
12#include <linux/types.h>
13#include <linux/interrupt.h>
14#include <linux/list.h>
15#include <linux/timer.h>
16#include <linux/init.h>
17#include <linux/clk.h>
18#include <linux/io.h>
19#include <linux/sysdev.h>
20#include <linux/serial_core.h>
21#include <linux/platform_device.h>
22#include <linux/sched.h>
23
24#include <asm/mach/arch.h>
25#include <asm/mach/map.h>
26#include <asm/mach/irq.h>
27
28#include <asm/proc-fns.h>
29
30#include <mach/hardware.h>
31#include <mach/map.h>
32#include <asm/irq.h>
33
34#include <plat/regs-serial.h>
35#include <mach/regs-clock.h>
36
37#include <plat/cpu.h>
38#include <plat/devs.h>
39#include <plat/clock.h>
40#include <plat/s5p6440.h>
41#include <plat/adc-core.h>
42
43static void s5p6440_idle(void)
44{
45	unsigned long val;
46
47	if (!need_resched()) {
48		val = __raw_readl(S5P_PWR_CFG);
49		val &= ~(0x3<<5);
50		val |= (0x1<<5);
51		__raw_writel(val, S5P_PWR_CFG);
52
53		cpu_do_idle();
54	}
55	local_irq_enable();
56}
57
58/* s5p6440_map_io
59 *
60 * register the standard cpu IO areas
61*/
62
63void __init s5p6440_map_io(void)
64{
65	/* initialize any device information early */
66	s3c_adc_setname("s3c64xx-adc");
67}
68
69void __init s5p6440_init_clocks(int xtal)
70{
71	printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
72
73	s3c24xx_register_baseclocks(xtal);
74	s5p_register_clocks(xtal);
75	s5p6440_register_clocks();
76	s5p6440_setup_clocks();
77}
78
79void __init s5p6440_init_irq(void)
80{
81	/* S5P6440 supports only 2 VIC */
82	u32 vic[2];
83
84	/*
85	 * VIC0 is missing IRQ_VIC0[3, 4, 8, 10, (12-22)]
86	 * VIC1 is missing IRQ VIC1[1, 3, 4, 10, 11, 12, 14, 15, 22]
87	 */
88	vic[0] = 0xff800ae7;
89	vic[1] = 0xffbf23e5;
90
91	s5p_init_irq(vic, ARRAY_SIZE(vic));
92}
93
94struct sysdev_class s5p6440_sysclass = {
95	.name	= "s5p6440-core",
96};
97
98static struct sys_device s5p6440_sysdev = {
99	.cls	= &s5p6440_sysclass,
100};
101
102static int __init s5p6440_core_init(void)
103{
104	return sysdev_class_register(&s5p6440_sysclass);
105}
106
107core_initcall(s5p6440_core_init);
108
109int __init s5p6440_init(void)
110{
111	printk(KERN_INFO "S5P6440: Initializing architecture\n");
112
113	/* set idle function */
114	pm_idle = s5p6440_idle;
115
116	return sysdev_register(&s5p6440_sysdev);
117}
118