linux/drivers/misc/mei/vsc-fw-loader.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2023, Intel Corporation.
 * Intel Visual Sensing Controller Transport Layer Linux driver
 */

#include <linux/acpi.h>
#include <linux/align.h>
#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/cleanup.h>
#include <linux/firmware.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/string_helpers.h>
#include <linux/types.h>

#include <asm-generic/unaligned.h>

#include "vsc-tp.h"

#define VSC_MAGIC_NUM
#define VSC_MAGIC_FW
#define VSC_MAGIC_FILE

#define VSC_ADDR_BASE
#define VSC_EFUSE_ADDR
#define VSC_STRAP_ADDR

#define VSC_MAINSTEPPING_VERSION_MASK
#define VSC_MAINSTEPPING_VERSION_A

#define VSC_SUBSTEPPING_VERSION_MASK
#define VSC_SUBSTEPPING_VERSION_0
#define VSC_SUBSTEPPING_VERSION_1

#define VSC_BOOT_IMG_OPTION_MASK

#define VSC_SKU_CFG_LOCATION
#define VSC_SKU_MAX_SIZE

#define VSC_ACE_IMG_CNT
#define VSC_CSI_IMG_CNT
#define VSC_IMG_CNT_MAX

#define VSC_ROM_PKG_SIZE
#define VSC_FW_PKG_SIZE

#define VSC_IMAGE_DIR

#define VSC_CSI_IMAGE_NAME
#define VSC_ACE_IMAGE_NAME_FMT
#define VSC_CFG_IMAGE_NAME_FMT

#define VSC_IMAGE_PATH_MAX_LEN

#define VSC_SENSOR_NAME_MAX_LEN

/* command id */
enum {};

/* command ack token */
enum {};

/* image type */
enum {};

/* image fragments */
enum {};

struct vsc_rom_cmd {};

struct vsc_rom_cmd_ack {};

struct vsc_fw_cmd {};

struct vsc_img {};

struct vsc_fw_sign {};

struct vsc_image_code_data {};

struct vsc_img_frag {};

/**
 * struct vsc_fw_loader - represent vsc firmware loader
 * @dev: device used to request firmware
 * @tp: transport layer used with the firmware loader
 * @csi: CSI image
 * @ace: ACE image
 * @cfg: config image
 * @tx_buf: tx buffer
 * @rx_buf: rx buffer
 * @option: command option
 * @count: total image count
 * @sensor_name: camera sensor name
 * @frags: image fragments
 */
struct vsc_fw_loader {};

static inline u32 vsc_sum_crc(void *data, size_t size)
{}

/* get sensor name to construct image name */
static int vsc_get_sensor_name(struct vsc_fw_loader *fw_loader,
			       struct device *dev)
{}

static int vsc_identify_silicon(struct vsc_fw_loader *fw_loader)
{}

static int vsc_identify_csi_image(struct vsc_fw_loader *fw_loader)
{}

static int vsc_identify_ace_image(struct vsc_fw_loader *fw_loader)
{}

static int vsc_identify_cfg_image(struct vsc_fw_loader *fw_loader)
{}

static int vsc_download_bootloader(struct vsc_fw_loader *fw_loader)
{}

static int vsc_download_firmware(struct vsc_fw_loader *fw_loader)
{}

/**
 * vsc_tp_init - init vsc_tp
 * @tp: vsc_tp device handle
 * @dev: device node for mei vsc device
 * Return: 0 in case of success, negative value in case of error
 */
int vsc_tp_init(struct vsc_tp *tp, struct device *dev)
{}
EXPORT_SYMBOL_NS_GPL();