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