siul.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2015, Freescale Semiconductor, Inc.
  4. */
  5. #ifndef __ARCH_ARM_MACH_S32V234_SIUL_H__
  6. #define __ARCH_ARM_MACH_S32V234_SIUL_H__
  7. #include "ddr.h"
  8. #define SIUL2_MIDR1 (SIUL2_BASE_ADDR + 0x00000004)
  9. #define SIUL2_MIDR2 (SIUL2_BASE_ADDR + 0x00000008)
  10. #define SIUL2_DISR0 (SIUL2_BASE_ADDR + 0x00000010)
  11. #define SIUL2_DIRER0 (SIUL2_BASE_ADDR + 0x00000018)
  12. #define SIUL2_DIRSR0 (SIUL2_BASE_ADDR + 0x00000020)
  13. #define SIUL2_IREER0 (SIUL2_BASE_ADDR + 0x00000028)
  14. #define SIUL2_IFEER0 (SIUL2_BASE_ADDR + 0x00000030)
  15. #define SIUL2_IFER0 (SIUL2_BASE_ADDR + 0x00000038)
  16. #define SIUL2_IFMCR_BASE (SIUL2_BASE_ADDR + 0x00000040)
  17. #define SIUL2_IFMCRn(i) (SIUL2_IFMCR_BASE + 4 * (i))
  18. #define SIUL2_IFCPR (SIUL2_BASE_ADDR + 0x000000C0)
  19. /* SIUL2_MSCR specifications as stated in Reference Manual:
  20. * 0 - 359 Output Multiplexed Signal Configuration Registers
  21. * 512- 1023 Input Multiplexed Signal Configuration Registers */
  22. #define SIUL2_MSCR_BASE (SIUL2_BASE_ADDR + 0x00000240)
  23. #define SIUL2_MSCRn(i) (SIUL2_MSCR_BASE + 4 * (i))
  24. #define SIUL2_IMCR_BASE (SIUL2_BASE_ADDR + 0x00000A40)
  25. #define SIUL2_IMCRn(i) (SIUL2_IMCR_BASE + 4 * (i))
  26. #define SIUL2_GPDO_BASE (SIUL2_BASE_ADDR + 0x00001300)
  27. #define SIUL2_GPDOn(i) (SIUL2_GPDO_BASE + 4 * (i))
  28. #define SIUL2_GPDI_BASE (SIUL2_BASE_ADDR + 0x00001500)
  29. #define SIUL2_GPDIn(i) (SIUL2_GPDI_BASE + 4 * (i))
  30. #define SIUL2_PGPDO_BASE (SIUL2_BASE_ADDR + 0x00001700)
  31. #define SIUL2_PGPDOn(i) (SIUL2_PGPDO_BASE + 2 * (i))
  32. #define SIUL2_PGPDI_BASE (SIUL2_BASE_ADDR + 0x00001740)
  33. #define SIUL2_PGPDIn(i) (SIUL2_PGPDI_BASE + 2 * (i))
  34. #define SIUL2_MPGPDO_BASE (SIUL2_BASE_ADDR + 0x00001780)
  35. #define SIUL2_MPGPDOn(i) (SIUL2_MPGPDO_BASE + 4 * (i))
  36. /* SIUL2_MSCR masks */
  37. #define SIUL2_MSCR_DDR_DO_TRIM(v) ((v) & 0xC0000000)
  38. #define SIUL2_MSCR_DDR_DO_TRIM_MIN (0 << 30)
  39. #define SIUL2_MSCR_DDR_DO_TRIM_50PS (1 << 30)
  40. #define SIUL2_MSCR_DDR_DO_TRIM_100PS (2 << 30)
  41. #define SIUL2_MSCR_DDR_DO_TRIM_150PS (3 << 30)
  42. #define SIUL2_MSCR_DDR_INPUT(v) ((v) & 0x20000000)
  43. #define SIUL2_MSCR_DDR_INPUT_CMOS (0 << 29)
  44. #define SIUL2_MSCR_DDR_INPUT_DIFF_DDR (1 << 29)
  45. #define SIUL2_MSCR_DDR_SEL(v) ((v) & 0x18000000)
  46. #define SIUL2_MSCR_DDR_SEL_DDR3 (0 << 27)
  47. #define SIUL2_MSCR_DDR_SEL_LPDDR2 (2 << 27)
  48. #define SIUL2_MSCR_DDR_ODT(v) ((v) & 0x07000000)
  49. #define SIUL2_MSCR_DDR_ODT_120ohm (1 << 24)
  50. #define SIUL2_MSCR_DDR_ODT_60ohm (2 << 24)
  51. #define SIUL2_MSCR_DDR_ODT_40ohm (3 << 24)
  52. #define SIUL2_MSCR_DDR_ODT_30ohm (4 << 24)
  53. #define SIUL2_MSCR_DDR_ODT_24ohm (5 << 24)
  54. #define SIUL2_MSCR_DDR_ODT_20ohm (6 << 24)
  55. #define SIUL2_MSCR_DDR_ODT_17ohm (7 << 24)
  56. #define SIUL2_MSCR_DCYCLE_TRIM(v) ((v) & 0x00C00000)
  57. #define SIUL2_MSCR_DCYCLE_TRIM_NONE (0 << 22)
  58. #define SIUL2_MSCR_DCYCLE_TRIM_LEFT (1 << 22)
  59. #define SIUL2_MSCR_DCYCLE_TRIM_RIGHT (2 << 22)
  60. #define SIUL2_MSCR_OBE(v) ((v) & 0x00200000)
  61. #define SIUL2_MSCR_OBE_EN (1 << 21)
  62. #define SIUL2_MSCR_ODE(v) ((v) & 0x00100000)
  63. #define SIUL2_MSCR_ODE_EN (1 << 20)
  64. #define SIUL2_MSCR_IBE(v) ((v) & 0x00010000)
  65. #define SIUL2_MSCR_IBE_EN (1 << 19)
  66. #define SIUL2_MSCR_HYS(v) ((v) & 0x00400000)
  67. #define SIUL2_MSCR_HYS_EN (1 << 18)
  68. #define SIUL2_MSCR_INV(v) ((v) & 0x00020000)
  69. #define SIUL2_MSCR_INV_EN (1 << 17)
  70. #define SIUL2_MSCR_PKE(v) ((v) & 0x00010000)
  71. #define SIUL2_MSCR_PKE_EN (1 << 16)
  72. #define SIUL2_MSCR_SRE(v) ((v) & 0x0000C000)
  73. #define SIUL2_MSCR_SRE_SPEED_LOW_50 (0 << 14)
  74. #define SIUL2_MSCR_SRE_SPEED_LOW_100 (1 << 14)
  75. #define SIUL2_MSCR_SRE_SPEED_HIGH_100 (2 << 14)
  76. #define SIUL2_MSCR_SRE_SPEED_HIGH_200 (3 << 14)
  77. #define SIUL2_MSCR_PUE(v) ((v) & 0x00002000)
  78. #define SIUL2_MSCR_PUE_EN (1 << 13)
  79. #define SIUL2_MSCR_PUS(v) ((v) & 0x00001800)
  80. #define SIUL2_MSCR_PUS_100K_DOWN (0 << 11)
  81. #define SIUL2_MSCR_PUS_50K_DOWN (1 << 11)
  82. #define SIUL2_MSCR_PUS_100K_UP (2 << 11)
  83. #define SIUL2_MSCR_PUS_33K_UP (3 << 11)
  84. #define SIUL2_MSCR_DSE(v) ((v) & 0x00000700)
  85. #define SIUL2_MSCR_DSE_240ohm (1 << 8)
  86. #define SIUL2_MSCR_DSE_120ohm (2 << 8)
  87. #define SIUL2_MSCR_DSE_80ohm (3 << 8)
  88. #define SIUL2_MSCR_DSE_60ohm (4 << 8)
  89. #define SIUL2_MSCR_DSE_48ohm (5 << 8)
  90. #define SIUL2_MSCR_DSE_40ohm (6 << 8)
  91. #define SIUL2_MSCR_DSE_34ohm (7 << 8)
  92. #define SIUL2_MSCR_CRPOINT_TRIM(v) ((v) & 0x000000C0)
  93. #define SIUL2_MSCR_CRPOINT_TRIM_1 (1 << 6)
  94. #define SIUL2_MSCR_SMC(v) ((v) & 0x00000020)
  95. #define SIUL2_MSCR_MUX_MODE(v) ((v) & 0x0000000f)
  96. #define SIUL2_MSCR_MUX_MODE_ALT1 (0x1)
  97. #define SIUL2_MSCR_MUX_MODE_ALT2 (0x2)
  98. #define SIUL2_MSCR_MUX_MODE_ALT3 (0x3)
  99. /* UART settings */
  100. #define SIUL2_UART0_TXD_PAD 12
  101. #define SIUL2_UART_TXD (SIUL2_MSCR_OBE_EN | SIUL2_MSCR_PUS_100K_UP | SIUL2_MSCR_DSE_60ohm | \
  102. SIUL2_MSCR_SRE_SPEED_LOW_100 | SIUL2_MSCR_MUX_MODE_ALT1)
  103. #define SIUL2_UART0_MSCR_RXD_PAD 11
  104. #define SIUL2_UART0_IMCR_RXD_PAD 200
  105. #define SIUL2_UART_MSCR_RXD (SIUL2_MSCR_PUE_EN | SIUL2_MSCR_IBE_EN | SIUL2_MSCR_DCYCLE_TRIM_RIGHT)
  106. #define SIUL2_UART_IMCR_RXD (SIUL2_MSCR_MUX_MODE_ALT2)
  107. /* uSDHC settings */
  108. #define SIUL2_USDHC_PAD_CTRL_BASE (SIUL2_MSCR_SRE_SPEED_HIGH_200 | SIUL2_MSCR_OBE_EN | \
  109. SIUL2_MSCR_DSE_34ohm | SIUL2_MSCR_PKE_EN | SIUL2_MSCR_IBE_EN | \
  110. SIUL2_MSCR_PUS_100K_UP | SIUL2_MSCR_PUE_EN )
  111. #define SIUL2_USDHC_PAD_CTRL_CMD (SIUL2_USDHC_PAD_CTRL_BASE | SIUL2_MSCR_MUX_MODE_ALT1)
  112. #define SIUL2_USDHC_PAD_CTRL_CLK (SIUL2_USDHC_PAD_CTRL_BASE | SIUL2_MSCR_MUX_MODE_ALT2)
  113. #define SIUL2_USDHC_PAD_CTRL_DAT0_3 (SIUL2_USDHC_PAD_CTRL_BASE | SIUL2_MSCR_MUX_MODE_ALT2)
  114. #define SIUL2_USDHC_PAD_CTRL_DAT4_7 (SIUL2_USDHC_PAD_CTRL_BASE | SIUL2_MSCR_MUX_MODE_ALT3)
  115. #endif /*__ARCH_ARM_MACH_S32V234_SIUL_H__ */