linux/sound/soc/sof/mediatek/mt8186/mt8186.h

/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */

/*
 * Copyright (c) 2022 MediaTek Corporation. All rights reserved.
 *
 *  Header file for the mt8186 DSP register definition
 */

#ifndef __MT8186_H
#define __MT8186_H

struct mtk_adsp_chip_info;
struct snd_sof_dev;

#define DSP_REG_BAR
#define DSP_SECREG_BAR
#define DSP_BUSREG_BAR

/*****************************************************************************
 *                  R E G I S T E R       TABLE
 *****************************************************************************/
/* dsp cfg */
#define ADSP_CFGREG_SW_RSTN
#define SW_DBG_RSTN_C0
#define SW_RSTN_C0
#define ADSP_HIFI_IO_CONFIG
#define TRACEMEMREADY
#define RUNSTALL
#define ADSP_IRQ_MASK
#define ADSP_DVFSRC_REQ
#define ADSP_DDREN_REQ_0
#define ADSP_SEMAPHORE
#define ADSP_WDT_CON_C0
#define ADSP_MBOX_IRQ_EN
#define DSP_MBOX0_IRQ_EN
#define DSP_MBOX1_IRQ_EN
#define DSP_MBOX2_IRQ_EN
#define DSP_MBOX3_IRQ_EN
#define DSP_MBOX4_IRQ_EN
#define DSP_PDEBUGPC
#define DSP_PDEBUGDATA
#define DSP_PDEBUGINST
#define DSP_PDEBUGLS0STAT
#define DSP_PDEBUGSTATUS
#define DSP_PFAULTINFO
#define ADSP_CK_EN
#define CORE_CLK_EN
#define COREDBG_EN
#define TIMER_EN
#define DMA_EN
#define UART_EN
#define ADSP_UART_CTRL
#define UART_BCLK_CG
#define UART_RSTN

/* dsp sec */
#define ADSP_PRID
#define ADSP_ALTVEC_C0
#define ADSP_ALTVECSEL
#define MT8188_ADSP_ALTVECSEL_C0
#define MT8186_ADSP_ALTVECSEL_C0

/*
 * On MT8188, BIT(1) is not evaluated and on MT8186 BIT(0) is not evaluated:
 * We can simplify the driver by safely setting both bits regardless of the SoC.
 */
#define ADSP_ALTVECSEL_C0

/* dsp bus */
#define ADSP_SRAM_POOL_CON
#define DSP_SRAM_POOL_PD_MASK
#define DSP_C0_EMI_MAP_ADDR
#define DSP_C0_DMAEMI_MAP_ADDR

/* DSP memories */
#define MBOX_OFFSET
#define MBOX_SIZE
#define DSP_DRAM_SIZE

/*remap dram between AP and DSP view, 4KB aligned*/
#define SRAM_PHYS_BASE_FROM_DSP_VIEW
#define DRAM_PHYS_BASE_FROM_DSP_VIEW
#define DRAM_REMAP_SHIFT
#define DRAM_REMAP_MASK

#define SIZE_SHARED_DRAM_DL
#define SIZE_SHARED_DRAM_UL
#define TOTAL_SIZE_SHARED_DRAM_FROM_TAIL

void mt8186_sof_hifixdsp_boot_sequence(struct snd_sof_dev *sdev, u32 boot_addr);
void mt8186_sof_hifixdsp_shutdown(struct snd_sof_dev *sdev);
#endif