linux/drivers/input/rmi4/rmi_f34.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2007-2016, Synaptics Incorporated
 * Copyright (C) 2016 Zodiac Inflight Innovations
 */

#ifndef _RMI_F34_H
#define _RMI_F34_H

/* F34 image file offsets. */
#define F34_FW_IMAGE_OFFSET

/* F34 register offsets. */
#define F34_BLOCK_DATA_OFFSET

/* F34 commands */
#define F34_WRITE_FW_BLOCK
#define F34_ERASE_ALL
#define F34_READ_CONFIG_BLOCK
#define F34_WRITE_CONFIG_BLOCK
#define F34_ERASE_CONFIG
#define F34_ENABLE_FLASH_PROG

#define F34_STATUS_IN_PROGRESS
#define F34_STATUS_IDLE

#define F34_IDLE_WAIT_MS
#define F34_ENABLE_WAIT_MS
#define F34_ERASE_WAIT_MS
#define F34_WRITE_WAIT_MS

#define F34_BOOTLOADER_ID_LEN

/* F34 V7 defines */
#define V7_FLASH_STATUS_OFFSET
#define V7_PARTITION_ID_OFFSET
#define V7_BLOCK_NUMBER_OFFSET
#define V7_TRANSFER_LENGTH_OFFSET
#define V7_COMMAND_OFFSET
#define V7_PAYLOAD_OFFSET
#define V7_BOOTLOADER_ID_OFFSET

#define IMAGE_HEADER_VERSION_10

#define CONFIG_ID_SIZE
#define PRODUCT_ID_SIZE


#define HAS_BSR
#define HAS_CONFIG_ID
#define HAS_GUEST_CODE
#define HAS_DISP_CFG

/* F34 V7 commands */
#define CMD_V7_IDLE
#define CMD_V7_ENTER_BL
#define CMD_V7_READ
#define CMD_V7_WRITE
#define CMD_V7_ERASE
#define CMD_V7_ERASE_AP
#define CMD_V7_SENSOR_ID

#define v7_CMD_IDLE
#define v7_CMD_WRITE_FW
#define v7_CMD_WRITE_CONFIG
#define v7_CMD_WRITE_LOCKDOWN
#define v7_CMD_WRITE_GUEST_CODE
#define v7_CMD_READ_CONFIG
#define v7_CMD_ERASE_ALL
#define v7_CMD_ERASE_UI_FIRMWARE
#define v7_CMD_ERASE_UI_CONFIG
#define v7_CMD_ERASE_BL_CONFIG
#define v7_CMD_ERASE_DISP_CONFIG
#define v7_CMD_ERASE_FLASH_CONFIG
#define v7_CMD_ERASE_GUEST_CODE
#define v7_CMD_ENABLE_FLASH_PROG

#define v7_UI_CONFIG_AREA
#define v7_PM_CONFIG_AREA
#define v7_BL_CONFIG_AREA
#define v7_DP_CONFIG_AREA
#define v7_FLASH_CONFIG_AREA

/* F34 V7 partition IDs */
#define BOOTLOADER_PARTITION
#define DEVICE_CONFIG_PARTITION
#define FLASH_CONFIG_PARTITION
#define MANUFACTURING_BLOCK_PARTITION
#define GUEST_SERIALIZATION_PARTITION
#define GLOBAL_PARAMETERS_PARTITION
#define CORE_CODE_PARTITION
#define CORE_CONFIG_PARTITION
#define GUEST_CODE_PARTITION
#define DISPLAY_CONFIG_PARTITION

/* F34 V7 container IDs */
#define TOP_LEVEL_CONTAINER
#define UI_CONTAINER
#define UI_CONFIG_CONTAINER
#define BL_CONTAINER
#define BL_IMAGE_CONTAINER
#define BL_CONFIG_CONTAINER
#define BL_LOCKDOWN_INFO_CONTAINER
#define PERMANENT_CONFIG_CONTAINER
#define GUEST_CODE_CONTAINER
#define BL_PROTOCOL_DESCRIPTOR_CONTAINER
#define UI_PROTOCOL_DESCRIPTOR_CONTAINER
#define RMI_SELF_DISCOVERY_CONTAINER
#define RMI_PAGE_CONTENT_CONTAINER
#define GENERAL_INFORMATION_CONTAINER
#define DEVICE_CONFIG_CONTAINER
#define FLASH_CONFIG_CONTAINER
#define GUEST_SERIALIZATION_CONTAINER
#define GLOBAL_PARAMETERS_CONTAINER
#define CORE_CODE_CONTAINER
#define CORE_CONFIG_CONTAINER
#define DISPLAY_CONFIG_CONTAINER

struct f34v7_query_1_7 {} __packed;

struct f34v7_data_1_5 {} __packed;

struct block_data {};

struct partition_table {} __packed;

struct physical_address {};

struct container_descriptor {} __packed;

struct block_count {};

struct image_header_10 {};

struct image_metadata {};

struct rmi_f34_firmware {};

struct f34v5_data {};

struct f34v7_data {};

struct f34_data {};

int rmi_f34v7_start_reflash(struct f34_data *f34, const struct firmware *fw);
int rmi_f34v7_do_reflash(struct f34_data *f34, const struct firmware *fw);
int rmi_f34v7_probe(struct f34_data *f34);

#endif /* _RMI_F34_H */