History

Merge tag 'char-misc-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc and other driver updates from Greg KH: "Here is the big set of char/misc and other small driver subsystem updates for 5.18-rc1. Included in here are merges from driver subsystems which contain: - iio driver updates and new drivers - fsi driver updates - fpga driver updates - habanalabs driver updates and support for new hardware - soundwire driver updates and new drivers - phy driver updates and new drivers - coresight driver updates - icc driver updates Individual changes include: - mei driver updates - interconnect driver updates - new PECI driver subsystem added - vmci driver updates - lots of tiny misc/char driver updates All of these have been in linux-next for a while with no reported problems" * tag 'char-misc-5.18-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (556 commits) firmware: google: Properly state IOMEM dependency kgdbts: fix return value of __setup handler firmware: sysfb: fix platform-device leak in error path firmware: stratix10-svc: add missing callback parameter on RSU arm64: dts: qcom: add non-secure domain property to fastrpc nodes misc: fastrpc: Add dma handle implementation misc: fastrpc: Add fdlist implementation misc: fastrpc: Add helper function to get list and page misc: fastrpc: Add support to secure memory map dt-bindings: misc: add fastrpc domain vmid property misc: fastrpc: check before loading process to the DSP misc: fastrpc: add secure domain support dt-bindings: misc: add property to support non-secure DSP misc: fastrpc: Add support to get DSP capabilities misc: fastrpc: add support for FASTRPC_IOCTL_MEM_MAP/UNMAP misc: fastrpc: separate fastrpc device from channel context dt-bindings: nvmem: brcm,nvram: add basic NVMEM cells dt-bindings: nvmem: make "reg" property optional nvmem: brcm_nvram: parse NVRAM content into NVMEM cells nvmem: dt-bindings: Fix the error of dt-bindings check ...

Linus Torvalds committed 4 years ago

Commit 02e2af22 parents ff61bc8 37fd839567 files · +26988 −6664Browse files

Showing the changes to include/uapi (5 of 567 files). Show all

Unified · Split

5 files
  1. include/uapi/linux/counter.h +2 −0
  2. include/uapi/linux/fsi.h +14 −0
  3. include/uapi/linux/iio/types.h +1 −0
  4. include/uapi/misc/fastrpc.h +80 −1
  5. include/uapi/misc/habanalabs.h +95 −51
