linux/drivers/remoteproc/mtk_scp.c

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

#include <asm/barrier.h>
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
#include <linux/of_reserved_mem.h>
#include <linux/platform_device.h>
#include <linux/remoteproc.h>
#include <linux/remoteproc/mtk_scp.h>
#include <linux/rpmsg/mtk_rpmsg.h>

#include "mtk_common.h"
#include "remoteproc_internal.h"

#define SECTION_NAME_IPI_BUFFER

/**
 * scp_get() - get a reference to SCP.
 *
 * @pdev:	the platform device of the module requesting SCP platform
 *		device for using SCP API.
 *
 * Return: Return NULL if failed.  otherwise reference to SCP.
 **/
struct mtk_scp *scp_get(struct platform_device *pdev)
{}
EXPORT_SYMBOL_GPL();

/**
 * scp_put() - "free" the SCP
 *
 * @scp:	mtk_scp structure from scp_get().
 **/
void scp_put(struct mtk_scp *scp)
{}
EXPORT_SYMBOL_GPL();

static void scp_wdt_handler(struct mtk_scp *scp, u32 scp_to_host)
{}

static void scp_init_ipi_handler(void *data, unsigned int len, void *priv)
{}

static void scp_ipi_handler(struct mtk_scp *scp)
{}

static int scp_elf_read_ipi_buf_addr(struct mtk_scp *scp,
				     const struct firmware *fw,
				     size_t *offset);

static int scp_ipi_init(struct mtk_scp *scp, const struct firmware *fw)
{}

static void mt8183_scp_reset_assert(struct mtk_scp *scp)
{}

static void mt8183_scp_reset_deassert(struct mtk_scp *scp)
{}

static void mt8192_scp_reset_assert(struct mtk_scp *scp)
{}

static void mt8192_scp_reset_deassert(struct mtk_scp *scp)
{}

static void mt8195_scp_c1_reset_assert(struct mtk_scp *scp)
{}

static void mt8195_scp_c1_reset_deassert(struct mtk_scp *scp)
{}

static void mt8183_scp_irq_handler(struct mtk_scp *scp)
{}

static void mt8192_scp_irq_handler(struct mtk_scp *scp)
{}

static void mt8195_scp_irq_handler(struct mtk_scp *scp)
{}

static void mt8195_scp_c1_irq_handler(struct mtk_scp *scp)
{}

static irqreturn_t scp_irq_handler(int irq, void *priv)
{}

static int scp_elf_load_segments(struct rproc *rproc, const struct firmware *fw)
{}

static int scp_elf_read_ipi_buf_addr(struct mtk_scp *scp,
				     const struct firmware *fw,
				     size_t *offset)
{}

static int mt8183_scp_clk_get(struct mtk_scp *scp)
{}

static int mt8192_scp_clk_get(struct mtk_scp *scp)
{}

static int mt8195_scp_clk_get(struct mtk_scp *scp)
{}

static int mt8183_scp_before_load(struct mtk_scp *scp)
{}

static void scp_sram_power_on(void __iomem *addr, u32 reserved_mask)
{}

static void scp_sram_power_off(void __iomem *addr, u32 reserved_mask)
{}

static int mt8186_scp_before_load(struct mtk_scp *scp)
{}

static int mt8188_scp_l2tcm_on(struct mtk_scp *scp)
{}

static int mt8188_scp_before_load(struct mtk_scp *scp)
{}

static int mt8188_scp_c1_before_load(struct mtk_scp *scp)
{}

static int mt8192_scp_before_load(struct mtk_scp *scp)
{}

static int mt8195_scp_l2tcm_on(struct mtk_scp *scp)
{}

static int mt8195_scp_before_load(struct mtk_scp *scp)
{}

static int mt8195_scp_c1_before_load(struct mtk_scp *scp)
{}

static int scp_load(struct rproc *rproc, const struct firmware *fw)
{}

static int scp_parse_fw(struct rproc *rproc, const struct firmware *fw)
{}

static int scp_start(struct rproc *rproc)
{}

static void *mt8183_scp_da_to_va(struct mtk_scp *scp, u64 da, size_t len)
{}

static void *mt8192_scp_da_to_va(struct mtk_scp *scp, u64 da, size_t len)
{}

static void *scp_da_to_va(struct rproc *rproc, u64 da, size_t len, bool *is_iomem)
{}

static void mt8183_scp_stop(struct mtk_scp *scp)
{}

static void mt8188_scp_l2tcm_off(struct mtk_scp *scp)
{}

static void mt8188_scp_stop(struct mtk_scp *scp)
{}

static void mt8188_scp_c1_stop(struct mtk_scp *scp)
{}

static void mt8192_scp_stop(struct mtk_scp *scp)
{}

static void mt8195_scp_l2tcm_off(struct mtk_scp *scp)
{}

