aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/at91sam9263_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/at91sam9263_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/at91sam9263_devices.c')
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c59
1 files changed, 36 insertions, 23 deletions
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index b4eb21769db9..9bdcf45defcf 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)
35static u64 ohci_dmamask = 0xffffffffUL; 36static u64 ohci_dmamask = DMA_BIT_MASK(32);
36static struct at91_usbh_data usbh_data; 37static struct at91_usbh_data usbh_data;
37 38
38static struct resource usbh_resources[] = { 39static 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)
139static u64 eth_dmamask = 0xffffffffUL; 140static u64 eth_dmamask = DMA_BIT_MASK(32);
140static struct at91_eth_data eth_data; 141static struct at91_eth_data eth_data;
141 142
142static struct resource eth_resources[] = { 143static 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 = &eth_dmamask, 160 .dma_mask = &eth_dmamask,
160 .coherent_dma_mask = 0xffffffff, 161 .coherent_dma_mask = DMA_BIT_MASK(32),
161 .platform_data = &eth_data, 162 .platform_data = &eth_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)
213static u64 mmc_dmamask = 0xffffffffUL; 214static u64 mmc_dmamask = DMA_BIT_MASK(32);
214static struct at91_mmc_data mmc0_data, mmc1_data; 215static struct at91_mmc_data mmc0_data, mmc1_data;
215 216
216static struct resource mmc0_resources[] = { 217static 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)
503static u64 spi_dmamask = 0xffffffffUL; 504static u64 spi_dmamask = DMA_BIT_MASK(32);
504 505
505static struct resource spi0_resources[] = { 506static 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)
615static u64 ac97_dmamask = 0xffffffffUL; 616static u64 ac97_dmamask = DMA_BIT_MASK(32);
616static struct atmel_ac97_data ac97_data; 617static struct atmel_ac97_data ac97_data;
617 618
618static struct resource ac97_resources[] = { 619static 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)
670static u64 lcdc_dmamask = 0xffffffffUL; 671static u64 lcdc_dmamask = DMA_BIT_MASK(32);
671static struct atmel_lcdfb_info lcdc_data; 672static struct atmel_lcdfb_info lcdc_data;
672 673
673static struct resource lcdc_resources[] = { 674static 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
893static u64 dbgu_dmamask = DMA_BIT_MASK(32);
894
892static struct platform_device at91sam9263_dbgu_device = { 895static 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
931static u64 uart0_dmamask = DMA_BIT_MASK(32);
932
927static struct platform_device at91sam9263_uart0_device = { 933static 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
971static u64 uart1_dmamask = DMA_BIT_MASK(32);
972
964static struct platform_device at91sam9263_uart1_device = { 973static 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
1011static u64 uart2_dmamask = DMA_BIT_MASK(32);
1012
1001static struct platform_device at91sam9263_uart2_device = { 1013static 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
1020struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ 1033static struct platform_device *at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */
1021struct platform_device *atmel_default_console_device; /* the serial console device */ 1034struct platform_device *atmel_default_console_device; /* the serial console device */
1022 1035
1023void __init at91_init_serial(struct at91_uart_config *config) 1036void __init at91_init_serial(struct at91_uart_config *config)