diff options
author | Andrew Victor <linux@maxim.org.za> | 2008-01-23 03:13:53 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-01-26 10:00:31 -0500 |
commit | c6686ff9df086f9473663c2e61c1173c56788b2e (patch) | |
tree | 47604c8f08bfe1dc50595e65cf40ec02fdccedbc /arch/arm/mach-at91 | |
parent | 884f5a6a8dc8646d5904f166adf3c558be57e1ab (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')
-rw-r--r-- | arch/arm/mach-at91/at91rm9200_devices.c | 54 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9260_devices.c | 70 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9261_devices.c | 49 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9263_devices.c | 59 | ||||
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 50 |
5 files changed, 181 insertions, 101 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 9296833f91c..a601c7c1670 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/mach/arch.h> | 13 | #include <asm/mach/arch.h> |
14 | #include <asm/mach/map.h> | 14 | #include <asm/mach/map.h> |
15 | 15 | ||
16 | #include <linux/dma-mapping.h> | ||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | #include <linux/i2c-gpio.h> | 18 | #include <linux/i2c-gpio.h> |
18 | 19 | ||
@@ -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) |
32 | static u64 ohci_dmamask = 0xffffffffUL; | 33 | static u64 ohci_dmamask = DMA_BIT_MASK(32); |
33 | static struct at91_usbh_data usbh_data; | 34 | static struct at91_usbh_data usbh_data; |
34 | 35 | ||
35 | static struct resource usbh_resources[] = { | 36 | static struct resource usbh_resources[] = { |
@@ -50,7 +51,7 @@ static struct platform_device at91rm9200_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_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE) | 128 | #if defined(CONFIG_ARM_AT91_ETHER) || defined(CONFIG_ARM_AT91_ETHER_MODULE) |
128 | static u64 eth_dmamask = 0xffffffffUL; | 129 | static u64 eth_dmamask = DMA_BIT_MASK(32); |
129 | static struct at91_eth_data eth_data; | 130 | static struct at91_eth_data eth_data; |
130 | 131 | ||
131 | static struct resource eth_resources[] = { | 132 | static struct resource eth_resources[] = { |
@@ -146,7 +147,7 @@ static struct platform_device at91rm9200_eth_device = { | |||
146 | .id = -1, | 147 | .id = -1, |
147 | .dev = { | 148 | .dev = { |
148 | .dma_mask = ð_dmamask, | 149 | .dma_mask = ð_dmamask, |
149 | .coherent_dma_mask = 0xffffffff, | 150 | .coherent_dma_mask = DMA_BIT_MASK(32), |
150 | .platform_data = ð_data, | 151 | .platform_data = ð_data, |
151 | }, | 152 | }, |
152 | .resource = eth_resources, | 153 | .resource = eth_resources, |
@@ -285,7 +286,7 @@ void __init at91_add_device_cf(struct at91_cf_data *data) {} | |||
285 | * -------------------------------------------------------------------- */ | 286 | * -------------------------------------------------------------------- */ |
286 | 287 | ||
287 | #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) | 288 | #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) |
288 | static u64 mmc_dmamask = 0xffffffffUL; | 289 | static u64 mmc_dmamask = DMA_BIT_MASK(32); |
289 | static struct at91_mmc_data mmc_data; | 290 | static struct at91_mmc_data mmc_data; |
290 | 291 | ||
291 | static struct resource mmc_resources[] = { | 292 | static struct resource mmc_resources[] = { |
@@ -306,7 +307,7 @@ static struct platform_device at91rm9200_mmc_device = { | |||
306 | .id = -1, | 307 | .id = -1, |
307 | .dev = { | 308 | .dev = { |
308 | .dma_mask = &mmc_dmamask, | 309 | .dma_mask = &mmc_dmamask, |
309 | .coherent_dma_mask = 0xffffffff, | 310 | .coherent_dma_mask = DMA_BIT_MASK(32), |
310 | .platform_data = &mmc_data, | 311 | .platform_data = &mmc_data, |
311 | }, | 312 | }, |
312 | .resource = mmc_resources, | 313 | .resource = mmc_resources, |
@@ -513,7 +514,7 @@ void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | |||
513 | * -------------------------------------------------------------------- */ | 514 | * -------------------------------------------------------------------- */ |
514 | 515 | ||
515 | #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) | 516 | #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) |
516 | static u64 spi_dmamask = 0xffffffffUL; | 517 | static u64 spi_dmamask = DMA_BIT_MASK(32); |
517 | 518 | ||
518 | static struct resource spi_resources[] = { | 519 | static struct resource spi_resources[] = { |
519 | [0] = { | 520 | [0] = { |
@@ -533,7 +534,7 @@ static struct platform_device at91rm9200_spi_device = { | |||
533 | .id = 0, | 534 | .id = 0, |
534 | .dev = { | 535 | .dev = { |
535 | .dma_mask = &spi_dmamask, | 536 | .dma_mask = &spi_dmamask, |
536 | .coherent_dma_mask = 0xffffffff, | 537 | .coherent_dma_mask = DMA_BIT_MASK(32), |
537 | }, | 538 | }, |
538 | .resource = spi_resources, | 539 | .resource = spi_resources, |
539 | .num_resources = ARRAY_SIZE(spi_resources), | 540 | .num_resources = ARRAY_SIZE(spi_resources), |
@@ -658,12 +659,15 @@ static struct atmel_uart_data dbgu_data = { | |||
658 | .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU), | 659 | .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU), |
659 | }; | 660 | }; |
660 | 661 | ||
662 | static u64 dbgu_dmamask = DMA_BIT_MASK(32); | ||
663 | |||
661 | static struct platform_device at91rm9200_dbgu_device = { | 664 | static struct platform_device at91rm9200_dbgu_device = { |
662 | .name = "atmel_usart", | 665 | .name = "atmel_usart", |
663 | .id = 0, | 666 | .id = 0, |
664 | .dev = { | 667 | .dev = { |
665 | .platform_data = &dbgu_data, | 668 | .dma_mask = &dbgu_dmamask, |
666 | .coherent_dma_mask = 0xffffffff, | 669 | .coherent_dma_mask = DMA_BIT_MASK(32), |
670 | .platform_data = &dbgu_data, | ||
667 | }, | 671 | }, |
668 | .resource = dbgu_resources, | 672 | .resource = dbgu_resources, |
669 | .num_resources = ARRAY_SIZE(dbgu_resources), | 673 | .num_resources = ARRAY_SIZE(dbgu_resources), |
@@ -693,12 +697,15 @@ static struct atmel_uart_data uart0_data = { | |||
693 | .use_dma_rx = 1, | 697 | .use_dma_rx = 1, |
694 | }; | 698 | }; |
695 | 699 | ||
700 | static u64 uart0_dmamask = DMA_BIT_MASK(32); | ||
701 | |||
696 | static struct platform_device at91rm9200_uart0_device = { | 702 | static struct platform_device at91rm9200_uart0_device = { |
697 | .name = "atmel_usart", | 703 | .name = "atmel_usart", |
698 | .id = 1, | 704 | .id = 1, |
699 | .dev = { | 705 | .dev = { |
700 | .platform_data = &uart0_data, | 706 | .dma_mask = &uart0_dmamask, |
701 | .coherent_dma_mask = 0xffffffff, | 707 | .coherent_dma_mask = DMA_BIT_MASK(32), |
708 | .platform_data = &uart0_data, | ||
702 | }, | 709 | }, |
703 | .resource = uart0_resources, | 710 | .resource = uart0_resources, |
704 | .num_resources = ARRAY_SIZE(uart0_resources), | 711 | .num_resources = ARRAY_SIZE(uart0_resources), |
@@ -735,12 +742,15 @@ static struct atmel_uart_data uart1_data = { | |||
735 | .use_dma_rx = 1, | 742 | .use_dma_rx = 1, |
736 | }; | 743 | }; |
737 | 744 | ||
745 | static u64 uart1_dmamask = DMA_BIT_MASK(32); | ||
746 | |||
738 | static struct platform_device at91rm9200_uart1_device = { | 747 | static struct platform_device at91rm9200_uart1_device = { |
739 | .name = "atmel_usart", | 748 | .name = "atmel_usart", |
740 | .id = 2, | 749 | .id = 2, |
741 | .dev = { | 750 | .dev = { |
742 | .platform_data = &uart1_data, | 751 | .dma_mask = &uart1_dmamask, |
743 | .coherent_dma_mask = 0xffffffff, | 752 | .coherent_dma_mask = DMA_BIT_MASK(32), |
753 | .platform_data = &uart1_data, | ||
744 | }, | 754 | }, |
745 | .resource = uart1_resources, | 755 | .resource = uart1_resources, |
746 | .num_resources = ARRAY_SIZE(uart1_resources), | 756 | .num_resources = ARRAY_SIZE(uart1_resources), |
@@ -776,12 +786,15 @@ static struct atmel_uart_data uart2_data = { | |||
776 | .use_dma_rx = 1, | 786 | .use_dma_rx = 1, |
777 | }; | 787 | }; |
778 | 788 | ||
789 | static u64 uart2_dmamask = DMA_BIT_MASK(32); | ||
790 | |||
779 | static struct platform_device at91rm9200_uart2_device = { | 791 | static struct platform_device at91rm9200_uart2_device = { |
780 | .name = "atmel_usart", | 792 | .name = "atmel_usart", |
781 | .id = 3, | 793 | .id = 3, |
782 | .dev = { | 794 | .dev = { |
783 | .platform_data = &uart2_data, | 795 | .dma_mask = &uart2_dmamask, |
784 | .coherent_dma_mask = 0xffffffff, | 796 | .coherent_dma_mask = DMA_BIT_MASK(32), |
797 | .platform_data = &uart2_data, | ||
785 | }, | 798 | }, |
786 | .resource = uart2_resources, | 799 | .resource = uart2_resources, |
787 | .num_resources = ARRAY_SIZE(uart2_resources), | 800 | .num_resources = ARRAY_SIZE(uart2_resources), |
@@ -811,12 +824,15 @@ static struct atmel_uart_data uart3_data = { | |||
811 | .use_dma_rx = 1, | 824 | .use_dma_rx = 1, |
812 | }; | 825 | }; |
813 | 826 | ||
827 | static u64 uart3_dmamask = DMA_BIT_MASK(32); | ||
828 | |||
814 | static struct platform_device at91rm9200_uart3_device = { | 829 | static struct platform_device at91rm9200_uart3_device = { |
815 | .name = "atmel_usart", | 830 | .name = "atmel_usart", |
816 | .id = 4, | 831 | .id = 4, |
817 | .dev = { | 832 | .dev = { |
818 | .platform_data = &uart3_data, | 833 | .dma_mask = &uart3_dmamask, |
819 | .coherent_dma_mask = 0xffffffff, | 834 | .coherent_dma_mask = DMA_BIT_MASK(32), |
835 | .platform_data = &uart3_data, | ||
820 | }, | 836 | }, |
821 | .resource = uart3_resources, | 837 | .resource = uart3_resources, |
822 | .num_resources = ARRAY_SIZE(uart3_resources), | 838 | .num_resources = ARRAY_SIZE(uart3_resources), |
@@ -828,7 +844,7 @@ static inline void configure_usart3_pins(void) | |||
828 | at91_set_B_periph(AT91_PIN_PA6, 0); /* RXD3 */ | 844 | at91_set_B_periph(AT91_PIN_PA6, 0); /* RXD3 */ |
829 | } | 845 | } |
830 | 846 | ||
831 | struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 847 | static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
832 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 848 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
833 | 849 | ||
834 | void __init at91_init_serial(struct at91_uart_config *config) | 850 | void __init at91_init_serial(struct at91_uart_config *config) |
diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c index 1533556fb87..c34fde362ad 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) |
32 | static u64 ohci_dmamask = 0xffffffffUL; | 33 | static u64 ohci_dmamask = DMA_BIT_MASK(32); |
33 | static struct at91_usbh_data usbh_data; | 34 | static struct at91_usbh_data usbh_data; |
34 | 35 | ||
35 | static struct resource usbh_resources[] = { | 36 | static 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) |
128 | static u64 eth_dmamask = 0xffffffffUL; | 129 | static u64 eth_dmamask = DMA_BIT_MASK(32); |
129 | static struct at91_eth_data eth_data; | 130 | static struct at91_eth_data eth_data; |
130 | 131 | ||
131 | static struct resource eth_resources[] = { | 132 | static 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 = ð_dmamask, | 149 | .dma_mask = ð_dmamask, |
149 | .coherent_dma_mask = 0xffffffff, | 150 | .coherent_dma_mask = DMA_BIT_MASK(32), |
150 | .platform_data = ð_data, | 151 | .platform_data = ð_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) |
202 | static u64 mmc_dmamask = 0xffffffffUL; | 203 | static u64 mmc_dmamask = DMA_BIT_MASK(32); |
203 | static struct at91_mmc_data mmc_data; | 204 | static struct at91_mmc_data mmc_data; |
204 | 205 | ||
205 | static struct resource mmc_resources[] = { | 206 | static 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) |
434 | static u64 spi_dmamask = 0xffffffffUL; | 435 | static u64 spi_dmamask = DMA_BIT_MASK(32); |
435 | 436 | ||
436 | static struct resource spi0_resources[] = { | 437 | static 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 | ||
632 | static u64 dbgu_dmamask = DMA_BIT_MASK(32); | ||
633 | |||
631 | static struct platform_device at91sam9260_dbgu_device = { | 634 | static 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 | ||
670 | static u64 uart0_dmamask = DMA_BIT_MASK(32); | ||
671 | |||
666 | static struct platform_device at91sam9260_uart0_device = { | 672 | static 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 | ||
714 | static u64 uart1_dmamask = DMA_BIT_MASK(32); | ||
715 | |||
707 | static struct platform_device at91sam9260_uart1_device = { | 716 | static 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 | ||
754 | static u64 uart2_dmamask = DMA_BIT_MASK(32); | ||
755 | |||
744 | static struct platform_device at91sam9260_uart2_device = { | 756 | static 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 | ||
792 | static u64 uart3_dmamask = DMA_BIT_MASK(32); | ||
793 | |||
779 | static struct platform_device at91sam9260_uart3_device = { | 794 | static 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 | ||
830 | static u64 uart4_dmamask = DMA_BIT_MASK(32); | ||
831 | |||
814 | static struct platform_device at91sam9260_uart4_device = { | 832 | static 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 | ||
868 | static u64 uart5_dmamask = DMA_BIT_MASK(32); | ||
869 | |||
849 | static struct platform_device at91sam9260_uart5_device = { | 870 | static 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 | ||
866 | struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 888 | static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
867 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 889 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
868 | 890 | ||
869 | void __init at91_init_serial(struct at91_uart_config *config) | 891 | void __init at91_init_serial(struct at91_uart_config *config) |
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c index 17f3f6a2479..f7f02d15045 100644 --- a/arch/arm/mach-at91/at91sam9261_devices.c +++ b/arch/arm/mach-at91/at91sam9261_devices.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/mach/arch.h> | 13 | #include <asm/mach/arch.h> |
14 | #include <asm/mach/map.h> | 14 | #include <asm/mach/map.h> |
15 | 15 | ||
16 | #include <linux/dma-mapping.h> | ||
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
17 | #include <linux/i2c-gpio.h> | 18 | #include <linux/i2c-gpio.h> |
18 | 19 | ||
@@ -33,7 +34,7 @@ | |||
33 | * -------------------------------------------------------------------- */ | 34 | * -------------------------------------------------------------------- */ |
34 | 35 | ||
35 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 36 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
36 | static u64 ohci_dmamask = 0xffffffffUL; | 37 | static u64 ohci_dmamask = DMA_BIT_MASK(32); |
37 | static struct at91_usbh_data usbh_data; | 38 | static struct at91_usbh_data usbh_data; |
38 | 39 | ||
39 | static struct resource usbh_resources[] = { | 40 | static struct resource usbh_resources[] = { |
@@ -54,7 +55,7 @@ static struct platform_device at91sam9261_usbh_device = { | |||
54 | .id = -1, | 55 | .id = -1, |
55 | .dev = { | 56 | .dev = { |
56 | .dma_mask = &ohci_dmamask, | 57 | .dma_mask = &ohci_dmamask, |
57 | .coherent_dma_mask = 0xffffffff, | 58 | .coherent_dma_mask = DMA_BIT_MASK(32), |
58 | .platform_data = &usbh_data, | 59 | .platform_data = &usbh_data, |
59 | }, | 60 | }, |
60 | .resource = usbh_resources, | 61 | .resource = usbh_resources, |
@@ -132,7 +133,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {} | |||
132 | * -------------------------------------------------------------------- */ | 133 | * -------------------------------------------------------------------- */ |
133 | 134 | ||
134 | #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) | 135 | #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) |
135 | static u64 mmc_dmamask = 0xffffffffUL; | 136 | static u64 mmc_dmamask = DMA_BIT_MASK(32); |
136 | static struct at91_mmc_data mmc_data; | 137 | static struct at91_mmc_data mmc_data; |
137 | 138 | ||
138 | static struct resource mmc_resources[] = { | 139 | static struct resource mmc_resources[] = { |
@@ -153,7 +154,7 @@ static struct platform_device at91sam9261_mmc_device = { | |||
153 | .id = -1, | 154 | .id = -1, |
154 | .dev = { | 155 | .dev = { |
155 | .dma_mask = &mmc_dmamask, | 156 | .dma_mask = &mmc_dmamask, |
156 | .coherent_dma_mask = 0xffffffff, | 157 | .coherent_dma_mask = DMA_BIT_MASK(32), |
157 | .platform_data = &mmc_data, | 158 | .platform_data = &mmc_data, |
158 | }, | 159 | }, |
159 | .resource = mmc_resources, | 160 | .resource = mmc_resources, |
@@ -354,7 +355,7 @@ void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | |||
354 | * -------------------------------------------------------------------- */ | 355 | * -------------------------------------------------------------------- */ |
355 | 356 | ||
356 | #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) | 357 | #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) |
357 | static u64 spi_dmamask = 0xffffffffUL; | 358 | static u64 spi_dmamask = DMA_BIT_MASK(32); |
358 | 359 | ||
359 | static struct resource spi0_resources[] = { | 360 | static struct resource spi0_resources[] = { |
360 | [0] = { | 361 | [0] = { |
@@ -374,7 +375,7 @@ static struct platform_device at91sam9261_spi0_device = { | |||
374 | .id = 0, | 375 | .id = 0, |
375 | .dev = { | 376 | .dev = { |
376 | .dma_mask = &spi_dmamask, | 377 | .dma_mask = &spi_dmamask, |
377 | .coherent_dma_mask = 0xffffffff, | 378 | .coherent_dma_mask = DMA_BIT_MASK(32), |
378 | }, | 379 | }, |
379 | .resource = spi0_resources, | 380 | .resource = spi0_resources, |
380 | .num_resources = ARRAY_SIZE(spi0_resources), | 381 | .num_resources = ARRAY_SIZE(spi0_resources), |
@@ -400,7 +401,7 @@ static struct platform_device at91sam9261_spi1_device = { | |||
400 | .id = 1, | 401 | .id = 1, |
401 | .dev = { | 402 | .dev = { |
402 | .dma_mask = &spi_dmamask, | 403 | .dma_mask = &spi_dmamask, |
403 | .coherent_dma_mask = 0xffffffff, | 404 | .coherent_dma_mask = DMA_BIT_MASK(32), |
404 | }, | 405 | }, |
405 | .resource = spi1_resources, | 406 | .resource = spi1_resources, |
406 | .num_resources = ARRAY_SIZE(spi1_resources), | 407 | .num_resources = ARRAY_SIZE(spi1_resources), |
@@ -466,7 +467,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
466 | * -------------------------------------------------------------------- */ | 467 | * -------------------------------------------------------------------- */ |
467 | 468 | ||
468 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) | 469 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) |
469 | static u64 lcdc_dmamask = 0xffffffffUL; | 470 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); |
470 | static struct atmel_lcdfb_info lcdc_data; | 471 | static struct atmel_lcdfb_info lcdc_data; |
471 | 472 | ||
472 | static struct resource lcdc_resources[] = { | 473 | static struct resource lcdc_resources[] = { |
@@ -494,7 +495,7 @@ static struct platform_device at91_lcdc_device = { | |||
494 | .id = 0, | 495 | .id = 0, |
495 | .dev = { | 496 | .dev = { |
496 | .dma_mask = &lcdc_dmamask, | 497 | .dma_mask = &lcdc_dmamask, |
497 | .coherent_dma_mask = 0xffffffff, | 498 | .coherent_dma_mask = DMA_BIT_MASK(32), |
498 | .platform_data = &lcdc_data, | 499 | .platform_data = &lcdc_data, |
499 | }, | 500 | }, |
500 | .resource = lcdc_resources, | 501 | .resource = lcdc_resources, |
@@ -641,12 +642,15 @@ static struct atmel_uart_data dbgu_data = { | |||
641 | .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU), | 642 | .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU), |
642 | }; | 643 | }; |
643 | 644 | ||
645 | static u64 dbgu_dmamask = DMA_BIT_MASK(32); | ||
646 | |||
644 | static struct platform_device at91sam9261_dbgu_device = { | 647 | static struct platform_device at91sam9261_dbgu_device = { |
645 | .name = "atmel_usart", | 648 | .name = "atmel_usart", |
646 | .id = 0, | 649 | .id = 0, |
647 | .dev = { | 650 | .dev = { |
648 | .platform_data = &dbgu_data, | 651 | .dma_mask = &dbgu_dmamask, |
649 | .coherent_dma_mask = 0xffffffff, | 652 | .coherent_dma_mask = DMA_BIT_MASK(32), |
653 | .platform_data = &dbgu_data, | ||
650 | }, | 654 | }, |
651 | .resource = dbgu_resources, | 655 | .resource = dbgu_resources, |
652 | .num_resources = ARRAY_SIZE(dbgu_resources), | 656 | .num_resources = ARRAY_SIZE(dbgu_resources), |
@@ -676,12 +680,15 @@ static struct atmel_uart_data uart0_data = { | |||
676 | .use_dma_rx = 1, | 680 | .use_dma_rx = 1, |
677 | }; | 681 | }; |
678 | 682 | ||
683 | static u64 uart0_dmamask = DMA_BIT_MASK(32); | ||
684 | |||
679 | static struct platform_device at91sam9261_uart0_device = { | 685 | static struct platform_device at91sam9261_uart0_device = { |
680 | .name = "atmel_usart", | 686 | .name = "atmel_usart", |
681 | .id = 1, | 687 | .id = 1, |
682 | .dev = { | 688 | .dev = { |
683 | .platform_data = &uart0_data, | 689 | .dma_mask = &uart0_dmamask, |
684 | .coherent_dma_mask = 0xffffffff, | 690 | .coherent_dma_mask = DMA_BIT_MASK(32), |
691 | .platform_data = &uart0_data, | ||
685 | }, | 692 | }, |
686 | .resource = uart0_resources, | 693 | .resource = uart0_resources, |
687 | .num_resources = ARRAY_SIZE(uart0_resources), | 694 | .num_resources = ARRAY_SIZE(uart0_resources), |
@@ -713,12 +720,15 @@ static struct atmel_uart_data uart1_data = { | |||
713 | .use_dma_rx = 1, | 720 | .use_dma_rx = 1, |
714 | }; | 721 | }; |
715 | 722 | ||
723 | static u64 uart1_dmamask = DMA_BIT_MASK(32); | ||
724 | |||
716 | static struct platform_device at91sam9261_uart1_device = { | 725 | static struct platform_device at91sam9261_uart1_device = { |
717 | .name = "atmel_usart", | 726 | .name = "atmel_usart", |
718 | .id = 2, | 727 | .id = 2, |
719 | .dev = { | 728 | .dev = { |
720 | .platform_data = &uart1_data, | 729 | .dma_mask = &uart1_dmamask, |
721 | .coherent_dma_mask = 0xffffffff, | 730 | .coherent_dma_mask = DMA_BIT_MASK(32), |
731 | .platform_data = &uart1_data, | ||
722 | }, | 732 | }, |
723 | .resource = uart1_resources, | 733 | .resource = uart1_resources, |
724 | .num_resources = ARRAY_SIZE(uart1_resources), | 734 | .num_resources = ARRAY_SIZE(uart1_resources), |
@@ -748,12 +758,15 @@ static struct atmel_uart_data uart2_data = { | |||
748 | .use_dma_rx = 1, | 758 | .use_dma_rx = 1, |
749 | }; | 759 | }; |
750 | 760 | ||
761 | static u64 uart2_dmamask = DMA_BIT_MASK(32); | ||
762 | |||
751 | static struct platform_device at91sam9261_uart2_device = { | 763 | static struct platform_device at91sam9261_uart2_device = { |
752 | .name = "atmel_usart", | 764 | .name = "atmel_usart", |
753 | .id = 3, | 765 | .id = 3, |
754 | .dev = { | 766 | .dev = { |
755 | .platform_data = &uart2_data, | 767 | .dma_mask = &uart2_dmamask, |
756 | .coherent_dma_mask = 0xffffffff, | 768 | .coherent_dma_mask = DMA_BIT_MASK(32), |
769 | .platform_data = &uart2_data, | ||
757 | }, | 770 | }, |
758 | .resource = uart2_resources, | 771 | .resource = uart2_resources, |
759 | .num_resources = ARRAY_SIZE(uart2_resources), | 772 | .num_resources = ARRAY_SIZE(uart2_resources), |
@@ -765,7 +778,7 @@ static inline void configure_usart2_pins(void) | |||
765 | at91_set_A_periph(AT91_PIN_PC14, 1); /* TXD2 */ | 778 | at91_set_A_periph(AT91_PIN_PC14, 1); /* TXD2 */ |
766 | } | 779 | } |
767 | 780 | ||
768 | struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 781 | static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
769 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 782 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
770 | 783 | ||
771 | void __init at91_init_serial(struct at91_uart_config *config) | 784 | void __init at91_init_serial(struct at91_uart_config *config) |
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c index b4eb21769db..9bdcf45defc 100644 --- a/arch/arm/mach-at91/at91sam9263_devices.c +++ b/arch/arm/mach-at91/at91sam9263_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 | ||
@@ -32,7 +33,7 @@ | |||
32 | * -------------------------------------------------------------------- */ | 33 | * -------------------------------------------------------------------- */ |
33 | 34 | ||
34 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 35 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
35 | static u64 ohci_dmamask = 0xffffffffUL; | 36 | static u64 ohci_dmamask = DMA_BIT_MASK(32); |
36 | static struct at91_usbh_data usbh_data; | 37 | static struct at91_usbh_data usbh_data; |
37 | 38 | ||
38 | static struct resource usbh_resources[] = { | 39 | static struct resource usbh_resources[] = { |
@@ -53,7 +54,7 @@ static struct platform_device at91_usbh_device = { | |||
53 | .id = -1, | 54 | .id = -1, |
54 | .dev = { | 55 | .dev = { |
55 | .dma_mask = &ohci_dmamask, | 56 | .dma_mask = &ohci_dmamask, |
56 | .coherent_dma_mask = 0xffffffff, | 57 | .coherent_dma_mask = DMA_BIT_MASK(32), |
57 | .platform_data = &usbh_data, | 58 | .platform_data = &usbh_data, |
58 | }, | 59 | }, |
59 | .resource = usbh_resources, | 60 | .resource = usbh_resources, |
@@ -136,7 +137,7 @@ void __init at91_add_device_udc(struct at91_udc_data *data) {} | |||
136 | * -------------------------------------------------------------------- */ | 137 | * -------------------------------------------------------------------- */ |
137 | 138 | ||
138 | #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) | 139 | #if defined(CONFIG_MACB) || defined(CONFIG_MACB_MODULE) |
139 | static u64 eth_dmamask = 0xffffffffUL; | 140 | static u64 eth_dmamask = DMA_BIT_MASK(32); |
140 | static struct at91_eth_data eth_data; | 141 | static struct at91_eth_data eth_data; |
141 | 142 | ||
142 | static struct resource eth_resources[] = { | 143 | static struct resource eth_resources[] = { |
@@ -157,7 +158,7 @@ static struct platform_device at91sam9263_eth_device = { | |||
157 | .id = -1, | 158 | .id = -1, |
158 | .dev = { | 159 | .dev = { |
159 | .dma_mask = ð_dmamask, | 160 | .dma_mask = ð_dmamask, |
160 | .coherent_dma_mask = 0xffffffff, | 161 | .coherent_dma_mask = DMA_BIT_MASK(32), |
161 | .platform_data = ð_data, | 162 | .platform_data = ð_data, |
162 | }, | 163 | }, |
163 | .resource = eth_resources, | 164 | .resource = eth_resources, |
@@ -210,7 +211,7 @@ void __init at91_add_device_eth(struct at91_eth_data *data) {} | |||
210 | * -------------------------------------------------------------------- */ | 211 | * -------------------------------------------------------------------- */ |
211 | 212 | ||
212 | #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) | 213 | #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) |
213 | static u64 mmc_dmamask = 0xffffffffUL; | 214 | static u64 mmc_dmamask = DMA_BIT_MASK(32); |
214 | static struct at91_mmc_data mmc0_data, mmc1_data; | 215 | static struct at91_mmc_data mmc0_data, mmc1_data; |
215 | 216 | ||
216 | static struct resource mmc0_resources[] = { | 217 | static struct resource mmc0_resources[] = { |
@@ -231,7 +232,7 @@ static struct platform_device at91sam9263_mmc0_device = { | |||
231 | .id = 0, | 232 | .id = 0, |
232 | .dev = { | 233 | .dev = { |
233 | .dma_mask = &mmc_dmamask, | 234 | .dma_mask = &mmc_dmamask, |
234 | .coherent_dma_mask = 0xffffffff, | 235 | .coherent_dma_mask = DMA_BIT_MASK(32), |
235 | .platform_data = &mmc0_data, | 236 | .platform_data = &mmc0_data, |
236 | }, | 237 | }, |
237 | .resource = mmc0_resources, | 238 | .resource = mmc0_resources, |
@@ -256,7 +257,7 @@ static struct platform_device at91sam9263_mmc1_device = { | |||
256 | .id = 1, | 257 | .id = 1, |
257 | .dev = { | 258 | .dev = { |
258 | .dma_mask = &mmc_dmamask, | 259 | .dma_mask = &mmc_dmamask, |
259 | .coherent_dma_mask = 0xffffffff, | 260 | .coherent_dma_mask = DMA_BIT_MASK(32), |
260 | .platform_data = &mmc1_data, | 261 | .platform_data = &mmc1_data, |
261 | }, | 262 | }, |
262 | .resource = mmc1_resources, | 263 | .resource = mmc1_resources, |
@@ -500,7 +501,7 @@ void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | |||
500 | * -------------------------------------------------------------------- */ | 501 | * -------------------------------------------------------------------- */ |
501 | 502 | ||
502 | #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) | 503 | #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) |
503 | static u64 spi_dmamask = 0xffffffffUL; | 504 | static u64 spi_dmamask = DMA_BIT_MASK(32); |
504 | 505 | ||
505 | static struct resource spi0_resources[] = { | 506 | static struct resource spi0_resources[] = { |
506 | [0] = { | 507 | [0] = { |
@@ -520,7 +521,7 @@ static struct platform_device at91sam9263_spi0_device = { | |||
520 | .id = 0, | 521 | .id = 0, |
521 | .dev = { | 522 | .dev = { |
522 | .dma_mask = &spi_dmamask, | 523 | .dma_mask = &spi_dmamask, |
523 | .coherent_dma_mask = 0xffffffff, | 524 | .coherent_dma_mask = DMA_BIT_MASK(32), |
524 | }, | 525 | }, |
525 | .resource = spi0_resources, | 526 | .resource = spi0_resources, |
526 | .num_resources = ARRAY_SIZE(spi0_resources), | 527 | .num_resources = ARRAY_SIZE(spi0_resources), |
@@ -546,7 +547,7 @@ static struct platform_device at91sam9263_spi1_device = { | |||
546 | .id = 1, | 547 | .id = 1, |
547 | .dev = { | 548 | .dev = { |
548 | .dma_mask = &spi_dmamask, | 549 | .dma_mask = &spi_dmamask, |
549 | .coherent_dma_mask = 0xffffffff, | 550 | .coherent_dma_mask = DMA_BIT_MASK(32), |
550 | }, | 551 | }, |
551 | .resource = spi1_resources, | 552 | .resource = spi1_resources, |
552 | .num_resources = ARRAY_SIZE(spi1_resources), | 553 | .num_resources = ARRAY_SIZE(spi1_resources), |
@@ -612,7 +613,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
612 | * -------------------------------------------------------------------- */ | 613 | * -------------------------------------------------------------------- */ |
613 | 614 | ||
614 | #if defined(CONFIG_SND_AT91_AC97) || defined(CONFIG_SND_AT91_AC97_MODULE) | 615 | #if defined(CONFIG_SND_AT91_AC97) || defined(CONFIG_SND_AT91_AC97_MODULE) |
615 | static u64 ac97_dmamask = 0xffffffffUL; | 616 | static u64 ac97_dmamask = DMA_BIT_MASK(32); |
616 | static struct atmel_ac97_data ac97_data; | 617 | static struct atmel_ac97_data ac97_data; |
617 | 618 | ||
618 | static struct resource ac97_resources[] = { | 619 | static struct resource ac97_resources[] = { |
@@ -633,7 +634,7 @@ static struct platform_device at91sam9263_ac97_device = { | |||
633 | .id = 1, | 634 | .id = 1, |
634 | .dev = { | 635 | .dev = { |
635 | .dma_mask = &ac97_dmamask, | 636 | .dma_mask = &ac97_dmamask, |
636 | .coherent_dma_mask = 0xffffffff, | 637 | .coherent_dma_mask = DMA_BIT_MASK(32), |
637 | .platform_data = &ac97_data, | 638 | .platform_data = &ac97_data, |
638 | }, | 639 | }, |
639 | .resource = ac97_resources, | 640 | .resource = ac97_resources, |
@@ -667,7 +668,7 @@ void __init at91_add_device_ac97(struct atmel_ac97_data *data) {} | |||
667 | * -------------------------------------------------------------------- */ | 668 | * -------------------------------------------------------------------- */ |
668 | 669 | ||
669 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) | 670 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) |
670 | static u64 lcdc_dmamask = 0xffffffffUL; | 671 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); |
671 | static struct atmel_lcdfb_info lcdc_data; | 672 | static struct atmel_lcdfb_info lcdc_data; |
672 | 673 | ||
673 | static struct resource lcdc_resources[] = { | 674 | static struct resource lcdc_resources[] = { |
@@ -688,7 +689,7 @@ static struct platform_device at91_lcdc_device = { | |||
688 | .id = 0, | 689 | .id = 0, |
689 | .dev = { | 690 | .dev = { |
690 | .dma_mask = &lcdc_dmamask, | 691 | .dma_mask = &lcdc_dmamask, |
691 | .coherent_dma_mask = 0xffffffff, | 692 | .coherent_dma_mask = DMA_BIT_MASK(32), |
692 | .platform_data = &lcdc_data, | 693 | .platform_data = &lcdc_data, |
693 | }, | 694 | }, |
694 | .resource = lcdc_resources, | 695 | .resource = lcdc_resources, |
@@ -889,12 +890,15 @@ static struct atmel_uart_data dbgu_data = { | |||
889 | .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU), | 890 | .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU), |
890 | }; | 891 | }; |
891 | 892 | ||
893 | static u64 dbgu_dmamask = DMA_BIT_MASK(32); | ||
894 | |||
892 | static struct platform_device at91sam9263_dbgu_device = { | 895 | static struct platform_device at91sam9263_dbgu_device = { |
893 | .name = "atmel_usart", | 896 | .name = "atmel_usart", |
894 | .id = 0, | 897 | .id = 0, |
895 | .dev = { | 898 | .dev = { |
896 | .platform_data = &dbgu_data, | 899 | .dma_mask = &dbgu_dmamask, |
897 | .coherent_dma_mask = 0xffffffff, | 900 | .coherent_dma_mask = DMA_BIT_MASK(32), |
901 | .platform_data = &dbgu_data, | ||
898 | }, | 902 | }, |
899 | .resource = dbgu_resources, | 903 | .resource = dbgu_resources, |
900 | .num_resources = ARRAY_SIZE(dbgu_resources), | 904 | .num_resources = ARRAY_SIZE(dbgu_resources), |
@@ -924,12 +928,15 @@ static struct atmel_uart_data uart0_data = { | |||
924 | .use_dma_rx = 1, | 928 | .use_dma_rx = 1, |
925 | }; | 929 | }; |
926 | 930 | ||
931 | static u64 uart0_dmamask = DMA_BIT_MASK(32); | ||
932 | |||
927 | static struct platform_device at91sam9263_uart0_device = { | 933 | static struct platform_device at91sam9263_uart0_device = { |
928 | .name = "atmel_usart", | 934 | .name = "atmel_usart", |
929 | .id = 1, | 935 | .id = 1, |
930 | .dev = { | 936 | .dev = { |
931 | .platform_data = &uart0_data, | 937 | .dma_mask = &uart0_dmamask, |
932 | .coherent_dma_mask = 0xffffffff, | 938 | .coherent_dma_mask = DMA_BIT_MASK(32), |
939 | .platform_data = &uart0_data, | ||
933 | }, | 940 | }, |
934 | .resource = uart0_resources, | 941 | .resource = uart0_resources, |
935 | .num_resources = ARRAY_SIZE(uart0_resources), | 942 | .num_resources = ARRAY_SIZE(uart0_resources), |
@@ -961,12 +968,15 @@ static struct atmel_uart_data uart1_data = { | |||
961 | .use_dma_rx = 1, | 968 | .use_dma_rx = 1, |
962 | }; | 969 | }; |
963 | 970 | ||
971 | static u64 uart1_dmamask = DMA_BIT_MASK(32); | ||
972 | |||
964 | static struct platform_device at91sam9263_uart1_device = { | 973 | static struct platform_device at91sam9263_uart1_device = { |
965 | .name = "atmel_usart", | 974 | .name = "atmel_usart", |
966 | .id = 2, | 975 | .id = 2, |
967 | .dev = { | 976 | .dev = { |
968 | .platform_data = &uart1_data, | 977 | .dma_mask = &uart1_dmamask, |
969 | .coherent_dma_mask = 0xffffffff, | 978 | .coherent_dma_mask = DMA_BIT_MASK(32), |
979 | .platform_data = &uart1_data, | ||
970 | }, | 980 | }, |
971 | .resource = uart1_resources, | 981 | .resource = uart1_resources, |
972 | .num_resources = ARRAY_SIZE(uart1_resources), | 982 | .num_resources = ARRAY_SIZE(uart1_resources), |
@@ -998,12 +1008,15 @@ static struct atmel_uart_data uart2_data = { | |||
998 | .use_dma_rx = 1, | 1008 | .use_dma_rx = 1, |
999 | }; | 1009 | }; |
1000 | 1010 | ||
1011 | static u64 uart2_dmamask = DMA_BIT_MASK(32); | ||
1012 | |||
1001 | static struct platform_device at91sam9263_uart2_device = { | 1013 | static struct platform_device at91sam9263_uart2_device = { |
1002 | .name = "atmel_usart", | 1014 | .name = "atmel_usart", |
1003 | .id = 3, | 1015 | .id = 3, |
1004 | .dev = { | 1016 | .dev = { |
1005 | .platform_data = &uart2_data, | 1017 | .dma_mask = &uart2_dmamask, |
1006 | .coherent_dma_mask = 0xffffffff, | 1018 | .coherent_dma_mask = DMA_BIT_MASK(32), |
1019 | .platform_data = &uart2_data, | ||
1007 | }, | 1020 | }, |
1008 | .resource = uart2_resources, | 1021 | .resource = uart2_resources, |
1009 | .num_resources = ARRAY_SIZE(uart2_resources), | 1022 | .num_resources = ARRAY_SIZE(uart2_resources), |
@@ -1017,7 +1030,7 @@ static inline void configure_usart2_pins(void) | |||
1017 | at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */ | 1030 | at91_set_B_periph(AT91_PIN_PD6, 0); /* CTS2 */ |
1018 | } | 1031 | } |
1019 | 1032 | ||
1020 | struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 1033 | static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
1021 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 1034 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
1022 | 1035 | ||
1023 | void __init at91_init_serial(struct at91_uart_config *config) | 1036 | void __init at91_init_serial(struct at91_uart_config *config) |
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 19ca71d3faa..bec8066f9ba 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <asm/mach/arch.h> | 9 | #include <asm/mach/arch.h> |
10 | #include <asm/mach/map.h> | 10 | #include <asm/mach/map.h> |
11 | 11 | ||
12 | #include <linux/dma-mapping.h> | ||
12 | #include <linux/platform_device.h> | 13 | #include <linux/platform_device.h> |
13 | #include <linux/i2c-gpio.h> | 14 | #include <linux/i2c-gpio.h> |
14 | 15 | ||
@@ -29,7 +30,7 @@ | |||
29 | * -------------------------------------------------------------------- */ | 30 | * -------------------------------------------------------------------- */ |
30 | 31 | ||
31 | #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) | 32 | #if defined(CONFIG_MMC_AT91) || defined(CONFIG_MMC_AT91_MODULE) |
32 | static u64 mmc_dmamask = 0xffffffffUL; | 33 | static u64 mmc_dmamask = DMA_BIT_MASK(32); |
33 | static struct at91_mmc_data mmc_data; | 34 | static struct at91_mmc_data mmc_data; |
34 | 35 | ||
35 | static struct resource mmc_resources[] = { | 36 | static struct resource mmc_resources[] = { |
@@ -50,7 +51,7 @@ static struct platform_device at91sam9rl_mmc_device = { | |||
50 | .id = -1, | 51 | .id = -1, |
51 | .dev = { | 52 | .dev = { |
52 | .dma_mask = &mmc_dmamask, | 53 | .dma_mask = &mmc_dmamask, |
53 | .coherent_dma_mask = 0xffffffff, | 54 | .coherent_dma_mask = DMA_BIT_MASK(32), |
54 | .platform_data = &mmc_data, | 55 | .platform_data = &mmc_data, |
55 | }, | 56 | }, |
56 | .resource = mmc_resources, | 57 | .resource = mmc_resources, |
@@ -247,7 +248,7 @@ void __init at91_add_device_i2c(struct i2c_board_info *devices, int nr_devices) | |||
247 | * -------------------------------------------------------------------- */ | 248 | * -------------------------------------------------------------------- */ |
248 | 249 | ||
249 | #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) | 250 | #if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) |
250 | static u64 spi_dmamask = 0xffffffffUL; | 251 | static u64 spi_dmamask = DMA_BIT_MASK(32); |
251 | 252 | ||
252 | static struct resource spi_resources[] = { | 253 | static struct resource spi_resources[] = { |
253 | [0] = { | 254 | [0] = { |
@@ -267,7 +268,7 @@ static struct platform_device at91sam9rl_spi_device = { | |||
267 | .id = 0, | 268 | .id = 0, |
268 | .dev = { | 269 | .dev = { |
269 | .dma_mask = &spi_dmamask, | 270 | .dma_mask = &spi_dmamask, |
270 | .coherent_dma_mask = 0xffffffff, | 271 | .coherent_dma_mask = DMA_BIT_MASK(32), |
271 | }, | 272 | }, |
272 | .resource = spi_resources, | 273 | .resource = spi_resources, |
273 | .num_resources = ARRAY_SIZE(spi_resources), | 274 | .num_resources = ARRAY_SIZE(spi_resources), |
@@ -312,7 +313,7 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices) | |||
312 | * -------------------------------------------------------------------- */ | 313 | * -------------------------------------------------------------------- */ |
313 | 314 | ||
314 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) | 315 | #if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE) |
315 | static u64 lcdc_dmamask = 0xffffffffUL; | 316 | static u64 lcdc_dmamask = DMA_BIT_MASK(32); |
316 | static struct atmel_lcdfb_info lcdc_data; | 317 | static struct atmel_lcdfb_info lcdc_data; |
317 | 318 | ||
318 | static struct resource lcdc_resources[] = { | 319 | static struct resource lcdc_resources[] = { |
@@ -340,7 +341,7 @@ static struct platform_device at91_lcdc_device = { | |||
340 | .id = 0, | 341 | .id = 0, |
341 | .dev = { | 342 | .dev = { |
342 | .dma_mask = &lcdc_dmamask, | 343 | .dma_mask = &lcdc_dmamask, |
343 | .coherent_dma_mask = 0xffffffff, | 344 | .coherent_dma_mask = DMA_BIT_MASK(32), |
344 | .platform_data = &lcdc_data, | 345 | .platform_data = &lcdc_data, |
345 | }, | 346 | }, |
346 | .resource = lcdc_resources, | 347 | .resource = lcdc_resources, |
@@ -494,12 +495,15 @@ static struct atmel_uart_data dbgu_data = { | |||
494 | .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU), | 495 | .regs = (void __iomem *)(AT91_VA_BASE_SYS + AT91_DBGU), |
495 | }; | 496 | }; |
496 | 497 | ||
498 | static u64 dbgu_dmamask = DMA_BIT_MASK(32); | ||
499 | |||
497 | static struct platform_device at91sam9rl_dbgu_device = { | 500 | static struct platform_device at91sam9rl_dbgu_device = { |
498 | .name = "atmel_usart", | 501 | .name = "atmel_usart", |
499 | .id = 0, | 502 | .id = 0, |
500 | .dev = { | 503 | .dev = { |
501 | .platform_data = &dbgu_data, | 504 | .dma_mask = &dbgu_dmamask, |
502 | .coherent_dma_mask = 0xffffffff, | 505 | .coherent_dma_mask = DMA_BIT_MASK(32), |
506 | .platform_data = &dbgu_data, | ||
503 | }, | 507 | }, |
504 | .resource = dbgu_resources, | 508 | .resource = dbgu_resources, |
505 | .num_resources = ARRAY_SIZE(dbgu_resources), | 509 | .num_resources = ARRAY_SIZE(dbgu_resources), |
@@ -529,12 +533,15 @@ static struct atmel_uart_data uart0_data = { | |||
529 | .use_dma_rx = 1, | 533 | .use_dma_rx = 1, |
530 | }; | 534 | }; |
531 | 535 | ||
536 | static u64 uart0_dmamask = DMA_BIT_MASK(32); | ||
537 | |||
532 | static struct platform_device at91sam9rl_uart0_device = { | 538 | static struct platform_device at91sam9rl_uart0_device = { |
533 | .name = "atmel_usart", | 539 | .name = "atmel_usart", |
534 | .id = 1, | 540 | .id = 1, |
535 | .dev = { | 541 | .dev = { |
536 | .platform_data = &uart0_data, | 542 | .dma_mask = &uart0_dmamask, |
537 | .coherent_dma_mask = 0xffffffff, | 543 | .coherent_dma_mask = DMA_BIT_MASK(32), |
544 | .platform_data = &uart0_data, | ||
538 | }, | 545 | }, |
539 | .resource = uart0_resources, | 546 | .resource = uart0_resources, |
540 | .num_resources = ARRAY_SIZE(uart0_resources), | 547 | .num_resources = ARRAY_SIZE(uart0_resources), |
@@ -566,12 +573,15 @@ static struct atmel_uart_data uart1_data = { | |||
566 | .use_dma_rx = 1, | 573 | .use_dma_rx = 1, |
567 | }; | 574 | }; |
568 | 575 | ||
576 | static u64 uart1_dmamask = DMA_BIT_MASK(32); | ||
577 | |||
569 | static struct platform_device at91sam9rl_uart1_device = { | 578 | static struct platform_device at91sam9rl_uart1_device = { |
570 | .name = "atmel_usart", | 579 | .name = "atmel_usart", |
571 | .id = 2, | 580 | .id = 2, |
572 | .dev = { | 581 | .dev = { |
573 | .platform_data = &uart1_data, | 582 | .dma_mask = &uart1_dmamask, |
574 | .coherent_dma_mask = 0xffffffff, | 583 | .coherent_dma_mask = DMA_BIT_MASK(32), |
584 | .platform_data = &uart1_data, | ||
575 | }, | 585 | }, |
576 | .resource = uart1_resources, | 586 | .resource = uart1_resources, |
577 | .num_resources = ARRAY_SIZE(uart1_resources), | 587 | .num_resources = ARRAY_SIZE(uart1_resources), |
@@ -601,12 +611,15 @@ static struct atmel_uart_data uart2_data = { | |||
601 | .use_dma_rx = 1, | 611 | .use_dma_rx = 1, |
602 | }; | 612 | }; |
603 | 613 | ||
614 | static u64 uart2_dmamask = DMA_BIT_MASK(32); | ||
615 | |||
604 | static struct platform_device at91sam9rl_uart2_device = { | 616 | static struct platform_device at91sam9rl_uart2_device = { |
605 | .name = "atmel_usart", | 617 | .name = "atmel_usart", |
606 | .id = 3, | 618 | .id = 3, |
607 | .dev = { | 619 | .dev = { |
608 | .platform_data = &uart2_data, | 620 | .dma_mask = &uart2_dmamask, |
609 | .coherent_dma_mask = 0xffffffff, | 621 | .coherent_dma_mask = DMA_BIT_MASK(32), |
622 | .platform_data = &uart2_data, | ||
610 | }, | 623 | }, |
611 | .resource = uart2_resources, | 624 | .resource = uart2_resources, |
612 | .num_resources = ARRAY_SIZE(uart2_resources), | 625 | .num_resources = ARRAY_SIZE(uart2_resources), |
@@ -636,12 +649,15 @@ static struct atmel_uart_data uart3_data = { | |||
636 | .use_dma_rx = 1, | 649 | .use_dma_rx = 1, |
637 | }; | 650 | }; |
638 | 651 | ||
652 | static u64 uart3_dmamask = DMA_BIT_MASK(32); | ||
653 | |||
639 | static struct platform_device at91sam9rl_uart3_device = { | 654 | static struct platform_device at91sam9rl_uart3_device = { |
640 | .name = "atmel_usart", | 655 | .name = "atmel_usart", |
641 | .id = 4, | 656 | .id = 4, |
642 | .dev = { | 657 | .dev = { |
643 | .platform_data = &uart3_data, | 658 | .dma_mask = &uart3_dmamask, |
644 | .coherent_dma_mask = 0xffffffff, | 659 | .coherent_dma_mask = DMA_BIT_MASK(32), |
660 | .platform_data = &uart3_data, | ||
645 | }, | 661 | }, |
646 | .resource = uart3_resources, | 662 | .resource = uart3_resources, |
647 | .num_resources = ARRAY_SIZE(uart3_resources), | 663 | .num_resources = ARRAY_SIZE(uart3_resources), |
@@ -653,7 +669,7 @@ static inline void configure_usart3_pins(void) | |||
653 | at91_set_A_periph(AT91_PIN_PB1, 0); /* RXD3 */ | 669 | at91_set_A_periph(AT91_PIN_PB1, 0); /* RXD3 */ |
654 | } | 670 | } |
655 | 671 | ||
656 | struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 672 | static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
657 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 673 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
658 | 674 | ||
659 | void __init at91_init_serial(struct at91_uart_config *config) | 675 | void __init at91_init_serial(struct at91_uart_config *config) |