linux/drivers/media/platform/st/sti/hva/hva-hw.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Copyright (C) STMicroelectronics SA 2015
 * Authors: Yannick Fertre <[email protected]>
 *          Hugues Fruchet <[email protected]>
 */

#include <linux/clk.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS
#include <linux/seq_file.h>
#endif

#include "hva.h"
#include "hva-hw.h"

/* HVA register offsets */
#define HVA_HIF_REG_RST
#define HVA_HIF_REG_RST_ACK
#define HVA_HIF_REG_MIF_CFG
#define HVA_HIF_REG_HEC_MIF_CFG
#define HVA_HIF_REG_CFL
#define HVA_HIF_FIFO_CMD
#define HVA_HIF_FIFO_STS
#define HVA_HIF_REG_SFL
#define HVA_HIF_REG_IT_ACK
#define HVA_HIF_REG_ERR_IT_ACK
#define HVA_HIF_REG_LMI_ERR
#define HVA_HIF_REG_EMI_ERR
#define HVA_HIF_REG_HEC_MIF_ERR
#define HVA_HIF_REG_HEC_STS
#define HVA_HIF_REG_HVC_STS
#define HVA_HIF_REG_HJE_STS
#define HVA_HIF_REG_CNT
#define HVA_HIF_REG_HEC_CHKSYN_DIS
#define HVA_HIF_REG_CLK_GATING
#define HVA_HIF_REG_VERSION
#define HVA_HIF_REG_BSM

/* define value for version id register (HVA_HIF_REG_VERSION) */
#define VERSION_ID_MASK

/* define values for BSM register (HVA_HIF_REG_BSM) */
#define BSM_CFG_VAL1
#define BSM_CFG_VAL2

/* define values for memory interface register (HVA_HIF_REG_MIF_CFG) */
#define MIF_CFG_VAL1
#define MIF_CFG_VAL2
#define MIF_CFG_VAL3

/* define value for HEC memory interface register (HVA_HIF_REG_MIF_CFG) */
#define HEC_MIF_CFG_VAL

/*  Bits definition for clock gating register (HVA_HIF_REG_CLK_GATING) */
#define CLK_GATING_HVC
#define CLK_GATING_HEC
#define CLK_GATING_HJE

/* fix hva clock rate */
#define CLK_RATE

/* fix delay for pmruntime */
#define AUTOSUSPEND_DELAY_MS

/*
 * hw encode error values
 * NO_ERROR: Success, Task OK
 * H264_BITSTREAM_OVERSIZE: VECH264 Bitstream size > bitstream buffer
 * H264_FRAME_SKIPPED: VECH264 Frame skipped (refers to CPB Buffer Size)
 * H264_SLICE_LIMIT_SIZE: VECH264 MB > slice limit size
 * H264_MAX_SLICE_NUMBER: VECH264 max slice number reached
 * H264_SLICE_READY: VECH264 Slice ready
 * TASK_LIST_FULL: HVA/FPC task list full
		   (discard latest transform command)
 * UNKNOWN_COMMAND: Transform command not known by HVA/FPC
 * WRONG_CODEC_OR_RESOLUTION: Wrong Codec or Resolution Selection
 * NO_INT_COMPLETION: Time-out on interrupt completion
 * LMI_ERR: Local Memory Interface Error
 * EMI_ERR: External Memory Interface Error
 * HECMI_ERR: HEC Memory Interface Error
 */
enum hva_hw_error {};

static irqreturn_t hva_hw_its_interrupt(int irq, void *data)
{}

static irqreturn_t hva_hw_its_irq_thread(int irq, void *arg)
{}

static irqreturn_t hva_hw_err_interrupt(int irq, void *data)
{}

static irqreturn_t hva_hw_err_irq_thread(int irq, void *arg)
{}

static unsigned long int hva_hw_get_ip_version(struct hva_dev *hva)
{}

int hva_hw_probe(struct platform_device *pdev, struct hva_dev *hva)
{}

void hva_hw_remove(struct hva_dev *hva)
{}

int hva_hw_runtime_suspend(struct device *dev)
{}

int hva_hw_runtime_resume(struct device *dev)
{}

int hva_hw_execute_task(struct hva_ctx *ctx, enum hva_hw_cmd_type cmd,
			struct hva_buffer *task)
{}

#ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS
#define DUMP(reg)

void hva_hw_dump_regs(struct hva_dev *hva, struct seq_file *s)
{}
#endif