Blame view
arch/arm/plat-s3c24xx/common-smdk.c
4.38 KB
a21765a70 [ARM] 4157/2: S3C... |
1 |
/* linux/arch/arm/plat-s3c24xx/common-smdk.c |
d3f4c571b [ARM] 3440/1: [S3... |
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
* * Copyright (c) 2006 Simtec Electronics * Ben Dooks <ben@simtec.co.uk> * * Common code for SMDK2410 and SMDK2440 boards * * http://www.fluff.org/ben/smdk2440/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include <linux/kernel.h> #include <linux/types.h> #include <linux/interrupt.h> #include <linux/list.h> #include <linux/timer.h> #include <linux/init.h> |
ec976d6eb [ARM] S3C24XX: GP... |
21 |
#include <linux/gpio.h> |
edbaa603e driver-core: remo... |
22 |
#include <linux/device.h> |
d3f4c571b [ARM] 3440/1: [S3... |
23 |
#include <linux/platform_device.h> |
dee9b2e93 [ARM] 3442/1: [S3... |
24 25 26 27 |
#include <linux/mtd/mtd.h> #include <linux/mtd/nand.h> #include <linux/mtd/nand_ecc.h> #include <linux/mtd/partitions.h> |
fced80c73 [ARM] Convert asm... |
28 |
#include <linux/io.h> |
dee9b2e93 [ARM] 3442/1: [S3... |
29 |
|
d3f4c571b [ARM] 3440/1: [S3... |
30 31 32 |
#include <asm/mach/arch.h> #include <asm/mach/map.h> #include <asm/mach/irq.h> |
42482e3c7 [ARM] 4399/2: S3C... |
33 |
#include <asm/mach-types.h> |
a09e64fbc [ARM] Move includ... |
34 |
#include <mach/hardware.h> |
d3f4c571b [ARM] 3440/1: [S3... |
35 |
#include <asm/irq.h> |
d3f4c571b [ARM] 3440/1: [S3... |
36 |
|
a09e64fbc [ARM] Move includ... |
37 38 |
#include <mach/regs-gpio.h> #include <mach/leds-gpio.h> |
d3f4c571b [ARM] 3440/1: [S3... |
39 |
|
7926b5a32 [ARM] S3C: Move n... |
40 |
#include <plat/nand.h> |
dee9b2e93 [ARM] 3442/1: [S3... |
41 |
|
d5120ae72 [ARM] S3C24XX: Ad... |
42 |
#include <plat/common-smdk.h> |
40b956f02 ARM: S3C24XX: Dro... |
43 |
#include <plat/gpio-cfg.h> |
a2b7ba9ca [ARM] S3C24XX: Mo... |
44 45 |
#include <plat/devs.h> #include <plat/pm.h> |
d3f4c571b [ARM] 3440/1: [S3... |
46 |
|
810c894f2 [ARM] 3558/1: SMD... |
47 48 49 |
/* LED devices */ static struct s3c24xx_led_platdata smdk_pdata_led4 = { |
070276d5d [ARM] S3C24XX: GP... |
50 |
.gpio = S3C2410_GPF(4), |
810c894f2 [ARM] 3558/1: SMD... |
51 52 53 54 55 56 |
.flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, .name = "led4", .def_trigger = "timer", }; static struct s3c24xx_led_platdata smdk_pdata_led5 = { |
070276d5d [ARM] S3C24XX: GP... |
57 |
.gpio = S3C2410_GPF(5), |
810c894f2 [ARM] 3558/1: SMD... |
58 59 60 61 62 63 |
.flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, .name = "led5", .def_trigger = "nand-disk", }; static struct s3c24xx_led_platdata smdk_pdata_led6 = { |
070276d5d [ARM] S3C24XX: GP... |
64 |
.gpio = S3C2410_GPF(6), |
810c894f2 [ARM] 3558/1: SMD... |
65 66 67 68 69 |
.flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, .name = "led6", }; static struct s3c24xx_led_platdata smdk_pdata_led7 = { |
070276d5d [ARM] S3C24XX: GP... |
70 |
.gpio = S3C2410_GPF(7), |
810c894f2 [ARM] 3558/1: SMD... |
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
.flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, .name = "led7", }; static struct platform_device smdk_led4 = { .name = "s3c24xx_led", .id = 0, .dev = { .platform_data = &smdk_pdata_led4, }, }; static struct platform_device smdk_led5 = { .name = "s3c24xx_led", .id = 1, .dev = { .platform_data = &smdk_pdata_led5, }, }; static struct platform_device smdk_led6 = { .name = "s3c24xx_led", .id = 2, .dev = { .platform_data = &smdk_pdata_led6, }, }; static struct platform_device smdk_led7 = { .name = "s3c24xx_led", .id = 3, .dev = { .platform_data = &smdk_pdata_led7, }, }; |
dee9b2e93 [ARM] 3442/1: [S3... |
106 107 108 109 110 111 112 113 114 |
/* NAND parititon from 2.4.18-swl5 */ static struct mtd_partition smdk_default_nand_part[] = { [0] = { .name = "Boot Agent", .size = SZ_16K, .offset = 0, }, [1] = { |
f68355434 [ARM] 3475/1: S3C... |
115 |
.name = "S3C2410 flash partition 1", |
dee9b2e93 [ARM] 3442/1: [S3... |
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
.offset = 0, .size = SZ_2M, }, [2] = { .name = "S3C2410 flash partition 2", .offset = SZ_4M, .size = SZ_4M, }, [3] = { .name = "S3C2410 flash partition 3", .offset = SZ_8M, .size = SZ_2M, }, [4] = { .name = "S3C2410 flash partition 4", .offset = SZ_1M * 10, .size = SZ_4M, }, [5] = { .name = "S3C2410 flash partition 5", .offset = SZ_1M * 14, .size = SZ_1M * 10, }, [6] = { .name = "S3C2410 flash partition 6", .offset = SZ_1M * 24, .size = SZ_1M * 24, }, [7] = { .name = "S3C2410 flash partition 7", .offset = SZ_1M * 48, |
66ad4eea7 ARM: S3C24XX: Fix... |
147 |
.size = MTDPART_SIZ_FULL, |
dee9b2e93 [ARM] 3442/1: [S3... |
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
} }; static struct s3c2410_nand_set smdk_nand_sets[] = { [0] = { .name = "NAND", .nr_chips = 1, .nr_partitions = ARRAY_SIZE(smdk_default_nand_part), .partitions = smdk_default_nand_part, }, }; /* choose a set of timings which should suit most 512Mbit * chips and beyond. */ static struct s3c2410_platform_nand smdk_nand_info = { .tacls = 20, .twrph0 = 60, .twrph1 = 20, .nr_sets = ARRAY_SIZE(smdk_nand_sets), .sets = smdk_nand_sets, }; /* devices we initialise */ static struct platform_device __initdata *smdk_devs[] = { &s3c_device_nand, |
810c894f2 [ARM] 3558/1: SMD... |
176 177 178 179 |
&smdk_led4, &smdk_led5, &smdk_led6, &smdk_led7, |
dee9b2e93 [ARM] 3442/1: [S3... |
180 |
}; |
d3f4c571b [ARM] 3440/1: [S3... |
181 182 183 |
void __init smdk_machine_init(void) { /* Configure the LEDs (even if we have no LED support)*/ |
40b956f02 ARM: S3C24XX: Dro... |
184 185 186 187 |
s3c_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); s3c_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); s3c_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); s3c_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); |
d3f4c571b [ARM] 3440/1: [S3... |
188 |
|
070276d5d [ARM] S3C24XX: GP... |
189 190 191 192 |
s3c2410_gpio_setpin(S3C2410_GPF(4), 1); s3c2410_gpio_setpin(S3C2410_GPF(5), 1); s3c2410_gpio_setpin(S3C2410_GPF(6), 1); s3c2410_gpio_setpin(S3C2410_GPF(7), 1); |
d3f4c571b [ARM] 3440/1: [S3... |
193 |
|
42482e3c7 [ARM] 4399/2: S3C... |
194 195 |
if (machine_is_smdk2443()) smdk_nand_info.twrph0 = 50; |
2a3a18045 ARM: S3C: Add NAN... |
196 |
s3c_nand_set_platdata(&smdk_nand_info); |
dee9b2e93 [ARM] 3442/1: [S3... |
197 198 |
platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs)); |
4e59c25dc [ARM] S3C: Rename... |
199 |
s3c_pm_init(); |
d3f4c571b [ARM] 3440/1: [S3... |
200 |
} |