gtbus_sun9i.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * GTBUS initialisation for sun9i
  4. *
  5. * (C) Copyright 2016 Theobroma Systems Design und Consulting GmbH
  6. * Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
  7. */
  8. #ifndef _SUNXI_GTBUS_SUN9I_H
  9. #define _SUNXI_GTBUS_SUN9I_H
  10. #include <linux/types.h>
  11. struct sunxi_gtbus_reg {
  12. u32 mst_cfg[36]; /* 0x000 */
  13. u8 reserved1[0x70]; /* 0x090 */
  14. u32 bw_wdw_cfg; /* 0x100 */
  15. u32 mst_read_prio_cfg[2]; /* 0x104 */
  16. u32 lvl2_mst_cfg; /* 0x10c */
  17. u32 sw_clk_on; /* 0x110 */
  18. u32 sw_clk_off; /* 0x114 */
  19. u32 pmu_mst_en; /* 0x118 */
  20. u32 pmu_cfg; /* 0x11c */
  21. u32 pmu_cnt[19]; /* 0x120 */
  22. u32 reserved2[0x94]; /* 0x16c */
  23. u32 cci400_config[3]; /* 0x200 */
  24. u32 cci400_status[2]; /* 0x20c */
  25. };
  26. /* for register GT_MST_CFG_REG(n) */
  27. #define GT_ENABLE_REQ (1<<31) /* clock on */
  28. #define GT_DISABLE_REQ (1<<30) /* clock off */
  29. #define GT_QOS_SHIFT 28
  30. #define GT_THD1_SHIFT 16
  31. #define GT_REQN_MAX 0xf /* max no master requests in one cycle */
  32. #define GT_REQN_SHIFT 12
  33. #define GT_THD0_SHIFT 0
  34. #define GT_QOS_MAX 0x3
  35. #define GT_THD_MAX 0xfff
  36. #define GT_BW_WDW_MAX 0xffff
  37. /* mst_read_prio_cfg */
  38. #define GT_PRIO_LOW 0
  39. #define GT_PRIO_HIGH 1
  40. /* GTBUS port ids */
  41. #define GT_PORT_CPUM1 0
  42. #define GT_PORT_CPUM2 1
  43. #define GT_PORT_SATA 2
  44. #define GT_PORT_USB3 3
  45. #define GT_PORT_FE0 4
  46. #define GT_PORT_BE1 5
  47. #define GT_PORT_BE2 6
  48. #define GT_PORT_IEP0 7
  49. #define GT_PORT_FE1 8
  50. #define GT_PORT_BE0 9
  51. #define GT_PORT_FE2 10
  52. #define GT_PORT_IEP1 11
  53. #define GT_PORT_VED 12
  54. #define GT_PORT_VEE 13
  55. #define GT_PORT_FD 14
  56. #define GT_PORT_CSI 15
  57. #define GT_PORT_MP 16
  58. #define GT_PORT_HSI 17
  59. #define GT_PORT_SS 18
  60. #define GT_PORT_TS 19
  61. #define GT_PORT_DMA 20
  62. #define GT_PORT_NDFC0 21
  63. #define GT_PORT_NDFC1 22
  64. #define GT_PORT_CPUS 23
  65. #define GT_PORT_TH 24
  66. #define GT_PORT_GMAC 25
  67. #define GT_PORT_USB0 26
  68. #define GT_PORT_MSTG0 27
  69. #define GT_PORT_MSTG1 28
  70. #define GT_PORT_MSTG2 29
  71. #define GT_PORT_MSTG3 30
  72. #define GT_PORT_USB1 31
  73. #define GT_PORT_GPU0 32
  74. #define GT_PORT_GPU1 33
  75. #define GT_PORT_USB2 34
  76. #define GT_PORT_CPUM0 35
  77. #define GP_MST_CFG_DEFAULT \
  78. ((GT_QOS_MAX << GT_QOS_SHIFT) | \
  79. (GT_THD_MAX << GT_THD1_SHIFT) | \
  80. (GT_REQN_MAX << GT_REQN_SHIFT) | \
  81. (GT_THD_MAX << GT_THD0_SHIFT))
  82. #endif