aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf533/boards/stamp.c
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-bf533/boards/stamp.c
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-bf533/boards/stamp.c')
-rw-r--r--arch/blackfin/mach-bf533/boards/stamp.c119
1 files changed, 102 insertions, 17 deletions
diff --git a/arch/blackfin/mach-bf533/boards/stamp.c b/arch/blackfin/mach-bf533/boards/stamp.c
index a9143c4cbdcd..8975e06ea158 100644
--- a/arch/blackfin/mach-bf533/boards/stamp.c
+++ b/arch/blackfin/mach-bf533/boards/stamp.c
@@ -37,8 +37,11 @@
37#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE) 37#if defined(CONFIG_USB_ISP1362_HCD) || defined(CONFIG_USB_ISP1362_HCD_MODULE)
38#include <linux/usb_isp1362.h> 38#include <linux/usb_isp1362.h>
39#endif 39#endif
40#include <linux/pata_platform.h>
40#include <linux/irq.h> 41#include <linux/irq.h>
42#include <asm/dma.h>
41#include <asm/bfin5xx_spi.h> 43#include <asm/bfin5xx_spi.h>
44#include <asm/reboot.h>
42 45
43/* 46/*
44 * Name the Board for the /proc/cpuinfo 47 * Name the Board for the /proc/cpuinfo
@@ -77,6 +80,12 @@ static struct platform_device smc91x_device = {
77}; 80};
78#endif 81#endif
79 82
83#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
84static struct platform_device bfin_fb_adv7393_device = {
85 .name = "bfin-adv7393",
86};
87#endif
88
80#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 89#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
81static struct resource net2272_bfin_resources[] = { 90static struct resource net2272_bfin_resources[] = {
82 { 91 {
@@ -177,7 +186,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
177 /* the modalias must be the same as spi device driver name */ 186 /* the modalias must be the same as spi device driver name */
178 .modalias = "m25p80", /* Name of spi_driver for this device */ 187 .modalias = "m25p80", /* Name of spi_driver for this device */
179 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 188 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
180 .bus_num = 1, /* Framework bus number */ 189 .bus_num = 0, /* Framework bus number */
181 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/ 190 .chip_select = 2, /* Framework chip select. On STAMP537 it is SPISSEL2*/
182 .platform_data = &bfin_spi_flash_data, 191 .platform_data = &bfin_spi_flash_data,
183 .controller_data = &spi_flash_chip_info, 192 .controller_data = &spi_flash_chip_info,
@@ -189,7 +198,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
189 { 198 {
190 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */ 199 .modalias = "bfin_spi_adc", /* Name of spi_driver for this device */
191 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */ 200 .max_speed_hz = 6250000, /* max spi clock (SCK) speed in HZ */
192 .bus_num = 1, /* Framework bus number */ 201 .bus_num = 0, /* Framework bus number */
193 .chip_select = 1, /* Framework chip select. */ 202 .chip_select = 1, /* Framework chip select. */
194 .platform_data = NULL, /* No spi_driver specific config */ 203 .platform_data = NULL, /* No spi_driver specific config */
195 .controller_data = &spi_adc_chip_info, 204 .controller_data = &spi_adc_chip_info,
@@ -200,7 +209,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
200 { 209 {
201 .modalias = "ad1836-spi", 210 .modalias = "ad1836-spi",
202 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */ 211 .max_speed_hz = 31250000, /* max spi clock (SCK) speed in HZ */
203 .bus_num = 1, 212 .bus_num = 0,
204 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT, 213 .chip_select = CONFIG_SND_BLACKFIN_SPI_PFBIT,
205 .controller_data = &ad1836_spi_chip_info, 214 .controller_data = &ad1836_spi_chip_info,
206 }, 215 },
@@ -210,7 +219,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
210 { 219 {
211 .modalias = "spi_mmc_dummy", 220 .modalias = "spi_mmc_dummy",
212 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 221 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
213 .bus_num = 1, 222 .bus_num = 0,
214 .chip_select = 0, 223 .chip_select = 0,
215 .platform_data = NULL, 224 .platform_data = NULL,
216 .controller_data = &spi_mmc_chip_info, 225 .controller_data = &spi_mmc_chip_info,
@@ -219,7 +228,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
219 { 228 {
220 .modalias = "spi_mmc", 229 .modalias = "spi_mmc",
221 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */ 230 .max_speed_hz = 25000000, /* max spi clock (SCK) speed in HZ */
222 .bus_num = 1, 231 .bus_num = 0,
223 .chip_select = CONFIG_SPI_MMC_CS_CHAN, 232 .chip_select = CONFIG_SPI_MMC_CS_CHAN,
224 .platform_data = NULL, 233 .platform_data = NULL,
225 .controller_data = &spi_mmc_chip_info, 234 .controller_data = &spi_mmc_chip_info,
@@ -231,16 +240,16 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
231 { 240 {
232 .modalias = "fxs-spi", 241 .modalias = "fxs-spi",
233 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 242 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
234 .bus_num = 1, 243 .bus_num = 0,
235 .chip_select = 3, 244 .chip_select = 8 - CONFIG_J11_JUMPER,
236 .controller_data = &spi_si3xxx_chip_info, 245 .controller_data = &spi_si3xxx_chip_info,
237 .mode = SPI_MODE_3, 246 .mode = SPI_MODE_3,
238 }, 247 },
239 { 248 {
240 .modalias = "fxo-spi", 249 .modalias = "fxo-spi",
241 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */ 250 .max_speed_hz = 12500000, /* max spi clock (SCK) speed in HZ */
242 .bus_num = 1, 251 .bus_num = 0,
243 .chip_select = 2, 252 .chip_select = 8 - CONFIG_J19_JUMPER,
244 .controller_data = &spi_si3xxx_chip_info, 253 .controller_data = &spi_si3xxx_chip_info,
245 .mode = SPI_MODE_3, 254 .mode = SPI_MODE_3,
246 }, 255 },
@@ -250,7 +259,7 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
250 { 259 {
251 .modalias = "ad5304_spi", 260 .modalias = "ad5304_spi",
252 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */ 261 .max_speed_hz = 1000000, /* max spi clock (SCK) speed in HZ */
253 .bus_num = 1, 262 .bus_num = 0,
254 .chip_select = 2, 263 .chip_select = 2,
255 .platform_data = NULL, 264 .platform_data = NULL,
256 .controller_data = &ad5304_chip_info, 265 .controller_data = &ad5304_chip_info,
@@ -259,17 +268,33 @@ static struct spi_board_info bfin_spi_board_info[] __initdata = {
259#endif 268#endif
260}; 269};
261 270
271/* SPI (0) */
272static struct resource bfin_spi0_resource[] = {
273 [0] = {
274 .start = SPI0_REGBASE,
275 .end = SPI0_REGBASE + 0xFF,
276 .flags = IORESOURCE_MEM,
277 },
278 [1] = {
279 .start = CH_SPI,
280 .end = CH_SPI,
281 .flags = IORESOURCE_IRQ,
282 }
283};
284
262/* SPI controller data */ 285/* SPI controller data */
263static struct bfin5xx_spi_master spi_bfin_master_info = { 286static struct bfin5xx_spi_master bfin_spi0_info = {
264 .num_chipselect = 8, 287 .num_chipselect = 8,
265 .enable_dma = 1, /* master has the ability to do dma transfer */ 288 .enable_dma = 1, /* master has the ability to do dma transfer */
266}; 289};
267 290
268static struct platform_device spi_bfin_master_device = { 291static struct platform_device bfin_spi0_device = {
269 .name = "bfin-spi-master", 292 .name = "bfin-spi",
270 .id = 1, /* Bus number */ 293 .id = 0, /* Bus number */
294 .num_resources = ARRAY_SIZE(bfin_spi0_resource),
295 .resource = bfin_spi0_resource,
271 .dev = { 296 .dev = {
272 .platform_data = &spi_bfin_master_info, /* Passed to driver */ 297 .platform_data = &bfin_spi0_info, /* Passed to driver */
273 }, 298 },
274}; 299};
275#endif /* spi master and devices */ 300#endif /* spi master and devices */
@@ -309,6 +334,43 @@ static struct platform_device bfin_sport1_uart_device = {
309}; 334};
310#endif 335#endif
311 336
337#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
338#define PATA_INT 55
339
340static struct pata_platform_info bfin_pata_platform_data = {
341 .ioport_shift = 1,
342 .irq_type = IRQF_TRIGGER_HIGH | IRQF_DISABLED,
343};
344
345static struct resource bfin_pata_resources[] = {
346 {
347 .start = 0x20314020,
348 .end = 0x2031403F,
349 .flags = IORESOURCE_MEM,
350 },
351 {
352 .start = 0x2031401C,
353 .end = 0x2031401F,
354 .flags = IORESOURCE_MEM,
355 },
356 {
357 .start = PATA_INT,
358 .end = PATA_INT,
359 .flags = IORESOURCE_IRQ,
360 },
361};
362
363static struct platform_device bfin_pata_device = {
364 .name = "pata_platform",
365 .id = -1,
366 .num_resources = ARRAY_SIZE(bfin_pata_resources),
367 .resource = bfin_pata_resources,
368 .dev = {
369 .platform_data = &bfin_pata_platform_data,
370 }
371};
372#endif
373
312static struct platform_device *stamp_devices[] __initdata = { 374static struct platform_device *stamp_devices[] __initdata = {
313#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE) 375#if defined(CONFIG_RTC_DRV_BFIN) || defined(CONFIG_RTC_DRV_BFIN_MODULE)
314 &rtc_device, 376 &rtc_device,
@@ -318,12 +380,16 @@ static struct platform_device *stamp_devices[] __initdata = {
318 &smc91x_device, 380 &smc91x_device,
319#endif 381#endif
320 382
383#if defined(CONFIG_FB_BFIN_7393) || defined(CONFIG_FB_BFIN_7393_MODULE)
384 &bfin_fb_adv7393_device,
385#endif
386
321#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE) 387#if defined(CONFIG_USB_NET2272) || defined(CONFIG_USB_NET2272_MODULE)
322 &net2272_bfin_device, 388 &net2272_bfin_device,
323#endif 389#endif
324 390
325#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 391#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
326 &spi_bfin_master_device, 392 &bfin_spi0_device,
327#endif 393#endif
328 394
329#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 395#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
@@ -334,6 +400,10 @@ static struct platform_device *stamp_devices[] __initdata = {
334 &bfin_sport0_uart_device, 400 &bfin_sport0_uart_device,
335 &bfin_sport1_uart_device, 401 &bfin_sport1_uart_device,
336#endif 402#endif
403
404#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
405 &bfin_pata_device,
406#endif
337}; 407};
338 408
339static int __init stamp_init(void) 409static int __init stamp_init(void)
@@ -355,8 +425,23 @@ static int __init stamp_init(void)
355#endif 425#endif
356 426
357#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 427#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)
358 return spi_register_board_info(bfin_spi_board_info, ARRAY_SIZE(bfin_spi_board_info)); 428 spi_register_board_info(bfin_spi_board_info,
429 ARRAY_SIZE(bfin_spi_board_info));
430#endif
431#if defined(CONFIG_PATA_PLATFORM) || defined(CONFIG_PATA_PLATFORM_MODULE)
432 irq_desc[PATA_INT].status |= IRQ_NOAUTOEN;
359#endif 433#endif
434 return 0;
360} 435}
361 436
362arch_initcall(stamp_init); 437arch_initcall(stamp_init);
438
439void native_machine_restart(char *cmd)
440{
441#if defined(CONFIG_BFIN_SHARED_FLASH_ENET)
442# define BIT_TO_SET (1 << CONFIG_ENET_FLASH_PIN)
443 bfin_write_FIO_INEN(~BIT_TO_SET);
444 bfin_write_FIO_DIR(BIT_TO_SET);
445 bfin_write_FIO_FLAG_C(BIT_TO_SET);
446#endif
447}