1 /* linux/arch/arm/plat-s5pc1xx/cpu.c
3 * Copyright 2009 Samsung Electronics Co.
4 * Byungho Min <bhmin@samsung.com>
8 * Based on plat-s3c64xx/cpu.c
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/init.h>
16 #include <linux/module.h>
17 #include <linux/interrupt.h>
18 #include <linux/ioport.h>
19 #include <linux/serial_core.h>
20 #include <linux/platform_device.h>
23 #include <mach/hardware.h>
26 #include <asm/mach/map.h>
28 #include <plat/regs-serial.h>
31 #include <plat/devs.h>
32 #include <plat/clock.h>
34 #include <plat/s5pc100.h>
36 /* table of supported CPUs */
38 static const char name_s5pc100
[] = "S5PC100";
40 static struct cpu_table cpu_ids
[] __initdata
= {
44 .map_io
= s5pc100_map_io
,
45 .init_clocks
= s5pc100_init_clocks
,
46 .init_uarts
= s5pc100_init_uarts
,
51 /* minimal IO mapping */
53 /* see notes on uart map in arch/arm/mach-s5pc100/include/mach/debug-macro.S */
54 #define UART_OFFS (S3C_PA_UART & 0xffff)
56 static struct map_desc s5pc1xx_iodesc
[] __initdata
= {
58 .virtual = (unsigned long)S5PC1XX_VA_CLK_OTHER
,
59 .pfn
= __phys_to_pfn(S5PC1XX_PA_CLK_OTHER
),
63 .virtual = (unsigned long)S5PC1XX_VA_GPIO
,
64 .pfn
= __phys_to_pfn(S5PC100_PA_GPIO
),
68 .virtual = (unsigned long)S5PC1XX_VA_CHIPID
,
69 .pfn
= __phys_to_pfn(S5PC1XX_PA_CHIPID
),
73 .virtual = (unsigned long)S5PC1XX_VA_CLK
,
74 .pfn
= __phys_to_pfn(S5PC1XX_PA_CLK
),
78 .virtual = (unsigned long)S5PC1XX_VA_PWR
,
79 .pfn
= __phys_to_pfn(S5PC1XX_PA_PWR
),
83 .virtual = (unsigned long)(S5PC1XX_VA_UART
),
84 .pfn
= __phys_to_pfn(S5PC1XX_PA_UART
),
88 .virtual = (unsigned long)S5PC1XX_VA_VIC(0),
89 .pfn
= __phys_to_pfn(S5PC1XX_PA_VIC(0)),
93 .virtual = (unsigned long)S5PC1XX_VA_VIC(1),
94 .pfn
= __phys_to_pfn(S5PC1XX_PA_VIC(1)),
98 .virtual = (unsigned long)S5PC1XX_VA_VIC(2),
99 .pfn
= __phys_to_pfn(S5PC1XX_PA_VIC(2)),
103 .virtual = (unsigned long)S5PC1XX_VA_TIMER
,
104 .pfn
= __phys_to_pfn(S5PC1XX_PA_TIMER
),
110 /* read cpu identification code */
112 void __init
s5pc1xx_init_io(struct map_desc
*mach_desc
, int size
)
114 unsigned long idcode
;
116 /* initialise the io descriptors we need for initialisation */
117 iotable_init(s5pc1xx_iodesc
, ARRAY_SIZE(s5pc1xx_iodesc
));
118 iotable_init(mach_desc
, size
);
120 idcode
= __raw_readl(S5PC1XX_VA_CHIPID
);
121 s3c_init_cpu(idcode
, cpu_ids
, ARRAY_SIZE(cpu_ids
));