2525#include <asm/bfin5xx_spi.h>
2626#include <asm/portmux.h>
2727#include <asm/dpmc.h>
28+ #include <asm/bfin_sport.h>
2829
2930/*
3031 * Name the Board for the /proc/cpuinfo
@@ -143,6 +144,71 @@ static struct platform_device bfin_spi0_device = {
143144};
144145#endif /* spi master and devices */
145146
147+ #if defined(CONFIG_SPI_BFIN_SPORT ) || defined(CONFIG_SPI_BFIN_SPORT_MODULE )
148+
149+ /* SPORT SPI controller data */
150+ static struct bfin5xx_spi_master bfin_sport_spi0_info = {
151+ .num_chipselect = MAX_BLACKFIN_GPIOS ,
152+ .enable_dma = 0 , /* master don't support DMA */
153+ .pin_req = {P_SPORT0_DTPRI , P_SPORT0_TSCLK , P_SPORT0_DRPRI ,
154+ P_SPORT0_RSCLK , P_SPORT0_TFS , P_SPORT0_RFS , 0 },
155+ };
156+
157+ static struct resource bfin_sport_spi0_resource [] = {
158+ [0 ] = {
159+ .start = SPORT0_TCR1 ,
160+ .end = SPORT0_TCR1 + 0xFF ,
161+ .flags = IORESOURCE_MEM ,
162+ },
163+ [1 ] = {
164+ .start = IRQ_SPORT0_ERROR ,
165+ .end = IRQ_SPORT0_ERROR ,
166+ .flags = IORESOURCE_IRQ ,
167+ },
168+ };
169+
170+ static struct platform_device bfin_sport_spi0_device = {
171+ .name = "bfin-sport-spi" ,
172+ .id = 1 , /* Bus number */
173+ .num_resources = ARRAY_SIZE (bfin_sport_spi0_resource ),
174+ .resource = bfin_sport_spi0_resource ,
175+ .dev = {
176+ .platform_data = & bfin_sport_spi0_info , /* Passed to driver */
177+ },
178+ };
179+
180+ static struct bfin5xx_spi_master bfin_sport_spi1_info = {
181+ .num_chipselect = MAX_BLACKFIN_GPIOS ,
182+ .enable_dma = 0 , /* master don't support DMA */
183+ .pin_req = {P_SPORT1_DTPRI , P_SPORT1_TSCLK , P_SPORT1_DRPRI ,
184+ P_SPORT1_RSCLK , P_SPORT1_TFS , P_SPORT1_RFS , 0 },
185+ };
186+
187+ static struct resource bfin_sport_spi1_resource [] = {
188+ [0 ] = {
189+ .start = SPORT1_TCR1 ,
190+ .end = SPORT1_TCR1 + 0xFF ,
191+ .flags = IORESOURCE_MEM ,
192+ },
193+ [1 ] = {
194+ .start = IRQ_SPORT1_ERROR ,
195+ .end = IRQ_SPORT1_ERROR ,
196+ .flags = IORESOURCE_IRQ ,
197+ },
198+ };
199+
200+ static struct platform_device bfin_sport_spi1_device = {
201+ .name = "bfin-sport-spi" ,
202+ .id = 2 , /* Bus number */
203+ .num_resources = ARRAY_SIZE (bfin_sport_spi1_resource ),
204+ .resource = bfin_sport_spi1_resource ,
205+ .dev = {
206+ .platform_data = & bfin_sport_spi1_info , /* Passed to driver */
207+ },
208+ };
209+
210+ #endif /* sport spi master and devices */
211+
146212#if defined(CONFIG_RTC_DRV_BFIN ) || defined(CONFIG_RTC_DRV_BFIN_MODULE )
147213static struct platform_device rtc_device = {
148214 .name = "rtc-bfin" ,
@@ -512,6 +578,13 @@ static struct platform_device i2c_bfin_twi_device = {
512578};
513579#endif
514580
581+ #if defined(CONFIG_SERIAL_BFIN_SPORT ) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE ) \
582+ || defined(CONFIG_BFIN_SPORT ) || defined(CONFIG_BFIN_SPORT_MODULE )
583+ unsigned short bfin_sport0_peripherals [] = {
584+ P_SPORT0_TFS , P_SPORT0_DTPRI , P_SPORT0_TSCLK , P_SPORT0_RFS ,
585+ P_SPORT0_DRPRI , P_SPORT0_RSCLK , P_SPORT0_DRSEC , P_SPORT0_DTSEC , 0
586+ };
587+ #endif
515588#if defined(CONFIG_SERIAL_BFIN_SPORT ) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE )
516589#ifdef CONFIG_SERIAL_BFIN_SPORT0_UART
517590static struct resource bfin_sport0_uart_resources [] = {
@@ -532,11 +605,6 @@ static struct resource bfin_sport0_uart_resources[] = {
532605 },
533606};
534607
535- static unsigned short bfin_sport0_peripherals [] = {
536- P_SPORT0_TFS , P_SPORT0_DTPRI , P_SPORT0_TSCLK , P_SPORT0_RFS ,
537- P_SPORT0_DRPRI , P_SPORT0_RSCLK , 0
538- };
539-
540608static struct platform_device bfin_sport0_uart_device = {
541609 .name = "bfin-sport-uart" ,
542610 .id = 0 ,
@@ -582,6 +650,49 @@ static struct platform_device bfin_sport1_uart_device = {
582650};
583651#endif
584652#endif
653+ #if defined(CONFIG_BFIN_SPORT ) || defined(CONFIG_BFIN_SPORT_MODULE )
654+ static struct resource bfin_sport0_resources [] = {
655+ {
656+ .start = SPORT0_TCR1 ,
657+ .end = SPORT0_MRCS3 + 4 ,
658+ .flags = IORESOURCE_MEM ,
659+ },
660+ {
661+ .start = IRQ_SPORT0_RX ,
662+ .end = IRQ_SPORT0_RX + 1 ,
663+ .flags = IORESOURCE_IRQ ,
664+ },
665+ {
666+ .start = IRQ_SPORT0_TX ,
667+ .end = IRQ_SPORT0_TX + 1 ,
668+ .flags = IORESOURCE_IRQ ,
669+ },
670+ {
671+ .start = IRQ_SPORT0_ERROR ,
672+ .end = IRQ_SPORT0_ERROR ,
673+ .flags = IORESOURCE_IRQ ,
674+ },
675+ {
676+ .start = CH_SPORT0_TX ,
677+ .end = CH_SPORT0_TX ,
678+ .flags = IORESOURCE_DMA ,
679+ },
680+ {
681+ .start = CH_SPORT0_RX ,
682+ .end = CH_SPORT0_RX ,
683+ .flags = IORESOURCE_DMA ,
684+ },
685+ };
686+ static struct platform_device bfin_sport0_device = {
687+ .name = "bfin_sport_raw" ,
688+ .id = 0 ,
689+ .num_resources = ARRAY_SIZE (bfin_sport0_resources ),
690+ .resource = bfin_sport0_resources ,
691+ .dev = {
692+ .platform_data = & bfin_sport0_peripherals , /* Passed to driver */
693+ },
694+ };
695+ #endif
585696
586697#if defined(CONFIG_BFIN_MAC ) || defined(CONFIG_BFIN_MAC_MODULE )
587698#include <linux/bfin_mac.h>
@@ -684,6 +795,10 @@ static struct platform_device *cm_bf537e_devices[] __initdata = {
684795
685796 & bfin_dpmc ,
686797
798+ #if defined(CONFIG_BFIN_SPORT ) || defined (CONFIG_BFIN_SPORT_MODULE )
799+ & bfin_sport0_device ,
800+ #endif
801+
687802#if defined(CONFIG_FB_HITACHI_TX09 ) || defined (CONFIG_FB_HITACHI_TX09_MODULE )
688803 & hitachi_fb_device ,
689804#endif
@@ -744,6 +859,11 @@ static struct platform_device *cm_bf537e_devices[] __initdata = {
744859 & bfin_spi0_device ,
745860#endif
746861
862+ #if defined(CONFIG_SPI_BFIN_SPORT ) || defined (CONFIG_SPI_BFIN_SPORT_MODULE )
863+ & bfin_sport_spi0_device ,
864+ & bfin_sport_spi1_device ,
865+ #endif
866+
747867#if defined(CONFIG_PATA_PLATFORM ) || defined (CONFIG_PATA_PLATFORM_MODULE )
748868 & bfin_pata_device ,
749869#endif
0 commit comments