aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9260_devices.c
diff options
context:
space:
mode:
authorAndrew Victor <linux@maxim.org.za>2008-01-23 03:13:53 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-01-26 10:00:31 -0500
commitc6686ff9df086f9473663c2e61c1173c56788b2e (patch)
tree47604c8f08bfe1dc50595e65cf40ec02fdccedbc /arch/arm/mach-at91/at91sam9260_devices.c
parent884f5a6a8dc8646d5904f166adf3c558be57e1ab (diff)
[ARM] 4753/1: [AT91] Use DMA_BIT_MASK
Replace hard-coded DMA mask (0xffffffff) with DMA_BIT_MASK(32) as defined in dma-mapping.h. Set "dma_mask" field for the UART platform_devices. Signed-off-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-at91/at91sam9260_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9260_devices.c70
1 files changed, 46 insertions, 24 deletions
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
index 1533556fb873..c34fde362ad4 100644
--- a/arch/arm/mach-at91/at91sam9260_devices.c
+++ b/arch/arm/mach-at91/at91sam9260_devices.c
@@ -12,6 +12,7 @@
12#include <asm/mach/arch.h> 12#include <asm/mach/arch.h>
13#include <asm/mach/map.h> 13#include <asm/mach/map.h>
14 14
15#include <linux/dma-mapping.h>
15#include <linux/platform_device.h> 16#include <linux/platform_device.h>
16#include <linux/i2c-gpio.h> 17#include <linux/i2c-gpio.h>
17 18
@@ -29,7 +30,7 @@
29 * -------------------------------------------------------------------- */ 30 * -------------------------------------------------------------------- */
30 31
31#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 32#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
32static u64 ohci_dmamask = 0xffffffffUL; 33static u64 ohci_dmamask = DMA_BIT_MASK(32);
33static struct at91_usbh_data usbh_data; 34static struct at91_usbh_data usbh_data;
34 35
35static struct resource usbh_resources[] = { 36static struct resource usbh_resources[] = {
@@ -50,7 +51,7 @@ static struct platform_device at91_usbh_device = {
50 .id = -1, 51 .id = -1,
51 .dev = { 52 .dev = {
52 .dma_mask = &ohci_dmamask, 53 .dma_mask = &ohci_dmamask,
53 .coherent_dma_mask = 0xffffffff, 54 .coherent_dma_mask = DMA_BIT_MASK(32),
54 .platform_data = &usbh_data, 55 .platform_data = &usbh_data,
55 }, 56 },
56 .resource = usbh_resources, 57 .resource = usbh_resources,
@@ -125,7 +126,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {}
125 * -------------------------------------------------------------------- */ 126 * -------------------------------------------------------------------- */
126 127
127#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) 128#if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE)
128static u64 eth_dmamask = 0xffffffffUL; 129static u64 eth_dmamask = DMA_BIT_MASK(32);
129static struct at91_eth_data eth_data; 130static struct at91_eth_data eth_data;
130 131
131static struct resource eth_resources[] = { 132static struct resource eth_resources[] = {
@@ -146,7 +147,7 @@ static struct platform_device at91sam9260_eth_device = {
146 .id = -1, 147 .id = -1,
147 .dev = { 148 .dev = {
148 .dma_mask = &eth_dmamask, 149 .dma_mask = &eth_dmamask,
149 .coherent_dma_mask = 0xffffffff, 150 .coherent_dma_mask = DMA_BIT_MASK(32),
150 .platform_data = &eth_data, 151 .platform_data = &eth_data,
151 }, 152 },
152 .resource = eth_resources, 153 .resource = eth_resources,
@@ -199,7 +200,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data) {}
199 * -------------------------------------------------------------------- */ 200 * -------------------------------------------------------------------- */
200 201
201#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) 202#if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE)
202static u64 mmc_dmamask = 0xffffffffUL; 203static u64 mmc_dmamask = DMA_BIT_MASK(32);
203static struct at91_mmc_data mmc_data; 204static struct at91_mmc_data mmc_data;
204 205
205static struct resource mmc_resources[] = { 206static struct resource mmc_resources[] = {
@@ -220,7 +221,7 @@ static struct platform_device at91sam9260_mmc_device = {
220 .id = -1, 221 .id = -1,
221 .dev = { 222 .dev = {
222 .dma_mask = &mmc_dmamask, 223 .dma_mask = &mmc_dmamask,
223 .coherent_dma_mask = 0xffffffff, 224 .coherent_dma_mask = DMA_BIT_MASK(32),
224 .platform_data = &mmc_data, 225 .platform_data = &mmc_data,
225 }, 226 },
226 .resource = mmc_resources, 227 .resource = mmc_resources,
@@ -431,7 +432,7 @@ void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices)
431 * -------------------------------------------------------------------- */ 432 * -------------------------------------------------------------------- */
432 433
433#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) 434#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
434static u64 spi_dmamask = 0xffffffffUL; 435static u64 spi_dmamask = DMA_BIT_MASK(32);
435 436
436static struct resource spi0_resources[] = { 437static struct resource spi0_resources[] = {
437 [0] = { 438 [0] = {
@@ -451,7 +452,7 @@ static struct platform_device at91sam9260_spi0_device = {
451 .id = 0, 452 .id = 0,
452 .dev = { 453 .dev = {
453 .dma_mask = &spi_dmamask, 454 .dma_mask = &spi_dmamask,
454 .coherent_dma_mask = 0xffffffff, 455 .coherent_dma_mask = DMA_BIT_MASK(32),
455 }, 456 },
456 .resource = spi0_resources, 457 .resource = spi0_resources,
457 .num_resources = ARRAY_SIZE(spi0_resources), 458 .num_resources = ARRAY_SIZE(spi0_resources),
@@ -477,7 +478,7 @@ static struct platform_device at91sam9260_spi1_device = {
477 .id = 1, 478 .id = 1,
478 .dev = { 479 .dev = {
479 .dma_mask = &spi_dmamask, 480 .dma_mask = &spi_dmamask,
480 .coherent_dma_mask = 0xffffffff, 481 .coherent_dma_mask = DMA_BIT_MASK(32),
481 }, 482 },
482 .resource = spi1_resources, 483 .resource = spi1_resources,
483 .num_resources = ARRAY_SIZE(spi1_resources), 484 .num_resources = ARRAY_SIZE(spi1_resources),
@@ -628,12 +629,15 @@ static struct atmel_uart_data dbgu_data = {
628 .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU), 629 .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU),
629}; 630};
630 631
632static u64 dbgu_dmamask = DMA_BIT_MASK(32);
633
631static struct platform_device at91sam9260_dbgu_device = { 634static struct platform_device at91sam9260_dbgu_device = {
632 .name = "atmel_usart", 635 .name = "atmel_usart",
633 .id = 0, 636 .id = 0,
634 .dev = { 637 .dev = {
635 .platform_data = &dbgu_data, 638 .dma_mask = &dbgu_dmamask,
636 .coherent_dma_mask = 0xffffffff, 639 .coherent_dma_mask = DMA_BIT_MASK(32),
640 .platform_data = &dbgu_data,
637 }, 641 },
638 .resource = dbgu_resources, 642 .resource = dbgu_resources,
639 .num_resources = ARRAY_SIZE(dbgu_resources), 643 .num_resources = ARRAY_SIZE(dbgu_resources),
@@ -663,12 +667,15 @@ static struct atmel_uart_data uart0_data = {
663 .use_dma_rx = 1, 667 .use_dma_rx = 1,
664}; 668};
665 669
670static u64 uart0_dmamask = DMA_BIT_MASK(32);
671
666static struct platform_device at91sam9260_uart0_device = { 672static struct platform_device at91sam9260_uart0_device = {
667 .name = "atmel_usart", 673 .name = "atmel_usart",
668 .id = 1, 674 .id = 1,
669 .dev = { 675 .dev = {
670 .platform_data = &uart0_data, 676 .dma_mask = &uart0_dmamask,
671 .coherent_dma_mask = 0xffffffff, 677 .coherent_dma_mask = DMA_BIT_MASK(32),
678 .platform_data = &uart0_data,
672 }, 679 },
673 .resource = uart0_resources, 680 .resource = uart0_resources,
674 .num_resources = ARRAY_SIZE(uart0_resources), 681 .num_resources = ARRAY_SIZE(uart0_resources),
@@ -704,12 +711,15 @@ static struct atmel_uart_data uart1_data = {
704 .use_dma_rx = 1, 711 .use_dma_rx = 1,
705}; 712};
706 713
714static u64 uart1_dmamask = DMA_BIT_MASK(32);
715
707static struct platform_device at91sam9260_uart1_device = { 716static struct platform_device at91sam9260_uart1_device = {
708 .name = "atmel_usart", 717 .name = "atmel_usart",
709 .id = 2, 718 .id = 2,
710 .dev = { 719 .dev = {
711 .platform_data = &uart1_data, 720 .dma_mask = &uart1_dmamask,
712 .coherent_dma_mask = 0xffffffff, 721 .coherent_dma_mask = DMA_BIT_MASK(32),
722 .platform_data = &uart1_data,
713 }, 723 },
714 .resource = uart1_resources, 724 .resource = uart1_resources,
715 .num_resources = ARRAY_SIZE(uart1_resources), 725 .num_resources = ARRAY_SIZE(uart1_resources),
@@ -741,12 +751,15 @@ static struct atmel_uart_data uart2_data = {
741 .use_dma_rx = 1, 751 .use_dma_rx = 1,
742}; 752};
743 753
754static u64 uart2_dmamask = DMA_BIT_MASK(32);
755
744static struct platform_device at91sam9260_uart2_device = { 756static struct platform_device at91sam9260_uart2_device = {
745 .name = "atmel_usart", 757 .name = "atmel_usart",
746 .id = 3, 758 .id = 3,
747 .dev = { 759 .dev = {
748 .platform_data = &uart2_data, 760 .dma_mask = &uart2_dmamask,
749 .coherent_dma_mask = 0xffffffff, 761 .coherent_dma_mask = DMA_BIT_MASK(32),
762 .platform_data = &uart2_data,
750 }, 763 },
751 .resource = uart2_resources, 764 .resource = uart2_resources,
752 .num_resources = ARRAY_SIZE(uart2_resources), 765 .num_resources = ARRAY_SIZE(uart2_resources),
@@ -776,12 +789,15 @@ static struct atmel_uart_data uart3_data = {
776 .use_dma_rx = 1, 789 .use_dma_rx = 1,
777}; 790};
778 791
792static u64 uart3_dmamask = DMA_BIT_MASK(32);
793
779static struct platform_device at91sam9260_uart3_device = { 794static struct platform_device at91sam9260_uart3_device = {
780 .name = "atmel_usart", 795 .name = "atmel_usart",
781 .id = 4, 796 .id = 4,
782 .dev = { 797 .dev = {
783 .platform_data = &uart3_data, 798 .dma_mask = &uart3_dmamask,
784 .coherent_dma_mask = 0xffffffff, 799 .coherent_dma_mask = DMA_BIT_MASK(32),
800 .platform_data = &uart3_data,
785 }, 801 },
786 .resource = uart3_resources, 802 .resource = uart3_resources,
787 .num_resources = ARRAY_SIZE(uart3_resources), 803 .num_resources = ARRAY_SIZE(uart3_resources),
@@ -811,12 +827,15 @@ static struct atmel_uart_data uart4_data = {
811 .use_dma_rx = 1, 827 .use_dma_rx = 1,
812}; 828};
813 829
830static u64 uart4_dmamask = DMA_BIT_MASK(32);
831
814static struct platform_device at91sam9260_uart4_device = { 832static struct platform_device at91sam9260_uart4_device = {
815 .name = "atmel_usart", 833 .name = "atmel_usart",
816 .id = 5, 834 .id = 5,
817 .dev = { 835 .dev = {
818 .platform_data = &uart4_data, 836 .dma_mask = &uart4_dmamask,
819 .coherent_dma_mask = 0xffffffff, 837 .coherent_dma_mask = DMA_BIT_MASK(32),
838 .platform_data = &uart4_data,
820 }, 839 },
821 .resource = uart4_resources, 840 .resource = uart4_resources,
822 .num_resources = ARRAY_SIZE(uart4_resources), 841 .num_resources = ARRAY_SIZE(uart4_resources),
@@ -846,12 +865,15 @@ static struct atmel_uart_data uart5_data = {
846 .use_dma_rx = 1, 865 .use_dma_rx = 1,
847}; 866};
848 867
868static u64 uart5_dmamask = DMA_BIT_MASK(32);
869
849static struct platform_device at91sam9260_uart5_device = { 870static struct platform_device at91sam9260_uart5_device = {
850 .name = "atmel_usart", 871 .name = "atmel_usart",
851 .id = 6, 872 .id = 6,
852 .dev = { 873 .dev = {
853 .platform_data = &uart5_data, 874 .dma_mask = &uart5_dmamask,
854 .coherent_dma_mask = 0xffffffff, 875 .coherent_dma_mask = DMA_BIT_MASK(32),
876 .platform_data = &uart5_data,
855 }, 877 },
856 .resource = uart5_resources, 878 .resource = uart5_resources,
857 .num_resources = ARRAY_SIZE(uart5_resources), 879 .num_resources = ARRAY_SIZE(uart5_resources),
@@ -863,7 +885,7 @@ static inline void configure_usart5_pins(void)
863 at91_set_A_periph(AT91_PIN_PB13, 0); /* RXD5 */ 885 at91_set_A_periph(AT91_PIN_PB13, 0); /* RXD5 */
864} 886}
865 887
866struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 888static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
867struct platform_device *atmel_default_console_device; /* the serial console device */ 889struct platform_device *atmel_default_console_device; /* the serial console device */
868 890
869void __init at91_init_serial(struct at91_uart_config *config) 891void __init at91_init_serial(struct at91_uart_config *config)