diff options
author | Heiko Stuebner <heiko@sntech.de> | 2012-03-07 04:47:01 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2012-03-07 04:47:01 -0500 |
commit | 28c569f6957859d7d53681e00758980750da0250 (patch) | |
tree | aee4a87960b04b872b7a625ac43aa2c488e5442a /arch/arm/mach-s3c24xx | |
parent | 880bcd4a8363f24375027f9ded4670960dcfa70a (diff) |
ARM: S3C24XX: Move common-smdk code to mach directory
This code is used by boards based on the S3C2410/S3C2440/S3C2416.
The patch includes also a rename of the option, as the smdk code
is not a mach itself, but only an extension with common code.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s3c24xx')
-rw-r--r-- | arch/arm/mach-s3c24xx/Kconfig | 19 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/common-smdk.c | 207 |
3 files changed, 222 insertions, 5 deletions
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig index 48af6fcb8acd..7dede0742daa 100644 --- a/arch/arm/mach-s3c24xx/Kconfig +++ b/arch/arm/mach-s3c24xx/Kconfig | |||
@@ -81,6 +81,15 @@ config CPU_S3C2443 | |||
81 | help | 81 | help |
82 | Support for the S3C2443 SoC from the S3C24XX line | 82 | Support for the S3C2443 SoC from the S3C24XX line |
83 | 83 | ||
84 | # common code | ||
85 | |||
86 | config S3C24XX_SMDK | ||
87 | bool | ||
88 | help | ||
89 | Common machine code for SMDK2410 and SMDK2440 | ||
90 | |||
91 | # cpu-specific sections | ||
92 | |||
84 | if CPU_S3C2410 | 93 | if CPU_S3C2410 |
85 | 94 | ||
86 | config S3C2410_DMA | 95 | config S3C2410_DMA |
@@ -192,7 +201,7 @@ config MACH_QT2410 | |||
192 | 201 | ||
193 | config ARCH_SMDK2410 | 202 | config ARCH_SMDK2410 |
194 | bool "SMDK2410/A9M2410" | 203 | bool "SMDK2410/A9M2410" |
195 | select MACH_SMDK | 204 | select S3C24XX_SMDK |
196 | help | 205 | help |
197 | Say Y here if you are using the SMDK2410 or the derived module A9M2410 | 206 | Say Y here if you are using the SMDK2410 or the derived module A9M2410 |
198 | <http://www.fsforth.de> | 207 | <http://www.fsforth.de> |
@@ -279,7 +288,7 @@ config MACH_SMDK2412 | |||
279 | config MACH_SMDK2413 | 288 | config MACH_SMDK2413 |
280 | bool "SMDK2413" | 289 | bool "SMDK2413" |
281 | select MACH_S3C2413 | 290 | select MACH_S3C2413 |
282 | select MACH_SMDK | 291 | select S3C24XX_SMDK |
283 | select S3C_DEV_USB_HOST | 292 | select S3C_DEV_USB_HOST |
284 | select S3C_DEV_NAND | 293 | select S3C_DEV_NAND |
285 | help | 294 | help |
@@ -317,7 +326,7 @@ comment "S3C2416 Boards" | |||
317 | 326 | ||
318 | config MACH_SMDK2416 | 327 | config MACH_SMDK2416 |
319 | bool "SMDK2416" | 328 | bool "SMDK2416" |
320 | select MACH_SMDK | 329 | select S3C24XX_SMDK |
321 | select S3C_DEV_FB | 330 | select S3C_DEV_FB |
322 | select S3C_DEV_HSMMC | 331 | select S3C_DEV_HSMMC |
323 | select S3C_DEV_HSMMC1 | 332 | select S3C_DEV_HSMMC1 |
@@ -420,7 +429,7 @@ config MACH_RX3715 | |||
420 | config ARCH_S3C2440 | 429 | config ARCH_S3C2440 |
421 | bool "SMDK2440" | 430 | bool "SMDK2440" |
422 | select S3C2440_XTAL_16934400 | 431 | select S3C2440_XTAL_16934400 |
423 | select MACH_SMDK | 432 | select S3C24XX_SMDK |
424 | select S3C_DEV_USB_HOST | 433 | select S3C_DEV_USB_HOST |
425 | select S3C_DEV_NAND | 434 | select S3C_DEV_NAND |
426 | help | 435 | help |
@@ -492,7 +501,7 @@ comment "S3C2443 Boards" | |||
492 | 501 | ||
493 | config MACH_SMDK2443 | 502 | config MACH_SMDK2443 |
494 | bool "SMDK2443" | 503 | bool "SMDK2443" |
495 | select MACH_SMDK | 504 | select S3C24XX_SMDK |
496 | select S3C_DEV_HSMMC1 | 505 | select S3C_DEV_HSMMC1 |
497 | help | 506 | help |
498 | Say Y here if you are using an SMDK2443 | 507 | Say Y here if you are using an SMDK2443 |
diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile index 876e5e54d976..b1c3c6f7c2eb 100644 --- a/arch/arm/mach-s3c24xx/Makefile +++ b/arch/arm/mach-s3c24xx/Makefile | |||
@@ -77,6 +77,7 @@ obj-$(CONFIG_MACH_SMDK2443) += mach-smdk2443.o | |||
77 | 77 | ||
78 | # common bits of machine support | 78 | # common bits of machine support |
79 | 79 | ||
80 | obj-$(CONFIG_S3C24XX_SMDK) += common-smdk.o | ||
80 | obj-$(CONFIG_SIMTEC_NOR) += nor-simtec.o | 81 | obj-$(CONFIG_SIMTEC_NOR) += nor-simtec.o |
81 | 82 | ||
82 | # machine additions | 83 | # machine additions |
diff --git a/arch/arm/mach-s3c24xx/common-smdk.c b/arch/arm/mach-s3c24xx/common-smdk.c new file mode 100644 index 000000000000..084604be6ad1 --- /dev/null +++ b/arch/arm/mach-s3c24xx/common-smdk.c | |||
@@ -0,0 +1,207 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/common-smdk.c | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * Common code for SMDK2410 and SMDK2440 boards | ||
7 | * | ||
8 | * http://www.fluff.org/ben/smdk2440/ | ||
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 | #include <linux/interrupt.h> | ||
18 | #include <linux/list.h> | ||
19 | #include <linux/timer.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/gpio.h> | ||
22 | #include <linux/device.h> | ||
23 | #include <linux/platform_device.h> | ||
24 | |||
25 | #include <linux/mtd/mtd.h> | ||
26 | #include <linux/mtd/nand.h> | ||
27 | #include <linux/mtd/nand_ecc.h> | ||
28 | #include <linux/mtd/partitions.h> | ||
29 | #include <linux/io.h> | ||
30 | |||
31 | #include <asm/mach/arch.h> | ||
32 | #include <asm/mach/map.h> | ||
33 | #include <asm/mach/irq.h> | ||
34 | |||
35 | #include <asm/mach-types.h> | ||
36 | #include <mach/hardware.h> | ||
37 | #include <asm/irq.h> | ||
38 | |||
39 | #include <mach/regs-gpio.h> | ||
40 | #include <mach/leds-gpio.h> | ||
41 | |||
42 | #include <plat/nand.h> | ||
43 | |||
44 | #include <plat/common-smdk.h> | ||
45 | #include <plat/gpio-cfg.h> | ||
46 | #include <plat/devs.h> | ||
47 | #include <plat/pm.h> | ||
48 | |||
49 | /* LED devices */ | ||
50 | |||
51 | static struct s3c24xx_led_platdata smdk_pdata_led4 = { | ||
52 | .gpio = S3C2410_GPF(4), | ||
53 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | ||
54 | .name = "led4", | ||
55 | .def_trigger = "timer", | ||
56 | }; | ||
57 | |||
58 | static struct s3c24xx_led_platdata smdk_pdata_led5 = { | ||
59 | .gpio = S3C2410_GPF(5), | ||
60 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | ||
61 | .name = "led5", | ||
62 | .def_trigger = "nand-disk", | ||
63 | }; | ||
64 | |||
65 | static struct s3c24xx_led_platdata smdk_pdata_led6 = { | ||
66 | .gpio = S3C2410_GPF(6), | ||
67 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | ||
68 | .name = "led6", | ||
69 | }; | ||
70 | |||
71 | static struct s3c24xx_led_platdata smdk_pdata_led7 = { | ||
72 | .gpio = S3C2410_GPF(7), | ||
73 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | ||
74 | .name = "led7", | ||
75 | }; | ||
76 | |||
77 | static struct platform_device smdk_led4 = { | ||
78 | .name = "s3c24xx_led", | ||
79 | .id = 0, | ||
80 | .dev = { | ||
81 | .platform_data = &smdk_pdata_led4, | ||
82 | }, | ||
83 | }; | ||
84 | |||
85 | static struct platform_device smdk_led5 = { | ||
86 | .name = "s3c24xx_led", | ||
87 | .id = 1, | ||
88 | .dev = { | ||
89 | .platform_data = &smdk_pdata_led5, | ||
90 | }, | ||
91 | }; | ||
92 | |||
93 | static struct platform_device smdk_led6 = { | ||
94 | .name = "s3c24xx_led", | ||
95 | .id = 2, | ||
96 | .dev = { | ||
97 | .platform_data = &smdk_pdata_led6, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | static struct platform_device smdk_led7 = { | ||
102 | .name = "s3c24xx_led", | ||
103 | .id = 3, | ||
104 | .dev = { | ||
105 | .platform_data = &smdk_pdata_led7, | ||
106 | }, | ||
107 | }; | ||
108 | |||
109 | /* NAND parititon from 2.4.18-swl5 */ | ||
110 | |||
111 | static struct mtd_partition smdk_default_nand_part[] = { | ||
112 | [0] = { | ||
113 | .name = "Boot Agent", | ||
114 | .size = SZ_16K, | ||
115 | .offset = 0, | ||
116 | }, | ||
117 | [1] = { | ||
118 | .name = "S3C2410 flash partition 1", | ||
119 | .offset = 0, | ||
120 | .size = SZ_2M, | ||
121 | }, | ||
122 | [2] = { | ||
123 | .name = "S3C2410 flash partition 2", | ||
124 | .offset = SZ_4M, | ||
125 | .size = SZ_4M, | ||
126 | }, | ||
127 | [3] = { | ||
128 | .name = "S3C2410 flash partition 3", | ||
129 | .offset = SZ_8M, | ||
130 | .size = SZ_2M, | ||
131 | }, | ||
132 | [4] = { | ||
133 | .name = "S3C2410 flash partition 4", | ||
134 | .offset = SZ_1M * 10, | ||
135 | .size = SZ_4M, | ||
136 | }, | ||
137 | [5] = { | ||
138 | .name = "S3C2410 flash partition 5", | ||
139 | .offset = SZ_1M * 14, | ||
140 | .size = SZ_1M * 10, | ||
141 | }, | ||
142 | [6] = { | ||
143 | .name = "S3C2410 flash partition 6", | ||
144 | .offset = SZ_1M * 24, | ||
145 | .size = SZ_1M * 24, | ||
146 | }, | ||
147 | [7] = { | ||
148 | .name = "S3C2410 flash partition 7", | ||
149 | .offset = SZ_1M * 48, | ||
150 | .size = MTDPART_SIZ_FULL, | ||
151 | } | ||
152 | }; | ||
153 | |||
154 | static struct s3c2410_nand_set smdk_nand_sets[] = { | ||
155 | [0] = { | ||
156 | .name = "NAND", | ||
157 | .nr_chips = 1, | ||
158 | .nr_partitions = ARRAY_SIZE(smdk_default_nand_part), | ||
159 | .partitions = smdk_default_nand_part, | ||
160 | }, | ||
161 | }; | ||
162 | |||
163 | /* choose a set of timings which should suit most 512Mbit | ||
164 | * chips and beyond. | ||
165 | */ | ||
166 | |||
167 | static struct s3c2410_platform_nand smdk_nand_info = { | ||
168 | .tacls = 20, | ||
169 | .twrph0 = 60, | ||
170 | .twrph1 = 20, | ||
171 | .nr_sets = ARRAY_SIZE(smdk_nand_sets), | ||
172 | .sets = smdk_nand_sets, | ||
173 | }; | ||
174 | |||
175 | /* devices we initialise */ | ||
176 | |||
177 | static struct platform_device __initdata *smdk_devs[] = { | ||
178 | &s3c_device_nand, | ||
179 | &smdk_led4, | ||
180 | &smdk_led5, | ||
181 | &smdk_led6, | ||
182 | &smdk_led7, | ||
183 | }; | ||
184 | |||
185 | void __init smdk_machine_init(void) | ||
186 | { | ||
187 | /* Configure the LEDs (even if we have no LED support)*/ | ||
188 | |||
189 | s3c_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); | ||
190 | s3c_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); | ||
191 | s3c_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); | ||
192 | s3c_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); | ||
193 | |||
194 | s3c2410_gpio_setpin(S3C2410_GPF(4), 1); | ||
195 | s3c2410_gpio_setpin(S3C2410_GPF(5), 1); | ||
196 | s3c2410_gpio_setpin(S3C2410_GPF(6), 1); | ||
197 | s3c2410_gpio_setpin(S3C2410_GPF(7), 1); | ||
198 | |||
199 | if (machine_is_smdk2443()) | ||
200 | smdk_nand_info.twrph0 = 50; | ||
201 | |||
202 | s3c_nand_set_platdata(&smdk_nand_info); | ||
203 | |||
204 | platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); | ||
205 | |||
206 | s3c_pm_init(); | ||
207 | } | ||