2020-05-27 23:21:28 +08:00
|
|
|
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0-only) */
|
|
|
|
/* Copyright(c) 2014 - 2020 Intel Corporation */
|
2014-06-06 04:42:39 +08:00
|
|
|
#ifndef ADF_CFG_COMMON_H_
|
|
|
|
#define ADF_CFG_COMMON_H_
|
|
|
|
|
|
|
|
#include <linux/types.h>
|
|
|
|
#include <linux/ioctl.h>
|
|
|
|
|
|
|
|
#define ADF_CFG_MAX_STR_LEN 64
|
|
|
|
#define ADF_CFG_MAX_KEY_LEN_IN_BYTES ADF_CFG_MAX_STR_LEN
|
|
|
|
#define ADF_CFG_MAX_VAL_LEN_IN_BYTES ADF_CFG_MAX_STR_LEN
|
|
|
|
#define ADF_CFG_MAX_SECTION_LEN_IN_BYTES ADF_CFG_MAX_STR_LEN
|
|
|
|
#define ADF_CFG_BASE_DEC 10
|
|
|
|
#define ADF_CFG_BASE_HEX 16
|
|
|
|
#define ADF_CFG_ALL_DEVICES 0xFE
|
|
|
|
#define ADF_CFG_NO_DEVICE 0xFF
|
|
|
|
#define ADF_CFG_AFFINITY_WHATEVER 0xFF
|
|
|
|
#define MAX_DEVICE_NAME_SIZE 32
|
2015-08-08 02:34:25 +08:00
|
|
|
#define ADF_MAX_DEVICES (32 * 32)
|
2016-12-22 23:01:02 +08:00
|
|
|
#define ADF_DEVS_ARRAY_SIZE BITS_TO_LONGS(ADF_MAX_DEVICES)
|
2014-06-06 04:42:39 +08:00
|
|
|
|
|
|
|
enum adf_cfg_val_type {
|
|
|
|
ADF_DEC,
|
|
|
|
ADF_HEX,
|
|
|
|
ADF_STR
|
|
|
|
};
|
|
|
|
|
|
|
|
enum adf_device_type {
|
|
|
|
DEV_UNKNOWN = 0,
|
|
|
|
DEV_DH895XCC,
|
2015-08-08 02:34:25 +08:00
|
|
|
DEV_DH895XCCVF,
|
2015-12-05 08:56:40 +08:00
|
|
|
DEV_C62X,
|
2015-12-05 08:56:51 +08:00
|
|
|
DEV_C62XVF,
|
2015-12-05 08:56:45 +08:00
|
|
|
DEV_C3XXX,
|
2020-11-14 00:46:43 +08:00
|
|
|
DEV_C3XXXVF,
|
|
|
|
DEV_4XXX,
|
2014-06-06 04:42:39 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct adf_dev_status_info {
|
|
|
|
enum adf_device_type type;
|
2020-06-04 01:33:45 +08:00
|
|
|
__u32 accel_id;
|
|
|
|
__u32 instance_id;
|
|
|
|
__u8 num_ae;
|
|
|
|
__u8 num_accel;
|
|
|
|
__u8 num_logical_accel;
|
|
|
|
__u8 banks_per_accel;
|
|
|
|
__u8 state;
|
|
|
|
__u8 bus;
|
|
|
|
__u8 dev;
|
|
|
|
__u8 fun;
|
2014-06-06 04:42:39 +08:00
|
|
|
char name[MAX_DEVICE_NAME_SIZE];
|
|
|
|
};
|
|
|
|
|
|
|
|
#define ADF_CTL_IOC_MAGIC 'a'
|
|
|
|
#define IOCTL_CONFIG_SYS_RESOURCE_PARAMETERS _IOW(ADF_CTL_IOC_MAGIC, 0, \
|
|
|
|
struct adf_user_cfg_ctl_data)
|
|
|
|
#define IOCTL_STOP_ACCEL_DEV _IOW(ADF_CTL_IOC_MAGIC, 1, \
|
|
|
|
struct adf_user_cfg_ctl_data)
|
|
|
|
#define IOCTL_START_ACCEL_DEV _IOW(ADF_CTL_IOC_MAGIC, 2, \
|
|
|
|
struct adf_user_cfg_ctl_data)
|
2020-06-04 01:33:45 +08:00
|
|
|
#define IOCTL_STATUS_ACCEL_DEV _IOW(ADF_CTL_IOC_MAGIC, 3, __u32)
|
|
|
|
#define IOCTL_GET_NUM_DEVICES _IOW(ADF_CTL_IOC_MAGIC, 4, __s32)
|
2014-06-06 04:42:39 +08:00
|
|
|
#endif
|