linux/drivers/media/pci/intel/ipu6/ipu6-fw-com.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2013--2024 Intel Corporation
 */

#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/io.h>
#include <linux/math.h>
#include <linux/overflow.h>
#include <linux/slab.h>
#include <linux/types.h>

#include "ipu6-bus.h"
#include "ipu6-fw-com.h"

/*
 * FWCOM layer is a shared resource between FW and driver. It consist
 * of token queues to both send and receive directions. Queue is simply
 * an array of structures with read and write indexes to the queue.
 * There are 1...n queues to both directions. Queues locates in
 * system RAM and are mapped to ISP MMU so that both CPU and ISP can
 * see the same buffer. Indexes are located in ISP DMEM so that FW code
 * can poll those with very low latency and cost. CPU access to indexes is
 * more costly but that happens only at message sending time and
 * interrupt triggered message handling. CPU doesn't need to poll indexes.
 * wr_reg / rd_reg are offsets to those dmem location. They are not
 * the indexes itself.
 */

/* Shared structure between driver and FW - do not modify */
struct ipu6_fw_sys_queue {} __packed;

struct ipu6_fw_sys_queue_res {} __packed;

enum syscom_state {};

enum syscom_cmd {};

/* firmware config: data that sent from the host to SP via DDR */
/* Cell copies data into a context */

struct ipu6_fw_syscom_config {};

struct ipu6_fw_com_context {};

#define FW_COM_WR_REG
#define FW_COM_RD_REG

#define REGMEM_OFFSET
#define TUNIT_MAGIC_PATTERN

enum regmem_id {};

#define BUTTRESS_FW_BOOT_PARAMS_0
#define BUTTRESS_FW_BOOT_PARAM_REG(base, offset, id)

enum buttress_syscom_id {};

static void ipu6_sys_queue_init(struct ipu6_fw_sys_queue *q, unsigned int size,
				unsigned int token_size,
				struct ipu6_fw_sys_queue_res *res)
{}

void *ipu6_fw_com_prepare(struct ipu6_fw_com_cfg *cfg,
			  struct ipu6_bus_device *adev, void __iomem *base)
{}
EXPORT_SYMBOL_NS_GPL();

int ipu6_fw_com_open(struct ipu6_fw_com_context *ctx)
{}
EXPORT_SYMBOL_NS_GPL();

int ipu6_fw_com_close(struct ipu6_fw_com_context *ctx)
{}
EXPORT_SYMBOL_NS_GPL();

int ipu6_fw_com_release(struct ipu6_fw_com_context *ctx, unsigned int force)
{}
EXPORT_SYMBOL_NS_GPL();

bool ipu6_fw_com_ready(struct ipu6_fw_com_context *ctx)
{}
EXPORT_SYMBOL_NS_GPL();

void *ipu6_send_get_token(struct ipu6_fw_com_context *ctx, int q_nbr)
{}
EXPORT_SYMBOL_NS_GPL();

void ipu6_send_put_token(struct ipu6_fw_com_context *ctx, int q_nbr)
{}
EXPORT_SYMBOL_NS_GPL();

void *ipu6_recv_get_token(struct ipu6_fw_com_context *ctx, int q_nbr)
{}
EXPORT_SYMBOL_NS_GPL();

void ipu6_recv_put_token(struct ipu6_fw_com_context *ctx, int q_nbr)
{}
EXPORT_SYMBOL_NS_GPL();