static void mt8195_scp_stop(struct mtk_scp *scp)
{}

static void mt8195_scp_c1_stop(struct mtk_scp *scp)
{}

static int scp_stop(struct rproc *rproc)
{}

static const struct rproc_ops scp_ops =;

/**
 * scp_get_device() - get device struct of SCP
 *
 * @scp:	mtk_scp structure
 **/
struct device *scp_get_device(struct mtk_scp *scp)
{}
EXPORT_SYMBOL_GPL();

/**
 * scp_get_rproc() - get rproc struct of SCP
 *
 * @scp:	mtk_scp structure
 **/
struct rproc *scp_get_rproc(struct mtk_scp *scp)
{}
EXPORT_SYMBOL_GPL();

/**
 * scp_get_vdec_hw_capa() - get video decoder hardware capability
 *
 * @scp:	mtk_scp structure
 *
 * Return: video decoder hardware capability
 **/
unsigned int scp_get_vdec_hw_capa(struct mtk_scp *scp)
{}
EXPORT_SYMBOL_GPL();

/**
 * scp_get_venc_hw_capa() - get video encoder hardware capability
 *
 * @scp:	mtk_scp structure
 *
 * Return: video encoder hardware capability
 **/
unsigned int scp_get_venc_hw_capa(struct mtk_scp *scp)
{}
EXPORT_SYMBOL_GPL();

/**
 * scp_mapping_dm_addr() - Mapping SRAM/DRAM to kernel virtual address
 *
 * @scp:	mtk_scp structure
 * @mem_addr:	SCP views memory address
 *
 * Mapping the SCP's SRAM address /
 * DMEM (Data Extended Memory) memory address /
 * Working buffer memory address to
 * kernel virtual address.
 *
 * Return: Return ERR_PTR(-EINVAL) if mapping failed,
 * otherwise the mapped kernel virtual address
 **/
void *scp_mapping_dm_addr(struct mtk_scp *scp, u32 mem_addr)
{}
EXPORT_SYMBOL_GPL();

static int scp_map_memory_region(struct mtk_scp *scp)
{}

static void scp_unmap_memory_region(struct mtk_scp *scp)
{}

static int scp_register_ipi(struct platform_device *pdev, u32 id,
			    ipi_handler_t handler, void *priv)
{}

static void scp_unregister_ipi(struct platform_device *pdev, u32 id)
{}

static int scp_send_ipi(struct platform_device *pdev, u32 id, void *buf,
			unsigned int len, unsigned int wait)
{}

static struct mtk_rpmsg_info mtk_scp_rpmsg_info =;

static void scp_add_rpmsg_subdev(struct mtk_scp *scp)
{}

static void scp_remove_rpmsg_subdev(struct mtk_scp *scp)
{}

static struct mtk_scp *scp_rproc_init(struct platform_device *pdev,
				      struct mtk_scp_of_cluster *scp_cluster,
				      const struct mtk_scp_of_data *of_data)
{}

static void scp_free(struct mtk_scp *scp)
{}

static int scp_add_single_core(struct platform_device *pdev,
			       struct mtk_scp_of_cluster *scp_cluster)
{}

static int scp_add_multi_core(struct platform_device *pdev,
			      struct mtk_scp_of_cluster *scp_cluster)
{}

static bool scp_is_single_core(struct platform_device *pdev)
{}

static int scp_cluster_init(struct platform_device *pdev, struct mtk_scp_of_cluster *scp_cluster)
{}

static int scp_probe(struct platform_device *pdev)
{}

static void scp_remove(struct platform_device *pdev)
{}

static const struct mtk_scp_sizes_data default_scp_sizes =;

static const struct mtk_scp_sizes_data mt8188_scp_sizes =;

static const struct mtk_scp_sizes_data mt8188_scp_c1_sizes =;

static const struct mtk_scp_sizes_data mt8195_scp_sizes =;

static const struct mtk_scp_of_data mt8183_of_data =;

static const struct mtk_scp_of_data mt8186_of_data =;

static const struct mtk_scp_of_data mt8188_of_data =;

static const struct mtk_scp_of_data mt8188_of_data_c1 =;

static const struct mtk_scp_of_data mt8192_of_data =;

static const struct mtk_scp_of_data mt8195_of_data =;

static const struct mtk_scp_of_data mt8195_of_data_c1 =;

static const struct mtk_scp_of_data *mt8188_of_data_cores[] =;

static const struct mtk_scp_of_data *mt8195_of_data_cores[] =;

static const struct of_device_id mtk_scp_of_match[] =;
MODULE_DEVICE_TABLE(of, mtk_scp_of_match);

static struct platform_driver mtk_scp_driver =;

module_platform_driver();

MODULE_LICENSE();
MODULE_DESCRIPTION();