Add PXP gsccs tee-link backend using empty stubs for now. Signed-off-by: Alan Previn <alan.previn.teres.alexis@xxxxxxxxx> --- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c | 46 ++++++++++++++++++++++ drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h | 13 ++++++ drivers/gpu/drm/i915/pxp/intel_pxp_tee.c | 14 +++++-- 4 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c create mode 100644 drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile index 6ed45d9145e8..05072d7a4ba4 100644 --- a/drivers/gpu/drm/i915/Makefile +++ b/drivers/gpu/drm/i915/Makefile @@ -320,7 +320,8 @@ i915-y += \ pxp/intel_pxp.o \ pxp/intel_pxp_tee.o \ pxp/intel_pxp_tee_mei.o \ - pxp/intel_pxp_huc.o + pxp/intel_pxp_huc.o \ + pxp/intel_pxp_gsccs.o i915-$(CONFIG_DRM_I915_PXP) += \ pxp/intel_pxp_cmd.o \ diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c b/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c new file mode 100644 index 000000000000..a4243272ca73 --- /dev/null +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c @@ -0,0 +1,46 @@ +// SPDX-License-Identifier: MIT +/* + * Copyright(c) 2022 Intel Corporation. + */ + +#include "i915_drv.h" +#include "intel_pxp.h" +#include "intel_pxp_gsccs.h" + +static int gsccs_tee_send_message(struct intel_pxp *pxp, + void *msg_in, size_t msg_in_size, + void *msg_out, size_t msg_out_size_max, + size_t *msg_out_len) +{ + return -ENODEV; +} + +static int +gsccs_tee_create_session(struct intel_pxp *pxp, + int session_id) +{ + return -ENODEV; +} + +static bool gsccs_tee_is_ready(struct intel_pxp *pxp) +{ + return false; +} + +static void gsccs_tee_fini(struct intel_pxp *pxp) +{ +} + +static int gsccs_tee_init(struct intel_pxp *pxp) +{ + return -ENODEV; +} + +void intel_pxp_init_gsccs_tee_hooks(struct intel_pxp *pxp) +{ + pxp->tee_link.init = gsccs_tee_init; + pxp->tee_link.fini = gsccs_tee_fini; + pxp->tee_link.is_ready = gsccs_tee_is_ready; + pxp->tee_link.create_session = gsccs_tee_create_session; + pxp->tee_link.send_message = gsccs_tee_send_message; +} diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h b/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h new file mode 100644 index 000000000000..5fb9f2c042ff --- /dev/null +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright(c) 2022, Intel Corporation. All rights reserved. + */ + +#ifndef __INTEL_PXP_TEE_GSCCS_H__ +#define __INTEL_PXP_TEE_GSCCS_H__ + +struct intel_pxp; + +void intel_pxp_init_gsccs_tee_hooks(struct intel_pxp *pxp); + +#endif /* __INTEL_PXP_TEE_GSCCS_H__ */ diff --git a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c index 1171f339643c..a4b7f6c7bc54 100644 --- a/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c +++ b/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c @@ -5,6 +5,7 @@ #include "i915_drv.h" #include "intel_pxp.h" +#include "intel_pxp_gsccs.h" #include "intel_pxp_tee.h" #include "intel_pxp_tee_mei.h" @@ -51,6 +52,11 @@ bool intel_pxp_teelink_is_ready(struct intel_pxp *pxp) return false; } +static bool gt_supports_teelink_via_gsccs(struct intel_gt *gt) +{ + return (HAS_ENGINE(gt, GSC0)); +} + static bool gt_supports_teelink_via_mei(struct intel_gt *gt) { return (IS_ENABLED(CONFIG_INTEL_MEI_PXP) && !HAS_ENGINE(gt, GSC0)); @@ -61,11 +67,13 @@ int intel_pxp_teelink_init(struct intel_pxp *pxp) struct intel_gt *gt = pxp_to_gt(pxp); int ret = -ENOLINK; - if (!gt_supports_teelink_via_mei(gt)) + if (gt_supports_teelink_via_mei(gt)) + intel_pxp_init_mei_tee_hooks(pxp); + else if (gt_supports_teelink_via_gsccs(gt)) + intel_pxp_init_gsccs_tee_hooks(pxp); + else return -ENODEV; - intel_pxp_init_mei_tee_hooks(pxp); - if (pxp->tee_link.init) ret = pxp->tee_link.init(pxp); if (ret) -- 2.34.1