diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-19 16:18:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-19 16:18:39 -0500 |
commit | 59b8175c771040afcd4ad67022b0cc80c216b866 (patch) | |
tree | 4ef5935bee1e342716d49b9d4b99e3fa835526e6 /arch/arm/plat-s3c24xx/common-smdk.c | |
parent | 920841d8d1d61bc12b43f95a579a5374f6d98f81 (diff) | |
parent | 3b0eb4a195a124567cd0dd6f700f8388def542c6 (diff) |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (117 commits)
[ARM] 4058/2: iop32x: set ->broken_parity_status on n2100 onboard r8169 ports
[ARM] 4140/1: AACI stability add ac97 timeout and retries
[ARM] 4139/1: AACI record support
[ARM] 4138/1: AACI: multiple channel support for IRQ handling
[ARM] 4211/1: Provide a defconfig for ns9xxx
[ARM] 4210/1: base for new machine type "NetSilicon NS9360"
[ARM] 4222/1: S3C2443: Remove reference to missing S3C2443_PM
[ARM] 4221/1: S3C2443: DMA support
[ARM] 4220/1: S3C24XX: DMA system initialised from sysdev
[ARM] 4219/1: S3C2443: DMA source definitions
[ARM] 4218/1: S3C2412: fix CONFIG_CPU_S3C2412_ONLY wrt to S3C2443
[ARM] 4217/1: S3C24XX: remove the dma channel show at startup
[ARM] 4090/2: avoid clash between PXA and SA1111 defines
[ARM] 4216/1: add .gitignore entries for ARM specific files
[ARM] 4214/2: S3C2410: Add Armzone QT2410
[ARM] 4215/1: s3c2410 usb device: per-platform vbus_draw
[ARM] 4213/1: S3C2410 - Update definition of ADCTSC_XY_PST
[ARM] 4098/1: ARM: rtc_lock only used with rtc_cmos
[ARM] 4137/1: Add kexec support
[ARM] 4201/1: SMP barriers pair needed for the secondary boot process
...
Fix up conflict due to typedef removal in sound/arm/aaci.h
Diffstat (limited to 'arch/arm/plat-s3c24xx/common-smdk.c')
-rw-r--r-- | arch/arm/plat-s3c24xx/common-smdk.c | 200 |
1 files changed, 200 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c new file mode 100644 index 000000000000..908efa7d745f --- /dev/null +++ b/arch/arm/plat-s3c24xx/common-smdk.c | |||
@@ -0,0 +1,200 @@ | |||
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/platform_device.h> | ||
22 | |||
23 | #include <linux/mtd/mtd.h> | ||
24 | #include <linux/mtd/nand.h> | ||
25 | #include <linux/mtd/nand_ecc.h> | ||
26 | #include <linux/mtd/partitions.h> | ||
27 | |||
28 | #include <asm/mach/arch.h> | ||
29 | #include <asm/mach/map.h> | ||
30 | #include <asm/mach/irq.h> | ||
31 | |||
32 | #include <asm/hardware.h> | ||
33 | #include <asm/io.h> | ||
34 | #include <asm/irq.h> | ||
35 | |||
36 | #include <asm/arch/regs-gpio.h> | ||
37 | #include <asm/arch/leds-gpio.h> | ||
38 | |||
39 | #include <asm/arch/nand.h> | ||
40 | |||
41 | #include <asm/plat-s3c24xx/common-smdk.h> | ||
42 | #include <asm/plat-s3c24xx/devs.h> | ||
43 | #include <asm/plat-s3c24xx/pm.h> | ||
44 | |||
45 | /* LED devices */ | ||
46 | |||
47 | static struct s3c24xx_led_platdata smdk_pdata_led4 = { | ||
48 | .gpio = S3C2410_GPF4, | ||
49 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | ||
50 | .name = "led4", | ||
51 | .def_trigger = "timer", | ||
52 | }; | ||
53 | |||
54 | static struct s3c24xx_led_platdata smdk_pdata_led5 = { | ||
55 | .gpio = S3C2410_GPF5, | ||
56 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | ||
57 | .name = "led5", | ||
58 | .def_trigger = "nand-disk", | ||
59 | }; | ||
60 | |||
61 | static struct s3c24xx_led_platdata smdk_pdata_led6 = { | ||
62 | .gpio = S3C2410_GPF6, | ||
63 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | ||
64 | .name = "led6", | ||
65 | }; | ||
66 | |||
67 | static struct s3c24xx_led_platdata smdk_pdata_led7 = { | ||
68 | .gpio = S3C2410_GPF7, | ||
69 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | ||
70 | .name = "led7", | ||
71 | }; | ||
72 | |||
73 | static struct platform_device smdk_led4 = { | ||
74 | .name = "s3c24xx_led", | ||
75 | .id = 0, | ||
76 | .dev = { | ||
77 | .platform_data = &smdk_pdata_led4, | ||
78 | }, | ||
79 | }; | ||
80 | |||
81 | static struct platform_device smdk_led5 = { | ||
82 | .name = "s3c24xx_led", | ||
83 | .id = 1, | ||
84 | .dev = { | ||
85 | .platform_data = &smdk_pdata_led5, | ||
86 | }, | ||
87 | }; | ||
88 | |||
89 | static struct platform_device smdk_led6 = { | ||
90 | .name = "s3c24xx_led", | ||
91 | .id = 2, | ||
92 | .dev = { | ||
93 | .platform_data = &smdk_pdata_led6, | ||
94 | }, | ||
95 | }; | ||
96 | |||
97 | static struct platform_device smdk_led7 = { | ||
98 | .name = "s3c24xx_led", | ||
99 | .id = 3, | ||
100 | .dev = { | ||
101 | .platform_data = &smdk_pdata_led7, | ||
102 | }, | ||
103 | }; | ||
104 | |||
105 | /* NAND parititon from 2.4.18-swl5 */ | ||
106 | |||
107 | static struct mtd_partition smdk_default_nand_part[] = { | ||
108 | [0] = { | ||
109 | .name = "Boot Agent", | ||
110 | .size = SZ_16K, | ||
111 | .offset = 0, | ||
112 | }, | ||
113 | [1] = { | ||
114 | .name = "S3C2410 flash partition 1", | ||
115 | .offset = 0, | ||
116 | .size = SZ_2M, | ||
117 | }, | ||
118 | [2] = { | ||
119 | .name = "S3C2410 flash partition 2", | ||
120 | .offset = SZ_4M, | ||
121 | .size = SZ_4M, | ||
122 | }, | ||
123 | [3] = { | ||
124 | .name = "S3C2410 flash partition 3", | ||
125 | .offset = SZ_8M, | ||
126 | .size = SZ_2M, | ||
127 | }, | ||
128 | [4] = { | ||
129 | .name = "S3C2410 flash partition 4", | ||
130 | .offset = SZ_1M * 10, | ||
131 | .size = SZ_4M, | ||
132 | }, | ||
133 | [5] = { | ||
134 | .name = "S3C2410 flash partition 5", | ||
135 | .offset = SZ_1M * 14, | ||
136 | .size = SZ_1M * 10, | ||
137 | }, | ||
138 | [6] = { | ||
139 | .name = "S3C2410 flash partition 6", | ||
140 | .offset = SZ_1M * 24, | ||
141 | .size = SZ_1M * 24, | ||
142 | }, | ||
143 | [7] = { | ||
144 | .name = "S3C2410 flash partition 7", | ||
145 | .offset = SZ_1M * 48, | ||
146 | .size = SZ_16M, | ||
147 | } | ||
148 | }; | ||
149 | |||
150 | static struct s3c2410_nand_set smdk_nand_sets[] = { | ||
151 | [0] = { | ||
152 | .name = "NAND", | ||
153 | .nr_chips = 1, | ||
154 | .nr_partitions = ARRAY_SIZE(smdk_default_nand_part), | ||
155 | .partitions = smdk_default_nand_part, | ||
156 | }, | ||
157 | }; | ||
158 | |||
159 | /* choose a set of timings which should suit most 512Mbit | ||
160 | * chips and beyond. | ||
161 | */ | ||
162 | |||
163 | static struct s3c2410_platform_nand smdk_nand_info = { | ||
164 | .tacls = 20, | ||
165 | .twrph0 = 60, | ||
166 | .twrph1 = 20, | ||
167 | .nr_sets = ARRAY_SIZE(smdk_nand_sets), | ||
168 | .sets = smdk_nand_sets, | ||
169 | }; | ||
170 | |||
171 | /* devices we initialise */ | ||
172 | |||
173 | static struct platform_device __initdata *smdk_devs[] = { | ||
174 | &s3c_device_nand, | ||
175 | &smdk_led4, | ||
176 | &smdk_led5, | ||
177 | &smdk_led6, | ||
178 | &smdk_led7, | ||
179 | }; | ||
180 | |||
181 | void __init smdk_machine_init(void) | ||
182 | { | ||
183 | /* Configure the LEDs (even if we have no LED support)*/ | ||
184 | |||
185 | s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP); | ||
186 | s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP); | ||
187 | s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP); | ||
188 | s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP); | ||
189 | |||
190 | s3c2410_gpio_setpin(S3C2410_GPF4, 1); | ||
191 | s3c2410_gpio_setpin(S3C2410_GPF5, 1); | ||
192 | s3c2410_gpio_setpin(S3C2410_GPF6, 1); | ||
193 | s3c2410_gpio_setpin(S3C2410_GPF7, 1); | ||
194 | |||
195 | s3c_device_nand.dev.platform_data = &smdk_nand_info; | ||
196 | |||
197 | platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); | ||
198 | |||
199 | s3c2410_pm_init(); | ||
200 | } | ||