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
6161 COUNTER_EVENT_THRESHOLD,
6262 /* Index signal detected */
6363 COUNTER_EVENT_INDEX,
64+ /* State of counter is changed */
65+ COUNTER_EVENT_CHANGE_OF_STATE,
6466 };
6567
6668 /**
include/uapi/linux/fsi.h+14−0
@@ -55,4 +55,18 @@ struct scom_access { · 54 unmodified lines
5555 #define FSI_SCOM_WRITE _IOWR('s', 0x02, struct scom_access)
5656 #define FSI_SCOM_RESET _IOW('s', 0x03, __u32)
5757
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+
5872 #endif /* _UAPI_LINUX_FSI_H */
include/uapi/linux/iio/types.h+1−0
@@ -104,6 +104,7 @@ enum iio_event_type { · 103 unmodified lines
104104 IIO_EV_TYPE_THRESH_ADAPTIVE,
105105 IIO_EV_TYPE_MAG_ADAPTIVE,
106106 IIO_EV_TYPE_CHANGE,
107+ IIO_EV_TYPE_MAG_REFERENCED,
107108 };
108109
109110 enum iio_event_direction {
include/uapi/misc/fastrpc.h+80−1
@@ -13,12 +13,64 @@ · 12 unmodified lines
1313 #define FASTRPC_IOCTL_MMAP _IOWR('R', 6, struct fastrpc_req_mmap)
1414 #define FASTRPC_IOCTL_MUNMAP _IOWR('R', 7, struct fastrpc_req_munmap)
1515 #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+ */
40+enum 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+
49+enum 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)
1668
1769 struct fastrpc_invoke_args {
1870 __u64 ptr;
1971 __u64 length;
2072 __s32 fd;
21− __u32 reserved;
73+ __u32 attr;
2274 };
2375
2476 struct fastrpc_invoke {
@@ -49,9 +101,36 @@ struct fastrpc_req_mmap { · 24 unmodified lines
49101 __u64 vaddrout; /* dsp virtual address */
50102 };
51103
104+struct 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+
52116 struct fastrpc_req_munmap {
53117 __u64 vaddrout; /* address to unmap */
54118 __u64 size; /* size */
55119 };
56120
121+struct 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+
129+struct fastrpc_ioctl_capability {
130+ __u32 domain;
131+ __u32 attribute_id;
132+ __u32 capability; /* dsp capability */
133+ __u32 reserved[4];
134+};
135+
57136 #endif /* __QCOM_FASTRPC_H__ */
include/uapi/misc/habanalabs.h+95−51
@@ -1,6 +1,6 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
22 *
3− * Copyright 2016-2020 HabanaLabs, Ltd.
3+ * Copyright 2016-2022 HabanaLabs, Ltd.
44 * All Rights Reserved.
55 *
66 */
@@ -30,6 +30,9 @@ · 23 unmodified lines
3030 */
3131 #define GAUDI_FIRST_AVAILABLE_W_S_MONITOR 72
3232
33+/* Max number of elements in timestamps registration buffers */
34+#define TS_MAX_ELEMENTS_NUM (1 << 20) /* 1MB */
35+
3336 /*
3437 * Goya queue Numbering
3538 *
@@ -404,6 +407,8 @@ enum hl_server_type { · 368 unmodified lines
404407 * @cpucp_version: The CPUCP f/w version.
405408 * @card_name: The card name as passed by the f/w.
406409 * @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.
407412 */
408413 struct hl_info_hw_ip_info {
409414 __u64 sram_base_address;
@@ -428,6 +433,9 @@ struct hl_info_hw_ip_info { · 18 unmodified lines
428433 __u8 card_name[HL_INFO_CARD_NAME_MAX_LEN];
429434 __u64 reserved2;
430435 __u64 dram_page_size;
436+ __u32 reserved3;
437+ __u16 number_of_user_interrupts;
438+ __u16 pad2;
431439 };
432440
433441 struct hl_info_dram_usage {
@@ -690,10 +698,12 @@ struct hl_cb_in { · 256 unmodified lines
690698 __u64 cb_handle;
691699 /* HL_CB_OP_* */
692700 __u32 op;
701+
693702 /* Size of CB. Maximum size is HL_MAX_CB_SIZE. The minimum size that
694703 * will be allocated, regardless of this parameter's value, is PAGE_SIZE
695704 */
696705 __u32 cb_size;
706+
697707 /* Context ID - Currently not in use */
698708 __u32 ctx_id;
699709 /* HL_CB_FLAGS_* */
@@ -959,6 +969,7 @@ union hl_cs_args { · 259 unmodified lines
959969 #define HL_WAIT_CS_FLAGS_INTERRUPT_MASK 0xFFF00000
960970 #define HL_WAIT_CS_FLAGS_MULTI_CS 0x4
961971 #define HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ 0x10
972+#define HL_WAIT_CS_FLAGS_REGISTER_INTERRUPT 0x20
962973
963974 #define HL_WAIT_MULTI_CS_LIST_MAX_LEN 32
964975
@@ -1031,6 +1042,20 @@ struct hl_wait_cs_in { · 66 unmodified lines
10311042 * relevant only when HL_WAIT_CS_FLAGS_INTERRUPT_KERNEL_CQ is set
10321043 */
10331044 __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;
10341059 };
10351060
10361061 #define HL_WAIT_CS_STATUS_COMPLETED 0
@@ -1077,100 +1102,119 @@ union hl_wait_cs_args { · 40 unmodified lines
10771102 */
10781103 #define HL_MEM_OP_EXPORT_DMABUF_FD 5
10791104
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+
10801113 /* Memory flags */
10811114 #define HL_MEM_CONTIGUOUS 0x1
10821115 #define HL_MEM_SHARED 0x2
10831116 #define HL_MEM_USERPTR 0x4
10841117 #define HL_MEM_FORCE_HINT 0x8
10851118
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+ */
10861128 struct hl_mem_in {
10871129 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+ */
10891136 struct {
1090− /* Size to alloc */
10911137 __u64 mem_size;
1138+ __u64 page_size;
10921139 } alloc;
10931140
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+ */
10951145 struct {
1096− /* Handle returned from HL_MEM_OP_ALLOC */
10971146 __u64 handle;
10981147 } free;
10991148
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+ */
11011159 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− */
11111160 __u64 hint_addr;
1112− /* Handle returned from HL_MEM_OP_ALLOC */
11131161 __u64 handle;
11141162 } map_device;
11151163
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+ */
11171175 struct {
1118− /* Address of allocated host memory */
11191176 __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− */
11291177 __u64 hint_addr;
1130− /* Size of allocated host memory */
11311178 __u64 mem_size;
11321179 } map_host;
11331180
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+ */
11351187 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− */
11421188 __u64 block_addr;
11431189 } map_block;
11441190
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+ */
11461195 struct {
1147− /* Virtual address returned from HL_MEM_OP_MAP */
11481196 __u64 device_virt_addr;
11491197 } unmap;
11501198
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+ */
11521208 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− */
11581209 __u64 handle;
1159− /* Size of memory allocation. Relevant only for GAUDI */
11601210 __u64 mem_size;
11611211 } export_dmabuf_fd;
11621212 };
11631213
1164− /* HL_MEM_OP_* */
11651214 __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− */
11701215 __u32 flags;
1171− /* Context ID - Currently not in use */
11721216 __u32 ctx_id;
1173− __u32 pad;
1217+ __u32 num_of_elements;
11741218 };
11751219
11761220 struct hl_mem_out {