mt8195.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2021 MediaTek Corporation. All rights reserved.
  4. *
  5. * Header file for the mt8195 DSP register definition
  6. */
  7. #ifndef __MT8195_H
  8. #define __MT8195_H
  9. struct mtk_adsp_chip_info;
  10. struct snd_sof_dev;
  11. #define DSP_REG_BASE 0x10803000
  12. #define SCP_CFGREG_BASE 0x10724000
  13. #define DSP_SYSAO_BASE 0x1080C000
  14. /*****************************************************************************
  15. * R E G I S T E R TABLE
  16. *****************************************************************************/
  17. #define DSP_JTAGMUX 0x0000
  18. #define DSP_ALTRESETVEC 0x0004
  19. #define DSP_PDEBUGDATA 0x0008
  20. #define DSP_PDEBUGBUS0 0x000c
  21. #define PDEBUG_ENABLE BIT(0)
  22. #define DSP_PDEBUGBUS1 0x0010
  23. #define DSP_PDEBUGINST 0x0014
  24. #define DSP_PDEBUGLS0STAT 0x0018
  25. #define DSP_PDEBUGLS1STAT 0x001c
  26. #define DSP_PDEBUGPC 0x0020
  27. #define DSP_RESET_SW 0x0024 /*reset sw*/
  28. #define ADSP_BRESET_SW BIT(0)
  29. #define ADSP_DRESET_SW BIT(1)
  30. #define ADSP_RUNSTALL BIT(3)
  31. #define STATVECTOR_SEL BIT(4)
  32. #define ADSP_PWAIT BIT(16)
  33. #define DSP_PFAULTBUS 0x0028
  34. #define DSP_PFAULTINFO 0x002c
  35. #define DSP_GPR00 0x0030
  36. #define DSP_GPR01 0x0034
  37. #define DSP_GPR02 0x0038
  38. #define DSP_GPR03 0x003c
  39. #define DSP_GPR04 0x0040
  40. #define DSP_GPR05 0x0044
  41. #define DSP_GPR06 0x0048
  42. #define DSP_GPR07 0x004c
  43. #define DSP_GPR08 0x0050
  44. #define DSP_GPR09 0x0054
  45. #define DSP_GPR0A 0x0058
  46. #define DSP_GPR0B 0x005c
  47. #define DSP_GPR0C 0x0060
  48. #define DSP_GPR0D 0x0064
  49. #define DSP_GPR0E 0x0068
  50. #define DSP_GPR0F 0x006c
  51. #define DSP_GPR10 0x0070
  52. #define DSP_GPR11 0x0074
  53. #define DSP_GPR12 0x0078
  54. #define DSP_GPR13 0x007c
  55. #define DSP_GPR14 0x0080
  56. #define DSP_GPR15 0x0084
  57. #define DSP_GPR16 0x0088
  58. #define DSP_GPR17 0x008c
  59. #define DSP_GPR18 0x0090
  60. #define DSP_GPR19 0x0094
  61. #define DSP_GPR1A 0x0098
  62. #define DSP_GPR1B 0x009c
  63. #define DSP_GPR1C 0x00a0
  64. #define DSP_GPR1D 0x00a4
  65. #define DSP_GPR1E 0x00a8
  66. #define DSP_GPR1F 0x00ac
  67. #define DSP_TCM_OFFSET 0x00b0 /* not used */
  68. #define DSP_DDR_OFFSET 0x00b4 /* not used */
  69. #define DSP_INTFDSP 0x00d0
  70. #define DSP_INTFDSP_CLR 0x00d4
  71. #define DSP_SRAM_PD_SW1 0x00d8
  72. #define DSP_SRAM_PD_SW2 0x00dc
  73. #define DSP_OCD 0x00e0
  74. #define DSP_RG_DSP_IRQ_POL 0x00f0 /* not used */
  75. #define DSP_DSP_IRQ_EN 0x00f4 /* not used */
  76. #define DSP_DSP_IRQ_LEVEL 0x00f8 /* not used */
  77. #define DSP_DSP_IRQ_STATUS 0x00fc /* not used */
  78. #define DSP_RG_INT2CIRQ 0x0114
  79. #define DSP_RG_INT_POL_CTL0 0x0120
  80. #define DSP_RG_INT_EN_CTL0 0x0130
  81. #define DSP_RG_INT_LV_CTL0 0x0140
  82. #define DSP_RG_INT_STATUS0 0x0150
  83. #define DSP_PDEBUGSTATUS0 0x0200
  84. #define DSP_PDEBUGSTATUS1 0x0204
  85. #define DSP_PDEBUGSTATUS2 0x0208
  86. #define DSP_PDEBUGSTATUS3 0x020c
  87. #define DSP_PDEBUGSTATUS4 0x0210
  88. #define DSP_PDEBUGSTATUS5 0x0214
  89. #define DSP_PDEBUGSTATUS6 0x0218
  90. #define DSP_PDEBUGSTATUS7 0x021c
  91. #define DSP_DSP2PSRAM_PRIORITY 0x0220 /* not used */
  92. #define DSP_AUDIO_DSP2SPM_INT 0x0224
  93. #define DSP_AUDIO_DSP2SPM_INT_ACK 0x0228
  94. #define DSP_AUDIO_DSP_DEBUG_SEL 0x022C
  95. #define DSP_AUDIO_DSP_EMI_BASE_ADDR 0x02E0 /* not used */
  96. #define DSP_AUDIO_DSP_SHARED_IRAM 0x02E4
  97. #define DSP_AUDIO_DSP_CKCTRL_P2P_CK_CON 0x02F0
  98. #define DSP_RG_SEMAPHORE00 0x0300
  99. #define DSP_RG_SEMAPHORE01 0x0304
  100. #define DSP_RG_SEMAPHORE02 0x0308
  101. #define DSP_RG_SEMAPHORE03 0x030C
  102. #define DSP_RG_SEMAPHORE04 0x0310
  103. #define DSP_RG_SEMAPHORE05 0x0314
  104. #define DSP_RG_SEMAPHORE06 0x0318
  105. #define DSP_RG_SEMAPHORE07 0x031C
  106. #define DSP_RESERVED_0 0x03F0
  107. #define DSP_RESERVED_1 0x03F4
  108. /* dsp wdt */
  109. #define DSP_WDT_MODE 0x0400
  110. /* dsp mbox */
  111. #define DSP_MBOX_IN_CMD 0x00
  112. #define DSP_MBOX_IN_CMD_CLR 0x04
  113. #define DSP_MBOX_OUT_CMD 0x1c
  114. #define DSP_MBOX_OUT_CMD_CLR 0x20
  115. #define DSP_MBOX_IN_MSG0 0x08
  116. #define DSP_MBOX_IN_MSG1 0x0C
  117. #define DSP_MBOX_OUT_MSG0 0x24
  118. #define DSP_MBOX_OUT_MSG1 0x28
  119. /*dsp sys ao*/
  120. #define ADSP_SRAM_POOL_CON (DSP_SYSAO_BASE + 0x30)
  121. #define DSP_SRAM_POOL_PD_MASK 0xf
  122. #define DSP_EMI_MAP_ADDR (DSP_SYSAO_BASE + 0x81c)
  123. /* DSP memories */
  124. #define MBOX_OFFSET 0x800000 /* DRAM */
  125. #define MBOX_SIZE 0x1000 /* consistent with which in memory.h of sof fw */
  126. #define DSP_DRAM_SIZE 0x1000000 /* 16M */
  127. #define DSP_REG_BAR 4
  128. #define DSP_MBOX0_BAR 5
  129. #define DSP_MBOX1_BAR 6
  130. #define DSP_MBOX2_BAR 7
  131. #define TOTAL_SIZE_SHARED_SRAM_FROM_TAIL 0x0
  132. #define SIZE_SHARED_DRAM_DL 0x40000 /*Shared buffer for Downlink*/
  133. #define SIZE_SHARED_DRAM_UL 0x40000 /*Shared buffer for Uplink*/
  134. #define TOTAL_SIZE_SHARED_DRAM_FROM_TAIL \
  135. (SIZE_SHARED_DRAM_DL + SIZE_SHARED_DRAM_UL)
  136. #define SRAM_PHYS_BASE_FROM_DSP_VIEW 0x40000000 /* MT8195 DSP view */
  137. #define DRAM_PHYS_BASE_FROM_DSP_VIEW 0x60000000 /* MT8195 DSP view */
  138. /*remap dram between AP and DSP view, 4KB aligned*/
  139. #define DRAM_REMAP_SHIFT 12
  140. #define DRAM_REMAP_MASK (BIT(DRAM_REMAP_SHIFT) - 1)
  141. /* suspend dsp idle check interval and timeout */
  142. #define SUSPEND_DSP_IDLE_TIMEOUT_US 1000000 /* timeout to wait dsp idle, 1 sec */
  143. #define SUSPEND_DSP_IDLE_POLL_INTERVAL_US 500 /* 0.5 msec */
  144. void sof_hifixdsp_boot_sequence(struct snd_sof_dev *sdev, u32 boot_addr);
  145. void sof_hifixdsp_shutdown(struct snd_sof_dev *sdev);
  146. #endif