include/uapi/linux/counter.h+2−0
@@ -61,6 +61,8 @@ enum counter_event_type { · 60 unmodified lines
61 COUNTER_EVENT_THRESHOLD,61 COUNTER_EVENT_THRESHOLD,
62 /* Index signal detected */62 /* Index signal detected */
63 COUNTER_EVENT_INDEX,63 COUNTER_EVENT_INDEX,
64 /* State of counter is changed */
65 COUNTER_EVENT_CHANGE_OF_STATE,
64};66};
65 67
66/**68/**
include/uapi/linux/fsi.h+14−0
@@ -55,4 +55,18 @@ struct scom_access { · 54 unmodified lines
55#define FSI_SCOM_WRITE _IOWR('s', 0x02, struct scom_access)55#define FSI_SCOM_WRITE _IOWR('s', 0x02, struct scom_access)
56#define FSI_SCOM_RESET _IOW('s', 0x03, __u32)56#define FSI_SCOM_RESET _IOW('s', 0x03, __u32)
57 57
58/*
59 * /dev/sbefifo* ioctl interface
60 */
61
62/**
63 * FSI_SBEFIFO_READ_TIMEOUT sets the read timeout for response from SBE.
64 *
65 * The read timeout is specified in seconds. The minimum value of read
66 * timeout is 10 seconds (default) and the maximum value of read timeout is
67 * 120 seconds. A read timeout of 0 will reset the value to the default of
68 * (10 seconds).
69 */
70#define FSI_SBEFIFO_READ_TIMEOUT_SECONDS _IOW('s', 0x00, __u32)
71
58#endif /* _UAPI_LINUX_FSI_H */72#endif /* _UAPI_LINUX_FSI_H */
include/uapi/linux/iio/types.h+1−0
@@ -104,6 +104,7 @@ enum iio_event_type { · 103 unmodified lines
104 IIO_EV_TYPE_THRESH_ADAPTIVE,104 IIO_EV_TYPE_THRESH_ADAPTIVE,
105 IIO_EV_TYPE_MAG_ADAPTIVE,105 IIO_EV_TYPE_MAG_ADAPTIVE,
106 IIO_EV_TYPE_CHANGE,106 IIO_EV_TYPE_CHANGE,
107 IIO_EV_TYPE_MAG_REFERENCED,
107};108};
108 109
109enum iio_event_direction {110enum iio_event_direction {
include/uapi/misc/fastrpc.h+80−1
@@ -13,12 +13,64 @@ · 12 unmodified lines
13#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)13#define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)
14#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)14#define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)
15#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8)15#define FASTRPC_IOCTL_INIT_ATTACH_SNS _IO('R', 8)
16#define FASTRPC_IOCTL_MEM_MAP _IOWR('R', 10, struct fastrpc_mem_map)
17#define FASTRPC_IOCTL_MEM_UNMAP _IOWR('R', 11, struct fastrpc_mem_unmap)
18#define FASTRPC_IOCTL_GET_DSP_INFO _IOWR('R', 13, struct fastrpc_ioctl_capability)
19
20/**
21 * enum fastrpc_map_flags - control flags for mapping memory on DSP user process
22 * @FASTRPC_MAP_STATIC: Map memory pages with RW- permission and CACHE WRITEBACK.
23 * The driver is responsible for cache maintenance when passed
24 * the buffer to FastRPC calls. Same virtual address will be
25 * assigned for subsequent FastRPC calls.
26 * @FASTRPC_MAP_RESERVED: Reserved
27 * @FASTRPC_MAP_FD: Map memory pages with RW- permission and CACHE WRITEBACK.
28 * Mapping tagged with a file descriptor. User is responsible for
29 * CPU and DSP cache maintenance for the buffer. Get virtual address
30 * of buffer on DSP using HAP_mmap_get() and HAP_mmap_put() APIs.
31 * @FASTRPC_MAP_FD_DELAYED: Mapping delayed until user call HAP_mmap() and HAP_munmap()
32 * functions on DSP. It is useful to map a buffer with cache modes
33 * other than default modes. User is responsible for CPU and DSP
34 * cache maintenance for the buffer.
35 * @FASTRPC_MAP_FD_NOMAP: This flag is used to skip CPU mapping,
36 * otherwise behaves similar to FASTRPC_MAP_FD_DELAYED flag.
37 * @FASTRPC_MAP_MAX: max count for flags
38 *
39 */
40enum fastrpc_map_flags {
41 FASTRPC_MAP_STATIC = 0,
42 FASTRPC_MAP_RESERVED,
43 FASTRPC_MAP_FD = 2,
44 FASTRPC_MAP_FD_DELAYED,
45 FASTRPC_MAP_FD_NOMAP = 16,
46 FASTRPC_MAP_MAX,
47};
48
49enum fastrpc_proc_attr {
50 /* Macro for Debug attr */
51 FASTRPC_MODE_DEBUG = (1 << 0),
52 /* Macro for Ptrace */
53 FASTRPC_MODE_PTRACE = (1 << 1),
54 /* Macro for CRC Check */
55 FASTRPC_MODE_CRC = (1 << 2),
56 /* Macro for Unsigned PD */
57 FASTRPC_MODE_UNSIGNED_MODULE = (1 << 3),
58 /* Macro for Adaptive QoS */
59 FASTRPC_MODE_ADAPTIVE_QOS = (1 << 4),
60 /* Macro for System Process */
61 FASTRPC_MODE_SYSTEM_PROCESS = (1 << 5),
62 /* Macro for Prvileged Process */
63 FASTRPC_MODE_PRIVILEGED = (1 << 6),
64};
65
66/* Fastrpc attribute for memory protection of buffers */
67#define FASTRPC_ATTR_SECUREMAP (1)
16 68
17struct fastrpc_invoke_args {69struct fastrpc_invoke_args {
18 __u64 ptr;70 __u64 ptr;
19 __u64 length;71 __u64 length;
20 __s32 fd;72 __s32 fd;
21 __u32 reserved;73 __u32 attr;
22};74};
23 75
24struct fastrpc_invoke {76struct fastrpc_invoke {
@@ -49,9 +101,36 @@ struct fastrpc_req_mmap { · 24 unmodified lines
49 __u64 vaddrout; /* dsp virtual address */101 __u64 vaddrout; /* dsp virtual address */
50};102};
51 103
104struct fastrpc_mem_map {
105 __s32 version;
106 __s32 fd; /* fd */
107 __s32 offset; /* buffer offset */
108 __u32 flags; /* flags defined in enum fastrpc_map_flags */
109 __u64 vaddrin; /* buffer virtual address */
110 __u64 length; /* buffer length */
111 __u64 vaddrout; /* [out] remote virtual address */
112 __s32 attrs; /* buffer attributes used for SMMU mapping */
113 __s32 reserved[4];
114};
115
52struct fastrpc_req_munmap {116struct fastrpc_req_munmap {
53 __u64 vaddrout; /* address to unmap */117 __u64 vaddrout; /* address to unmap */
54 __u64 size; /* size */118 __u64 size; /* size */
55};119};
56 120
121struct fastrpc_mem_unmap {
122 __s32 vesion;
123 __s32 fd; /* fd */
124 __u64 vaddr; /* remote process (dsp) virtual address */
125 __u64 length; /* buffer size */
126 __s32 reserved[5];
127};
128
129struct fastrpc_ioctl_capability {
130 __u32 domain;
131 __u32 attribute_id;
132 __u32 capability; /* dsp capability */
133 __u32 reserved[4];
134};
135
57#endif /* __QCOM_FASTRPC_H__ */136#endif /* __QCOM_FASTRPC_H__ */
include/uapi/misc/habanalabs.h+95−51
@@ -1,6 +1,6 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
2 *2 *
3 * Copyright 2016-2020 HabanaLabs, Ltd.3 * Copyright 2016-2022 HabanaLabs, Ltd.
4 * All Rights Reserved.4 * All Rights Reserved.
5 *5 *
6 */6 */
@@ -30,6 +30,9 @@ · 23 unmodified lines
30 */30 */
31#define GAUDI_FIRST_AVAILABLE_W_S_MONITOR 7231#define GAUDI_FIRST_AVAILABLE_W_S_MONITOR 72
32 32
33/* Max number of elements in timestamps registration buffers */
34#define TS_MAX_ELEMENTS_NUM (1 << 20) /* 1MB */
35
33/*36/*
34 * Goya queue Numbering37 * Goya queue Numbering
35 *38 *
@@ -404,6 +407,8 @@ enum hl_server_type { · 368 unmodified lines
404 * @cpucp_version: The CPUCP f/w version.407 * @cpucp_version: The CPUCP f/w version.
405 * @card_name: The card name as passed by the f/w.408 * @card_name: The card name as passed by the f/w.
406 * @dram_page_size: The DRAM physical page size.409 * @dram_page_size: The DRAM physical page size.
410 * @number_of_user_interrupts: The number of interrupts that are available to the userspace
411 * application to use. Relevant for Gaudi2 and later.
407 */412 */
408struct hl_info_hw_ip_info {413struct hl_info_hw_ip_info {
409 __u64 sram_base_address;414 __u64 sram_base_address;
@@ -428,6 +433,9 @@ struct hl_info_hw_ip_info { · 18 unmodified lines
428 __u8 card_name[HL_INFO_CARD_NAME_MAX_LEN];433 __u8 card_name[HL_INFO_CARD_NAME_MAX_LEN];
429 __u64 reserved2;434 __u64 reserved2;
430 __u64 dram_page_size;435 __u64 dram_page_size;
436 __u32 reserved3;
437 __u16 number_of_user_interrupts;
438 __u16 pad2;
431};439};
432 440
433struct hl_info_dram_usage {441struct hl_info_dram_usage {
@@ -690,10 +698,12 @@ struct hl_cb_in { · 256 unmodified lines
690 __u64 cb_handle;698 __u64 cb_handle;
691 /* HL_CB_OP_* */699 /* HL_CB_OP_* */
692 __u32 op;700 __u32 op;
701
693 /* Size of CB. Maximum size is HL_MAX_CB_SIZE. The minimum size that702 /* Size of CB. Maximum size is HL_MAX_CB_SIZE. The minimum size that
694 * will be allocated, regardless of this parameter's value, is PAGE_SIZE703 * will be allocated, regardless of this parameter's value, is PAGE_SIZE
695 */704 */
696 __u32 cb_size;705 __u32 cb_size;
706
697 /* Context ID - Currently not in use */707 /* Context ID - Currently not in use */
698 __u32 ctx_id;708 __u32 ctx_id;
699 /* HL_CB_FLAGS_* */709 /* HL_CB_FLAGS_* */
@@ -959,6 +969,7 @@ union hl_cs_args { · 259 unmodified lines
959#define HL_WAIT_CS_FLAGS_INTERRUPT_MASK 0xFFF00000969#define HL_WAIT_CS_FLAGS_INTERRUPT_MASK 0xFFF00000
960#define HL_WAIT_CS_FLAGS_MULTI_CS 0x4970#define HL_WAIT_CS_FLAGS_MULTI_CS 0x4
961#define HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ 0x10971#define HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ 0x10
972#define HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT 0x20
962 973
963#define HL_WAIT_MULTI_CS_LIST_MAX_LEN 32974#define HL_WAIT_MULTI_CS_LIST_MAX_LEN 32
964 975
@@ -1031,6 +1042,20 @@ struct hl_wait_cs_in { · 66 unmodified lines
1031 * relevant only when HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ is set1042 * relevant only when HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ is set
1032 */1043 */
1033 __u64 cq_counters_offset;1044 __u64 cq_counters_offset;
1045
1046 /*
1047 * Timestamp_handle timestamps buffer handle.
1048 * relevant only when HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT is set
1049 */
1050 __u64 timestamp_handle;
1051
1052 /*
1053 * Timestamp_offset is offset inside the timestamp buffer pointed by timestamp_handle above.
1054 * upon interrupt, if the cq reached the target value then driver will write
1055 * timestamp to this offset.
1056 * relevant only when HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT is set
1057 */
1058 __u64 timestamp_offset;
1034};1059};
1035 1060
1036#define HL_WAIT_CS_STATUS_COMPLETED 01061#define HL_WAIT_CS_STATUS_COMPLETED 0
@@ -1077,100 +1102,119 @@ union hl_wait_cs_args { · 40 unmodified lines
1077 */1102 */
1078#define HL_MEM_OP_EXPORT_DMABUF_FD 51103#define HL_MEM_OP_EXPORT_DMABUF_FD 5
1079 1104
1105/* Opcode to create timestamps pool for user interrupts registration support
1106 * The memory will be allocated by the kernel driver, A timestamp buffer which the user
1107 * will get handle to it for mmap, and another internal buffer used by the
1108 * driver for registration management
1109 * The memory will be freed when the user closes the file descriptor(ctx close)
1110 */
1111#define HL_MEM_OP_TS_ALLOC 6
1112
1080/* Memory flags */1113/* Memory flags */
1081#define HL_MEM_CONTIGUOUS 0x11114#define HL_MEM_CONTIGUOUS 0x1
1082#define HL_MEM_SHARED 0x21115#define HL_MEM_SHARED 0x2
1083#define HL_MEM_USERPTR 0x41116#define HL_MEM_USERPTR 0x4
1084#define HL_MEM_FORCE_HINT 0x81117#define HL_MEM_FORCE_HINT 0x8
1085 1118
1119/**
1120 * structure hl_mem_in - structure that handle input args for memory IOCTL
1121 * @union arg: union of structures to be used based on the input operation
1122 * @op: specify the requested memory operation (one of the HL_MEM_OP_* definitions).
1123 * @flags: flags for the memory operation (one of the HL_MEM_* definitions).
1124 * For the HL_MEM_OP_EXPORT_DMABUF_FD opcode, this field holds the DMA-BUF file/FD flags.
1125 * @ctx_id: context ID - currently not in use.
1126 * @num_of_elements: number of timestamp elements used only with HL_MEM_OP_TS_ALLOC opcode.
1127 */
1086struct hl_mem_in {1128struct hl_mem_in {
1087 union {1129 union {
1088 /* HL_MEM_OP_ALLOC- allocate device memory */1130 /**
1131 * structure for device memory allocation (used with the HL_MEM_OP_ALLOC op)
1132 * @mem_size: memory size to allocate
1133 * @page_size: page size to use on allocation. when the value is 0 the default page
1134 * size will be taken.
1135 */
1089 struct {1136 struct {
1090 /* Size to alloc */
1091 __u64 mem_size;1137 __u64 mem_size;
1138 __u64 page_size;
1092 } alloc;1139 } alloc;
1093 1140
1094 /* HL_MEM_OP_FREE - free device memory */1141 /**
1142 * structure for free-ing device memory (used with the HL_MEM_OP_FREE op)
1143 * @handle: handle returned from HL_MEM_OP_ALLOC
1144 */
1095 struct {1145 struct {
1096 /* Handle returned from HL_MEM_OP_ALLOC */
1097 __u64 handle;1146 __u64 handle;
1098 } free;1147 } free;
1099 1148
1100 /* HL_MEM_OP_MAP - map device memory */1149 /**
1150 * structure for mapping device memory (used with the HL_MEM_OP_MAP op)
1151 * @hint_addr: requested virtual address of mapped memory.
1152 * the driver will try to map the requested region to this hint
1153 * address, as long as the address is valid and not already mapped.
1154 * the user should check the returned address of the IOCTL to make
1155 * sure he got the hint address.
1156 * passing 0 here means that the driver will choose the address itself.
1157 * @handle: handle returned from HL_MEM_OP_ALLOC.
1158 */
1101 struct {1159 struct {
1102 /*
1103 * Requested virtual address of mapped memory.
1104 * The driver will try to map the requested region to
1105 * this hint address, as long as the address is valid
1106 * and not already mapped. The user should check the
1107 * returned address of the IOCTL to make sure he got
1108 * the hint address. Passing 0 here means that the
1109 * driver will choose the address itself.
1110 */
1111 __u64 hint_addr;1160 __u64 hint_addr;
1112 /* Handle returned from HL_MEM_OP_ALLOC */
1113 __u64 handle;1161 __u64 handle;
1114 } map_device;1162 } map_device;
1115 1163
1116 /* HL_MEM_OP_MAP - map host memory */1164 /**
1165 * structure for mapping host memory (used with the HL_MEM_OP_MAP op)
1166 * @host_virt_addr: address of allocated host memory.
1167 * @hint_addr: requested virtual address of mapped memory.
1168 * the driver will try to map the requested region to this hint
1169 * address, as long as the address is valid and not already mapped.
1170 * the user should check the returned address of the IOCTL to make
1171 * sure he got the hint address.
1172 * passing 0 here means that the driver will choose the address itself.
1173 * @size: size of allocated host memory.
1174 */
1117 struct {1175 struct {
1118 /* Address of allocated host memory */
1119 __u64 host_virt_addr;1176 __u64 host_virt_addr;
1120 /*
1121 * Requested virtual address of mapped memory.
1122 * The driver will try to map the requested region to
1123 * this hint address, as long as the address is valid
1124 * and not already mapped. The user should check the
1125 * returned address of the IOCTL to make sure he got
1126 * the hint address. Passing 0 here means that the
1127 * driver will choose the address itself.
1128 */
1129 __u64 hint_addr;1177 __u64 hint_addr;
1130 /* Size of allocated host memory */
1131 __u64 mem_size;1178 __u64 mem_size;
1132 } map_host;1179 } map_host;
1133 1180
1134 /* HL_MEM_OP_MAP_BLOCK - map a hw block */1181 /**
1182 * structure for mapping hw block (used with the HL_MEM_OP_MAP_BLOCK op)
1183 * @block_addr:HW block address to map, a handle and size will be returned
1184 * to the user and will be used to mmap the relevant block.
1185 * only addresses from configuration space are allowed.
1186 */
1135 struct {1187 struct {
1136 /*
1137 * HW block address to map, a handle and size will be
1138 * returned to the user and will be used to mmap the
1139 * relevant block. Only addresses from configuration
1140 * space are allowed.
1141 */
1142 __u64 block_addr;1188 __u64 block_addr;
1143 } map_block;1189 } map_block;
1144 1190
1145 /* HL_MEM_OP_UNMAP - unmap host memory */1191 /**
1192 * structure for unmapping host memory (used with the HL_MEM_OP_UNMAP op)
1193 * @device_virt_addr: virtual address returned from HL_MEM_OP_MAP
1194 */
1146 struct {1195 struct {
1147 /* Virtual address returned from HL_MEM_OP_MAP */
1148 __u64 device_virt_addr;1196 __u64 device_virt_addr;
1149 } unmap;1197 } unmap;
1150 1198
1151 /* HL_MEM_OP_EXPORT_DMABUF_FD */1199 /**
1200 * structure for exporting DMABUF object (used with
1201 * the HL_MEM_OP_EXPORT_DMABUF_FD op)
1202 * @handle: handle returned from HL_MEM_OP_ALLOC.
1203 * in Gaudi, where we don't have MMU for the device memory, the
1204 * driver expects a physical address (instead of a handle) in the
1205 * device memory space.
1206 * @mem_size: size of memory allocation. Relevant only for GAUDI
1207 */
1152 struct {1208 struct {
1153 /* Handle returned from HL_MEM_OP_ALLOC. In Gaudi,
1154 * where we don't have MMU for the device memory, the
1155 * driver expects a physical address (instead of
1156 * a handle) in the device memory space.
1157 */
1158 __u64 handle;1209 __u64 handle;
1159 /* Size of memory allocation. Relevant only for GAUDI */
1160 __u64 mem_size;1210 __u64 mem_size;
1161 } export_dmabuf_fd;1211 } export_dmabuf_fd;
1162 };1212 };
1163 1213
1164 /* HL_MEM_OP_* */
1165 __u32 op;1214 __u32 op;
1166 /* HL_MEM_* flags.
1167 * For the HL_MEM_OP_EXPORT_DMABUF_FD opcode, this field holds the
1168 * DMA-BUF file/FD flags.
1169 */
1170 __u32 flags;1215 __u32 flags;
1171 /* Context ID - Currently not in use */
1172 __u32 ctx_id;1216 __u32 ctx_id;
1173 __u32 pad;1217 __u32 num_of_elements;
1174};1218};
1175 1219
1176struct hl_mem_out {1220struct hl_mem_out {