linux/drivers/gpu/drm/i915/pxp/intel_pxp_tee_interface.h
Huang, Sean Z cbbd3764b2 drm/i915/pxp: Create the arbitrary session after boot
Create the arbitrary session, with the fixed session id 0xf, after
system boot, for the case that application allocates the protected
buffer without establishing any protection session. Because the
hardware requires at least one alive session for protected buffer
creation. This arbitrary session will need to be re-created after
teardown or power event because hardware encryption key won't be
valid after such cases.

The session ID is exposed as part of the uapi so it can be used as part
of userspace commands.

v2: use gt->uncore->rpm (Chris)
v3: s/arb_is_in_play/arb_is_valid (Chris), move set-up to the new
    init_hw function
v4: move interface defs to separate header, set arb_is valid to false
    on fini (Rodrigo)
v5: handle async component binding

Signed-off-by: Huang, Sean Z <sean.z.huang@intel.com>
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210924191452.1539378-8-alan.previn.teres.alexis@intel.com
2021-10-04 13:10:44 -04:00

37 lines
856 B
C

/* SPDX-License-Identifier: MIT */
/*
* Copyright(c) 2020, Intel Corporation. All rights reserved.
*/
#ifndef __INTEL_PXP_TEE_INTERFACE_H__
#define __INTEL_PXP_TEE_INTERFACE_H__
#include <linux/types.h>
#define PXP_TEE_APIVER 0x40002
#define PXP_TEE_ARB_CMDID 0x1e
#define PXP_TEE_ARB_PROTECTION_MODE 0x2
/* PXP TEE message header */
struct pxp_tee_cmd_header {
u32 api_version;
u32 command_id;
u32 status;
/* Length of the message (excluding the header) */
u32 buffer_len;
} __packed;
/* PXP TEE message input to create a arbitrary session */
struct pxp_tee_create_arb_in {
struct pxp_tee_cmd_header header;
u32 protection_mode;
u32 session_id;
} __packed;
/* PXP TEE message output to create a arbitrary session */
struct pxp_tee_create_arb_out {
struct pxp_tee_cmd_header header;
} __packed;
#endif /* __INTEL_PXP_TEE_INTERFACE_H__ */