aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91rm9200_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/at91rm9200_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/at91rm9200_devices.c')
-rw-r--r--arch/arm/mach-at91/at91rm9200_devices.c54
1 files changed, 35 insertions, 19 deletions
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
index 9296833f91cc..a601c7c1670e 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)
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 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)
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 at91rm9200_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,
@@ -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)
288static u64 mmc_dmamask = 0xffffffffUL; 289static u64 mmc_dmamask = DMA_BIT_MASK(32);
289static struct at91_mmc_data mmc_data; 290static struct at91_mmc_data mmc_data;
290 291
291static struct resource mmc_resources[] = { 292static 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)
516static u64 spi_dmamask = 0xffffffffUL; 517static u64 spi_dmamask = DMA_BIT_MASK(32);
517 518
518static struct resource spi_resources[] = { 519static 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
662static u64 dbgu_dmamask = DMA_BIT_MASK(32);
663
661static struct platform_device at91rm9200_dbgu_device = { 664static 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
700static u64 uart0_dmamask = DMA_BIT_MASK(32);
701
696static struct platform_device at91rm9200_uart0_device = { 702static 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
745static u64 uart1_dmamask = DMA_BIT_MASK(32);
746
738static struct platform_device at91rm9200_uart1_device = { 747static 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
789static u64 uart2_dmamask = DMA_BIT_MASK(32);
790
779static struct platform_device at91rm9200_uart2_device = { 791static 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
827static u64 uart3_dmamask = DMA_BIT_MASK(32);
828
814static struct platform_device at91rm9200_uart3_device = { 829static 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
831struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 847static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
832struct platform_device *atmel_default_console_device; /* the serial console device */ 848struct platform_device *atmel_default_console_device; /* the serial console device */
833 849
834void __init at91_init_serial(struct at91_uart_config *config) 850void __init at91_init_serial(struct at91_uart_config *config)