#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/firmware.h>
#include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/math64.h>
#include <linux/mm.h>
#include <linux/mutex.h>
#include <linux/pci.h>
#include <linux/pfn.h>
#include <linux/pm_runtime.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/time64.h>
#include "ipu6.h"
#include "ipu6-bus.h"
#include "ipu6-buttress.h"
#include "ipu6-platform-buttress-regs.h"
#define BOOTLOADER_STATUS_OFFSET …
#define BOOTLOADER_MAGIC_KEY …
#define ENTRY …
#define EXIT …
#define QUERY …
#define BUTTRESS_TSC_SYNC_RESET_TRIAL_MAX …
#define BUTTRESS_POWER_TIMEOUT_US …
#define BUTTRESS_CSE_BOOTLOAD_TIMEOUT_US …
#define BUTTRESS_CSE_AUTHENTICATE_TIMEOUT_US …
#define BUTTRESS_CSE_FWRESET_TIMEOUT_US …
#define BUTTRESS_IPC_TX_TIMEOUT_MS …
#define BUTTRESS_IPC_RX_TIMEOUT_MS …
#define BUTTRESS_IPC_VALIDITY_TIMEOUT_US …
#define BUTTRESS_TSC_SYNC_TIMEOUT_US …
#define BUTTRESS_IPC_RESET_RETRY …
#define BUTTRESS_CSE_IPC_RESET_RETRY …
#define BUTTRESS_IPC_CMD_SEND_RETRY …
#define BUTTRESS_MAX_CONSECUTIVE_IRQS …
static const u32 ipu6_adev_irq_mask[2] = …;
int ipu6_buttress_ipc_reset(struct ipu6_device *isp,
struct ipu6_buttress_ipc *ipc)
{ … }
static void ipu6_buttress_ipc_validity_close(struct ipu6_device *isp,
struct ipu6_buttress_ipc *ipc)
{ … }
static int
ipu6_buttress_ipc_validity_open(struct ipu6_device *isp,
struct ipu6_buttress_ipc *ipc)
{ … }
static void ipu6_buttress_ipc_recv(struct ipu6_device *isp,
struct ipu6_buttress_ipc *ipc, u32 *ipc_msg)
{ … }
static int ipu6_buttress_ipc_send_bulk(struct ipu6_device *isp,
enum ipu6_buttress_ipc_domain ipc_domain,
struct ipu6_ipc_buttress_bulk_msg *msgs,
u32 size)
{ … }
static int
ipu6_buttress_ipc_send(struct ipu6_device *isp,
enum ipu6_buttress_ipc_domain ipc_domain,
u32 ipc_msg, u32 size, bool require_resp,
u32 expected_resp)
{ … }
static irqreturn_t ipu6_buttress_call_isr(struct ipu6_bus_device *adev)
{ … }
irqreturn_t ipu6_buttress_isr(int irq, void *isp_ptr)
{ … }
irqreturn_t ipu6_buttress_isr_threaded(int irq, void *isp_ptr)
{ … }
int ipu6_buttress_power(struct device *dev, struct ipu6_buttress_ctrl *ctrl,
bool on)
{ … }
bool ipu6_buttress_get_secure_mode(struct ipu6_device *isp)
{ … }
bool ipu6_buttress_auth_done(struct ipu6_device *isp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int ipu6_buttress_reset_authentication(struct ipu6_device *isp)
{ … }
int ipu6_buttress_map_fw_image(struct ipu6_bus_device *sys,
const struct firmware *fw, struct sg_table *sgt)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
void ipu6_buttress_unmap_fw_image(struct ipu6_bus_device *sys,
struct sg_table *sgt)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
int ipu6_buttress_authenticate(struct ipu6_device *isp)
{ … }
static int ipu6_buttress_send_tsc_request(struct ipu6_device *isp)
{ … }
int ipu6_buttress_start_tsc_sync(struct ipu6_device *isp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
void ipu6_buttress_tsc_read(struct ipu6_device *isp, u64 *val)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
u64 ipu6_buttress_tsc_ticks_to_ns(u64 ticks, const struct ipu6_device *isp)
{ … }
EXPORT_SYMBOL_NS_GPL(…);
void ipu6_buttress_restore(struct ipu6_device *isp)
{ … }
int ipu6_buttress_init(struct ipu6_device *isp)
{ … }
void ipu6_buttress_exit(struct ipu6_device *isp)
{ … }