linux/drivers/crypto/ccp/psp-dev.h

/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * AMD Platform Security Processor (PSP) interface driver
 *
 * Copyright (C) 2017-2019 Advanced Micro Devices, Inc.
 *
 * Author: Brijesh Singh <[email protected]>
 */

#ifndef __PSP_DEV_H__
#define __PSP_DEV_H__

#include <linux/device.h>
#include <linux/list.h>
#include <linux/bits.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/psp.h>
#include <linux/psp-platform-access.h>

#include "sp-dev.h"

#define MAX_PSP_NAME_LEN

extern struct psp_device *psp_master;

psp_irq_handler_t;

psp_cap_register;

struct psp_device {};

void psp_set_sev_irq_handler(struct psp_device *psp, psp_irq_handler_t handler,
			     void *data);
void psp_clear_sev_irq_handler(struct psp_device *psp);

struct psp_device *psp_get_master_device(void);

/**
 * enum psp_cmd - PSP mailbox commands
 * @PSP_CMD_TEE_RING_INIT:	Initialize TEE ring buffer
 * @PSP_CMD_TEE_RING_DESTROY:	Destroy TEE ring buffer
 * @PSP_CMD_TEE_EXTENDED_CMD:	Extended command
 * @PSP_CMD_MAX:		Maximum command id
 */
enum psp_cmd {};

int psp_mailbox_command(struct psp_device *psp, enum psp_cmd cmd, void *cmdbuff,
			unsigned int timeout_msecs, unsigned int *cmdresp);

/**
 * struct psp_ext_req_buffer_hdr - Structure of the extended command header
 * @payload_size: total payload size
 * @sub_cmd_id: extended command ID
 * @status: status of command execution (out)
 */
struct psp_ext_req_buffer_hdr {} __packed;

struct psp_ext_request {} __packed;

/**
 * enum psp_sub_cmd - PSP mailbox sub commands
 * @PSP_SUB_CMD_DBC_GET_NONCE:		Get nonce from DBC
 * @PSP_SUB_CMD_DBC_SET_UID:		Set UID for DBC
 * @PSP_SUB_CMD_DBC_GET_PARAMETER:	Get parameter from DBC
 * @PSP_SUB_CMD_DBC_SET_PARAMETER:	Set parameter for DBC
 */
enum psp_sub_cmd {};

int psp_extended_mailbox_cmd(struct psp_device *psp, unsigned int timeout_msecs,
			     struct psp_ext_request *req);
#endif /* __PSP_DEV_H */