omap1-io.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef __ASM_ARCH_OMAP_IO_H
  3. #define __ASM_ARCH_OMAP_IO_H
  4. #ifndef __ASSEMBLER__
  5. #include <linux/types.h>
  6. #ifdef CONFIG_ARCH_OMAP1
  7. /*
  8. * NOTE: Please use ioremap + __raw_read/write where possible instead of these
  9. */
  10. extern u8 omap_readb(u32 pa);
  11. extern u16 omap_readw(u32 pa);
  12. extern u32 omap_readl(u32 pa);
  13. extern void omap_writeb(u8 v, u32 pa);
  14. extern void omap_writew(u16 v, u32 pa);
  15. extern void omap_writel(u32 v, u32 pa);
  16. #elif defined(CONFIG_COMPILE_TEST)
  17. static inline u8 omap_readb(u32 pa) { return 0; }
  18. static inline u16 omap_readw(u32 pa) { return 0; }
  19. static inline u32 omap_readl(u32 pa) { return 0; }
  20. static inline void omap_writeb(u8 v, u32 pa) { }
  21. static inline void omap_writew(u16 v, u32 pa) { }
  22. static inline void omap_writel(u32 v, u32 pa) { }
  23. #endif
  24. #endif
  25. /*
  26. * ----------------------------------------------------------------------------
  27. * System control registers
  28. * ----------------------------------------------------------------------------
  29. */
  30. #define MOD_CONF_CTRL_0 0xfffe1080
  31. #define MOD_CONF_CTRL_1 0xfffe1110
  32. /*
  33. * ---------------------------------------------------------------------------
  34. * UPLD
  35. * ---------------------------------------------------------------------------
  36. */
  37. #define ULPD_REG_BASE (0xfffe0800)
  38. #define ULPD_IT_STATUS (ULPD_REG_BASE + 0x14)
  39. #define ULPD_SETUP_ANALOG_CELL_3 (ULPD_REG_BASE + 0x24)
  40. #define ULPD_CLOCK_CTRL (ULPD_REG_BASE + 0x30)
  41. # define DIS_USB_PVCI_CLK (1 << 5) /* no USB/FAC synch */
  42. # define USB_MCLK_EN (1 << 4) /* enable W4_USB_CLKO */
  43. #define ULPD_SOFT_REQ (ULPD_REG_BASE + 0x34)
  44. # define SOFT_UDC_REQ (1 << 4)
  45. # define SOFT_USB_CLK_REQ (1 << 3)
  46. # define SOFT_DPLL_REQ (1 << 0)
  47. #define ULPD_DPLL_CTRL (ULPD_REG_BASE + 0x3c)
  48. #define ULPD_STATUS_REQ (ULPD_REG_BASE + 0x40)
  49. #define ULPD_APLL_CTRL (ULPD_REG_BASE + 0x4c)
  50. #define ULPD_POWER_CTRL (ULPD_REG_BASE + 0x50)
  51. #define ULPD_SOFT_DISABLE_REQ_REG (ULPD_REG_BASE + 0x68)
  52. # define DIS_MMC2_DPLL_REQ (1 << 11)
  53. # define DIS_MMC1_DPLL_REQ (1 << 10)
  54. # define DIS_UART3_DPLL_REQ (1 << 9)
  55. # define DIS_UART2_DPLL_REQ (1 << 8)
  56. # define DIS_UART1_DPLL_REQ (1 << 7)
  57. # define DIS_USB_HOST_DPLL_REQ (1 << 6)
  58. #define ULPD_SDW_CLK_DIV_CTRL_SEL (ULPD_REG_BASE + 0x74)
  59. #define ULPD_CAM_CLK_CTRL (ULPD_REG_BASE + 0x7c)
  60. /*
  61. * ----------------------------------------------------------------------------
  62. * Clocks
  63. * ----------------------------------------------------------------------------
  64. */
  65. #define CLKGEN_REG_BASE (0xfffece00)
  66. #define ARM_CKCTL (CLKGEN_REG_BASE + 0x0)
  67. #define ARM_IDLECT1 (CLKGEN_REG_BASE + 0x4)
  68. #define ARM_IDLECT2 (CLKGEN_REG_BASE + 0x8)
  69. #define ARM_EWUPCT (CLKGEN_REG_BASE + 0xC)
  70. #define ARM_RSTCT1 (CLKGEN_REG_BASE + 0x10)
  71. #define ARM_RSTCT2 (CLKGEN_REG_BASE + 0x14)
  72. #define ARM_SYSST (CLKGEN_REG_BASE + 0x18)
  73. #define ARM_IDLECT3 (CLKGEN_REG_BASE + 0x24)
  74. #define CK_RATEF 1
  75. #define CK_IDLEF 2
  76. #define CK_ENABLEF 4
  77. #define CK_SELECTF 8
  78. #define SETARM_IDLE_SHIFT
  79. /* DPLL control registers */
  80. #define DPLL_CTL (0xfffecf00)
  81. /* DSP clock control. Must use __raw_readw() and __raw_writew() with these */
  82. #define DSP_CONFIG_REG_BASE IOMEM(0xe1008000)
  83. #define DSP_CKCTL (DSP_CONFIG_REG_BASE + 0x0)
  84. #define DSP_IDLECT1 (DSP_CONFIG_REG_BASE + 0x4)
  85. #define DSP_IDLECT2 (DSP_CONFIG_REG_BASE + 0x8)
  86. #define DSP_RSTCT2 (DSP_CONFIG_REG_BASE + 0x14)
  87. /*
  88. * ----------------------------------------------------------------------------
  89. * Pulse-Width Light
  90. * ----------------------------------------------------------------------------
  91. */
  92. #define OMAP_PWL_BASE 0xfffb5800
  93. #define OMAP_PWL_ENABLE (OMAP_PWL_BASE + 0x00)
  94. #define OMAP_PWL_CLK_ENABLE (OMAP_PWL_BASE + 0x04)
  95. /*
  96. * ----------------------------------------------------------------------------
  97. * Pin multiplexing registers
  98. * ----------------------------------------------------------------------------
  99. */
  100. #define FUNC_MUX_CTRL_0 0xfffe1000
  101. #define FUNC_MUX_CTRL_1 0xfffe1004
  102. #define FUNC_MUX_CTRL_2 0xfffe1008
  103. #define COMP_MODE_CTRL_0 0xfffe100c
  104. #define FUNC_MUX_CTRL_3 0xfffe1010
  105. #define FUNC_MUX_CTRL_4 0xfffe1014
  106. #define FUNC_MUX_CTRL_5 0xfffe1018
  107. #define FUNC_MUX_CTRL_6 0xfffe101C
  108. #define FUNC_MUX_CTRL_7 0xfffe1020
  109. #define FUNC_MUX_CTRL_8 0xfffe1024
  110. #define FUNC_MUX_CTRL_9 0xfffe1028
  111. #define FUNC_MUX_CTRL_A 0xfffe102C
  112. #define FUNC_MUX_CTRL_B 0xfffe1030
  113. #define FUNC_MUX_CTRL_C 0xfffe1034
  114. #define FUNC_MUX_CTRL_D 0xfffe1038
  115. #define PULL_DWN_CTRL_0 0xfffe1040
  116. #define PULL_DWN_CTRL_1 0xfffe1044
  117. #define PULL_DWN_CTRL_2 0xfffe1048
  118. #define PULL_DWN_CTRL_3 0xfffe104c
  119. #define PULL_DWN_CTRL_4 0xfffe10ac
  120. /* OMAP-1610 specific multiplexing registers */
  121. #define FUNC_MUX_CTRL_E 0xfffe1090
  122. #define FUNC_MUX_CTRL_F 0xfffe1094
  123. #define FUNC_MUX_CTRL_10 0xfffe1098
  124. #define FUNC_MUX_CTRL_11 0xfffe109c
  125. #define FUNC_MUX_CTRL_12 0xfffe10a0
  126. #define PU_PD_SEL_0 0xfffe10b4
  127. #define PU_PD_SEL_1 0xfffe10b8
  128. #define PU_PD_SEL_2 0xfffe10bc
  129. #define PU_PD_SEL_3 0xfffe10c0
  130. #define PU_PD_SEL_4 0xfffe10c4
  131. #endif