2 * DA8XX/OMAP L1XX platform device data
4 * Copyright (c) 2007-2009, MontaVista Software, Inc. <source@mvista.com>
5 * Derived from code that was:
6 * Copyright (C) 2006 Komal Shah <komal_shah802003@yahoo.com>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 #include <linux/init.h>
14 #include <linux/platform_device.h>
15 #include <linux/dma-mapping.h>
16 #include <linux/serial_8250.h>
18 #include <mach/cputype.h>
19 #include <mach/common.h>
20 #include <mach/time.h>
21 #include <mach/da8xx.h>
22 #include <mach/cpuidle.h>
26 #define DA8XX_TPCC_BASE 0x01c00000
27 #define DA8XX_TPTC0_BASE 0x01c08000
28 #define DA8XX_TPTC1_BASE 0x01c08400
29 #define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */
30 #define DA8XX_I2C0_BASE 0x01c22000
31 #define DA8XX_RTC_BASE 0x01c23000
32 #define DA8XX_MMCSD0_BASE 0x01c40000
33 #define DA8XX_SPI0_BASE 0x01c41000
34 #define DA830_SPI1_BASE 0x01e12000
35 #define DA8XX_LCD_CNTRL_BASE 0x01e13000
36 #define DA850_MMCSD1_BASE 0x01e1b000
37 #define DA8XX_EMAC_CPPI_PORT_BASE 0x01e20000
38 #define DA8XX_EMAC_CPGMACSS_BASE 0x01e22000
39 #define DA8XX_EMAC_CPGMAC_BASE 0x01e23000
40 #define DA8XX_EMAC_MDIO_BASE 0x01e24000
41 #define DA8XX_I2C1_BASE 0x01e28000
42 #define DA850_TPCC1_BASE 0x01e30000
43 #define DA850_TPTC2_BASE 0x01e38000
44 #define DA850_SPI1_BASE 0x01f0e000
45 #define DA8XX_DDR2_CTL_BASE 0xb0000000
47 #define DA8XX_EMAC_CTRL_REG_OFFSET 0x3000
48 #define DA8XX_EMAC_MOD_REG_OFFSET 0x2000
49 #define DA8XX_EMAC_RAM_OFFSET 0x0000
50 #define DA8XX_EMAC_CTRL_RAM_SIZE SZ_8K
52 #define DA8XX_DMA_SPI0_RX EDMA_CTLR_CHAN(0, 14)
53 #define DA8XX_DMA_SPI0_TX EDMA_CTLR_CHAN(0, 15)
54 #define DA8XX_DMA_MMCSD0_RX EDMA_CTLR_CHAN(0, 16)
55 #define DA8XX_DMA_MMCSD0_TX EDMA_CTLR_CHAN(0, 17)
56 #define DA8XX_DMA_SPI1_RX EDMA_CTLR_CHAN(0, 18)
57 #define DA8XX_DMA_SPI1_TX EDMA_CTLR_CHAN(0, 19)
58 #define DA850_DMA_MMCSD1_RX EDMA_CTLR_CHAN(1, 28)
59 #define DA850_DMA_MMCSD1_TX EDMA_CTLR_CHAN(1, 29)
61 void __iomem
*da8xx_syscfg0_base
;
62 void __iomem
*da8xx_syscfg1_base
;
64 static struct plat_serial8250_port da8xx_serial_pdata
[] = {
66 .mapbase
= DA8XX_UART0_BASE
,
67 .irq
= IRQ_DA8XX_UARTINT0
,
68 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
|
74 .mapbase
= DA8XX_UART1_BASE
,
75 .irq
= IRQ_DA8XX_UARTINT1
,
76 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
|
82 .mapbase
= DA8XX_UART2_BASE
,
83 .irq
= IRQ_DA8XX_UARTINT2
,
84 .flags
= UPF_BOOT_AUTOCONF
| UPF_SKIP_TEST
|
94 struct platform_device da8xx_serial_device
= {
96 .id
= PLAT8250_DEV_PLATFORM
,
98 .platform_data
= da8xx_serial_pdata
,
102 static const s8 da8xx_queue_tc_mapping
[][2] = {
103 /* {event queue no, TC no} */
109 static const s8 da8xx_queue_priority_mapping
[][2] = {
110 /* {event queue no, Priority} */
116 static const s8 da850_queue_tc_mapping
[][2] = {
117 /* {event queue no, TC no} */
122 static const s8 da850_queue_priority_mapping
[][2] = {
123 /* {event queue no, Priority} */
128 static struct edma_soc_info da830_edma_cc0_info
= {
134 .queue_tc_mapping
= da8xx_queue_tc_mapping
,
135 .queue_priority_mapping
= da8xx_queue_priority_mapping
,
138 static struct edma_soc_info
*da830_edma_info
[EDMA_MAX_CC
] = {
139 &da830_edma_cc0_info
,
142 static struct edma_soc_info da850_edma_cc_info
[] = {
149 .queue_tc_mapping
= da8xx_queue_tc_mapping
,
150 .queue_priority_mapping
= da8xx_queue_priority_mapping
,
158 .queue_tc_mapping
= da850_queue_tc_mapping
,
159 .queue_priority_mapping
= da850_queue_priority_mapping
,
163 static struct edma_soc_info
*da850_edma_info
[EDMA_MAX_CC
] = {
164 &da850_edma_cc_info
[0],
165 &da850_edma_cc_info
[1],
168 static struct resource da830_edma_resources
[] = {
171 .start
= DA8XX_TPCC_BASE
,
172 .end
= DA8XX_TPCC_BASE
+ SZ_32K
- 1,
173 .flags
= IORESOURCE_MEM
,
177 .start
= DA8XX_TPTC0_BASE
,
178 .end
= DA8XX_TPTC0_BASE
+ SZ_1K
- 1,
179 .flags
= IORESOURCE_MEM
,
183 .start
= DA8XX_TPTC1_BASE
,
184 .end
= DA8XX_TPTC1_BASE
+ SZ_1K
- 1,
185 .flags
= IORESOURCE_MEM
,
189 .start
= IRQ_DA8XX_CCINT0
,
190 .flags
= IORESOURCE_IRQ
,
194 .start
= IRQ_DA8XX_CCERRINT
,
195 .flags
= IORESOURCE_IRQ
,
199 static struct resource da850_edma_resources
[] = {
202 .start
= DA8XX_TPCC_BASE
,
203 .end
= DA8XX_TPCC_BASE
+ SZ_32K
- 1,
204 .flags
= IORESOURCE_MEM
,
208 .start
= DA8XX_TPTC0_BASE
,
209 .end
= DA8XX_TPTC0_BASE
+ SZ_1K
- 1,
210 .flags
= IORESOURCE_MEM
,
214 .start
= DA8XX_TPTC1_BASE
,
215 .end
= DA8XX_TPTC1_BASE
+ SZ_1K
- 1,
216 .flags
= IORESOURCE_MEM
,
220 .start
= DA850_TPCC1_BASE
,
221 .end
= DA850_TPCC1_BASE
+ SZ_32K
- 1,
222 .flags
= IORESOURCE_MEM
,
226 .start
= DA850_TPTC2_BASE
,
227 .end
= DA850_TPTC2_BASE
+ SZ_1K
- 1,
228 .flags
= IORESOURCE_MEM
,
232 .start
= IRQ_DA8XX_CCINT0
,
233 .flags
= IORESOURCE_IRQ
,
237 .start
= IRQ_DA8XX_CCERRINT
,
238 .flags
= IORESOURCE_IRQ
,
242 .start
= IRQ_DA850_CCINT1
,
243 .flags
= IORESOURCE_IRQ
,
247 .start
= IRQ_DA850_CCERRINT1
,
248 .flags
= IORESOURCE_IRQ
,
252 static struct platform_device da830_edma_device
= {
256 .platform_data
= da830_edma_info
,
258 .num_resources
= ARRAY_SIZE(da830_edma_resources
),
259 .resource
= da830_edma_resources
,
262 static struct platform_device da850_edma_device
= {
266 .platform_data
= da850_edma_info
,
268 .num_resources
= ARRAY_SIZE(da850_edma_resources
),
269 .resource
= da850_edma_resources
,
272 int __init
da830_register_edma(struct edma_rsv_info
*rsv
)
274 da830_edma_cc0_info
.rsv
= rsv
;
276 return platform_device_register(&da830_edma_device
);
279 int __init
da850_register_edma(struct edma_rsv_info
*rsv
[2])
282 da850_edma_cc_info
[0].rsv
= rsv
[0];
283 da850_edma_cc_info
[1].rsv
= rsv
[1];
286 return platform_device_register(&da850_edma_device
);
289 static struct resource da8xx_i2c_resources0
[] = {
291 .start
= DA8XX_I2C0_BASE
,
292 .end
= DA8XX_I2C0_BASE
+ SZ_4K
- 1,
293 .flags
= IORESOURCE_MEM
,
296 .start
= IRQ_DA8XX_I2CINT0
,
297 .end
= IRQ_DA8XX_I2CINT0
,
298 .flags
= IORESOURCE_IRQ
,
302 static struct platform_device da8xx_i2c_device0
= {
303 .name
= "i2c_davinci",
305 .num_resources
= ARRAY_SIZE(da8xx_i2c_resources0
),
306 .resource
= da8xx_i2c_resources0
,
309 static struct resource da8xx_i2c_resources1
[] = {
311 .start
= DA8XX_I2C1_BASE
,
312 .end
= DA8XX_I2C1_BASE
+ SZ_4K
- 1,
313 .flags
= IORESOURCE_MEM
,
316 .start
= IRQ_DA8XX_I2CINT1
,
317 .end
= IRQ_DA8XX_I2CINT1
,
318 .flags
= IORESOURCE_IRQ
,
322 static struct platform_device da8xx_i2c_device1
= {
323 .name
= "i2c_davinci",
325 .num_resources
= ARRAY_SIZE(da8xx_i2c_resources1
),
326 .resource
= da8xx_i2c_resources1
,
329 int __init
da8xx_register_i2c(int instance
,
330 struct davinci_i2c_platform_data
*pdata
)
332 struct platform_device
*pdev
;
335 pdev
= &da8xx_i2c_device0
;
336 else if (instance
== 1)
337 pdev
= &da8xx_i2c_device1
;
341 pdev
->dev
.platform_data
= pdata
;
342 return platform_device_register(pdev
);
345 static struct resource da8xx_watchdog_resources
[] = {
347 .start
= DA8XX_WDOG_BASE
,
348 .end
= DA8XX_WDOG_BASE
+ SZ_4K
- 1,
349 .flags
= IORESOURCE_MEM
,
353 struct platform_device da8xx_wdt_device
= {
356 .num_resources
= ARRAY_SIZE(da8xx_watchdog_resources
),
357 .resource
= da8xx_watchdog_resources
,
360 int __init
da8xx_register_watchdog(void)
362 return platform_device_register(&da8xx_wdt_device
);
365 static struct resource da8xx_emac_resources
[] = {
367 .start
= DA8XX_EMAC_CPPI_PORT_BASE
,
368 .end
= DA8XX_EMAC_CPPI_PORT_BASE
+ SZ_16K
- 1,
369 .flags
= IORESOURCE_MEM
,
372 .start
= IRQ_DA8XX_C0_RX_THRESH_PULSE
,
373 .end
= IRQ_DA8XX_C0_RX_THRESH_PULSE
,
374 .flags
= IORESOURCE_IRQ
,
377 .start
= IRQ_DA8XX_C0_RX_PULSE
,
378 .end
= IRQ_DA8XX_C0_RX_PULSE
,
379 .flags
= IORESOURCE_IRQ
,
382 .start
= IRQ_DA8XX_C0_TX_PULSE
,
383 .end
= IRQ_DA8XX_C0_TX_PULSE
,
384 .flags
= IORESOURCE_IRQ
,
387 .start
= IRQ_DA8XX_C0_MISC_PULSE
,
388 .end
= IRQ_DA8XX_C0_MISC_PULSE
,
389 .flags
= IORESOURCE_IRQ
,
393 struct emac_platform_data da8xx_emac_pdata
= {
394 .ctrl_reg_offset
= DA8XX_EMAC_CTRL_REG_OFFSET
,
395 .ctrl_mod_reg_offset
= DA8XX_EMAC_MOD_REG_OFFSET
,
396 .ctrl_ram_offset
= DA8XX_EMAC_RAM_OFFSET
,
397 .ctrl_ram_size
= DA8XX_EMAC_CTRL_RAM_SIZE
,
398 .version
= EMAC_VERSION_2
,
401 static struct platform_device da8xx_emac_device
= {
402 .name
= "davinci_emac",
405 .platform_data
= &da8xx_emac_pdata
,
407 .num_resources
= ARRAY_SIZE(da8xx_emac_resources
),
408 .resource
= da8xx_emac_resources
,
411 static struct resource da8xx_mdio_resources
[] = {
413 .start
= DA8XX_EMAC_MDIO_BASE
,
414 .end
= DA8XX_EMAC_MDIO_BASE
+ SZ_4K
- 1,
415 .flags
= IORESOURCE_MEM
,
419 static struct platform_device da8xx_mdio_device
= {
420 .name
= "davinci_mdio",
422 .num_resources
= ARRAY_SIZE(da8xx_mdio_resources
),
423 .resource
= da8xx_mdio_resources
,
426 int __init
da8xx_register_emac(void)
430 ret
= platform_device_register(&da8xx_mdio_device
);
433 ret
= platform_device_register(&da8xx_emac_device
);
436 ret
= clk_add_alias(NULL
, dev_name(&da8xx_mdio_device
.dev
),
437 NULL
, &da8xx_emac_device
.dev
);
441 static struct resource da830_mcasp1_resources
[] = {
444 .start
= DAVINCI_DA830_MCASP1_REG_BASE
,
445 .end
= DAVINCI_DA830_MCASP1_REG_BASE
+ (SZ_1K
* 12) - 1,
446 .flags
= IORESOURCE_MEM
,
450 .start
= DAVINCI_DA830_DMA_MCASP1_AXEVT
,
451 .end
= DAVINCI_DA830_DMA_MCASP1_AXEVT
,
452 .flags
= IORESOURCE_DMA
,
456 .start
= DAVINCI_DA830_DMA_MCASP1_AREVT
,
457 .end
= DAVINCI_DA830_DMA_MCASP1_AREVT
,
458 .flags
= IORESOURCE_DMA
,
462 static struct platform_device da830_mcasp1_device
= {
463 .name
= "davinci-mcasp",
465 .num_resources
= ARRAY_SIZE(da830_mcasp1_resources
),
466 .resource
= da830_mcasp1_resources
,
469 static struct resource da850_mcasp_resources
[] = {
472 .start
= DAVINCI_DA8XX_MCASP0_REG_BASE
,
473 .end
= DAVINCI_DA8XX_MCASP0_REG_BASE
+ (SZ_1K
* 12) - 1,
474 .flags
= IORESOURCE_MEM
,
478 .start
= DAVINCI_DA8XX_DMA_MCASP0_AXEVT
,
479 .end
= DAVINCI_DA8XX_DMA_MCASP0_AXEVT
,
480 .flags
= IORESOURCE_DMA
,
484 .start
= DAVINCI_DA8XX_DMA_MCASP0_AREVT
,
485 .end
= DAVINCI_DA8XX_DMA_MCASP0_AREVT
,
486 .flags
= IORESOURCE_DMA
,
490 static struct platform_device da850_mcasp_device
= {
491 .name
= "davinci-mcasp",
493 .num_resources
= ARRAY_SIZE(da850_mcasp_resources
),
494 .resource
= da850_mcasp_resources
,
497 static struct platform_device davinci_pcm_device
= {
498 .name
= "davinci-pcm-audio",
502 void __init
da8xx_register_mcasp(int id
, struct snd_platform_data
*pdata
)
504 platform_device_register(&davinci_pcm_device
);
506 /* DA830/OMAP-L137 has 3 instances of McASP */
507 if (cpu_is_davinci_da830() && id
== 1) {
508 da830_mcasp1_device
.dev
.platform_data
= pdata
;
509 platform_device_register(&da830_mcasp1_device
);
510 } else if (cpu_is_davinci_da850()) {
511 da850_mcasp_device
.dev
.platform_data
= pdata
;
512 platform_device_register(&da850_mcasp_device
);
516 static const struct display_panel disp_panel
= {
523 static struct lcd_ctrl_config lcd_cfg
= {
533 .invert_line_clock
= 1,
534 .invert_frm_clock
= 1,
540 struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata
= {
541 .manu_name
= "sharp",
542 .controller_data
= &lcd_cfg
,
543 .type
= "Sharp_LCD035Q3DG01",
546 struct da8xx_lcdc_platform_data sharp_lk043t1dg01_pdata
= {
547 .manu_name
= "sharp",
548 .controller_data
= &lcd_cfg
,
549 .type
= "Sharp_LK043T1DG01",
552 static struct resource da8xx_lcdc_resources
[] = {
553 [0] = { /* registers */
554 .start
= DA8XX_LCD_CNTRL_BASE
,
555 .end
= DA8XX_LCD_CNTRL_BASE
+ SZ_4K
- 1,
556 .flags
= IORESOURCE_MEM
,
558 [1] = { /* interrupt */
559 .start
= IRQ_DA8XX_LCDINT
,
560 .end
= IRQ_DA8XX_LCDINT
,
561 .flags
= IORESOURCE_IRQ
,
565 static struct platform_device da8xx_lcdc_device
= {
566 .name
= "da8xx_lcdc",
568 .num_resources
= ARRAY_SIZE(da8xx_lcdc_resources
),
569 .resource
= da8xx_lcdc_resources
,
572 int __init
da8xx_register_lcdc(struct da8xx_lcdc_platform_data
*pdata
)
574 da8xx_lcdc_device
.dev
.platform_data
= pdata
;
575 return platform_device_register(&da8xx_lcdc_device
);
578 static struct resource da8xx_mmcsd0_resources
[] = {
580 .start
= DA8XX_MMCSD0_BASE
,
581 .end
= DA8XX_MMCSD0_BASE
+ SZ_4K
- 1,
582 .flags
= IORESOURCE_MEM
,
585 .start
= IRQ_DA8XX_MMCSDINT0
,
586 .end
= IRQ_DA8XX_MMCSDINT0
,
587 .flags
= IORESOURCE_IRQ
,
590 .start
= DA8XX_DMA_MMCSD0_RX
,
591 .end
= DA8XX_DMA_MMCSD0_RX
,
592 .flags
= IORESOURCE_DMA
,
595 .start
= DA8XX_DMA_MMCSD0_TX
,
596 .end
= DA8XX_DMA_MMCSD0_TX
,
597 .flags
= IORESOURCE_DMA
,
601 static struct platform_device da8xx_mmcsd0_device
= {
602 .name
= "davinci_mmc",
604 .num_resources
= ARRAY_SIZE(da8xx_mmcsd0_resources
),
605 .resource
= da8xx_mmcsd0_resources
,
608 int __init
da8xx_register_mmcsd0(struct davinci_mmc_config
*config
)
610 da8xx_mmcsd0_device
.dev
.platform_data
= config
;
611 return platform_device_register(&da8xx_mmcsd0_device
);
614 #ifdef CONFIG_ARCH_DAVINCI_DA850
615 static struct resource da850_mmcsd1_resources
[] = {
617 .start
= DA850_MMCSD1_BASE
,
618 .end
= DA850_MMCSD1_BASE
+ SZ_4K
- 1,
619 .flags
= IORESOURCE_MEM
,
622 .start
= IRQ_DA850_MMCSDINT0_1
,
623 .end
= IRQ_DA850_MMCSDINT0_1
,
624 .flags
= IORESOURCE_IRQ
,
627 .start
= DA850_DMA_MMCSD1_RX
,
628 .end
= DA850_DMA_MMCSD1_RX
,
629 .flags
= IORESOURCE_DMA
,
632 .start
= DA850_DMA_MMCSD1_TX
,
633 .end
= DA850_DMA_MMCSD1_TX
,
634 .flags
= IORESOURCE_DMA
,
638 static struct platform_device da850_mmcsd1_device
= {
639 .name
= "davinci_mmc",
641 .num_resources
= ARRAY_SIZE(da850_mmcsd1_resources
),
642 .resource
= da850_mmcsd1_resources
,
645 int __init
da850_register_mmcsd1(struct davinci_mmc_config
*config
)
647 da850_mmcsd1_device
.dev
.platform_data
= config
;
648 return platform_device_register(&da850_mmcsd1_device
);
652 static struct resource da8xx_rtc_resources
[] = {
654 .start
= DA8XX_RTC_BASE
,
655 .end
= DA8XX_RTC_BASE
+ SZ_4K
- 1,
656 .flags
= IORESOURCE_MEM
,
659 .start
= IRQ_DA8XX_RTC
,
660 .end
= IRQ_DA8XX_RTC
,
661 .flags
= IORESOURCE_IRQ
,
664 .start
= IRQ_DA8XX_RTC
,
665 .end
= IRQ_DA8XX_RTC
,
666 .flags
= IORESOURCE_IRQ
,
670 static struct platform_device da8xx_rtc_device
= {
673 .num_resources
= ARRAY_SIZE(da8xx_rtc_resources
),
674 .resource
= da8xx_rtc_resources
,
677 int da8xx_register_rtc(void)
682 base
= ioremap(DA8XX_RTC_BASE
, SZ_4K
);
686 /* Unlock the rtc's registers */
687 __raw_writel(0x83e70b13, base
+ 0x6c);
688 __raw_writel(0x95a4f1e0, base
+ 0x70);
692 ret
= platform_device_register(&da8xx_rtc_device
);
694 /* Atleast on DA850, RTC is a wakeup source */
695 device_init_wakeup(&da8xx_rtc_device
.dev
, true);
700 static void __iomem
*da8xx_ddr2_ctlr_base
;
701 void __iomem
* __init
da8xx_get_mem_ctlr(void)
703 if (da8xx_ddr2_ctlr_base
)
704 return da8xx_ddr2_ctlr_base
;
706 da8xx_ddr2_ctlr_base
= ioremap(DA8XX_DDR2_CTL_BASE
, SZ_32K
);
707 if (!da8xx_ddr2_ctlr_base
)
708 pr_warning("%s: Unable to map DDR2 controller", __func__
);
710 return da8xx_ddr2_ctlr_base
;
713 static struct resource da8xx_cpuidle_resources
[] = {
715 .start
= DA8XX_DDR2_CTL_BASE
,
716 .end
= DA8XX_DDR2_CTL_BASE
+ SZ_32K
- 1,
717 .flags
= IORESOURCE_MEM
,
721 /* DA8XX devices support DDR2 power down */
722 static struct davinci_cpuidle_config da8xx_cpuidle_pdata
= {
727 static struct platform_device da8xx_cpuidle_device
= {
728 .name
= "cpuidle-davinci",
729 .num_resources
= ARRAY_SIZE(da8xx_cpuidle_resources
),
730 .resource
= da8xx_cpuidle_resources
,
732 .platform_data
= &da8xx_cpuidle_pdata
,
736 int __init
da8xx_register_cpuidle(void)
738 da8xx_cpuidle_pdata
.ddr2_ctlr_base
= da8xx_get_mem_ctlr();
740 return platform_device_register(&da8xx_cpuidle_device
);
743 static struct resource da8xx_spi0_resources
[] = {
745 .start
= DA8XX_SPI0_BASE
,
746 .end
= DA8XX_SPI0_BASE
+ SZ_4K
- 1,
747 .flags
= IORESOURCE_MEM
,
750 .start
= IRQ_DA8XX_SPINT0
,
751 .end
= IRQ_DA8XX_SPINT0
,
752 .flags
= IORESOURCE_IRQ
,
755 .start
= DA8XX_DMA_SPI0_RX
,
756 .end
= DA8XX_DMA_SPI0_RX
,
757 .flags
= IORESOURCE_DMA
,
760 .start
= DA8XX_DMA_SPI0_TX
,
761 .end
= DA8XX_DMA_SPI0_TX
,
762 .flags
= IORESOURCE_DMA
,
766 static struct resource da8xx_spi1_resources
[] = {
768 .start
= DA830_SPI1_BASE
,
769 .end
= DA830_SPI1_BASE
+ SZ_4K
- 1,
770 .flags
= IORESOURCE_MEM
,
773 .start
= IRQ_DA8XX_SPINT1
,
774 .end
= IRQ_DA8XX_SPINT1
,
775 .flags
= IORESOURCE_IRQ
,
778 .start
= DA8XX_DMA_SPI1_RX
,
779 .end
= DA8XX_DMA_SPI1_RX
,
780 .flags
= IORESOURCE_DMA
,
783 .start
= DA8XX_DMA_SPI1_TX
,
784 .end
= DA8XX_DMA_SPI1_TX
,
785 .flags
= IORESOURCE_DMA
,
789 struct davinci_spi_platform_data da8xx_spi_pdata
[] = {
791 .version
= SPI_VERSION_2
,
793 .dma_event_q
= EVENTQ_0
,
796 .version
= SPI_VERSION_2
,
798 .dma_event_q
= EVENTQ_0
,
802 static struct platform_device da8xx_spi_device
[] = {
804 .name
= "spi_davinci",
806 .num_resources
= ARRAY_SIZE(da8xx_spi0_resources
),
807 .resource
= da8xx_spi0_resources
,
809 .platform_data
= &da8xx_spi_pdata
[0],
813 .name
= "spi_davinci",
815 .num_resources
= ARRAY_SIZE(da8xx_spi1_resources
),
816 .resource
= da8xx_spi1_resources
,
818 .platform_data
= &da8xx_spi_pdata
[1],
823 int __init
da8xx_register_spi(int instance
, struct spi_board_info
*info
,
828 if (instance
< 0 || instance
> 1)
831 ret
= spi_register_board_info(info
, len
);
833 pr_warning("%s: failed to register board info for spi %d :"
834 " %d\n", __func__
, instance
, ret
);
836 da8xx_spi_pdata
[instance
].num_chipselect
= len
;
838 if (instance
== 1 && cpu_is_davinci_da850()) {
839 da8xx_spi1_resources
[0].start
= DA850_SPI1_BASE
;
840 da8xx_spi1_resources
[0].end
= DA850_SPI1_BASE
+ SZ_4K
- 1;
843 return platform_device_register(&da8xx_spi_device
[instance
]);