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/at91sam9rl_devices.c | |
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/at91sam9rl_devices.c')
-rw-r--r-- | arch/arm/mach-at91/at91sam9rl_devices.c | 50 |
1 files changed, 33 insertions, 17 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 19ca71d3faab..bec8066f9ba1 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) |