linux/drivers/misc/issei/dma.h
Alexander Usyskin 65f0ecb9ec issei: initial driver skeleton
The ISSEI (Intel Silicon Security Engine Interface)
subsystem provides a communication channel between the host and the
Silicon Security Engine.

Prepare basic driver functions and character device
for user-space communication.
Add DMA access routines for ISSEI HECI devices.
Add of DMA-related structures and implementation of routines for
setting up DMA, as well as reading and writing DMA buffers.

Reviewed-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Co-developed-by: Vitaly Lubart <lubvital@gmail.com>
Signed-off-by: Vitaly Lubart <lubvital@gmail.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Link: https://patch.msgid.link/20260513-issei-for-upstream-v1-1-f590038678f9@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-07-17 15:48:11 +02:00

70 lines
1.7 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2023-2026 Intel Corporation */
#ifndef _ISSEI_DMA_H_
#define _ISSEI_DMA_H_
#include <linux/types.h>
struct issei_device;
/**
* struct issei_dma_length - sizes of DMA memory portions
* @h2f: host to firmware buffer size
* @f2h: firmware to host buffer size
* @ctl: control buffer size
*/
struct issei_dma_length {
size_t h2f;
size_t f2h;
size_t ctl;
};
/**
* struct issei_dma - DMA memory structure
* @vaddr: virtual address
* @daddr: physical address
* @length: memory sizes structure
*/
struct issei_dma {
void *vaddr;
dma_addr_t daddr;
struct issei_dma_length length;
};
/* Operation statuses */
#define HAMS_SUCCESS 0x00
#define HAMS_PROTOCOL_NOT_SUPPORTED 0x01
#define HAMS_DEPRECATED_BUS_MSG 0x02
#define HAMS_CLIENT_NOT_EXISTS 0x03
#define HAMS_MSG_TOO_BIG 0x04
#define HAMS_MSG_NOT_CONSUMED 0x05
#define HAMS_CORRUPTED_BUS_MSG 0x06
#define HAMS_CORRUPTED_HEADER 0x07
#define HAMS_INVALID_LENGTH 0x08
#define HAMS_SHARED_MEMORY_SIZE_UNSUPPORTED 0x09
#define HAMS_GENERAL_FATAL_ERROR 0xff
/**
* struct issei_dma_data - data passed through channel
* @fw_id: firmware client id
* @host_id: host client id
* @flags: flags bitmap
* @status: operation status
* @length: data length
* @buf: pointer to data buffer
*/
struct issei_dma_data {
u16 fw_id;
u16 host_id;
u32 flags;
u32 status;
u32 length;
void *buf;
};
int issei_dmam_setup(struct issei_device *idev);
int issei_dma_write(struct issei_device *idev, const struct issei_dma_data *data);
int issei_dma_read(struct issei_device *idev, struct issei_dma_data *data);
#endif /*_ISSEI_DMA_H_*/