From fcb48b89813b14f38b31b86b4a6ace376bd86d8b Mon Sep 17 00:00:00 2001 From: Varadarajan Narayanan Date: Wed, 21 Jan 2026 12:09:17 +0530 Subject: drivers: sysreset: Add sysreset op that can take arguments Add a 'request_arg' op to struct sysreset_ops to enable sysreset drivers to receive arguments given to the 'reset' command. Process the request_arg() op before the usual request() op. Reviewed-by: Casey Connolly Reviewed-by: Sumit Garg Signed-off-by: Varadarajan Narayanan Reviewed-by: Tom Rini Link: https://patch.msgid.link/20260121063920.1500293-3-varadarajan.narayanan@oss.qualcomm.com Signed-off-by: Casey Connolly --- include/sysreset.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'include') diff --git a/include/sysreset.h b/include/sysreset.h index ff20abdeed3..d1cc9ebc542 100644 --- a/include/sysreset.h +++ b/include/sysreset.h @@ -43,6 +43,24 @@ struct sysreset_ops { * (in which case this method will not actually return) */ int (*request)(struct udevice *dev, enum sysreset_t type); + + /** + * @request_arg: Reset handler implementations that might need to process + * arguments given to the 'reset' command. + * + * Note that this function may return before the reset takes effect. + * + * @dev: Device to be used for system reset + * @argc: No. of items in @argv + * @argv: Arguments given to 'reset' command + * Return: + * -EINPROGRESS if the reset has started and will complete soon + * -EPROTONOSUPPORT if not supported by this device + * 0 if the reset has already happened + * (in which case this method will not actually return) + */ + int (*request_arg)(struct udevice *dev, int argc, char * const argv[]); + /** * @get_status: get printable reset status information * -- cgit v1.3.1 From 3eefe12b4b45fa5eb431246ec6ca55728aa79616 Mon Sep 17 00:00:00 2001 From: Sumit Garg Date: Tue, 27 Jan 2026 11:53:39 +0530 Subject: tee: optee: Export OP-TEE message UID check API OP-TEE message UID check API can be useful to know whether OP-TEE is enabled on not assuming the corresponding SMC call is properly handled if OP-TEE is not supported. This API can be used by platform code to know OP-TEE presence and on that basis OP-TEE DT node can be added as part of DT fixups for the OP-TEE driver probe to happen for both U-Boot and Linux. Signed-off-by: Sumit Garg Reviewed-by: Casey Connolly Link: https://patch.msgid.link/20260127062341.723966-2-sumit.garg@kernel.org Signed-off-by: Casey Connolly --- drivers/tee/optee/core.c | 5 +++++ include/tee/optee.h | 9 +++++++++ 2 files changed, 14 insertions(+) (limited to 'include') diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 5fc0505c788..4d67c948ec1 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -795,6 +795,11 @@ static optee_invoke_fn *get_invoke_func(struct udevice *dev) return ERR_PTR(-EINVAL); } +bool is_optee_smc_api(void) +{ + return is_optee_api(optee_smccc_smc); +} + static int optee_of_to_plat(struct udevice *dev) { struct optee_pdata *pdata = dev_get_plat(dev); diff --git a/include/tee/optee.h b/include/tee/optee.h index 77729450bb6..d1194493780 100644 --- a/include/tee/optee.h +++ b/include/tee/optee.h @@ -65,4 +65,13 @@ static inline int optee_copy_fdt_nodes(void *new_blob) } #endif +#if defined(CONFIG_OPTEE) +bool is_optee_smc_api(void); +#else +static inline bool is_optee_smc_api(void) +{ + return false; +} +#endif + #endif /* _OPTEE_H */ -- cgit v1.3.1