devices-db8500.c 2.3 KB

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