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/platform_device.h>
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>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/map.h>
30 #include <asm/mach/irq.h>
32 #include <asm/hardware.h>
36 #include <asm/arch/regs-gpio.h>
37 #include <asm/arch/leds-gpio.h>
39 #include <asm/arch/nand.h>
41 #include <asm/plat-s3c24xx/common-smdk.h>
42 #include <asm/plat-s3c24xx/devs.h>
43 #include <asm/plat-s3c24xx/pm.h>
47 static struct s3c24xx_led_platdata smdk_pdata_led4 = {
49 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
51 .def_trigger = "timer",
54 static struct s3c24xx_led_platdata smdk_pdata_led5 = {
56 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
58 .def_trigger = "nand-disk",
61 static struct s3c24xx_led_platdata smdk_pdata_led6 = {
63 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
67 static struct s3c24xx_led_platdata smdk_pdata_led7 = {
69 .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE,
73 static struct platform_device smdk_led4 = {
74 .name = "s3c24xx_led",
77 .platform_data = &smdk_pdata_led4,
81 static struct platform_device smdk_led5 = {
82 .name = "s3c24xx_led",
85 .platform_data = &smdk_pdata_led5,
89 static struct platform_device smdk_led6 = {
90 .name = "s3c24xx_led",
93 .platform_data = &smdk_pdata_led6,
97 static struct platform_device smdk_led7 = {
98 .name = "s3c24xx_led",
101 .platform_data = &smdk_pdata_led7,
105 /* NAND parititon from 2.4.18-swl5 */
107 static struct mtd_partition smdk_default_nand_part[] = {
109 .name = "Boot Agent",
114 .name = "S3C2410 flash partition 1",
119 .name = "S3C2410 flash partition 2",
124 .name = "S3C2410 flash partition 3",
129 .name = "S3C2410 flash partition 4",
130 .offset = SZ_1M * 10,
134 .name = "S3C2410 flash partition 5",
135 .offset = SZ_1M * 14,
139 .name = "S3C2410 flash partition 6",
140 .offset = SZ_1M * 24,
144 .name = "S3C2410 flash partition 7",
145 .offset = SZ_1M * 48,
150 static struct s3c2410_nand_set smdk_nand_sets[] = {
154 .nr_partitions = ARRAY_SIZE(smdk_default_nand_part),
155 .partitions = smdk_default_nand_part,
159 /* choose a set of timings which should suit most 512Mbit
163 static struct s3c2410_platform_nand smdk_nand_info = {
167 .nr_sets = ARRAY_SIZE(smdk_nand_sets),
168 .sets = smdk_nand_sets,
171 /* devices we initialise */
173 static struct platform_device __initdata *smdk_devs[] = {
181 void __init smdk_machine_init(void)
183 /* Configure the LEDs (even if we have no LED support)*/
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);
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);
195 s3c_device_nand.dev.platform_data = &smdk_nand_info;
197 platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));