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/sysdev.h>
22 #include <linux/platform_device.h>
24 #include <linux/mtd/mtd.h>
25 #include <linux/mtd/nand.h>
26 #include <linux/mtd/nand_ecc.h>
27 #include <linux/mtd/partitions.h>
30 #include <asm/mach/arch.h>
31 #include <asm/mach/map.h>
32 #include <asm/mach/irq.h>
34 #include <asm/mach-types.h>
35 #include <mach/hardware.h>
38 #include <mach/regs-gpio.h>
39 #include <mach/leds-gpio.h>
41 #include <plat/nand.h>
43 #include <plat/common-smdk.h>
44 #include <plat/devs.h>
49 static struct s3c24xx_led_platdata smdk_pdata_led4 = {
51 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
53 .def_trigger = "timer",
56 static struct s3c24xx_led_platdata smdk_pdata_led5 = {
58 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
60 .def_trigger = "nand-disk",
63 static struct s3c24xx_led_platdata smdk_pdata_led6 = {
65 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
69 static struct s3c24xx_led_platdata smdk_pdata_led7 = {
71 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
75 static struct platform_device smdk_led4 = {
76 .name = "s3c24xx_led",
79 .platform_data = &smdk_pdata_led4,
83 static struct platform_device smdk_led5 = {
84 .name = "s3c24xx_led",
87 .platform_data = &smdk_pdata_led5,
91 static struct platform_device smdk_led6 = {
92 .name = "s3c24xx_led",
95 .platform_data = &smdk_pdata_led6,
99 static struct platform_device smdk_led7 = {
100 .name = "s3c24xx_led",
103 .platform_data = &smdk_pdata_led7,
107 /* NAND parititon from 2.4.18-swl5 */
109 static struct mtd_partition smdk_default_nand_part[] = {
111 .name = "Boot Agent",
116 .name = "S3C2410 flash partition 1",
121 .name = "S3C2410 flash partition 2",
126 .name = "S3C2410 flash partition 3",
131 .name = "S3C2410 flash partition 4",
132 .offset = SZ_1M * 10,
136 .name = "S3C2410 flash partition 5",
137 .offset = SZ_1M * 14,
141 .name = "S3C2410 flash partition 6",
142 .offset = SZ_1M * 24,
146 .name = "S3C2410 flash partition 7",
147 .offset = SZ_1M * 48,
152 static struct s3c2410_nand_set smdk_nand_sets[] = {
156 .nr_partitions = ARRAY_SIZE(smdk_default_nand_part),
157 .partitions = smdk_default_nand_part,
161 /* choose a set of timings which should suit most 512Mbit
165 static struct s3c2410_platform_nand smdk_nand_info = {
169 .nr_sets = ARRAY_SIZE(smdk_nand_sets),
170 .sets = smdk_nand_sets,
173 /* devices we initialise */
175 static struct platform_device __initdata *smdk_devs[] = {
183 void __init smdk_machine_init(void)
185 /* Configure the LEDs (even if we have no LED support)*/
187 s3c2410_gpio_cfgpin(S3C2410_GPF4, S3C2410_GPF4_OUTP);
188 s3c2410_gpio_cfgpin(S3C2410_GPF5, S3C2410_GPF5_OUTP);
189 s3c2410_gpio_cfgpin(S3C2410_GPF6, S3C2410_GPF6_OUTP);
190 s3c2410_gpio_cfgpin(S3C2410_GPF7, S3C2410_GPF7_OUTP);
192 s3c2410_gpio_setpin(S3C2410_GPF4, 1);
193 s3c2410_gpio_setpin(S3C2410_GPF5, 1);
194 s3c2410_gpio_setpin(S3C2410_GPF6, 1);
195 s3c2410_gpio_setpin(S3C2410_GPF7, 1);
197 if (machine_is_smdk2443())
198 smdk_nand_info.twrph0 = 50;
200 s3c_device_nand.dev.platform_data = &smdk_nand_info;
202 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));