aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf561
diff options
context:
space:
mode:
authorBryan Wu <bryan.wu@analog.com>2007-10-10 13:20:06 -0400
committerBryan Wu <bryan.wu@analog.com>2007-10-10 13:20:06 -0400
commitc6c4d7bbbb498c38afa05688dfc2784948a0c4e2 (patch)
tree9ebefb1b6c6ceff6e83eda3dfcbd616a725ecced /arch/blackfin/mach-bf561
parentbbf25010f1a6b761914430f5fca081ec8c7accd1 (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-bf561')
-rw-r--r--arch/blackfin/mach-bf561/boards/cm_bf561.c84
-rw-r--r--arch/blackfin/mach-bf561/boards/ezkit.c82
2 files changed, 147 insertions, 19 deletions
diff --git a/arch/blackfin/mach-bf561/boards/cm_bf561.c b/arch/blackfin/mach-bf561/boards/cm_bf561.c
index 5b2b544529a1..cd827a1b6ba1 100644
--- a/arch/blackfin/mach-bf561/boards/cm_bf561.c
+++ b/arch/blackfin/mach-bf561/boards/cm_bf561.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/*
@@ -112,7 +114,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
112 /* the modalias must be the same as spi device driver name */ 114 /* the modalias must be the same as spi device driver name */
113 .modalias = "m25p80", /* Name of spi_driver for this device */ 115 .modalias = "m25p80", /* Name of spi_driver for this device */
114 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 116 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
115 .bus_num = 1, /* Framework bus number */ 117 .bus_num = 0, /* Framework bus number */
116 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/ 118 .chip_select = 1, /* Framework chip select. On STAMP537 it is SPISSEL1*/
117 .platform_data = &bfin_spi_flash_data, 119 .platform_data = &bfin_spi_flash_data,
118 .controller_data = &spi_flash_chip_info, 120 .controller_data = &spi_flash_chip_info,
@@ -124,7 +126,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
124 { 126 {
125 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 127 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
126 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 128 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
127 .bus_num = 1, /* Framework bus number */ 129 .bus_num = 0, /* Framework bus number */
128 .chip_select = 1, /* Framework chip select. */ 130 .chip_select = 1, /* Framework chip select. */
129 .platform_data = NULL, /* No spi_driver specific config */ 131 .platform_data = NULL, /* No spi_driver specific config */
130 .controller_data = &spi_adc_chip_info, 132 .controller_data = &spi_adc_chip_info,
@@ -135,7 +137,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
135 { 137 {
136 .modalias = "ad1836-spi", 138 .modalias = "ad1836-spi",
137 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 139 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
138 .bus_num = 1, 140 .bus_num = 0,
139 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 141 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
140 .controller_data = &ad1836_spi_chip_info, 142 .controller_data = &ad1836_spi_chip_info,
141 }, 143 },
@@ -144,7 +146,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
144 { 146 {
145 .modalias = "ad9960-spi", 147 .modalias = "ad9960-spi",
146 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */ 148 .max_speed_hz = 10000000, /* max spi clock (SCK) speed in HZ */
147 .bus_num = 1, 149 .bus_num = 0,
148 .chip_select = 1, 150 .chip_select = 1,
149 .controller_data = &ad9960_spi_chip_info, 151 .controller_data = &ad9960_spi_chip_info,
150 }, 152 },
@@ -153,7 +155,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
153 { 155 {
154 .modalias = "spi_mmc", 156 .modalias = "spi_mmc",
155 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 157 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
156 .bus_num = 1, 158 .bus_num = 0,
157 .chip_select = CONFIG_SPI_MMC_CS_CHAN, 159 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
158 .platform_data = NULL, 160 .platform_data = NULL,
159 .controller_data = &spi_mmc_chip_info, 161 .controller_data = &spi_mmc_chip_info,
@@ -162,17 +164,33 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
162#endif 164#endif
163}; 165};
164 166
167/* SPI (0) */
168static struct resource bfin_spi0_resource[] = {
169 [0] = {
170 .start = SPI0_REGBASE,
171 .end = SPI0_REGBASE + 0xFF,
172 .flags = IORESOURCE_MEM,
173 },
174 [1] = {
175 .start = CH_SPI,
176 .end = CH_SPI,
177 .flags = IORESOURCE_IRQ,
178 }
179};
180
165/* SPI controller data */ 181/* SPI controller data */
166static struct bfin5xx_spi_master spi_bfin_master_info = { 182static struct bfin5xx_spi_master bfin_spi0_info = {
167 .num_chipselect = 8, 183 .num_chipselect = 8,
168 .enable_dma = 1, /* master has the ability to do dma transfer */ 184 .enable_dma = 1, /* master has the ability to do dma transfer */
169}; 185};
170 186
171static struct platform_device spi_bfin_master_device = { 187static struct platform_device bfin_spi0_device = {
172 .name = "bfin-spi-master", 188 .name = "bfin-spi",
173 .id = 1, /* Bus number */ 189 .id = 0, /* Bus number */
190 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
191 .resource = bfin_spi0_resource,
174 .dev = { 192 .dev = {
175 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 193 .platform_data = &bfin_spi0_info, /* Passed to driver */
176 }, 194 },
177}; 195};
178#endif /* spi master and devices */ 196#endif /* spi master and devices */
@@ -256,6 +274,43 @@ static struct platform_device bfin_uart_device = {
256}; 274};
257#endif 275#endif
258 276
277#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
278#define PATA_INT 119
279
280static struct pata_platform_info bfin_pata_platform_data = {
281 .ioport_shift = 2,
282 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
283};
284
285static struct resource bfin_pata_resources[] = {
286 {
287 .start = 0x2400C000,
288 .end = 0x2400C001F,
289 .flags = IORESOURCE_MEM,
290 },
291 {
292 .start = 0x2400D018,
293 .end = 0x2400D01B,
294 .flags = IORESOURCE_MEM,
295 },
296 {
297 .start = PATA_INT,
298 .end = PATA_INT,
299 .flags = IORESOURCE_IRQ,
300 },
301};
302
303static struct platform_device bfin_pata_device = {
304 .name = "pata_platform",
305 .id = -1,
306 .num_resources = ARRAY_SIZE(bfin_pata_resources),
307 .resource = bfin_pata_resources,
308 .dev = {
309 .platform_data = &bfin_pata_platform_data,
310 }
311};
312#endif
313
259static struct platform_device *cm_bf561_devices[] __initdata = { 314static struct platform_device *cm_bf561_devices[] __initdata = {
260 315
261#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 316#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
@@ -271,9 +326,12 @@ static struct platform_device *cm_bf561_devices[] __initdata = {
271#endif 326#endif
272 327
273#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 328#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
274 &spi_bfin_master_device, 329 &bfin_spi0_device,
275#endif 330#endif
276 331
332#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
333 &bfin_pata_device,
334#endif
277}; 335};
278 336
279static int __init cm_bf561_init(void) 337static int __init cm_bf561_init(void)
@@ -283,6 +341,10 @@ static int __init cm_bf561_init(void)
283#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 341#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
284 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 342 spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info));
285#endif 343#endif
344
345#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
346 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
347#endif
286 return 0; 348 return 0;
287} 349}
288 350
diff --git a/arch/blackfin/mach-bf561/boards/ezkit.c b/arch/blackfin/mach-bf561/boards/ezkit.c
index 724191da20a2..57e14edca8b1 100644
--- a/arch/blackfin/mach-bf561/boards/ezkit.c
+++ b/arch/blackfin/mach-bf561/boards/ezkit.c
@@ -32,6 +32,8 @@
32#include <linux/spi/spi.h> 32#include <linux/spi/spi.h>
33#include <linux/irq.h> 33#include <linux/irq.h>
34#include <linux/interrupt.h> 34#include <linux/interrupt.h>
35#include <linux/pata_platform.h>
36#include <asm/dma.h>
35#include <asm/bfin5xx_spi.h> 37#include <asm/bfin5xx_spi.h>
36 38
37/* 39/*
@@ -140,17 +142,33 @@ static struct bfin5xx_spi_chip ad1836_spi_chip_info = {
140#endif 142#endif
141#endif 143#endif
142 144
145/* SPI (0) */
146static struct resource bfin_spi0_resource[] = {
147 [0] = {
148 .start = SPI0_REGBASE,
149 .end = SPI0_REGBASE + 0xFF,
150 .flags = IORESOURCE_MEM,
151 },
152 [1] = {
153 .start = CH_SPI,
154 .end = CH_SPI,
155 .flags = IORESOURCE_IRQ,
156 }
157};
158
143/* SPI controller data */ 159/* SPI controller data */
144static struct bfin5xx_spi_master spi_bfin_master_info = { 160static struct bfin5xx_spi_master bfin_spi0_info = {
145 .num_chipselect = 8, 161 .num_chipselect = 8,
146 .enable_dma = 1, /* master has the ability to do dma transfer */ 162 .enable_dma = 1, /* master has the ability to do dma transfer */
147}; 163};
148 164
149static struct platform_device spi_bfin_master_device = { 165static struct platform_device bfin_spi0_device = {
150 .name = "bfin-spi-master", 166 .name = "bfin-spi",
151 .id = 1, /* Bus number */ 167 .id = 0, /* Bus number */
168 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
169 .resource = bfin_spi0_resource,
152 .dev = { 170 .dev = {
153 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 171 .platform_data = &bfin_spi0_info, /* Passed to driver */
154 }, 172 },
155}; 173};
156 174
@@ -160,23 +178,63 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
160 { 178 {
161 .modalias = "ad1836-spi", 179 .modalias = "ad1836-spi",
162 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */ 180 .max_speed_hz = 3125000, /* max spi clock (SCK) speed in HZ */
163 .bus_num = 1, 181 .bus_num = 0,
164 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 182 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
165 .controller_data = &ad1836_spi_chip_info, 183 .controller_data = &ad1836_spi_chip_info,
166 }, 184 },
167#endif 185#endif
168}; 186};
169 187
188#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
189#define PATA_INT 55
190
191static struct pata_platform_info bfin_pata_platform_data = {
192 .ioport_shift = 1,
193 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
194};
195
196static struct resource bfin_pata_resources[] = {
197 {
198 .start = 0x20314020,
199 .end = 0x2031403F,
200 .flags = IORESOURCE_MEM,
201 },
202 {
203 .start = 0x2031401C,
204 .end = 0x2031401F,
205 .flags = IORESOURCE_MEM,
206 },
207 {
208 .start = PATA_INT,
209 .end = PATA_INT,
210 .flags = IORESOURCE_IRQ,
211 },
212};
213
214static struct platform_device bfin_pata_device = {
215 .name = "pata_platform",
216 .id = -1,
217 .num_resources = ARRAY_SIZE(bfin_pata_resources),
218 .resource = bfin_pata_resources,
219 .dev = {
220 .platform_data = &bfin_pata_platform_data,
221 }
222};
223#endif
224
170static struct platform_device *ezkit_devices[] __initdata = { 225static struct platform_device *ezkit_devices[] __initdata = {
171#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE) 226#if defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)
172 &smc91x_device, 227 &smc91x_device,
173#endif 228#endif
174#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 229#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
175 &spi_bfin_master_device, 230 &bfin_spi0_device,
176#endif 231#endif
177#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 232#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
178 &bfin_uart_device, 233 &bfin_uart_device,
179#endif 234#endif
235#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
236 &bfin_pata_device,
237#endif
180}; 238};
181 239
182static int __init ezkit_init(void) 240static int __init ezkit_init(void)
@@ -194,7 +252,15 @@ static int __init ezkit_init(void)
194 SSYNC(); 252 SSYNC();
195#endif 253#endif
196 254
197 return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 255#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
256 spi_register_board_info(bfin_spi_board_info,
257 ARRAY_SIZE(bfin_spi_board_info));
258#endif
259
260#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
261 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
262#endif
263 return 0;
198} 264}
199 265
200arch_initcall(ezkit_init); 266arch_initcall(ezkit_init);