mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
Qcom platforms has the legacy of using non-standard SCM calls splintered over the various kernel drivers. These SCM calls aren't compliant with the standard SMC calling conventions which is a prerequisite to enable migration to the FF-A specifications from Arm. OP-TEE as an alternative trusted OS to Qualcomm TEE (QTEE) can't support these non-standard SCM calls. And even for newer architectures using S-EL2 with Hafnium support, QTEE won't be able to support SCM calls either with FF-A requirements coming in. And with both OP-TEE and QTEE drivers well integrated in the TEE subsystem, it makes further sense to reuse the TEE bus client drivers infrastructure. The added benefit of TEE bus infrastructure is that there is support for discoverable/enumerable services. With that client drivers don't have to manually invoke a special SCM call to know the service status. So enable the generic Peripheral Authentication Service (PAS) provided by the firmware. It acts as the common layer with different TZ backends plugged in whether it's an SCM implementation or a proper TEE bus based PAS service implementation. Reviewed-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> Tested-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> # Lemans Reviewed-by: Harshal Dev <harshal.dev@oss.qualcomm.com> Tested-by: Vignesh Viswanathan <vignesh.viswanathan@oss.qualcomm.com> # IPQ9650 Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://lore.kernel.org/r/20260702115835.167602-2-sumit.garg@kernel.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
51 lines
1.8 KiB
C
51 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
|
*/
|
|
|
|
#ifndef __QCOM_PAS_INT_H
|
|
#define __QCOM_PAS_INT_H
|
|
|
|
struct device;
|
|
|
|
/**
|
|
* struct qcom_pas_ops - Qcom Peripheral Authentication Service (PAS) ops
|
|
* @drv_name: PAS driver name.
|
|
* @dev: PAS device pointer.
|
|
* @supported: Peripheral supported callback.
|
|
* @init_image: Peripheral image initialization callback.
|
|
* @mem_setup: Peripheral memory setup callback.
|
|
* @get_rsc_table: Peripheral get resource table callback.
|
|
* @prepare_and_auth_reset: Peripheral prepare firmware authentication and
|
|
* reset callback.
|
|
* @auth_and_reset: Peripheral firmware authentication and reset
|
|
* callback.
|
|
* @set_remote_state: Peripheral set remote state callback.
|
|
* @shutdown: Peripheral shutdown callback.
|
|
* @metadata_release: Image metadata release callback.
|
|
*/
|
|
struct qcom_pas_ops {
|
|
const char *drv_name;
|
|
struct device *dev;
|
|
bool (*supported)(struct device *dev, u32 pas_id);
|
|
int (*init_image)(struct device *dev, u32 pas_id, const void *metadata,
|
|
size_t size, struct qcom_pas_context *ctx);
|
|
int (*mem_setup)(struct device *dev, u32 pas_id, phys_addr_t addr,
|
|
phys_addr_t size);
|
|
void *(*get_rsc_table)(struct device *dev, struct qcom_pas_context *ctx,
|
|
void *input_rt, size_t input_rt_size,
|
|
size_t *output_rt_size);
|
|
int (*prepare_and_auth_reset)(struct device *dev,
|
|
struct qcom_pas_context *ctx);
|
|
int (*auth_and_reset)(struct device *dev, u32 pas_id);
|
|
int (*set_remote_state)(struct device *dev, u32 state, u32 pas_id);
|
|
int (*shutdown)(struct device *dev, u32 pas_id);
|
|
void (*metadata_release)(struct device *dev,
|
|
struct qcom_pas_context *ctx);
|
|
};
|
|
|
|
void qcom_pas_ops_register(struct qcom_pas_ops *ops);
|
|
void qcom_pas_ops_unregister(void);
|
|
|
|
#endif /* __QCOM_PAS_INT_H */
|