1 /* linux/arch/arm/plat-s3c24xx/common-smdk.c
3 * Copyright (c) 2006 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
6 * Common code for SMDK2410 and SMDK2440 boards
8 * http://www.fluff.org/ben/smdk2440/
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/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>
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>
31 #include <asm/mach/arch.h>
32 #include <asm/mach/map.h>
33 #include <asm/mach/irq.h>
35 #include <asm/mach-types.h>
36 #include <mach/hardware.h>
39 #include <mach/regs-gpio.h>
40 #include <mach/leds-gpio.h>
42 #include <plat/nand.h>
44 #include <plat/common-smdk.h>
45 #include <plat/gpio-cfg.h>
46 #include <plat/devs.h>
51 static struct s3c24xx_led_platdata smdk_pdata_led4
= {
52 .gpio
= S3C2410_GPF(4),
53 .flags
= S3C24XX_LEDF_ACTLOW
| S3C24XX_LEDF_TRISTATE
,
55 .def_trigger
= "timer",
58 static struct s3c24xx_led_platdata smdk_pdata_led5
= {
59 .gpio
= S3C2410_GPF(5),
60 .flags
= S3C24XX_LEDF_ACTLOW
| S3C24XX_LEDF_TRISTATE
,
62 .def_trigger
= "nand-disk",
65 static struct s3c24xx_led_platdata smdk_pdata_led6
= {
66 .gpio
= S3C2410_GPF(6),
67 .flags
= S3C24XX_LEDF_ACTLOW
| S3C24XX_LEDF_TRISTATE
,
71 static struct s3c24xx_led_platdata smdk_pdata_led7
= {
72 .gpio
= S3C2410_GPF(7),
73 .flags
= S3C24XX_LEDF_ACTLOW
| S3C24XX_LEDF_TRISTATE
,
77 static struct platform_device smdk_led4
= {
78 .name
= "s3c24xx_led",
81 .platform_data
= &smdk_pdata_led4
,
85 static struct platform_device smdk_led5
= {
86 .name
= "s3c24xx_led",
89 .platform_data
= &smdk_pdata_led5
,
93 static struct platform_device smdk_led6
= {
94 .name
= "s3c24xx_led",
97 .platform_data
= &smdk_pdata_led6
,
101 static struct platform_device smdk_led7
= {
102 .name
= "s3c24xx_led",
105 .platform_data
= &smdk_pdata_led7
,
109 /* NAND parititon from 2.4.18-swl5 */
111 static struct mtd_partition smdk_default_nand_part
[] = {
113 .name
= "Boot Agent",
118 .name
= "S3C2410 flash partition 1",
123 .name
= "S3C2410 flash partition 2",
128 .name
= "S3C2410 flash partition 3",
133 .name
= "S3C2410 flash partition 4",
134 .offset
= SZ_1M
* 10,
138 .name
= "S3C2410 flash partition 5",
139 .offset
= SZ_1M
* 14,
143 .name
= "S3C2410 flash partition 6",
144 .offset
= SZ_1M
* 24,
148 .name
= "S3C2410 flash partition 7",
149 .offset
= SZ_1M
* 48,
150 .size
= MTDPART_SIZ_FULL
,
154 static struct s3c2410_nand_set smdk_nand_sets
[] = {
158 .nr_partitions
= ARRAY_SIZE(smdk_default_nand_part
),
159 .partitions
= smdk_default_nand_part
,
163 /* choose a set of timings which should suit most 512Mbit
167 static struct s3c2410_platform_nand smdk_nand_info
= {
171 .nr_sets
= ARRAY_SIZE(smdk_nand_sets
),
172 .sets
= smdk_nand_sets
,
175 /* devices we initialise */
177 static struct platform_device __initdata
*smdk_devs
[] = {
185 void __init
smdk_machine_init(void)
187 /* Configure the LEDs (even if we have no LED support)*/
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
);
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);
199 if (machine_is_smdk2443())
200 smdk_nand_info
.twrph0
= 50;
202 s3c_nand_set_platdata(&smdk_nand_info
);
204 platform_add_devices(smdk_devs
, ARRAY_SIZE(smdk_devs
));