diff options
Diffstat (limited to 'arch/blackfin/mach-bf561/boards/ezkit.c')
-rw-r--r-- | arch/blackfin/mach-bf561/boards/ezkit.c | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c index 4ff8f6e7a11f..7601c3be1b5c 100644 --- a/arch/blackfin/mach-bf561/boards/ezkit.c +++ b/arch/blackfin/mach-bf561/boards/ezkit.c | |||
@@ -29,6 +29,9 @@ | |||
29 | 29 | ||
30 | #include <linux/device.h> | 30 | #include <linux/device.h> |
31 | #include <linux/platform_device.h> | 31 | #include <linux/platform_device.h> |
32 | #include <linux/mtd/mtd.h> | ||
33 | #include <linux/mtd/partitions.h> | ||
34 | #include <linux/mtd/physmap.h> | ||
32 | #include <linux/spi/spi.h> | 35 | #include <linux/spi/spi.h> |
33 | #include <linux/irq.h> | 36 | #include <linux/irq.h> |
34 | #include <linux/interrupt.h> | 37 | #include <linux/interrupt.h> |
@@ -155,6 +158,44 @@ static struct platform_device bfin_uart_device = { | |||
155 | }; | 158 | }; |
156 | #endif | 159 | #endif |
157 | 160 | ||
161 | static struct mtd_partition ezkit_partitions[] = { | ||
162 | { | ||
163 | .name = "Bootloader", | ||
164 | .size = 0x20000, | ||
165 | .offset = 0, | ||
166 | }, { | ||
167 | .name = "Kernel", | ||
168 | .size = 0xE0000, | ||
169 | .offset = MTDPART_OFS_APPEND, | ||
170 | }, { | ||
171 | .name = "RootFS", | ||
172 | .size = MTDPART_SIZ_FULL, | ||
173 | .offset = MTDPART_OFS_APPEND, | ||
174 | } | ||
175 | }; | ||
176 | |||
177 | static struct physmap_flash_data ezkit_flash_data = { | ||
178 | .width = 2, | ||
179 | .parts = ezkit_partitions, | ||
180 | .nr_parts = ARRAY_SIZE(ezkit_partitions), | ||
181 | }; | ||
182 | |||
183 | static struct resource ezkit_flash_resource = { | ||
184 | .start = 0x20000000, | ||
185 | .end = 0x207fffff, | ||
186 | .flags = IORESOURCE_MEM, | ||
187 | }; | ||
188 | |||
189 | static struct platform_device ezkit_flash_device = { | ||
190 | .name = "physmap-flash", | ||
191 | .id = 0, | ||
192 | .dev = { | ||
193 | .platform_data = &ezkit_flash_data, | ||
194 | }, | ||
195 | .num_resources = 1, | ||
196 | .resource = &ezkit_flash_resource, | ||
197 | }; | ||
198 | |||
158 | #ifdef CONFIG_SPI_BFIN | 199 | #ifdef CONFIG_SPI_BFIN |
159 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ | 200 | #if defined(CONFIG_SND_BLACKFIN_AD1836) \ |
160 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) | 201 | || defined(CONFIG_SND_BLACKFIN_AD1836_MODULE) |
@@ -246,6 +287,50 @@ static struct platform_device bfin_pata_device = { | |||
246 | }; | 287 | }; |
247 | #endif | 288 | #endif |
248 | 289 | ||
290 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
291 | #include <linux/input.h> | ||
292 | #include <linux/gpio_keys.h> | ||
293 | |||
294 | static struct gpio_keys_button bfin_gpio_keys_table[] = { | ||
295 | {BTN_0, GPIO_PF5, 1, "gpio-keys: BTN0"}, | ||
296 | {BTN_1, GPIO_PF6, 1, "gpio-keys: BTN1"}, | ||
297 | {BTN_2, GPIO_PF7, 1, "gpio-keys: BTN2"}, | ||
298 | {BTN_3, GPIO_PF8, 1, "gpio-keys: BTN3"}, | ||
299 | }; | ||
300 | |||
301 | static struct gpio_keys_platform_data bfin_gpio_keys_data = { | ||
302 | .buttons = bfin_gpio_keys_table, | ||
303 | .nbuttons = ARRAY_SIZE(bfin_gpio_keys_table), | ||
304 | }; | ||
305 | |||
306 | static struct platform_device bfin_device_gpiokeys = { | ||
307 | .name = "gpio-keys", | ||
308 | .dev = { | ||
309 | .platform_data = &bfin_gpio_keys_data, | ||
310 | }, | ||
311 | }; | ||
312 | #endif | ||
313 | |||
314 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
315 | #include <linux/i2c-gpio.h> | ||
316 | |||
317 | static struct i2c_gpio_platform_data i2c_gpio_data = { | ||
318 | .sda_pin = 1, | ||
319 | .scl_pin = 0, | ||
320 | .sda_is_open_drain = 0, | ||
321 | .scl_is_open_drain = 0, | ||
322 | .udelay = 40, | ||
323 | }; | ||
324 | |||
325 | static struct platform_device i2c_gpio_device = { | ||
326 | .name = "i2c-gpio", | ||
327 | .id = 0, | ||
328 | .dev = { | ||
329 | .platform_data = &i2c_gpio_data, | ||
330 | }, | ||
331 | }; | ||
332 | #endif | ||
333 | |||
249 | static struct platform_device *ezkit_devices[] __initdata = { | 334 | static struct platform_device *ezkit_devices[] __initdata = { |
250 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) | 335 | #if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) |
251 | &smc91x_device, | 336 | &smc91x_device, |
@@ -258,12 +343,23 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
258 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 343 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
259 | &bfin_spi0_device, | 344 | &bfin_spi0_device, |
260 | #endif | 345 | #endif |
346 | |||
261 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 347 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
262 | &bfin_uart_device, | 348 | &bfin_uart_device, |
263 | #endif | 349 | #endif |
350 | |||
264 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | 351 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) |
265 | &bfin_pata_device, | 352 | &bfin_pata_device, |
266 | #endif | 353 | #endif |
354 | |||
355 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
356 | &bfin_device_gpiokeys, | ||
357 | #endif | ||
358 | |||
359 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | ||
360 | &i2c_gpio_device, | ||
361 | #endif | ||
362 | &ezkit_flash_device, | ||
267 | }; | 363 | }; |
268 | 364 | ||
269 | static int __init ezkit_init(void) | 365 | static int __init ezkit_init(void) |