linux/drivers/remoteproc/mtk_common.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) 2019 MediaTek Inc.
 */

#ifndef __RPROC_MTK_COMMON_H
#define __RPROC_MTK_COMMON_H

#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/remoteproc.h>
#include <linux/remoteproc/mtk_scp.h>

#define MT8183_SW_RSTN
#define MT8183_SW_RSTN_BIT
#define MT8183_SCP_TO_HOST
#define MT8183_SCP_IPC_INT_BIT
#define MT8183_SCP_WDT_INT_BIT
#define MT8183_HOST_TO_SCP
#define MT8183_HOST_IPC_INT_BIT
#define MT8183_WDT_CFG
#define MT8183_SCP_CLK_SW_SEL
#define MT8183_SCP_CLK_DIV_SEL
#define MT8183_SCP_SRAM_PDN
#define MT8183_SCP_L1_SRAM_PD
#define MT8183_SCP_TCM_TAIL_SRAM_PD

#define MT8183_SCP_CACHE_SEL(x)
#define MT8183_SCP_CACHE_CON
#define MT8183_SCP_DCACHE_CON
#define MT8183_SCP_CACHESIZE_8KB
#define MT8183_SCP_CACHE_CON_WAYEN

#define MT8186_SCP_L1_SRAM_PD_P1
#define MT8186_SCP_L1_SRAM_PD_p2

#define MT8192_L2TCM_SRAM_PD_0
#define MT8192_L2TCM_SRAM_PD_1
#define MT8192_L2TCM_SRAM_PD_2
#define MT8192_L1TCM_SRAM_PDN
#define MT8192_CPU0_SRAM_PD

#define MT8192_SCP2APMCU_IPC_SET
#define MT8192_SCP2APMCU_IPC_CLR
#define MT8192_SCP_IPC_INT_BIT
#define MT8192_SCP2SPM_IPC_CLR
#define MT8192_GIPC_IN_SET
#define MT8192_HOST_IPC_INT_BIT
#define MT8195_CORE1_HOST_IPC_INT_BIT

#define MT8192_CORE0_SW_RSTN_CLR
#define MT8192_CORE0_SW_RSTN_SET
#define MT8192_CORE0_MEM_ATT_PREDEF
#define MT8192_CORE0_WDT_IRQ
#define MT8192_CORE0_WDT_CFG

#define MT8195_SYS_STATUS
#define MT8195_CORE0_WDT
#define MT8195_CORE1_WDT

#define MT8195_L1TCM_SRAM_PDN_RESERVED_RSI_BITS

#define MT8195_CPU1_SRAM_PD
#define MT8195_SSHUB2APMCU_IPC_SET
#define MT8195_SSHUB2APMCU_IPC_CLR
#define MT8195_CORE1_SW_RSTN_CLR
#define MT8195_CORE1_SW_RSTN_SET
#define MT8195_CORE1_MEM_ATT_PREDEF
#define MT8195_CORE1_WDT_IRQ
#define MT8195_CORE1_WDT_CFG

#define MT8195_SEC_CTRL
#define MT8195_CORE_OFFSET_ENABLE_D
#define MT8195_CORE_OFFSET_ENABLE_I
#define MT8195_L2TCM_OFFSET_RANGE_0_LOW
#define MT8195_L2TCM_OFFSET_RANGE_0_HIGH
#define MT8195_L2TCM_OFFSET

#define SCP_FW_VER_LEN

struct scp_run {};

struct scp_ipi_desc {};

struct mtk_scp;

struct mtk_scp_sizes_data {};

struct mtk_scp_of_data {};

struct mtk_scp_of_cluster {};

struct mtk_scp {};

/**
 * struct mtk_share_obj - SRAM buffer shared with AP and SCP
 *
 * @id:		IPI id
 * @len:	share buffer length
 * @share_buf:	share buffer data
 */
struct mtk_share_obj {};

void scp_memcpy_aligned(void __iomem *dst, const void *src, unsigned int len);
void scp_ipi_lock(struct mtk_scp *scp, u32 id);
void scp_ipi_unlock(struct mtk_scp *scp, u32 id);

#endif