mt8186.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
  2. /*
  3. * Copyright (c) 2022 MediaTek Corporation. All rights reserved.
  4. *
  5. * Header file for the mt8186 DSP register definition
  6. */
  7. #ifndef __MT8186_H
  8. #define __MT8186_H
  9. struct mtk_adsp_chip_info;
  10. struct snd_sof_dev;
  11. #define DSP_REG_BAR 4
  12. #define DSP_SECREG_BAR 5
  13. #define DSP_BUSREG_BAR 6
  14. /*****************************************************************************
  15. * R E G I S T E R TABLE
  16. *****************************************************************************/
  17. /* dsp cfg */
  18. #define ADSP_CFGREG_SW_RSTN 0x0000
  19. #define SW_DBG_RSTN_C0 BIT(0)
  20. #define SW_RSTN_C0 BIT(4)
  21. #define ADSP_HIFI_IO_CONFIG 0x000C
  22. #define TRACEMEMREADY BIT(15)
  23. #define RUNSTALL BIT(31)
  24. #define ADSP_IRQ_MASK 0x0030
  25. #define ADSP_DVFSRC_REQ 0x0040
  26. #define ADSP_DDREN_REQ_0 0x0044
  27. #define ADSP_SEMAPHORE 0x0064
  28. #define ADSP_WDT_CON_C0 0x007C
  29. #define ADSP_MBOX_IRQ_EN 0x009C
  30. #define DSP_MBOX0_IRQ_EN BIT(0)
  31. #define DSP_MBOX1_IRQ_EN BIT(1)
  32. #define DSP_MBOX2_IRQ_EN BIT(2)
  33. #define DSP_MBOX3_IRQ_EN BIT(3)
  34. #define DSP_MBOX4_IRQ_EN BIT(4)
  35. #define DSP_PDEBUGPC 0x013C
  36. #define ADSP_CK_EN 0x1000
  37. #define CORE_CLK_EN BIT(0)
  38. #define COREDBG_EN BIT(1)
  39. #define TIMER_EN BIT(3)
  40. #define DMA_EN BIT(4)
  41. #define UART_EN BIT(5)
  42. #define ADSP_UART_CTRL 0x1010
  43. #define UART_BCLK_CG BIT(0)
  44. #define UART_RSTN BIT(3)
  45. /* dsp sec */
  46. #define ADSP_PRID 0x0
  47. #define ADSP_ALTVEC_C0 0x04
  48. #define ADSP_ALTVECSEL 0x0C
  49. #define ADSP_ALTVECSEL_C0 BIT(1)
  50. /* dsp bus */
  51. #define ADSP_SRAM_POOL_CON 0x190
  52. #define DSP_SRAM_POOL_PD_MASK 0xF00F /* [0:3] and [12:15] */
  53. #define DSP_C0_EMI_MAP_ADDR 0xA00 /* ADSP Core0 To EMI Address Remap */
  54. #define DSP_C0_DMAEMI_MAP_ADDR 0xA08 /* DMA0 To EMI Address Remap */
  55. /* DSP memories */
  56. #define MBOX_OFFSET 0x500000 /* DRAM */
  57. #define MBOX_SIZE 0x1000 /* consistent with which in memory.h of sof fw */
  58. #define DSP_DRAM_SIZE 0xA00000 /* 16M */
  59. /*remap dram between AP and DSP view, 4KB aligned*/
  60. #define SRAM_PHYS_BASE_FROM_DSP_VIEW 0x4E100000 /* MT8186 DSP view */
  61. #define DRAM_PHYS_BASE_FROM_DSP_VIEW 0x60000000 /* MT8186 DSP view */
  62. #define DRAM_REMAP_SHIFT 12
  63. #define DRAM_REMAP_MASK 0xFFF
  64. #define SIZE_SHARED_DRAM_DL 0x40000 /*Shared buffer for Downlink*/
  65. #define SIZE_SHARED_DRAM_UL 0x40000 /*Shared buffer for Uplink*/
  66. #define TOTAL_SIZE_SHARED_DRAM_FROM_TAIL (SIZE_SHARED_DRAM_DL + SIZE_SHARED_DRAM_UL)
  67. void mt8186_sof_hifixdsp_boot_sequence(struct snd_sof_dev *sdev, u32 boot_addr);
  68. void mt8186_sof_hifixdsp_shutdown(struct snd_sof_dev *sdev);
  69. #endif