Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5886048rwb; Wed, 7 Sep 2022 09:18:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR4bBiHF5jXW1LMmP0LV87u5Z698h2EhvJ4yZXSJ2hSvJazB/tHmPlQvNqrfDu5nBWIGvnTt X-Received: by 2002:a05:6402:1f13:b0:44e:97dd:7b77 with SMTP id b19-20020a0564021f1300b0044e97dd7b77mr3788461edb.300.1662567518570; Wed, 07 Sep 2022 09:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662567518; cv=none; d=google.com; s=arc-20160816; b=jHH2DENBgmy0uPzwF2b44xEQghUD8pwCwy4vSdmyvdH78E0Xy6Rp7FfFF/+i+vGMsl IK3+rcMvqOWUmbkUM+5/dUUxPquZfJtSPU2dxw62JZV9xA1h+eKb0abezRJ/4xcHZjM8 0MBYpKYOAbP/VmAl63WN9+N0SG/H2rhkk++QhsrZXbTe0zhEHN4CAY6QQ5IMYyAfNvBM R8pub/N8XyHLPcxrjTERao/RcyFl/N8UGmMu8WxE9b2bN0BcRr40vQbOJGngWL/ML4or WdDgnyzdLMKiTRy2ib5KfPIxvzEpi4aLoBXIDFTg1ft19MxuELkSgrfHFtDcvCbRZEjE eRrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hcq9h0SJKjzRUhGWJ+qBFp1Ymkt9mSl8XbGlc7pjz/o=; b=j22xcTtGO5m8BQrBXPPyYvFWN1f2vgILL0o+gzgU5qXo0pNWPqprO0yqGdiVdVFb9J hOGhHQM15q+QWzEfqY/VanEhzP3L4AGEewGJhYh5Wg9FNEH9AAtfGHkZc7W7Q1wUJ+pL 8fWh80iNlFmP7us0PiQV34L96l+/SczrdwVkRNA6Z/qeQB1txWpWxtcEYgMqeivgjt9z WT8jNrAtH4Fa+F4jK4YsNdjvgtiu+VCD88cPUmKaw6Dd3oRz4Sqnjvtq8qq1DaC02tjy O9E4LEzHPlg2vjNku5cAkDQItHgi+bzgfA7ZDN1AsXzOBmiJxkUi+VwvYwzD42DJioiG SU1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ldFqP8M7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id da26-20020a056402177a00b0044f288e02edsi532468edb.15.2022.09.07.09.18.13; Wed, 07 Sep 2022 09:18:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ldFqP8M7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229653AbiIGQA1 (ORCPT + 99 others); Wed, 7 Sep 2022 12:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbiIGQAB (ORCPT ); Wed, 7 Sep 2022 12:00:01 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52C6C33407 for ; Wed, 7 Sep 2022 08:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662566383; x=1694102383; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7LPD4nhApM8sqGjNR6JnkE4Y4ACFhfMxX7DGMWYyNmI=; b=ldFqP8M77lqH9J826/7yRSwSoR93Sv82yL1uXBj8RWasSLmodoGQ8pe9 MplXn2ySkcAkaYUE7uStY/YOxeByZNOF8NWGNiFh9GiHfG8n1CW28VaCD J2k89RRAoiXWHDFZTaEXPVOcWTO5+uKeasYkdO/M5a5VJ2mugKwF2h4qE QdkhnQSw1MjoURt14eIfW4gL3uFWcJDW0yQcPnCaHnzDm7pRyKu8yv4eb NYZrXEkGfSYNJF4LmtwyZH2/cy2P0H2qI88mIDWPjdrltLOWzBASkZCas ovEjZrTe49zx2O6EJltaAuSddNAHaHKWmvoKNODSMtLCVRPMe3oYL+PQ0 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10463"; a="297701421" X-IronPort-AV: E=Sophos;i="5.93,297,1654585200"; d="scan'208";a="297701421" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 08:59:18 -0700 X-IronPort-AV: E=Sophos;i="5.93,297,1654585200"; d="scan'208";a="676248010" Received: from twinkler-lnx.jer.intel.com ([10.12.87.143]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Sep 2022 08:59:15 -0700 From: Tomas Winkler To: Greg Kroah-Hartman , David Airlie , Daniel Vetter Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, Tomas Winkler , Alexander Usyskin , Vitaly Lubart Subject: [PATCH v8 09/16] mei: bus: export common mkhi definitions into a separate header Date: Wed, 7 Sep 2022 18:58:06 +0300 Message-Id: <20220907155813.1427526-10-tomas.winkler@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220907155813.1427526-1-tomas.winkler@intel.com> References: <20220907155813.1427526-1-tomas.winkler@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Lubart Exported common mkhi definitions from bus-fixup.c into a separate header file mkhi.h for other driver usage. Signed-off-by: Vitaly Lubart Signed-off-by: Tomas Winkler Signed-off-by: Alexander Usyskin --- drivers/misc/mei/bus-fixup.c | 31 +------------------- drivers/misc/mei/mkhi.h | 57 ++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 30 deletions(-) create mode 100644 drivers/misc/mei/mkhi.h diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c index 344598fcf8e9..c4e527803299 100644 --- a/drivers/misc/mei/bus-fixup.c +++ b/drivers/misc/mei/bus-fixup.c @@ -15,6 +15,7 @@ #include "mei_dev.h" #include "client.h" +#include "mkhi.h" #define MEI_UUID_NFC_INFO UUID_LE(0xd2de1625, 0x382d, 0x417d, \ 0x48, 0xa4, 0xef, 0xab, 0xba, 0x8a, 0x12, 0x06) @@ -89,20 +90,6 @@ struct mei_os_ver { u8 reserved2; } __packed; -#define MKHI_FEATURE_PTT 0x10 - -struct mkhi_rule_id { - __le16 rule_type; - u8 feature_id; - u8 reserved; -} __packed; - -struct mkhi_fwcaps { - struct mkhi_rule_id id; - u8 len; - u8 data[]; -} __packed; - struct mkhi_fw_ver_block { u16 minor; u8 major; @@ -115,22 +102,6 @@ struct mkhi_fw_ver { struct mkhi_fw_ver_block ver[MEI_MAX_FW_VER_BLOCKS]; } __packed; -#define MKHI_FWCAPS_GROUP_ID 0x3 -#define MKHI_FWCAPS_SET_OS_VER_APP_RULE_CMD 6 -#define MKHI_GEN_GROUP_ID 0xFF -#define MKHI_GEN_GET_FW_VERSION_CMD 0x2 -struct mkhi_msg_hdr { - u8 group_id; - u8 command; - u8 reserved; - u8 result; -} __packed; - -struct mkhi_msg { - struct mkhi_msg_hdr hdr; - u8 data[]; -} __packed; - #define MKHI_OSVER_BUF_LEN (sizeof(struct mkhi_msg_hdr) + \ sizeof(struct mkhi_fwcaps) + \ sizeof(struct mei_os_ver)) diff --git a/drivers/misc/mei/mkhi.h b/drivers/misc/mei/mkhi.h new file mode 100644 index 000000000000..43cadfb1b990 --- /dev/null +++ b/drivers/misc/mei/mkhi.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2003-2022, Intel Corporation. All rights reserved. + * Intel Management Engine Interface (Intel MEI) Linux driver + */ + +#ifndef _MEI_MKHI_H_ +#define _MEI_MKHI_H_ + +#include + +#define MKHI_FEATURE_PTT 0x10 + +#define MKHI_FWCAPS_GROUP_ID 0x3 +#define MKHI_FWCAPS_SET_OS_VER_APP_RULE_CMD 6 +#define MKHI_GEN_GROUP_ID 0xFF +#define MKHI_GEN_GET_FW_VERSION_CMD 0x2 + +#define MKHI_GROUP_ID_GFX 0x30 +#define MKHI_GFX_RESET_WARN_CMD_REQ 0x0 +#define MKHI_GFX_MEMORY_READY_CMD_REQ 0x1 + +/* Allow transition to PXP mode without approval */ +#define MKHI_GFX_MEM_READY_PXP_ALLOWED 0x1 + +#define MKHI_GROUP_ID_GFX 0x30 +#define MKHI_GFX_RESET_WARN_CMD_REQ 0x0 +#define MKHI_GFX_MEMORY_READY_CMD_REQ 0x1 + +/* Allow transition to PXP mode without approval */ +#define MKHI_GFX_MEM_READY_PXP_ALLOWED 0x1 + +struct mkhi_rule_id { + __le16 rule_type; + u8 feature_id; + u8 reserved; +} __packed; + +struct mkhi_fwcaps { + struct mkhi_rule_id id; + u8 len; + u8 data[]; +} __packed; + +struct mkhi_msg_hdr { + u8 group_id; + u8 command; + u8 reserved; + u8 result; +} __packed; + +struct mkhi_msg { + struct mkhi_msg_hdr hdr; + u8 data[]; +} __packed; + +#endif /* _MEI_MKHI_H_ */ -- 2.37.2