diff options
author | Bryan Wu <bryan.wu@analog.com> | 2007-10-10 13:20:06 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-10-10 13:20:06 -0400 |
commit | c6c4d7bbbb498c38afa05688dfc2784948a0c4e2 (patch) | |
tree | 9ebefb1b6c6ceff6e83eda3dfcbd616a725ecced /arch/blackfin/mach-bf533/boards/cm_bf533.c | |
parent | bbf25010f1a6b761914430f5fca081ec8c7accd1 (diff) |
Blackfin arch: update platform driver resource information to all board files
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'arch/blackfin/mach-bf533/boards/cm_bf533.c')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/cm_bf533.c | 81 |
1 files changed, 72 insertions, 9 deletions
diff --git a/arch/blackfin/mach-bf533/boards/cm_bf533.c b/arch/blackfin/mach-bf533/boards/cm_bf533.c index 4545f363e641..a57b52d207cd 100644 --- a/arch/blackfin/mach-bf533/boards/cm_bf533.c +++ b/arch/blackfin/mach-bf533/boards/cm_bf533.c | |||
@@ -34,7 +34,9 @@ | |||
34 | #include <linux/spi/spi.h> | 34 | #include <linux/spi/spi.h> |
35 | #include <linux/spi/flash.h> | 35 | #include <linux/spi/flash.h> |
36 | #include <linux/usb_isp1362.h> | 36 | #include <linux/usb_isp1362.h> |
37 | #include <linux/pata_platform.h> | ||
37 | #include <linux/irq.h> | 38 | #include <linux/irq.h> |
39 | #include <asm/dma.h> | ||
38 | #include <asm/bfin5xx_spi.h> | 40 | #include <asm/bfin5xx_spi.h> |
39 | 41 | ||
40 | /* | 42 | /* |
@@ -93,7 +95,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
93 | /* the modalias must be the same as spi device driver name */ | 95 | /* the modalias must be the same as spi device driver name */ |
94 | .modalias = "m25p80", /* Name of spi_driver for this device */ | 96 | .modalias = "m25p80", /* Name of spi_driver for this device */ |
95 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ | 97 | .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ |
96 | .bus_num = 1, /* Framework bus number */ | 98 | .bus_num = 0, /* Framework bus number */ |
97 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ | 99 | .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ |
98 | .platform_data = &bfin_spi_flash_data, | 100 | .platform_data = &bfin_spi_flash_data, |
99 | .controller_data = &spi_flash_chip_info, | 101 | .controller_data = &spi_flash_chip_info, |
@@ -101,7 +103,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
101 | }, { | 103 | }, { |
102 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ | 104 | .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ |
103 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ | 105 | .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ |
104 | .bus_num = 1, /* Framework bus number */ | 106 | .bus_num = 0, /* Framework bus number */ |
105 | .chip_select = 2, /* Framework chip select. */ | 107 | .chip_select = 2, /* Framework chip select. */ |
106 | .platform_data = NULL, /* No spi_driver specific config */ | 108 | .platform_data = NULL, /* No spi_driver specific config */ |
107 | .controller_data = &spi_adc_chip_info, | 109 | .controller_data = &spi_adc_chip_info, |
@@ -110,24 +112,40 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = { | |||
110 | { | 112 | { |
111 | .modalias = "ad1836-spi", | 113 | .modalias = "ad1836-spi", |
112 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ | 114 | .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ |
113 | .bus_num = 1, | 115 | .bus_num = 0, |
114 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, | 116 | .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, |
115 | .controller_data = &ad1836_spi_chip_info, | 117 | .controller_data = &ad1836_spi_chip_info, |
116 | }, | 118 | }, |
117 | #endif | 119 | #endif |
118 | }; | 120 | }; |
119 | 121 | ||
122 | /* SPI (0) */ | ||
123 | static struct resource bfin_spi0_resource[] = { | ||
124 | [0] = { | ||
125 | .start = SPI0_REGBASE, | ||
126 | .end = SPI0_REGBASE + 0xFF, | ||
127 | .flags = IORESOURCE_MEM, | ||
128 | }, | ||
129 | [1] = { | ||
130 | .start = CH_SPI, | ||
131 | .end = CH_SPI, | ||
132 | .flags = IORESOURCE_IRQ, | ||
133 | } | ||
134 | }; | ||
135 | |||
120 | /* SPI controller data */ | 136 | /* SPI controller data */ |
121 | static struct bfin5xx_spi_master spi_bfin_master_info = { | 137 | static struct bfin5xx_spi_master bfin_spi0_info = { |
122 | .num_chipselect = 8, | 138 | .num_chipselect = 8, |
123 | .enable_dma = 1, /* master has the ability to do dma transfer */ | 139 | .enable_dma = 1, /* master has the ability to do dma transfer */ |
124 | }; | 140 | }; |
125 | 141 | ||
126 | static struct platform_device spi_bfin_master_device = { | 142 | static struct platform_device bfin_spi0_device = { |
127 | .name = "bfin-spi-master", | 143 | .name = "bfin-spi", |
128 | .id = 1, /* Bus number */ | 144 | .id = 0, /* Bus number */ |
145 | .num_resources = ARRAY_SIZE(bfin_spi0_resource), | ||
146 | .resource = bfin_spi0_resource, | ||
129 | .dev = { | 147 | .dev = { |
130 | .platform_data = &spi_bfin_master_info, /* Passed to driver */ | 148 | .platform_data = &bfin_spi0_info, /* Passed to driver */ |
131 | }, | 149 | }, |
132 | }; | 150 | }; |
133 | #endif /* spi master and devices */ | 151 | #endif /* spi master and devices */ |
@@ -227,6 +245,43 @@ static struct platform_device isp1362_hcd_device = { | |||
227 | }; | 245 | }; |
228 | #endif | 246 | #endif |
229 | 247 | ||
248 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
249 | #define PATA_INT 38 | ||
250 | |||
251 | static struct pata_platform_info bfin_pata_platform_data = { | ||
252 | .ioport_shift = 2, | ||
253 | .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED, | ||
254 | }; | ||
255 | |||
256 | static struct resource bfin_pata_resources[] = { | ||
257 | { | ||
258 | .start = 0x2030C000, | ||
259 | .end = 0x2030C01F, | ||
260 | .flags = IORESOURCE_MEM, | ||
261 | }, | ||
262 | { | ||
263 | .start = 0x2030D018, | ||
264 | .end = 0x2030D01B, | ||
265 | .flags = IORESOURCE_MEM, | ||
266 | }, | ||
267 | { | ||
268 | .start = PATA_INT, | ||
269 | .end = PATA_INT, | ||
270 | .flags = IORESOURCE_IRQ, | ||
271 | }, | ||
272 | }; | ||
273 | |||
274 | static struct platform_device bfin_pata_device = { | ||
275 | .name = "pata_platform", | ||
276 | .id = -1, | ||
277 | .num_resources = ARRAY_SIZE(bfin_pata_resources), | ||
278 | .resource = bfin_pata_resources, | ||
279 | .dev = { | ||
280 | .platform_data = &bfin_pata_platform_data, | ||
281 | } | ||
282 | }; | ||
283 | #endif | ||
284 | |||
230 | static struct platform_device *cm_bf533_devices[] __initdata = { | 285 | static struct platform_device *cm_bf533_devices[] __initdata = { |
231 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 286 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
232 | &bfin_uart_device, | 287 | &bfin_uart_device, |
@@ -250,7 +305,11 @@ static struct platform_device *cm_bf533_devices[] __initdata = { | |||
250 | #endif | 305 | #endif |
251 | 306 | ||
252 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 307 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
253 | &spi_bfin_master_device, | 308 | &bfin_spi0_device, |
309 | #endif | ||
310 | |||
311 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
312 | &bfin_pata_device, | ||
254 | #endif | 313 | #endif |
255 | }; | 314 | }; |
256 | 315 | ||
@@ -261,6 +320,10 @@ static int __init cm_bf533_init(void) | |||
261 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) | 320 | #if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) |
262 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); | 321 | spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); |
263 | #endif | 322 | #endif |
323 | |||
324 | #if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE) | ||
325 | irq_desc[PATA_INT].status |= IRQ_NOAUTOEN; | ||
326 | #endif | ||
264 | return 0; | 327 | return 0; |
265 | } | 328 | } |
266 | 329 | ||