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 7AF06D29C2A for ; Mon, 19 Jan 2026 13:30:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B17210E45D; Mon, 19 Jan 2026 13:30:04 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="L2R2gFxz"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) by gabe.freedesktop.org (Postfix) with ESMTPS id 93C6E10E45D for ; Mon, 19 Jan 2026 13:30:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768829403; x=1800365403; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HWJuI2G8mGDPAFCWcnGHF/WQuRTM6edcRwTxGSNkncQ=; b=L2R2gFxz40RTiD352AFElz39AeN5VTByRg1NdsmH/uFCW7gsNx5UGxDy 8JEL5AD8AQUuuZEUYD74afmbwCUB/ZJi+hKS1IDwrbv/TT9Aui1lb6on1 WEZEcbhopP54KlQd9k6CUAiN28ZsjWROp4ixkJOQN+1JAp7P2Qr3NQWL5 kEzxCbH+e2ICP41SF2QfCz9I0DkVMyX257TQcPo4mRqkIrQnMRonCBCb/ xLWr7qvRgoq0b8/H96rOOZBCGuo+go1wSOe036EEXfR5M1m4kv9bVUciN Yx1Mb/D/u2dGiyUqW0JZWdCvJXQnY8apLQZP7fedNf7AV0ZUyk5lsK5NH w==; X-CSE-ConnectionGUID: 4X+v647LTQagpgjgClUTDA== X-CSE-MsgGUID: c4O3L7ssQqWtsBmjkf9ZtQ== X-IronPort-AV: E=McAfee;i="6800,10657,11676"; a="70202336" X-IronPort-AV: E=Sophos;i="6.21,238,1763452800"; d="scan'208";a="70202336" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2026 05:30:03 -0800 X-CSE-ConnectionGUID: WaCovsO1RwW3DukrPXr2RQ== X-CSE-MsgGUID: j0RMQWVpQ9e1TYmPsmHylg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,238,1763452800"; d="scan'208";a="205659130" Received: from anoopcvi-vm.gar.corp.intel.com ([10.109.80.88]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2026 05:29:58 -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 v4 2/6] drm/xe/sysctrl: Add System Controller types and structures Date: Mon, 19 Jan 2026 05:29:39 -0800 Message-ID: <20260119132938.2173032-10-anoop.c.vijay@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119132938.2173032-8-anoop.c.vijay@intel.com> References: <20260119132938.2173032-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 --- v4: (Matt, Mike) - Add domain-specific MMIO accessor - Change phase_bit type from u32 to bool --- 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 | 33 +++++++++++++++++ 3 files changed, 104 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..2b64165c8e76 --- /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..d4a362564925 --- /dev/null +++ b/drivers/gpu/drm/xe/xe_sysctrl_types.h @@ -0,0 +1,33 @@ +/* SPDX-License-Identifier: MIT */ +/* + * Copyright © 2026 Intel Corporation + */ + +#ifndef _XE_SYSCTRL_TYPES_H_ +#define _XE_SYSCTRL_TYPES_H_ + +#include +#include + +struct xe_mmio; + +/** + * struct xe_sysctrl - System Controller driver context + */ +struct xe_sysctrl { + /** @mmio: MMIO region for system control registers */ + struct xe_mmio *mmio; + + /** @cmd_lock: Mutex protecting mailbox command operations */ + struct mutex cmd_lock; + + /** + * @phase_bit: MKHI message boundary phase toggle bit + * + * Phase bit alternates between 0 and 1 for consecutive + * messages to help distinguish message boundaries. + */ + bool phase_bit; +}; + +#endif /* _XE_SYSCTRL_TYPES_H_ */ -- 2.43.0