1 /* SPDX-License-Identifier: MIT */ 2 /* 3 * Copyright © 2026 Intel Corporation 4 */ 5 6 #ifndef _XE_SYSCTRL_ABI_H_ 7 #define _XE_SYSCTRL_ABI_H_ 8 9 #include <linux/types.h> 10 11 /** 12 * DOC: System Controller ABI 13 * 14 * This header defines the Application Binary Interface (ABI) used by 15 * drm/xe to communicate with System Controller firmware on Intel Xe3p 16 * discrete GPU platforms. 17 * 18 * System Controller (sysctrl) is a firmware-managed entity on Intel 19 * dGPUs responsible for certain low-level platform management 20 * functions. 21 * 22 * Communication protocol: 23 * 24 * Communication uses a mailbox interface with messages composed of: 25 * 26 * - Application message header (struct xe_sysctrl_app_msg_hdr) 27 * containing group_id, command, and version 28 * - Variable-length, command-specific payload 29 * 30 * Message header format: 31 * 32 * The 32-bit application message header is packed as: 33 * 34 * - Bits [7:0] : Group ID identifying command group 35 * - Bits [15:8] : Command identifier within group 36 * - Bits [23:16] : Command version for interface compatibility 37 * - Bits [31:24] : Reserved, must be zero 38 * 39 * This header defines firmware ABI message formats and constants shared 40 * between driver and System Controller firmware. 41 */ 42 43 /** 44 * struct xe_sysctrl_app_msg_hdr - Application layer message header 45 * @data: 32-bit header data 46 * 47 * Header structure for application-level messages. 48 */ 49 struct xe_sysctrl_app_msg_hdr { 50 u32 data; 51 } __packed; 52 53 #define SYSCTRL_HDR_GROUP_ID_MASK GENMASK(7, 0) 54 #define SYSCTRL_HDR_COMMAND_MASK GENMASK(14, 8) 55 #define SYSCTRL_HDR_COMMAND_MAX 0x7f 56 #define SYSCTRL_HDR_IS_RESPONSE BIT(15) 57 #define SYSCTRL_HDR_RESERVED_MASK GENMASK(23, 16) 58 #define SYSCTRL_HDR_RESULT_MASK GENMASK(31, 24) 59 60 #define APP_HDR_GROUP_ID_MASK GENMASK(7, 0) 61 #define APP_HDR_COMMAND_MASK GENMASK(15, 8) 62 #define APP_HDR_VERSION_MASK GENMASK(23, 16) 63 #define APP_HDR_RESERVED_MASK GENMASK(31, 24) 64 65 #endif 66