diff options
Diffstat (limited to 'arch/blackfin/mach-bf533/boards/ezkit.c')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/ezkit.c | 132 |
1 files changed, 56 insertions, 76 deletions
diff --git a/arch/blackfin/mach-bf533/boards/ezkit.c b/arch/blackfin/mach-bf533/boards/ezkit.c index fd518e383b79..d4689dcc198e 100644 --- a/arch/blackfin/mach-bf533/boards/ezkit.c +++ b/arch/blackfin/mach-bf533/boards/ezkit.c | |||
@@ -1,31 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * File: arch/blackfin/mach-bf533/ezkit.c | 2 | * Copyright 2004-2009 Analog Devices Inc. |
3 | * Based on: Original Work | 3 | * 2005 National ICT Australia (NICTA) |
4 | * Author: Aidan Williams <aidan@nicta.com.au> | 4 | * Aidan Williams <aidan@nicta.com.au> |
5 | * | 5 | * |
6 | * Created: 2005 | 6 | * Licensed under the GPL-2 or later. |
7 | * Description: | ||
8 | * | ||
9 | * Modified: Robin Getz <rgetz@blackfin.uclinux.org> - Named the boards | ||
10 | * Copyright 2005 National ICT Australia (NICTA) | ||
11 | * Copyright 2004-2006 Analog Devices Inc. | ||
12 | * | ||
13 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ | ||
14 | * | ||
15 | * This program is free software; you can redistribute it and/or modify | ||
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, see the file COPYING, or write | ||
27 | * to the Free Software Foundation, Inc., | ||
28 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
29 | */ | 7 | */ |
30 | 8 | ||
31 | #include <linux/device.h> | 9 | #include <linux/device.h> |
@@ -33,12 +11,14 @@ | |||
33 | #include <linux/mtd/mtd.h> | 11 | #include <linux/mtd/mtd.h> |
34 | #include <linux/mtd/partitions.h> | 12 | #include <linux/mtd/partitions.h> |
35 | #include <linux/mtd/plat-ram.h> | 13 | #include <linux/mtd/plat-ram.h> |
14 | #include <linux/mtd/physmap.h> | ||
36 | #include <linux/spi/spi.h> | 15 | #include <linux/spi/spi.h> |
37 | #include <linux/spi/flash.h> | 16 | #include <linux/spi/flash.h> |
38 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) | 17 | #if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) |
39 | #include <linux/usb/isp1362.h> | 18 | #include <linux/usb/isp1362.h> |
40 | #endif | 19 | #endif |
41 | #include <linux/irq.h> | 20 | #include <linux/irq.h> |
21 | #include <linux/i2c.h> | ||
42 | #include <asm/dma.h> | 22 | #include <asm/dma.h> |
43 | #include <asm/bfin5xx_spi.h> | 23 | #include <asm/bfin5xx_spi.h> |
44 | #include <asm/portmux.h> | 24 | #include <asm/portmux.h> |
@@ -56,12 +36,6 @@ static struct platform_device rtc_device = { | |||
56 | }; | 36 | }; |
57 | #endif | 37 | #endif |
58 | 38 | ||
59 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | ||
60 | static struct platform_device bfin_fb_adv7393_device = { | ||
61 | .name = "bfin-adv7393", | ||
62 | }; | ||
63 | #endif | ||
64 | |||
65 | /* | 39 | /* |
66 | * USB-LAN EzExtender board | 40 | * USB-LAN EzExtender board |
67 | * Driver needs to know address, irq and flag pin. | 41 | * Driver needs to know address, irq and flag pin. |
@@ -98,54 +72,69 @@ static struct platform_device smc91x_device = { | |||
98 | }; | 72 | }; |
99 | #endif | 73 | #endif |
100 | 74 | ||
101 | #if defined(CONFIG_MTD_PSD4256G) || defined(CONFIG_MTD_PSD4256G_MODULE) | 75 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
102 | static const char *map_probes[] = { | 76 | static struct mtd_partition ezkit_partitions_a[] = { |
103 | "stm_flash", | 77 | { |
104 | NULL, | 78 | .name = "bootloader(nor a)", |
79 | .size = 0x40000, | ||
80 | .offset = 0, | ||
81 | }, { | ||
82 | .name = "linux kernel(nor a)", | ||
83 | .size = MTDPART_SIZ_FULL, | ||
84 | .offset = MTDPART_OFS_APPEND, | ||
85 | }, | ||
105 | }; | 86 | }; |
106 | 87 | ||
107 | static struct platdata_mtd_ram stm_pri_data_a = { | 88 | static struct physmap_flash_data ezkit_flash_data_a = { |
108 | .mapname = "Flash A Primary", | 89 | .width = 2, |
109 | .map_probes = map_probes, | 90 | .parts = ezkit_partitions_a, |
110 | .bankwidth = 2, | 91 | .nr_parts = ARRAY_SIZE(ezkit_partitions_a), |
111 | }; | 92 | }; |
112 | 93 | ||
113 | static struct resource stm_pri_resource_a = { | 94 | static struct resource ezkit_flash_resource_a = { |
114 | .start = 0x20000000, | 95 | .start = 0x20000000, |
115 | .end = 0x200fffff, | 96 | .end = 0x200fffff, |
116 | .flags = IORESOURCE_MEM, | 97 | .flags = IORESOURCE_MEM, |
117 | }; | 98 | }; |
118 | 99 | ||
119 | static struct platform_device stm_pri_device_a = { | 100 | static struct platform_device ezkit_flash_device_a = { |
120 | .name = "mtd-ram", | 101 | .name = "physmap-flash", |
121 | .id = 0, | 102 | .id = 0, |
122 | .dev = { | 103 | .dev = { |
123 | .platform_data = &stm_pri_data_a, | 104 | .platform_data = &ezkit_flash_data_a, |
124 | }, | 105 | }, |
125 | .num_resources = 1, | 106 | .num_resources = 1, |
126 | .resource = &stm_pri_resource_a, | 107 | .resource = &ezkit_flash_resource_a, |
108 | }; | ||
109 | |||
110 | static struct mtd_partition ezkit_partitions_b[] = { | ||
111 | { | ||
112 | .name = "file system(nor b)", | ||
113 | .size = MTDPART_SIZ_FULL, | ||
114 | .offset = MTDPART_OFS_APPEND, | ||
115 | }, | ||
127 | }; | 116 | }; |
128 | 117 | ||
129 | static struct platdata_mtd_ram stm_pri_data_b = { | 118 | static struct physmap_flash_data ezkit_flash_data_b = { |
130 | .mapname = "Flash B Primary", | 119 | .width = 2, |
131 | .map_probes = map_probes, | 120 | .parts = ezkit_partitions_b, |
132 | .bankwidth = 2, | 121 | .nr_parts = ARRAY_SIZE(ezkit_partitions_b), |
133 | }; | 122 | }; |
134 | 123 | ||
135 | static struct resource stm_pri_resource_b = { | 124 | static struct resource ezkit_flash_resource_b = { |
136 | .start = 0x20100000, | 125 | .start = 0x20100000, |
137 | .end = 0x201fffff, | 126 | .end = 0x201fffff, |
138 | .flags = IORESOURCE_MEM, | 127 | .flags = IORESOURCE_MEM, |
139 | }; | 128 | }; |
140 | 129 | ||
141 | static struct platform_device stm_pri_device_b = { | 130 | static struct platform_device ezkit_flash_device_b = { |
142 | .name = "mtd-ram", | 131 | .name = "physmap-flash", |
143 | .id = 4, | 132 | .id = 4, |
144 | .dev = { | 133 | .dev = { |
145 | .platform_data = &stm_pri_data_b, | 134 | .platform_data = &ezkit_flash_data_b, |
146 | }, | 135 | }, |
147 | .num_resources = 1, | 136 | .num_resources = 1, |
148 | .resource = &stm_pri_resource_b, | 137 | .resource = &ezkit_flash_resource_b, |
149 | }; | 138 | }; |
150 | #endif | 139 | #endif |
151 | 140 | ||
@@ -400,19 +389,6 @@ static struct platform_device bfin_device_gpiokeys = { | |||
400 | }; | 389 | }; |
401 | #endif | 390 | #endif |
402 | 391 | ||
403 | static struct resource bfin_gpios_resources = { | ||
404 | .start = 0, | ||
405 | .end = MAX_BLACKFIN_GPIOS - 1, | ||
406 | .flags = IORESOURCE_IRQ, | ||
407 | }; | ||
408 | |||
409 | static struct platform_device bfin_gpios_device = { | ||
410 | .name = "simple-gpio", | ||
411 | .id = -1, | ||
412 | .num_resources = 1, | ||
413 | .resource = &bfin_gpios_resources, | ||
414 | }; | ||
415 | |||
416 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | 392 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
417 | #include <linux/i2c-gpio.h> | 393 | #include <linux/i2c-gpio.h> |
418 | 394 | ||
@@ -460,13 +436,21 @@ static struct platform_device bfin_dpmc = { | |||
460 | }, | 436 | }, |
461 | }; | 437 | }; |
462 | 438 | ||
439 | static struct i2c_board_info __initdata bfin_i2c_board_info[] = { | ||
440 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | ||
441 | { | ||
442 | I2C_BOARD_INFO("bfin-adv7393", 0x2B), | ||
443 | }, | ||
444 | #endif | ||
445 | }; | ||
446 | |||
463 | static struct platform_device *ezkit_devices[] __initdata = { | 447 | static struct platform_device *ezkit_devices[] __initdata = { |
464 | 448 | ||
465 | &bfin_dpmc, | 449 | &bfin_dpmc, |
466 | 450 | ||
467 | #if defined(CONFIG_MTD_PSD4256G) || defined(CONFIG_MTD_PSD4256G_MODULE) | 451 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) |
468 | &stm_pri_device_a, | 452 | &ezkit_flash_device_a, |
469 | &stm_pri_device_b, | 453 | &ezkit_flash_device_b, |
470 | #endif | 454 | #endif |
471 | 455 | ||
472 | #if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE) | 456 | #if defined(CONFIG_MTD_PLATRAM) || defined(CONFIG_MTD_PLATRAM_MODULE) |
@@ -482,10 +466,6 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
482 | &bfin_spi0_device, | 466 | &bfin_spi0_device, |
483 | #endif | 467 | #endif |
484 | 468 | ||
485 | #if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE) | ||
486 | &bfin_fb_adv7393_device, | ||
487 | #endif | ||
488 | |||
489 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) | 469 | #if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) |
490 | &rtc_device, | 470 | &rtc_device, |
491 | #endif | 471 | #endif |
@@ -507,8 +487,6 @@ static struct platform_device *ezkit_devices[] __initdata = { | |||
507 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) | 487 | #if defined(CONFIG_I2C_GPIO) || defined(CONFIG_I2C_GPIO_MODULE) |
508 | &i2c_gpio_device, | 488 | &i2c_gpio_device, |
509 | #endif | 489 | #endif |
510 | |||
511 | &bfin_gpios_device, | ||
512 | }; | 490 | }; |
513 | 491 | ||
514 | static int __init ezkit_init(void) | 492 | static int __init ezkit_init(void) |
@@ -516,6 +494,8 @@ static int __init ezkit_init(void) | |||
516 | printk(KERN_INFO "%s(): registering device resources\n", __func__); | 494 | printk(KERN_INFO "%s(): registering device resources\n", __func__); |
517 | platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); | 495 | platform_add_devices(ezkit_devices, ARRAY_SIZE(ezkit_devices)); |
518 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | 496 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
497 | i2c_register_board_info(0, bfin_i2c_board_info, | ||
498 | ARRAY_SIZE(bfin_i2c_board_info)); | ||
519 | return 0; | 499 | return 0; |
520 | } | 500 | } |
521 | 501 | ||