devices-db8500.c 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Copyright (C) ST-Ericsson SA 2010
  3. *
  4. * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
  5. * License terms: GNU General Public License (GPL) version 2
  6. */
  7. #include <linux/kernel.h>
  8. #include <linux/platform_device.h>
  9. #include <linux/interrupt.h>
  10. #include <linux/io.h>
  11. #include <linux/gpio.h>
  12. #include <linux/amba/bus.h>
  13. #include <linux/amba/pl022.h>
  14. #include <linux/platform_data/dma-ste-dma40.h>
  15. #include <linux/mfd/dbx500-prcmu.h>
  16. #include "setup.h"
  17. #include "irqs.h"
  18. #include "db8500-regs.h"
  19. #include "devices-db8500.h"
  20. #include "ste-dma40-db8500.h"
  21. static struct resource dma40_resources[] = {
  22. [0] = {
  23. .start = U8500_DMA_BASE,
  24. .end = U8500_DMA_BASE + SZ_4K - 1,
  25. .flags = IORESOURCE_MEM,
  26. .name = "base",
  27. },
  28. [1] = {
  29. .start = U8500_DMA_LCPA_BASE,
  30. .end = U8500_DMA_LCPA_BASE + 2 * SZ_1K - 1,
  31. .flags = IORESOURCE_MEM,
  32. .name = "lcpa",
  33. },
  34. [2] = {
  35. .start = IRQ_DB8500_DMA,
  36. .end = IRQ_DB8500_DMA,
  37. .flags = IORESOURCE_IRQ,
  38. }
  39. };
  40. struct stedma40_platform_data dma40_plat_data = {
  41. .disabled_channels = {-1},
  42. };
  43. struct platform_device u8500_dma40_device = {
  44. .dev = {
  45. .platform_data = &dma40_plat_data,
  46. .coherent_dma_mask = DMA_BIT_MASK(32),
  47. },
  48. .name = "dma40",
  49. .id = 0,
  50. .num_resources = ARRAY_SIZE(dma40_resources),
  51. .resource = dma40_resources
  52. };
  53. struct prcmu_pdata db8500_prcmu_pdata = {
  54. .ab_platdata = &ab8500_platdata,
  55. .ab_irq = IRQ_DB8500_AB8500,
  56. .irq_base = IRQ_PRCMU_BASE,
  57. .version_offset = DB8500_PRCMU_FW_VERSION_OFFSET,
  58. .legacy_offset = DB8500_PRCMU_LEGACY_OFFSET,
  59. };
  60. static struct resource db8500_prcmu_res[] = {
  61. {
  62. .name = "prcmu",
  63. .start = U8500_PRCMU_BASE,
  64. .end = U8500_PRCMU_BASE + SZ_8K - 1,
  65. .flags = IORESOURCE_MEM,
  66. },
  67. {
  68. .name = "prcmu-tcdm",
  69. .start = U8500_PRCMU_TCDM_BASE,
  70. .end = U8500_PRCMU_TCDM_BASE + SZ_4K - 1,
  71. .flags = IORESOURCE_MEM,
  72. },
  73. {
  74. .name = "irq",
  75. .start = IRQ_DB8500_PRCMU1,
  76. .end = IRQ_DB8500_PRCMU1,
  77. .flags = IORESOURCE_IRQ,
  78. },
  79. {
  80. .name = "prcmu-tcpm",
  81. .start = U8500_PRCMU_TCPM_BASE,
  82. .end = U8500_PRCMU_TCPM_BASE + SZ_32K - 1,
  83. .flags = IORESOURCE_MEM,
  84. },
  85. };
  86. struct platform_device db8500_prcmu_device = {
  87. .name = "db8500-prcmu",
  88. .resource = db8500_prcmu_res,
  89. .num_resources = ARRAY_SIZE(db8500_prcmu_res),
  90. .dev = {
  91. .platform_data = &db8500_prcmu_pdata,
  92. },
  93. };