diff options
author | Kukjin Kim <kgene.kim@samsung.com> | 2010-01-14 01:29:17 -0500 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-01-15 05:16:08 -0500 |
commit | 209fecd1b8e65b8046efbbc8314d449e53c4c6b6 (patch) | |
tree | 5b8cc8ea137431224c22fc5cfd6dbb21dd652ed6 | |
parent | be97162d47b2e067f9d21097650f2f0405dacc9f (diff) |
ARM: S5P6440: Add new CPU initialization support
This patch adds Samsung's S5P6440 CPU support.
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r-- | arch/arm/mach-s5p6440/cpu.c | 114 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/debug-macro.S | 37 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/entry-macro.S | 16 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/gpio-core.h | 19 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/gpio.h | 80 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/hardware.h | 18 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/map.h | 94 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/memory.h | 19 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/system.h | 26 | ||||
-rw-r--r-- | arch/arm/mach-s5p6440/include/mach/uncompress.h | 24 | ||||
-rw-r--r-- | arch/arm/plat-s3c/include/plat/cpu.h | 3 | ||||
-rw-r--r-- | arch/arm/plat-s5p/cpu.c | 90 | ||||
-rw-r--r-- | arch/arm/plat-s5p/include/plat/s5p6440.h | 37 | ||||
-rw-r--r-- | arch/arm/plat-s5p/s5p6440-init.c | 50 | ||||
-rw-r--r-- | arch/arm/plat-s5p/setup-i2c0.c | 25 |
15 files changed, 652 insertions, 0 deletions
diff --git a/arch/arm/mach-s5p6440/cpu.c b/arch/arm/mach-s5p6440/cpu.c new file mode 100644 index 000000000000..1794131aeacb --- /dev/null +++ b/arch/arm/mach-s5p6440/cpu.c | |||
@@ -0,0 +1,114 @@ | |||
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 | |||
23 | #include <asm/mach/arch.h> | ||
24 | #include <asm/mach/map.h> | ||
25 | #include <asm/mach/irq.h> | ||
26 | |||
27 | #include <asm/proc-fns.h> | ||
28 | |||
29 | #include <mach/hardware.h> | ||
30 | #include <mach/map.h> | ||
31 | #include <asm/irq.h> | ||
32 | |||
33 | #include <plat/regs-serial.h> | ||
34 | #include <mach/regs-clock.h> | ||
35 | |||
36 | #include <plat/cpu.h> | ||
37 | #include <plat/devs.h> | ||
38 | #include <plat/clock.h> | ||
39 | #include <plat/s5p6440.h> | ||
40 | |||
41 | static void s5p6440_idle(void) | ||
42 | { | ||
43 | unsigned long val; | ||
44 | |||
45 | if (!need_resched()) { | ||
46 | val = __raw_readl(S5P_PWR_CFG); | ||
47 | val &= ~(0x3<<5); | ||
48 | val |= (0x1<<5); | ||
49 | __raw_writel(val, S5P_PWR_CFG); | ||
50 | |||
51 | cpu_do_idle(); | ||
52 | } | ||
53 | local_irq_enable(); | ||
54 | } | ||
55 | |||
56 | /* s5p6440_map_io | ||
57 | * | ||
58 | * register the standard cpu IO areas | ||
59 | */ | ||
60 | |||
61 | void __init s5p6440_map_io(void) | ||
62 | { | ||
63 | /* initialize any device information early */ | ||
64 | } | ||
65 | |||
66 | void __init s5p6440_init_clocks(int xtal) | ||
67 | { | ||
68 | printk(KERN_DEBUG "%s: initializing clocks\n", __func__); | ||
69 | |||
70 | s3c24xx_register_baseclocks(xtal); | ||
71 | s5p_register_clocks(xtal); | ||
72 | s5p6440_register_clocks(); | ||
73 | s5p6440_setup_clocks(); | ||
74 | } | ||
75 | |||
76 | void __init s5p6440_init_irq(void) | ||
77 | { | ||
78 | /* S5P6440 supports only 2 VIC */ | ||
79 | u32 vic[2]; | ||
80 | |||
81 | /* | ||
82 | * VIC0 is missing IRQ_VIC0[3, 4, 8, 10, (12-22)] | ||
83 | * VIC1 is missing IRQ VIC1[1, 3, 4, 10, 11, 12, 14, 15, 22] | ||
84 | */ | ||
85 | vic[0] = 0xff800ae7; | ||
86 | vic[1] = 0xffbf23e5; | ||
87 | |||
88 | s5p_init_irq(vic, ARRAY_SIZE(vic)); | ||
89 | } | ||
90 | |||
91 | static struct sysdev_class s5p6440_sysclass = { | ||
92 | .name = "s5p6440-core", | ||
93 | }; | ||
94 | |||
95 | static struct sys_device s5p6440_sysdev = { | ||
96 | .cls = &s5p6440_sysclass, | ||
97 | }; | ||
98 | |||
99 | static int __init s5p6440_core_init(void) | ||
100 | { | ||
101 | return sysdev_class_register(&s5p6440_sysclass); | ||
102 | } | ||
103 | |||
104 | core_initcall(s5p6440_core_init); | ||
105 | |||
106 | int __init s5p6440_init(void) | ||
107 | { | ||
108 | printk(KERN_INFO "S5P6440: Initializing architecture\n"); | ||
109 | |||
110 | /* set idle function */ | ||
111 | pm_idle = s5p6440_idle; | ||
112 | |||
113 | return sysdev_register(&s5p6440_sysdev); | ||
114 | } | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/debug-macro.S b/arch/arm/mach-s5p6440/include/mach/debug-macro.S new file mode 100644 index 000000000000..f3a5d1635be5 --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/debug-macro.S | |||
@@ -0,0 +1,37 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/debug-macro.S | ||
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 | /* pull in the relevant register and map files. */ | ||
12 | |||
13 | #include <mach/map.h> | ||
14 | #include <plat/regs-serial.h> | ||
15 | |||
16 | /* note, for the boot process to work we have to keep the UART | ||
17 | * virtual address aligned to an 1MiB boundary for the L1 | ||
18 | * mapping the head code makes. We keep the UART virtual address | ||
19 | * aligned and add in the offset when we load the value here. | ||
20 | */ | ||
21 | |||
22 | .macro addruart, rx | ||
23 | mrc p15, 0, \rx, c1, c0 | ||
24 | tst \rx, #1 | ||
25 | ldreq \rx, = S5P_PA_UART | ||
26 | ldrne \rx, = (S5P_VA_UART + S5P_PA_UART & 0xfffff) | ||
27 | #if CONFIG_DEBUG_S3C_UART != 0 | ||
28 | add \rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART) | ||
29 | #endif | ||
30 | .endm | ||
31 | |||
32 | /* include the reset of the code which will do the work, we're only | ||
33 | * compiling for a single cpu processor type so the default of s3c2440 | ||
34 | * will be fine with us. | ||
35 | */ | ||
36 | |||
37 | #include <plat/debug-macro.S> | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/entry-macro.S b/arch/arm/mach-s5p6440/include/mach/entry-macro.S new file mode 100644 index 000000000000..e65f1b967262 --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/entry-macro.S | |||
@@ -0,0 +1,16 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/entry-macro.S | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * Low-level IRQ helper macros for the Samsung S5P6440 | ||
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 <mach/map.h> | ||
14 | #include <plat/irqs.h> | ||
15 | |||
16 | #include <asm/entry-macro-vic2.S> | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/gpio-core.h b/arch/arm/mach-s5p6440/include/mach/gpio-core.h new file mode 100644 index 000000000000..ff7fb3094188 --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/gpio-core.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/gpio-core.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5P6440 - GPIO core support | ||
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 | #ifndef __ASM_ARCH_GPIO_CORE_H | ||
14 | #define __ASM_ARCH_GPIO_CORE_H __FILE__ | ||
15 | |||
16 | /* currently we just include the platform support */ | ||
17 | #include <plat/gpio-core.h> | ||
18 | |||
19 | #endif /* __ASM_ARCH_GPIO_CORE_H */ | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/gpio.h b/arch/arm/mach-s5p6440/include/mach/gpio.h new file mode 100644 index 000000000000..21783834f2a2 --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/gpio.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/gpio.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5P6440 - GPIO lib support | ||
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 | #ifndef __ASM_ARCH_GPIO_H | ||
14 | #define __ASM_ARCH_GPIO_H __FILE__ | ||
15 | |||
16 | #define gpio_get_value __gpio_get_value | ||
17 | #define gpio_set_value __gpio_set_value | ||
18 | #define gpio_cansleep __gpio_cansleep | ||
19 | #define gpio_to_irq __gpio_to_irq | ||
20 | |||
21 | /* GPIO bank sizes */ | ||
22 | #define S5P6440_GPIO_A_NR (6) | ||
23 | #define S5P6440_GPIO_B_NR (7) | ||
24 | #define S5P6440_GPIO_C_NR (8) | ||
25 | #define S5P6440_GPIO_F_NR (2) | ||
26 | #define S5P6440_GPIO_G_NR (7) | ||
27 | #define S5P6440_GPIO_H_NR (10) | ||
28 | #define S5P6440_GPIO_I_NR (16) | ||
29 | #define S5P6440_GPIO_J_NR (12) | ||
30 | #define S5P6440_GPIO_N_NR (16) | ||
31 | #define S5P6440_GPIO_P_NR (8) | ||
32 | #define S5P6440_GPIO_R_NR (15) | ||
33 | |||
34 | /* GPIO bank numbers */ | ||
35 | |||
36 | /* CONFIG_S3C_GPIO_SPACE allows the user to select extra | ||
37 | * space for debugging purposes so that any accidental | ||
38 | * change from one gpio bank to another can be caught. | ||
39 | */ | ||
40 | #define S5P6440_GPIO_NEXT(__gpio) \ | ||
41 | ((__gpio##_START) + (__gpio##_NR) + CONFIG_S3C_GPIO_SPACE + 1) | ||
42 | |||
43 | enum s5p_gpio_number { | ||
44 | S5P6440_GPIO_A_START = 0, | ||
45 | S5P6440_GPIO_B_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_A), | ||
46 | S5P6440_GPIO_C_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_B), | ||
47 | S5P6440_GPIO_F_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_C), | ||
48 | S5P6440_GPIO_G_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_F), | ||
49 | S5P6440_GPIO_H_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_G), | ||
50 | S5P6440_GPIO_I_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_H), | ||
51 | S5P6440_GPIO_J_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_I), | ||
52 | S5P6440_GPIO_N_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_J), | ||
53 | S5P6440_GPIO_P_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_N), | ||
54 | S5P6440_GPIO_R_START = S5P6440_GPIO_NEXT(S5P6440_GPIO_P), | ||
55 | }; | ||
56 | |||
57 | /* S5P6440 GPIO number definitions. */ | ||
58 | #define S5P6440_GPA(_nr) (S5P6440_GPIO_A_START + (_nr)) | ||
59 | #define S5P6440_GPB(_nr) (S5P6440_GPIO_B_START + (_nr)) | ||
60 | #define S5P6440_GPC(_nr) (S5P6440_GPIO_C_START + (_nr)) | ||
61 | #define S5P6440_GPF(_nr) (S5P6440_GPIO_F_START + (_nr)) | ||
62 | #define S5P6440_GPG(_nr) (S5P6440_GPIO_G_START + (_nr)) | ||
63 | #define S5P6440_GPH(_nr) (S5P6440_GPIO_H_START + (_nr)) | ||
64 | #define S5P6440_GPI(_nr) (S5P6440_GPIO_I_START + (_nr)) | ||
65 | #define S5P6440_GPJ(_nr) (S5P6440_GPIO_J_START + (_nr)) | ||
66 | #define S5P6440_GPN(_nr) (S5P6440_GPIO_N_START + (_nr)) | ||
67 | #define S5P6440_GPP(_nr) (S5P6440_GPIO_P_START + (_nr)) | ||
68 | #define S5P6440_GPR(_nr) (S5P6440_GPIO_R_START + (_nr)) | ||
69 | |||
70 | /* the end of the S5P6440 specific gpios */ | ||
71 | #define S5P6440_GPIO_END (S5P6440_GPR(S5P6440_GPIO_R_NR) + 1) | ||
72 | #define S3C_GPIO_END S5P6440_GPIO_END | ||
73 | |||
74 | /* define the number of gpios we need to the one after the GPR() range */ | ||
75 | #define ARCH_NR_GPIOS (S5P6440_GPR(S5P6440_GPIO_R_NR) + \ | ||
76 | CONFIG_SAMSUNG_GPIO_EXTRA + 1) | ||
77 | |||
78 | #include <asm-generic/gpio.h> | ||
79 | |||
80 | #endif /* __ASM_ARCH_GPIO_H */ | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/hardware.h b/arch/arm/mach-s5p6440/include/mach/hardware.h new file mode 100644 index 000000000000..be8b26e875db --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/hardware.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/hardware.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5P6440 - Hardware support | ||
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 | #ifndef __ASM_ARCH_HARDWARE_H | ||
14 | #define __ASM_ARCH_HARDWARE_H __FILE__ | ||
15 | |||
16 | /* currently nothing here, placeholder */ | ||
17 | |||
18 | #endif /* __ASM_ARCH_HARDWARE_H */ | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/map.h b/arch/arm/mach-s5p6440/include/mach/map.h new file mode 100644 index 000000000000..b3703293cc3b --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/map.h | |||
@@ -0,0 +1,94 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/map.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5P6440 - Memory map definitions | ||
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 | #ifndef __ASM_ARCH_MAP_H | ||
14 | #define __ASM_ARCH_MAP_H __FILE__ | ||
15 | |||
16 | #include <plat/map-base.h> | ||
17 | |||
18 | /* SYSCON */ | ||
19 | #define S5P6440_PA_SYSCON (0xE0100000) | ||
20 | #define S5P_PA_SYSCON S5P6440_PA_SYSCON | ||
21 | #define S5P_VA_SYSCON S3C_VA_SYS | ||
22 | |||
23 | #define S5P6440_PA_CLK (S5P6440_PA_SYSCON + 0x0) | ||
24 | #define S5P_PA_CLK S5P6440_PA_CLK | ||
25 | #define S5P_VA_CLK (S5P_VA_SYSCON + 0x0) | ||
26 | |||
27 | /* GPIO */ | ||
28 | #define S5P6440_PA_GPIO (0xE0308000) | ||
29 | #define S5P_PA_GPIO S5P6440_PA_GPIO | ||
30 | #define S5P_VA_GPIO S3C_ADDR(0x00500000) | ||
31 | |||
32 | /* VIC0 */ | ||
33 | #define S5P6440_PA_VIC0 (0xE4000000) | ||
34 | #define S5P_PA_VIC0 S5P6440_PA_VIC0 | ||
35 | #define S5P_VA_VIC0 (S3C_VA_IRQ + 0x0) | ||
36 | #define VA_VIC0 S5P_VA_VIC0 | ||
37 | |||
38 | /* VIC1 */ | ||
39 | #define S5P6440_PA_VIC1 (0xE4100000) | ||
40 | #define S5P_PA_VIC1 S5P6440_PA_VIC1 | ||
41 | #define S5P_VA_VIC1 (S3C_VA_IRQ + 0x10000) | ||
42 | #define VA_VIC1 S5P_VA_VIC1 | ||
43 | |||
44 | /* Timer */ | ||
45 | #define S5P6440_PA_TIMER (0xEA000000) | ||
46 | #define S5P_PA_TIMER S5P6440_PA_TIMER | ||
47 | #define S5P_VA_TIMER S3C_VA_TIMER | ||
48 | |||
49 | /* RTC */ | ||
50 | #define S5P6440_PA_RTC (0xEA100000) | ||
51 | #define S5P_PA_RTC S5P6440_PA_RTC | ||
52 | #define S5P_VA_RTC S3C_ADDR(0x00600000) | ||
53 | |||
54 | /* WDT */ | ||
55 | #define S5P6440_PA_WDT (0xEA200000) | ||
56 | #define S5P_PA_WDT S5P6440_PA_WDT | ||
57 | #define S5p_VA_WDT S3C_VA_WATCHDOG | ||
58 | |||
59 | /* UART */ | ||
60 | #define S5P6440_PA_UART (0xEC000000) | ||
61 | #define S5P_PA_UART S5P6440_PA_UART | ||
62 | #define S5P_VA_UART S3C_VA_UART | ||
63 | |||
64 | #define S5P_PA_UART0 (S5P_PA_UART + 0x0) | ||
65 | #define S5P_PA_UART1 (S5P_PA_UART + 0x400) | ||
66 | #define S5P_PA_UART2 (S5P_PA_UART + 0x800) | ||
67 | #define S5P_PA_UART3 (S5P_PA_UART + 0xC00) | ||
68 | #define S5P_UART_OFFSET (0x400) | ||
69 | |||
70 | #define S5P_VA_UARTx(x) (S5P_VA_UART + (S5P_PA_UART & 0xfffff) \ | ||
71 | + ((x) * S5P_UART_OFFSET)) | ||
72 | |||
73 | #define S5P_VA_UART0 S5P_VA_UARTx(0) | ||
74 | #define S5P_VA_UART1 S5P_VA_UARTx(1) | ||
75 | #define S5P_VA_UART2 S5P_VA_UARTx(2) | ||
76 | #define S5P_VA_UART3 S5P_VA_UARTx(3) | ||
77 | #define S5P_SZ_UART SZ_256 | ||
78 | |||
79 | /* I2C */ | ||
80 | #define S5P6440_PA_IIC0 (0xEC104000) | ||
81 | #define S5P_PA_IIC0 S5P6440_PA_IIC0 | ||
82 | #define S5p_VA_IIC0 S3C_ADDR(0x00700000) | ||
83 | |||
84 | /* SDRAM */ | ||
85 | #define S5P6440_PA_SDRAM (0x20000000) | ||
86 | #define S5P_PA_SDRAM S5P6440_PA_SDRAM | ||
87 | |||
88 | /* compatibiltiy defines. */ | ||
89 | #define S3C_PA_UART S5P_PA_UART | ||
90 | #define S3C_UART_OFFSET S5P_UART_OFFSET | ||
91 | #define S3C_PA_TIMER S5P_PA_TIMER | ||
92 | #define S3C_PA_IIC S5P_PA_IIC0 | ||
93 | |||
94 | #endif /* __ASM_ARCH_MAP_H */ | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/memory.h b/arch/arm/mach-s5p6440/include/mach/memory.h new file mode 100644 index 000000000000..d62910c71b56 --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/memory.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/memory.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5P6440 - Memory definitions | ||
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 | #ifndef __ASM_ARCH_MEMORY_H | ||
14 | #define __ASM_ARCH_MEMORY_H | ||
15 | |||
16 | #define PHYS_OFFSET UL(0x20000000) | ||
17 | #define CONSISTENT_DMA_SIZE SZ_8M | ||
18 | |||
19 | #endif /* __ASM_ARCH_MEMORY_H */ | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/system.h b/arch/arm/mach-s5p6440/include/mach/system.h new file mode 100644 index 000000000000..d2dd817da66a --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/system.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/system.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5P6440 - system support header | ||
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 | #ifndef __ASM_ARCH_SYSTEM_H | ||
14 | #define __ASM_ARCH_SYSTEM_H __FILE__ | ||
15 | |||
16 | static void arch_idle(void) | ||
17 | { | ||
18 | /* nothing here yet */ | ||
19 | } | ||
20 | |||
21 | static void arch_reset(char mode, const char *cmd) | ||
22 | { | ||
23 | /* nothing here yet */ | ||
24 | } | ||
25 | |||
26 | #endif /* __ASM_ARCH_SYSTEM_H */ | ||
diff --git a/arch/arm/mach-s5p6440/include/mach/uncompress.h b/arch/arm/mach-s5p6440/include/mach/uncompress.h new file mode 100644 index 000000000000..7c1f600d65c0 --- /dev/null +++ b/arch/arm/mach-s5p6440/include/mach/uncompress.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* linux/arch/arm/mach-s5p6440/include/mach/uncompress.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5P6440 - uncompress code | ||
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 | #ifndef __ASM_ARCH_UNCOMPRESS_H | ||
14 | #define __ASM_ARCH_UNCOMPRESS_H | ||
15 | |||
16 | #include <mach/map.h> | ||
17 | #include <plat/uncompress.h> | ||
18 | |||
19 | static void arch_detect_cpu(void) | ||
20 | { | ||
21 | /* we do not need to do any cpu detection here at the moment. */ | ||
22 | } | ||
23 | |||
24 | #endif /* __ASM_ARCH_UNCOMPRESS_H */ | ||
diff --git a/arch/arm/plat-s3c/include/plat/cpu.h b/arch/arm/plat-s3c/include/plat/cpu.h index d1131ca11e97..676db9465674 100644 --- a/arch/arm/plat-s3c/include/plat/cpu.h +++ b/arch/arm/plat-s3c/include/plat/cpu.h | |||
@@ -48,9 +48,12 @@ extern void s3c_init_cpu(unsigned long idcode, | |||
48 | 48 | ||
49 | extern void s3c24xx_init_irq(void); | 49 | extern void s3c24xx_init_irq(void); |
50 | extern void s3c64xx_init_irq(u32 vic0, u32 vic1); | 50 | extern void s3c64xx_init_irq(u32 vic0, u32 vic1); |
51 | extern void s5p_init_irq(u32 *vic, u32 num_vic); | ||
51 | 52 | ||
52 | extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); | 53 | extern void s3c24xx_init_io(struct map_desc *mach_desc, int size); |
53 | extern void s3c64xx_init_io(struct map_desc *mach_desc, int size); | 54 | extern void s3c64xx_init_io(struct map_desc *mach_desc, int size); |
55 | extern void s5p_init_io(struct map_desc *mach_desc, | ||
56 | int size, void __iomem *cpuid_addr); | ||
54 | 57 | ||
55 | extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); | 58 | extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no); |
56 | 59 | ||
diff --git a/arch/arm/plat-s5p/cpu.c b/arch/arm/plat-s5p/cpu.c new file mode 100644 index 000000000000..0895a77a2835 --- /dev/null +++ b/arch/arm/plat-s5p/cpu.c | |||
@@ -0,0 +1,90 @@ | |||
1 | /* linux/arch/arm/plat-s5p/cpu.c | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * S5P CPU Support | ||
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/init.h> | ||
14 | #include <linux/module.h> | ||
15 | #include <mach/map.h> | ||
16 | #include <asm/mach/arch.h> | ||
17 | #include <asm/mach/map.h> | ||
18 | #include <mach/regs-clock.h> | ||
19 | #include <plat/cpu.h> | ||
20 | #include <plat/s5p6440.h> | ||
21 | |||
22 | /* table of supported CPUs */ | ||
23 | |||
24 | static const char name_s5p6440[] = "S5P6440"; | ||
25 | |||
26 | static struct cpu_table cpu_ids[] __initdata = { | ||
27 | { | ||
28 | .idcode = 0x56440100, | ||
29 | .idmask = 0xffffff00, | ||
30 | .map_io = s5p6440_map_io, | ||
31 | .init_clocks = s5p6440_init_clocks, | ||
32 | .init_uarts = s5p6440_init_uarts, | ||
33 | .init = s5p6440_init, | ||
34 | .name = name_s5p6440, | ||
35 | }, | ||
36 | }; | ||
37 | |||
38 | /* minimal IO mapping */ | ||
39 | |||
40 | #define UART_OFFS (S5P_PA_UART & 0xfffff) | ||
41 | |||
42 | static struct map_desc s5p_iodesc[] __initdata = { | ||
43 | { | ||
44 | .virtual = (unsigned long)S5P_VA_SYSCON, | ||
45 | .pfn = __phys_to_pfn(S5P_PA_SYSCON), | ||
46 | .length = SZ_64K, | ||
47 | .type = MT_DEVICE, | ||
48 | }, { | ||
49 | .virtual = (unsigned long)(S5P_VA_UART + UART_OFFS), | ||
50 | .pfn = __phys_to_pfn(S5P_PA_UART), | ||
51 | .length = SZ_4K, | ||
52 | .type = MT_DEVICE, | ||
53 | }, { | ||
54 | .virtual = (unsigned long)S5P_VA_VIC0, | ||
55 | .pfn = __phys_to_pfn(S5P_PA_VIC0), | ||
56 | .length = SZ_16K, | ||
57 | .type = MT_DEVICE, | ||
58 | }, { | ||
59 | .virtual = (unsigned long)S5P_VA_VIC1, | ||
60 | .pfn = __phys_to_pfn(S5P_PA_VIC1), | ||
61 | .length = SZ_16K, | ||
62 | .type = MT_DEVICE, | ||
63 | }, { | ||
64 | .virtual = (unsigned long)S5P_VA_TIMER, | ||
65 | .pfn = __phys_to_pfn(S5P_PA_TIMER), | ||
66 | .length = SZ_16K, | ||
67 | .type = MT_DEVICE, | ||
68 | }, { | ||
69 | .virtual = (unsigned long)S5P_VA_GPIO, | ||
70 | .pfn = __phys_to_pfn(S5P_PA_GPIO), | ||
71 | .length = SZ_4K, | ||
72 | .type = MT_DEVICE, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | /* read cpu identification code */ | ||
77 | |||
78 | void __init s5p_init_io(struct map_desc *mach_desc, | ||
79 | int size, void __iomem *cpuid_addr) | ||
80 | { | ||
81 | unsigned long idcode; | ||
82 | |||
83 | /* initialize the io descriptors we need for initialization */ | ||
84 | iotable_init(s5p_iodesc, ARRAY_SIZE(s5p_iodesc)); | ||
85 | if (mach_desc) | ||
86 | iotable_init(mach_desc, size); | ||
87 | |||
88 | idcode = __raw_readl(cpuid_addr); | ||
89 | s3c_init_cpu(idcode, cpu_ids, ARRAY_SIZE(cpu_ids)); | ||
90 | } | ||
diff --git a/arch/arm/plat-s5p/include/plat/s5p6440.h b/arch/arm/plat-s5p/include/plat/s5p6440.h new file mode 100644 index 000000000000..a4cd75afeb3b --- /dev/null +++ b/arch/arm/plat-s5p/include/plat/s5p6440.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* arch/arm/plat-s5p/include/plat/s5p6440.h | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * Header file for s5p6440 cpu support | ||
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 | /* Common init code for S5P6440 related SoCs */ | ||
14 | |||
15 | extern void s5p6440_common_init_uarts(struct s3c2410_uartcfg *cfg, int no); | ||
16 | extern void s5p6440_register_clocks(void); | ||
17 | extern void s5p6440_setup_clocks(void); | ||
18 | |||
19 | #ifdef CONFIG_CPU_S5P6440 | ||
20 | |||
21 | extern int s5p6440_init(void); | ||
22 | extern void s5p6440_init_irq(void); | ||
23 | extern void s5p6440_map_io(void); | ||
24 | extern void s5p6440_init_clocks(int xtal); | ||
25 | |||
26 | #define s5p6440_init_uarts s5p6440_common_init_uarts | ||
27 | |||
28 | #else | ||
29 | #define s5p6440_init_clocks NULL | ||
30 | #define s5p6440_init_uarts NULL | ||
31 | #define s5p6440_map_io NULL | ||
32 | #define s5p6440_init NULL | ||
33 | #endif | ||
34 | |||
35 | /* S5P6440 timer */ | ||
36 | |||
37 | extern struct sys_timer s5p6440_timer; | ||
diff --git a/arch/arm/plat-s5p/s5p6440-init.c b/arch/arm/plat-s5p/s5p6440-init.c new file mode 100644 index 000000000000..90178256cc28 --- /dev/null +++ b/arch/arm/plat-s5p/s5p6440-init.c | |||
@@ -0,0 +1,50 @@ | |||
1 | /* linux/arch/arm/plat-s5p/s5p6440-init.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/init.h> | ||
14 | #include <linux/serial_core.h> | ||
15 | |||
16 | #include <plat/cpu.h> | ||
17 | #include <plat/devs.h> | ||
18 | #include <plat/s5p6440.h> | ||
19 | #include <plat/regs-serial.h> | ||
20 | |||
21 | static struct s3c24xx_uart_clksrc s5p6440_serial_clocks[] = { | ||
22 | [0] = { | ||
23 | .name = "pclk_low", | ||
24 | .divisor = 1, | ||
25 | .min_baud = 0, | ||
26 | .max_baud = 0, | ||
27 | }, | ||
28 | [1] = { | ||
29 | .name = "uclk1", | ||
30 | .divisor = 1, | ||
31 | .min_baud = 0, | ||
32 | .max_baud = 0, | ||
33 | }, | ||
34 | }; | ||
35 | |||
36 | /* uart registration process */ | ||
37 | void __init s5p6440_common_init_uarts(struct s3c2410_uartcfg *cfg, int no) | ||
38 | { | ||
39 | struct s3c2410_uartcfg *tcfg = cfg; | ||
40 | u32 ucnt; | ||
41 | |||
42 | for (ucnt = 0; ucnt < no; ucnt++, tcfg++) { | ||
43 | if (!tcfg->clocks) { | ||
44 | tcfg->clocks = s5p6440_serial_clocks; | ||
45 | tcfg->clocks_size = ARRAY_SIZE(s5p6440_serial_clocks); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | s3c24xx_init_uartdevs("s3c6400-uart", s5p_uart_resources, cfg, no); | ||
50 | } | ||
diff --git a/arch/arm/plat-s5p/setup-i2c0.c b/arch/arm/plat-s5p/setup-i2c0.c new file mode 100644 index 000000000000..67a66e02a97a --- /dev/null +++ b/arch/arm/plat-s5p/setup-i2c0.c | |||
@@ -0,0 +1,25 @@ | |||
1 | /* linux/arch/arm/plat-s5p/setup-i2c0.c | ||
2 | * | ||
3 | * Copyright (c) 2009 Samsung Electronics Co., Ltd. | ||
4 | * http://www.samsung.com/ | ||
5 | * | ||
6 | * I2C0 GPIO configuration. | ||
7 | * | ||
8 | * Based on plat-s3c64xx/setup-i2c0.c | ||
9 | * | ||
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. | ||
13 | */ | ||
14 | |||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/types.h> | ||
17 | |||
18 | struct platform_device; /* don't need the contents */ | ||
19 | |||
20 | #include <plat/iic.h> | ||
21 | |||
22 | void s3c_i2c0_cfg_gpio(struct platform_device *dev) | ||
23 | { | ||
24 | /* Will be populated later */ | ||
25 | } | ||