dma.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. * Copyright (C) 2010 Samsung Electronics Co. Ltd.
  3. * Jaswinder Singh <jassi.brar@samsung.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19. #include <linux/platform_device.h>
  20. #include <linux/dma-mapping.h>
  21. #include <plat/devs.h>
  22. #include <plat/irqs.h>
  23. #include <mach/map.h>
  24. #include <mach/irqs.h>
  25. #include <plat/s3c-pl330-pdata.h>
  26. static u64 dma_dmamask = DMA_BIT_MASK(32);
  27. static struct resource s5p6442_pdma_resource[] = {
  28. [0] = {
  29. .start = S5P6442_PA_PDMA,
  30. .end = S5P6442_PA_PDMA + SZ_4K,
  31. .flags = IORESOURCE_MEM,
  32. },
  33. [1] = {
  34. .start = IRQ_PDMA,
  35. .end = IRQ_PDMA,
  36. .flags = IORESOURCE_IRQ,
  37. },
  38. };
  39. static struct s3c_pl330_platdata s5p6442_pdma_pdata = {
  40. .peri = {
  41. [0] = DMACH_UART0_RX,
  42. [1] = DMACH_UART0_TX,
  43. [2] = DMACH_UART1_RX,
  44. [3] = DMACH_UART1_TX,
  45. [4] = DMACH_UART2_RX,
  46. [5] = DMACH_UART2_TX,
  47. [6] = DMACH_MAX,
  48. [7] = DMACH_MAX,
  49. [8] = DMACH_MAX,
  50. [9] = DMACH_I2S0_RX,
  51. [10] = DMACH_I2S0_TX,
  52. [11] = DMACH_I2S0S_TX,
  53. [12] = DMACH_I2S1_RX,
  54. [13] = DMACH_I2S1_TX,
  55. [14] = DMACH_MAX,
  56. [15] = DMACH_MAX,
  57. [16] = DMACH_SPI0_RX,
  58. [17] = DMACH_SPI0_TX,
  59. [18] = DMACH_MAX,
  60. [19] = DMACH_MAX,
  61. [20] = DMACH_PCM0_RX,
  62. [21] = DMACH_PCM0_TX,
  63. [22] = DMACH_PCM1_RX,
  64. [23] = DMACH_PCM1_TX,
  65. [24] = DMACH_MAX,
  66. [25] = DMACH_MAX,
  67. [26] = DMACH_MAX,
  68. [27] = DMACH_MSM_REQ0,
  69. [28] = DMACH_MSM_REQ1,
  70. [29] = DMACH_MSM_REQ2,
  71. [30] = DMACH_MSM_REQ3,
  72. [31] = DMACH_MAX,
  73. },
  74. };
  75. static struct platform_device s5p6442_device_pdma = {
  76. .name = "s3c-pl330",
  77. .id = 1,
  78. .num_resources = ARRAY_SIZE(s5p6442_pdma_resource),
  79. .resource = s5p6442_pdma_resource,
  80. .dev = {
  81. .dma_mask = &dma_dmamask,
  82. .coherent_dma_mask = DMA_BIT_MASK(32),
  83. .platform_data = &s5p6442_pdma_pdata,
  84. },
  85. };
  86. static struct platform_device *s5p6442_dmacs[] __initdata = {
  87. &s5p6442_device_pdma,
  88. };
  89. static int __init s5p6442_dma_init(void)
  90. {
  91. platform_add_devices(s5p6442_dmacs, ARRAY_SIZE(s5p6442_dmacs));
  92. return 0;
  93. }
  94. arch_initcall(s5p6442_dma_init);