dataSynchronizationMemory.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * Copyright (C) 2007 Atmel Corporation
  3. *
  4. * This file is subject to the terms and conditions of the GNU General Public
  5. * License. See the file COPYING in the main directory of this archive for
  6. * more details.
  7. */
  8. #include <asm/mach/arch.h>
  9. #include <asm/mach/map.h>
  10. #include <linux/dma-mapping.h>
  11. #include <linux/gpio.h>
  12. #include <linux/platform_device.h>
  13. #include <linux/i2c-gpio.h>
  14. #include <linux/fb.h>
  15. #include <video/atmel_lcdc.h>
  16. #include <mach/at91sam9rl.h>
  17. #include <mach/at91sam9rl_matrix.h>
  18. #include <mach/at91_matrix.h>
  19. #include <mach/at91sam9_smc.h>
  20. #include <linux/platform_data/dma-atmel.h>
  21. #include "board.h"
  22. #include "generic.h"
  23. /* --------------------------------------------------------------------
  24. * HDMAC - AHB DMA Controller
  25. * -------------------------------------------------------------------- */
  26. #if defined(CONFIG_AT_HDMAC) || defined(CONFIG_AT_HDMAC_MODULE)
  27. static u64 hdmac_dmamask = DMA_BIT_MASK(32);
  28. static struct resource hdmac_resources[] = {
  29. [0] = {
  30. .start = AT91SAM9RL_BASE_DMA,
  31. .end = AT91SAM9RL_BASE_DMA + SZ_512 - 1,
  32. .flags = IORESOURCE_MEM,
  33. },
  34. [2] = {
  35. .start = NR_IRQS_LEGACY + AT91SAM9RL_ID_DMA,
  36. .end = NR_IRQS_LEGACY + AT91SAM9RL_ID_DMA,
  37. .flags = IORESOURCE_IRQ,
  38. },
  39. };
  40. static struct platform_device at_hdmac_device = {
  41. .name = "at91sam9rl_dma",
  42. .id = -1,
  43. .dev = {
  44. .dma_mask = &hdmac_dmamask,
  45. .coherent_dma_mask = DMA_BIT_MASK(32),
  46. },
  47. .resource = hdmac_resources,
  48. .num_resources = ARRAY_SIZE(hdmac_resources),
  49. };
  50. void __init at91_add_device_hdmac(void)
  51. {
  52. platform_device_register(&at_hdmac_device);
  53. }
  54. #else
  55. void __init at91_add_device_hdmac(void) {}
  56. #endif
  57. /* --------------------------------------------------------------------
  58. * USB HS Device (Gadget)
  59. * -------------------------------------------------------------------- */
  60. #if defined(CONFIG_USB_ATMEL_USBA) || defined(CONFIG_USB_ATMEL_USBA_MODULE)
  61. static struct resource usba_udc_resources[] = {
  62. [0] = {
  63. .start = AT91SAM9RL_UDPHS_FIFO,
  64. .end = AT91SAM9RL_UDPHS_FIFO + SZ_512K - 1,
  65. .flags = IORESOURCE_MEM,
  66. },
  67. [1] = {
  68. .start = AT91SAM9RL_BASE_UDPHS,
  69. .end = AT91SAM9RL_BASE_UDPHS + SZ_1K - 1,
  70. .flags = IORESOURCE_MEM,
  71. },
  72. [2] = {
  73. .start = NR_IRQS_LEGACY + AT91SAM9RL_ID_UDPHS,
  74. .end = NR_IRQS_LEGACY + AT91SAM9RL_ID_UDPHS,
  75. .flags = IORESOURCE_IRQ,
  76. },
  77. };
  78. #define EP(nam, idx, maxpkt, maxbk, dma, isoc) \
  79. [idx] = { \
  80. .name = nam, \
  81. .index = idx, \
  82. .fifo_size = maxpkt, \
  83. .nr_banks = maxbk, \
  84. .can_dma = dma, \
  85. .can_isoc = isoc, \
  86. }
  87. static struct usba_ep_data usba_udc_ep[] __initdata = {
  88. EP("ep0", 0, 64, 1, 0, 0),
  89. EP("ep1", 1, 1024, 2, 1, 1),
  90. EP("ep2", 2, 1024, 2, 1, 1),
  91. EP("ep3", 3, 1024, 3, 1, 0),
  92. EP("ep4", 4, 1024, 3, 1, 0),
  93. EP("ep5", 5, 1024, 3, 1, 1),
  94. EP("ep6", 6, 1024, 3, 1, 1),
  95. };
  96. #undef EP
  97. /*
  98. * pdata doesn't have room for any endpoints, so we need to
  99. * append room for the ones we need right after it.
  100. */
  101. static struct {
  102. struct usba_platform_data pdata;
  103. struct usba_ep_data ep[7];
  104. } usba_udc_data;
  105. static struct platform_device at91_usba_udc_device = {
  106. .name = "atmel_usba_udc",
  107. .id = -1,
  108. .dev = {
  109. .platform_data = &usba_udc_data.pdata,
  110. },