aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-06 12:41:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-06 12:41:12 -0500
commit384d11fa0e2ca15a3e7e52db34a4e43bedf0dc70 (patch)
treeb68ecd9458fb77d6b80e1389fc3705ca360a7def /include/linux
parent6ad63dec9c2c80710896edd1996e56c54a230870 (diff)
parent8ceb820b69fe6ff58234ff604146a9e88e6c1974 (diff)
Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
Pull ARM SoC driver updates from Arnd Bergmann: "As usual, the drivers/tee and drivers/reset subsystems get merged here, with the expected set of smaller updates and some new hardware support. The tee subsystem now supports device drivers to be attached to a tee, the first example here is a random number driver with its implementation in the secure world. Three new power domain drivers get added for specific chip families: - Broadcom BCM283x chips (used in Raspberry Pi) - Qualcomm Snapdragon phone chips - Xilinx ZynqMP FPGA SoCs One new driver is added to talk to the BPMP firmware on NVIDIA Tegra210 Existing drivers are extended for new SoC variants from NXP, NVIDIA, Amlogic and Qualcomm" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (113 commits) tee: optee: update optee_msg.h and optee_smc.h to dual license tee: add cancellation support to client interface dpaa2-eth: configure the cache stashing amount on a queue soc: fsl: dpio: configure cache stashing destination soc: fsl: dpio: enable frame data cache stashing per software portal soc: fsl: guts: make fsl_guts_get_svr() static hwrng: make symbol 'optee_rng_id_table' static tee: optee: Fix unsigned comparison with less than zero hwrng: Fix unsigned comparison with less than zero tee: fix possible error pointer ctx dereferencing hwrng: optee: Initialize some structs using memset instead of braces tee: optee: Initialize some structs using memset instead of braces soc: fsl: dpio: fix memory leak of a struct qbman on error exit path clk: tegra: dfll: Make symbol 'tegra210_cpu_cvb_tables' static soc: qcom: llcc-slice: Fix typos qcom: soc: llcc-slice: Consolidate some code qcom: soc: llcc-slice: Clear the global drv_data pointer on error drivers: soc: xilinx: Add ZynqMP power domain driver firmware: xilinx: Add APIs to control node status/power dt-bindings: power: Add ZynqMP power domain bindings ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/firmware/imx/svc/misc.h3
-rw-r--r--include/linux/firmware/xlnx-zynqmp.h184
-rw-r--r--include/linux/fsl/guts.h2
-rw-r--r--include/linux/mfd/bcm2835-pm.h14
-rw-r--r--include/linux/mod_devicetable.h9
-rw-r--r--include/linux/pm_opp.h7
-rw-r--r--include/linux/reset/socfpga.h7
-rw-r--r--include/linux/reset/sunxi.h7
-rw-r--r--include/linux/soc/qcom/llcc-qcom.h6
-rw-r--r--include/linux/tee_drv.h50
10 files changed, 286 insertions, 3 deletions
diff --git a/include/linux/firmware/imx/svc/misc.h b/include/linux/firmware/imx/svc/misc.h
index e21c49aba92f..031dd4d3c766 100644
--- a/include/linux/firmware/imx/svc/misc.h
+++ b/include/linux/firmware/imx/svc/misc.h
@@ -52,4 +52,7 @@ int imx_sc_misc_set_control(struct imx_sc_ipc *ipc, u32 resource,
52int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource, 52int imx_sc_misc_get_control(struct imx_sc_ipc *ipc, u32 resource,
53 u8 ctrl, u32 *val); 53 u8 ctrl, u32 *val);
54 54
55int imx_sc_pm_cpu_start(struct imx_sc_ipc *ipc, u32 resource,
56 bool enable, u64 phys_addr);
57
55#endif /* _SC_MISC_API_H */ 58#endif /* _SC_MISC_API_H */
diff --git a/include/linux/firmware/xlnx-zynqmp.h b/include/linux/firmware/xlnx-zynqmp.h
index 3c3c28eff56a..642dab10f65d 100644
--- a/include/linux/firmware/xlnx-zynqmp.h
+++ b/include/linux/firmware/xlnx-zynqmp.h
@@ -28,12 +28,35 @@
28/* SMC SIP service Call Function Identifier Prefix */ 28/* SMC SIP service Call Function Identifier Prefix */
29#define PM_SIP_SVC 0xC2000000 29#define PM_SIP_SVC 0xC2000000
30#define PM_GET_TRUSTZONE_VERSION 0xa03 30#define PM_GET_TRUSTZONE_VERSION 0xa03
31#define PM_SET_SUSPEND_MODE 0xa02
32#define GET_CALLBACK_DATA 0xa01
31 33
32/* Number of 32bits values in payload */ 34/* Number of 32bits values in payload */
33#define PAYLOAD_ARG_CNT 4U 35#define PAYLOAD_ARG_CNT 4U
34 36
37/* Number of arguments for a callback */
38#define CB_ARG_CNT 4
39
40/* Payload size (consists of callback API ID + arguments) */
41#define CB_PAYLOAD_SIZE (CB_ARG_CNT + 1)
42
43#define ZYNQMP_PM_MAX_QOS 100U
44
45/* Node capabilities */
46#define ZYNQMP_PM_CAPABILITY_ACCESS 0x1U
47#define ZYNQMP_PM_CAPABILITY_CONTEXT 0x2U
48#define ZYNQMP_PM_CAPABILITY_WAKEUP 0x4U
49#define ZYNQMP_PM_CAPABILITY_POWER 0x8U
50
35enum pm_api_id { 51enum pm_api_id {
36 PM_GET_API_VERSION = 1, 52 PM_GET_API_VERSION = 1,
53 PM_REQUEST_NODE = 13,
54 PM_RELEASE_NODE,
55 PM_SET_REQUIREMENT,
56 PM_RESET_ASSERT = 17,
57 PM_RESET_GET_STATUS,
58 PM_PM_INIT_FINALIZE = 21,
59 PM_GET_CHIPID = 24,
37 PM_IOCTL = 34, 60 PM_IOCTL = 34,
38 PM_QUERY_DATA, 61 PM_QUERY_DATA,
39 PM_CLOCK_ENABLE, 62 PM_CLOCK_ENABLE,
@@ -75,6 +98,149 @@ enum pm_query_id {
75 PM_QID_CLOCK_GET_NUM_CLOCKS = 12, 98 PM_QID_CLOCK_GET_NUM_CLOCKS = 12,
76}; 99};
77 100
101enum zynqmp_pm_reset_action {
102 PM_RESET_ACTION_RELEASE,
103 PM_RESET_ACTION_ASSERT,
104 PM_RESET_ACTION_PULSE,
105};
106
107enum zynqmp_pm_reset {
108 ZYNQMP_PM_RESET_START = 1000,
109 ZYNQMP_PM_RESET_PCIE_CFG = ZYNQMP_PM_RESET_START,
110 ZYNQMP_PM_RESET_PCIE_BRIDGE,
111 ZYNQMP_PM_RESET_PCIE_CTRL,
112 ZYNQMP_PM_RESET_DP,
113 ZYNQMP_PM_RESET_SWDT_CRF,
114 ZYNQMP_PM_RESET_AFI_FM5,
115 ZYNQMP_PM_RESET_AFI_FM4,
116 ZYNQMP_PM_RESET_AFI_FM3,
117 ZYNQMP_PM_RESET_AFI_FM2,
118 ZYNQMP_PM_RESET_AFI_FM1,
119 ZYNQMP_PM_RESET_AFI_FM0,
120 ZYNQMP_PM_RESET_GDMA,
121 ZYNQMP_PM_RESET_GPU_PP1,
122 ZYNQMP_PM_RESET_GPU_PP0,
123 ZYNQMP_PM_RESET_GPU,
124 ZYNQMP_PM_RESET_GT,
125 ZYNQMP_PM_RESET_SATA,
126 ZYNQMP_PM_RESET_ACPU3_PWRON,
127 ZYNQMP_PM_RESET_ACPU2_PWRON,
128 ZYNQMP_PM_RESET_ACPU1_PWRON,
129 ZYNQMP_PM_RESET_ACPU0_PWRON,
130 ZYNQMP_PM_RESET_APU_L2,
131 ZYNQMP_PM_RESET_ACPU3,
132 ZYNQMP_PM_RESET_ACPU2,
133 ZYNQMP_PM_RESET_ACPU1,
134 ZYNQMP_PM_RESET_ACPU0,
135 ZYNQMP_PM_RESET_DDR,
136 ZYNQMP_PM_RESET_APM_FPD,
137 ZYNQMP_PM_RESET_SOFT,
138 ZYNQMP_PM_RESET_GEM0,
139 ZYNQMP_PM_RESET_GEM1,
140 ZYNQMP_PM_RESET_GEM2,
141 ZYNQMP_PM_RESET_GEM3,
142 ZYNQMP_PM_RESET_QSPI,
143 ZYNQMP_PM_RESET_UART0,
144 ZYNQMP_PM_RESET_UART1,
145 ZYNQMP_PM_RESET_SPI0,
146 ZYNQMP_PM_RESET_SPI1,
147 ZYNQMP_PM_RESET_SDIO0,
148 ZYNQMP_PM_RESET_SDIO1,
149 ZYNQMP_PM_RESET_CAN0,
150 ZYNQMP_PM_RESET_CAN1,
151 ZYNQMP_PM_RESET_I2C0,
152 ZYNQMP_PM_RESET_I2C1,
153 ZYNQMP_PM_RESET_TTC0,
154 ZYNQMP_PM_RESET_TTC1,
155 ZYNQMP_PM_RESET_TTC2,
156 ZYNQMP_PM_RESET_TTC3,
157 ZYNQMP_PM_RESET_SWDT_CRL,
158 ZYNQMP_PM_RESET_NAND,
159 ZYNQMP_PM_RESET_ADMA,
160 ZYNQMP_PM_RESET_GPIO,
161 ZYNQMP_PM_RESET_IOU_CC,
162 ZYNQMP_PM_RESET_TIMESTAMP,
163 ZYNQMP_PM_RESET_RPU_R50,
164 ZYNQMP_PM_RESET_RPU_R51,
165 ZYNQMP_PM_RESET_RPU_AMBA,
166 ZYNQMP_PM_RESET_OCM,
167 ZYNQMP_PM_RESET_RPU_PGE,
168 ZYNQMP_PM_RESET_USB0_CORERESET,
169 ZYNQMP_PM_RESET_USB1_CORERESET,
170 ZYNQMP_PM_RESET_USB0_HIBERRESET,
171 ZYNQMP_PM_RESET_USB1_HIBERRESET,
172 ZYNQMP_PM_RESET_USB0_APB,
173 ZYNQMP_PM_RESET_USB1_APB,
174 ZYNQMP_PM_RESET_IPI,
175 ZYNQMP_PM_RESET_APM_LPD,
176 ZYNQMP_PM_RESET_RTC,
177 ZYNQMP_PM_RESET_SYSMON,
178 ZYNQMP_PM_RESET_AFI_FM6,
179 ZYNQMP_PM_RESET_LPD_SWDT,
180 ZYNQMP_PM_RESET_FPD,
181 ZYNQMP_PM_RESET_RPU_DBG1,
182 ZYNQMP_PM_RESET_RPU_DBG0,
183 ZYNQMP_PM_RESET_DBG_LPD,
184 ZYNQMP_PM_RESET_DBG_FPD,
185 ZYNQMP_PM_RESET_APLL,
186 ZYNQMP_PM_RESET_DPLL,
187 ZYNQMP_PM_RESET_VPLL,
188 ZYNQMP_PM_RESET_IOPLL,
189 ZYNQMP_PM_RESET_RPLL,
190 ZYNQMP_PM_RESET_GPO3_PL_0,
191 ZYNQMP_PM_RESET_GPO3_PL_1,
192 ZYNQMP_PM_RESET_GPO3_PL_2,
193 ZYNQMP_PM_RESET_GPO3_PL_3,
194 ZYNQMP_PM_RESET_GPO3_PL_4,
195 ZYNQMP_PM_RESET_GPO3_PL_5,
196 ZYNQMP_PM_RESET_GPO3_PL_6,
197 ZYNQMP_PM_RESET_GPO3_PL_7,
198 ZYNQMP_PM_RESET_GPO3_PL_8,
199 ZYNQMP_PM_RESET_GPO3_PL_9,
200 ZYNQMP_PM_RESET_GPO3_PL_10,
201 ZYNQMP_PM_RESET_GPO3_PL_11,
202 ZYNQMP_PM_RESET_GPO3_PL_12,
203 ZYNQMP_PM_RESET_GPO3_PL_13,
204 ZYNQMP_PM_RESET_GPO3_PL_14,
205 ZYNQMP_PM_RESET_GPO3_PL_15,
206 ZYNQMP_PM_RESET_GPO3_PL_16,
207 ZYNQMP_PM_RESET_GPO3_PL_17,
208 ZYNQMP_PM_RESET_GPO3_PL_18,
209 ZYNQMP_PM_RESET_GPO3_PL_19,
210 ZYNQMP_PM_RESET_GPO3_PL_20,
211 ZYNQMP_PM_RESET_GPO3_PL_21,
212 ZYNQMP_PM_RESET_GPO3_PL_22,
213 ZYNQMP_PM_RESET_GPO3_PL_23,
214 ZYNQMP_PM_RESET_GPO3_PL_24,
215 ZYNQMP_PM_RESET_GPO3_PL_25,
216 ZYNQMP_PM_RESET_GPO3_PL_26,
217 ZYNQMP_PM_RESET_GPO3_PL_27,
218 ZYNQMP_PM_RESET_GPO3_PL_28,
219 ZYNQMP_PM_RESET_GPO3_PL_29,
220 ZYNQMP_PM_RESET_GPO3_PL_30,
221 ZYNQMP_PM_RESET_GPO3_PL_31,
222 ZYNQMP_PM_RESET_RPU_LS,
223 ZYNQMP_PM_RESET_PS_ONLY,
224 ZYNQMP_PM_RESET_PL,
225 ZYNQMP_PM_RESET_PS_PL0,
226 ZYNQMP_PM_RESET_PS_PL1,
227 ZYNQMP_PM_RESET_PS_PL2,
228 ZYNQMP_PM_RESET_PS_PL3,
229 ZYNQMP_PM_RESET_END = ZYNQMP_PM_RESET_PS_PL3
230};
231
232enum zynqmp_pm_suspend_reason {
233 SUSPEND_POWER_REQUEST = 201,
234 SUSPEND_ALERT,
235 SUSPEND_SYSTEM_SHUTDOWN,
236};
237
238enum zynqmp_pm_request_ack {
239 ZYNQMP_PM_REQUEST_ACK_NO = 1,
240 ZYNQMP_PM_REQUEST_ACK_BLOCKING,
241 ZYNQMP_PM_REQUEST_ACK_NON_BLOCKING,
242};
243
78/** 244/**
79 * struct zynqmp_pm_query_data - PM query data 245 * struct zynqmp_pm_query_data - PM query data
80 * @qid: query ID 246 * @qid: query ID
@@ -91,6 +257,7 @@ struct zynqmp_pm_query_data {
91 257
92struct zynqmp_eemi_ops { 258struct zynqmp_eemi_ops {
93 int (*get_api_version)(u32 *version); 259 int (*get_api_version)(u32 *version);
260 int (*get_chipid)(u32 *idcode, u32 *version);
94 int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out); 261 int (*query_data)(struct zynqmp_pm_query_data qdata, u32 *out);
95 int (*clock_enable)(u32 clock_id); 262 int (*clock_enable)(u32 clock_id);
96 int (*clock_disable)(u32 clock_id); 263 int (*clock_disable)(u32 clock_id);
@@ -102,8 +269,25 @@ struct zynqmp_eemi_ops {
102 int (*clock_setparent)(u32 clock_id, u32 parent_id); 269 int (*clock_setparent)(u32 clock_id, u32 parent_id);
103 int (*clock_getparent)(u32 clock_id, u32 *parent_id); 270 int (*clock_getparent)(u32 clock_id, u32 *parent_id);
104 int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out); 271 int (*ioctl)(u32 node_id, u32 ioctl_id, u32 arg1, u32 arg2, u32 *out);
272 int (*reset_assert)(const enum zynqmp_pm_reset reset,
273 const enum zynqmp_pm_reset_action assert_flag);
274 int (*reset_get_status)(const enum zynqmp_pm_reset reset, u32 *status);
275 int (*init_finalize)(void);
276 int (*set_suspend_mode)(u32 mode);
277 int (*request_node)(const u32 node,
278 const u32 capabilities,
279 const u32 qos,
280 const enum zynqmp_pm_request_ack ack);
281 int (*release_node)(const u32 node);
282 int (*set_requirement)(const u32 node,
283 const u32 capabilities,
284 const u32 qos,
285 const enum zynqmp_pm_request_ack ack);
105}; 286};
106 287
288int zynqmp_pm_invoke_fn(u32 pm_api_id, u32 arg0, u32 arg1,
289 u32 arg2, u32 arg3, u32 *ret_payload);
290
107#if IS_REACHABLE(CONFIG_ARCH_ZYNQMP) 291#if IS_REACHABLE(CONFIG_ARCH_ZYNQMP)
108const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void); 292const struct zynqmp_eemi_ops *zynqmp_pm_get_eemi_ops(void);
109#else 293#else
diff --git a/include/linux/fsl/guts.h b/include/linux/fsl/guts.h
index 941b11811f85..1fc0edd71c52 100644
--- a/include/linux/fsl/guts.h
+++ b/include/linux/fsl/guts.h
@@ -135,8 +135,6 @@ struct ccsr_guts {
135 u32 srds2cr1; /* 0x.0f44 - SerDes2 Control Register 0 */ 135 u32 srds2cr1; /* 0x.0f44 - SerDes2 Control Register 0 */
136} __attribute__ ((packed)); 136} __attribute__ ((packed));
137 137
138u32 fsl_guts_get_svr(void);
139
140/* Alternate function signal multiplex control */ 138/* Alternate function signal multiplex control */
141#define MPC85xx_PMUXCR_QE(x) (0x8000 >> (x)) 139#define MPC85xx_PMUXCR_QE(x) (0x8000 >> (x))
142 140
diff --git a/include/linux/mfd/bcm2835-pm.h b/include/linux/mfd/bcm2835-pm.h
new file mode 100644
index 000000000000..ed37dc40e82a
--- /dev/null
+++ b/include/linux/mfd/bcm2835-pm.h
@@ -0,0 +1,14 @@
1/* SPDX-License-Identifier: GPL-2.0+ */
2
3#ifndef BCM2835_MFD_PM_H
4#define BCM2835_MFD_PM_H
5
6#include <linux/regmap.h>
7
8struct bcm2835_pm {
9 struct device *dev;
10 void __iomem *base;
11 void __iomem *asb;
12};
13
14#endif /* BCM2835_MFD_PM_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index f9bd2f34b99f..14eaeeb46f41 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -779,4 +779,13 @@ struct typec_device_id {
779 kernel_ulong_t driver_data; 779 kernel_ulong_t driver_data;
780}; 780};
781 781
782/**
783 * struct tee_client_device_id - tee based device identifier
784 * @uuid: For TEE based client devices we use the device uuid as
785 * the identifier.
786 */
787struct tee_client_device_id {
788 uuid_t uuid;
789};
790
782#endif /* LINUX_MOD_DEVICETABLE_H */ 791#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/pm_opp.h b/include/linux/pm_opp.h
index b895f4e79868..900359342965 100644
--- a/include/linux/pm_opp.h
+++ b/include/linux/pm_opp.h
@@ -86,6 +86,8 @@ unsigned long dev_pm_opp_get_voltage(struct dev_pm_opp *opp);
86 86
87unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp); 87unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp);
88 88
89unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp);
90
89bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp); 91bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp);
90 92
91int dev_pm_opp_get_opp_count(struct device *dev); 93int dev_pm_opp_get_opp_count(struct device *dev);
@@ -158,6 +160,11 @@ static inline unsigned long dev_pm_opp_get_freq(struct dev_pm_opp *opp)
158 return 0; 160 return 0;
159} 161}
160 162
163static inline unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp)
164{
165 return 0;
166}
167
161static inline bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp) 168static inline bool dev_pm_opp_is_turbo(struct dev_pm_opp *opp)
162{ 169{
163 return false; 170 return false;
diff --git a/include/linux/reset/socfpga.h b/include/linux/reset/socfpga.h
new file mode 100644
index 000000000000..b11a2047c342
--- /dev/null
+++ b/include/linux/reset/socfpga.h
@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LINUX_RESET_SOCFPGA_H__
3#define __LINUX_RESET_SOCFPGA_H__
4
5void __init socfpga_reset_init(void);
6
7#endif /* __LINUX_RESET_SOCFPGA_H__ */
diff --git a/include/linux/reset/sunxi.h b/include/linux/reset/sunxi.h
new file mode 100644
index 000000000000..1ad7fffb413e
--- /dev/null
+++ b/include/linux/reset/sunxi.h
@@ -0,0 +1,7 @@
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __LINUX_RESET_SUNXI_H__
3#define __LINUX_RESET_SUNXI_H__
4
5void __init sun6i_reset_init(void);
6
7#endif /* __LINUX_RESET_SUNXI_H__ */
diff --git a/include/linux/soc/qcom/llcc-qcom.h b/include/linux/soc/qcom/llcc-qcom.h
index 69c285b1c990..eb71a50b8afc 100644
--- a/include/linux/soc/qcom/llcc-qcom.h
+++ b/include/linux/soc/qcom/llcc-qcom.h
@@ -162,6 +162,12 @@ int llcc_slice_deactivate(struct llcc_slice_desc *desc);
162 */ 162 */
163int qcom_llcc_probe(struct platform_device *pdev, 163int qcom_llcc_probe(struct platform_device *pdev,
164 const struct llcc_slice_config *table, u32 sz); 164 const struct llcc_slice_config *table, u32 sz);
165
166/**
167 * qcom_llcc_remove - remove the sct table
168 * @pdev: Platform device pointer
169 */
170int qcom_llcc_remove(struct platform_device *pdev);
165#else 171#else
166static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid) 172static inline struct llcc_slice_desc *llcc_slice_getd(u32 uid)
167{ 173{
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
index 6cfe05893a76..4a49f80e7f71 100644
--- a/include/linux/tee_drv.h
+++ b/include/linux/tee_drv.h
@@ -15,11 +15,14 @@
15#ifndef __TEE_DRV_H 15#ifndef __TEE_DRV_H
16#define __TEE_DRV_H 16#define __TEE_DRV_H
17 17
18#include <linux/types.h> 18#include <linux/device.h>
19#include <linux/idr.h> 19#include <linux/idr.h>
20#include <linux/kref.h> 20#include <linux/kref.h>
21#include <linux/list.h> 21#include <linux/list.h>
22#include <linux/mod_devicetable.h>
22#include <linux/tee.h> 23#include <linux/tee.h>
24#include <linux/types.h>
25#include <linux/uuid.h>
23 26
24/* 27/*
25 * The file describes the API provided by the generic TEE driver to the 28 * The file describes the API provided by the generic TEE driver to the
@@ -47,6 +50,11 @@ struct tee_shm_pool;
47 * @releasing: flag that indicates if context is being released right now. 50 * @releasing: flag that indicates if context is being released right now.
48 * It is needed to break circular dependency on context during 51 * It is needed to break circular dependency on context during
49 * shared memory release. 52 * shared memory release.
53 * @supp_nowait: flag that indicates that requests in this context should not
54 * wait for tee-supplicant daemon to be started if not present
55 * and just return with an error code. It is needed for requests
56 * that arises from TEE based kernel drivers that should be
57 * non-blocking in nature.
50 */ 58 */
51struct tee_context { 59struct tee_context {
52 struct tee_device *teedev; 60 struct tee_device *teedev;
@@ -54,6 +62,7 @@ struct tee_context {
54 void *data; 62 void *data;
55 struct kref refcount; 63 struct kref refcount;
56 bool releasing; 64 bool releasing;
65 bool supp_nowait;
57}; 66};
58 67
59struct tee_param_memref { 68struct tee_param_memref {
@@ -526,6 +535,18 @@ int tee_client_invoke_func(struct tee_context *ctx,
526 struct tee_ioctl_invoke_arg *arg, 535 struct tee_ioctl_invoke_arg *arg,
527 struct tee_param *param); 536 struct tee_param *param);
528 537
538/**
539 * tee_client_cancel_req() - Request cancellation of the previous open-session
540 * or invoke-command operations in a Trusted Application
541 * @ctx: TEE Context
542 * @arg: Cancellation arguments, see description of
543 * struct tee_ioctl_cancel_arg
544 *
545 * Returns < 0 on error else 0 if the cancellation was successfully requested.
546 */
547int tee_client_cancel_req(struct tee_context *ctx,
548 struct tee_ioctl_cancel_arg *arg);
549
529static inline bool tee_param_is_memref(struct tee_param *param) 550static inline bool tee_param_is_memref(struct tee_param *param)
530{ 551{
531 switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) { 552 switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
@@ -538,4 +559,31 @@ static inline bool tee_param_is_memref(struct tee_param *param)
538 } 559 }
539} 560}
540 561
562extern struct bus_type tee_bus_type;
563
564/**
565 * struct tee_client_device - tee based device
566 * @id: device identifier
567 * @dev: device structure
568 */
569struct tee_client_device {
570 struct tee_client_device_id id;
571 struct device dev;
572};
573
574#define to_tee_client_device(d) container_of(d, struct tee_client_device, dev)
575
576/**
577 * struct tee_client_driver - tee client driver
578 * @id_table: device id table supported by this driver
579 * @driver: driver structure
580 */
581struct tee_client_driver {
582 const struct tee_client_device_id *id_table;
583 struct device_driver driver;
584};
585
586#define to_tee_client_driver(d) \
587 container_of(d, struct tee_client_driver, driver)
588
541#endif /*__TEE_DRV_H*/ 589#endif /*__TEE_DRV_H*/