Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2678D185E8 for ; Thu, 8 Jan 2026 12:06:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 701D910E6F9; Thu, 8 Jan 2026 12:06:51 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="HbucyCMW"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by gabe.freedesktop.org (Postfix) with ESMTPS id 464DD10E6F9 for ; Thu, 8 Jan 2026 12:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1767874009; x=1799410009; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VyX37kS85xpwVatWGU2YnKugr6CRTNyn6985TBNNPjI=; b=HbucyCMWhE4vtXRv2J4pBI8cJLtBLQuoSYCCGxzdHzCiMNB5iGw8wQjI knAf3+aSnqANflvX2hNrq0QZQ+6ri99wqkvxBmHrUAOrowQHd8Hwx0Mnb 0aXCwe99hnDnG3sPwuSK4JHmphrAcSrQwZYerVO+xsudoLMU/FRGdYMc4 lHkXC0ggIMd6KBE+0sSphnVAO+hvjUguiY04+QrbPrJRcWtG3vDxDm5MG dNk8C2Ou6QzNilS4FRmK/HbEnhoANPAU5lqSxFvCU+JwAMN5tEx7te1cR McfRLZnbFxdx6re0DEFxJ/DRxo9duWgtBvDDBhdG718Ath7RRMKAzHrJh Q==; X-CSE-ConnectionGUID: yEeXJQr+TbClnM9v0KVBAw== X-CSE-MsgGUID: fXVMPaJ+RdOHl/Mgg0P6sw== X-IronPort-AV: E=McAfee;i="6800,10657,11665"; a="86839540" X-IronPort-AV: E=Sophos;i="6.21,210,1763452800"; d="scan'208";a="86839540" Received: from fmviesa008.fm.intel.com ([10.60.135.148]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2026 04:06:49 -0800 X-CSE-ConnectionGUID: 0sKdAzoCRUa39Wo7FqgrCw== X-CSE-MsgGUID: RrAGxSxMQxun75j2oDfC9w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,210,1763452800"; d="scan'208";a="203463935" Received: from anoopcvi-vm.gar.corp.intel.com ([10.109.80.88]) by fmviesa008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jan 2026 04:06:45 -0800 From: "Anoop, Vijay" To: intel-xe@lists.freedesktop.org Cc: umesh.nerlige.ramappa@intel.com, badal.nilawar@intel.com, rodrigo.vivi@intel.com, aravind.iddamsetty@intel.com, riana.tauro@intel.com, anshuman.gupta@intel.com, matthew.d.roper@intel.com, michael.j.ruhl@intel.com, paul.e.luse@intel.com, mohamed.mansoor.v@intel.com, kam.nasim@intel.com, anoop.c.vijay@intel.com Subject: [PATCH v3 2/6] drm/xe/sysctrl: Add System Controller types and structures Date: Thu, 8 Jan 2026 04:05:50 -0800 Message-ID: <20260108120548.1015154-10-anoop.c.vijay@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260108120548.1015154-8-anoop.c.vijay@intel.com> References: <20260108120548.1015154-8-anoop.c.vijay@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" From: Anoop Vijay Add type definitions and header declarations for System Controller mailbox communication protocol. Signed-off-by: Anoop Vijay --- drivers/gpu/drm/xe/xe_sysctrl_mailbox.h | 35 ++++++++++++++++++ drivers/gpu/drm/xe/xe_sysctrl_mailbox_types.h | 36 +++++++++++++++++++ drivers/gpu/drm/xe/xe_sysctrl_types.h | 23 ++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox.h create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_mailbox_types.h create mode 100644 drivers/gpu/drm/xe/xe_sysctrl_types.h diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h new file mode 100644 index 000000000000..750b7528bab2 --- /dev/null +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2026 Intel Corporation + */ + +#ifndef __XE_SYSCTRL_MAILBOX_H__ +#define __XE_SYSCTRL_MAILBOX_H__ + +#include +#include + +struct xe_sysctrl; +struct xe_device; +struct xe_sysctrl_mailbox_command; + +#define APP_HDR_GROUP_ID_MASK GENMASK(7, 0) +#define APP_HDR_COMMAND_MASK GENMASK(15, 8) +#define APP_HDR_VERSION_MASK GENMASK(23, 16) +#define APP_HDR_RESERVED_MASK GENMASK(31, 24) + +#define XE_SYSCTRL_APP_HDR_GROUP_ID(hdr) \ + FIELD_GET(APP_HDR_GROUP_ID_MASK, le32_to_cpu((hdr)->data)) + +#define XE_SYSCTRL_APP_HDR_COMMAND(hdr) \ + FIELD_GET(APP_HDR_COMMAND_MASK, le32_to_cpu((hdr)->data)) + +#define XE_SYSCTRL_APP_HDR_VERSION(hdr) \ + FIELD_GET(APP_HDR_VERSION_MASK, le32_to_cpu((hdr)->data)) + +void xe_sysctrl_mailbox_init(struct xe_sysctrl *sc); +int xe_sysctrl_send_command(struct xe_device *xe, + struct xe_sysctrl_mailbox_command *cmd, + size_t *rdata_len); + +#endif /* __XE_SYSCTRL_MAILBOX_H__ */ diff --git a/drivers/gpu/drm/xe/xe_sysctrl_mailbox_types.h b/drivers/gpu/drm/xe/xe_sysctrl_mailbox_types.h new file mode 100644 index 000000000000..1f315ad1b996 --- /dev/null +++ b/drivers/gpu/drm/xe/xe_sysctrl_mailbox_types.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2026 Intel Corporation + */ + +#ifndef __XE_SYSCTRL_MAILBOX_TYPES_H__ +#define __XE_SYSCTRL_MAILBOX_TYPES_H__ + +#include + +struct xe_sysctrl_mailbox_mkhi_msg_hdr { + __le32 data; +} __packed; + +struct xe_sysctrl_mailbox_app_msg_hdr { + __le32 data; +} __packed; + +struct xe_sysctrl_mailbox_command { + /** @header: Application message header containing command information */ + struct xe_sysctrl_mailbox_app_msg_hdr header; + + /** @data_in: Pointer to input payload data (can be NULL if no input data) */ + void *data_in; + + /** @data_in_len: Size of input payload in bytes (0 if no input data) */ + size_t data_in_len; + + /** @data_out: Pointer to output buffer for response data (can be NULL if no response) */ + void *data_out; + + /** @data_out_len: Size of output buffer in bytes (0 if no response expected) */ + size_t data_out_len; +}; + +#endif /* __XE_SYSCTRL_MAILBOX_TYPES_H__ */ diff --git a/drivers/gpu/drm/xe/xe_sysctrl_types.h b/drivers/gpu/drm/xe/xe_sysctrl_types.h new file mode 100644 index 000000000000..88a34967688b --- /dev/null +++ b/drivers/gpu/drm/xe/xe_sysctrl_types.h @@ -0,0 +1,23 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2026 Intel Corporation + */ + +#ifndef _XE_SYSCTRL_TYPES_H_ +#define _XE_SYSCTRL_TYPES_H_ + +#include +#include + +/** + * struct xe_sysctrl - System Controller driver context + */ +struct xe_sysctrl { + /** @cmd_lock: Mutex protecting mailbox command operations */ + struct mutex cmd_lock; + + /** @phase_bit: MKHI message boundary phase toggle bit */ + u32 phase_bit; +}; + +#endif /* _XE_SYSCTRL_TYPES_H_ */ -- 2.43.0