From patchwork Thu Nov 23 04:03:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "David E. Box" X-Patchwork-Id: 168688 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp207515vqx; Wed, 22 Nov 2023 20:05:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IHrM7VwhrTns6HllAm7V/4jcQ5+eFot8L+envXvAyXIiybWkw627/7XCDbHrNEG9repTu6e X-Received: by 2002:a05:6a21:348b:b0:188:1125:88bd with SMTP id yo11-20020a056a21348b00b00188112588bdmr5356001pzb.43.1700712309158; Wed, 22 Nov 2023 20:05:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700712309; cv=none; d=google.com; s=arc-20160816; b=IgO/Nxd7cnlRd5UjqZXhRhEFtzhzPoHUvQ5ItjG988A9Ymf5tuVwsNZXz8ttbmQjov sX4fyb9AcUgp4ArI3aPXb1Xww+VhnJMZG08Lfala6k5HV/xxuXFquqACmtHm/i4RjcoL GycLcGVjwNDVC2hhuhJ0j9MA+wbSxckkRlbyVL5dfFGRTfYCTDntv124VReFbCyTVzTs fZVIVdE7+wEMoK1cDFeZSDYehqJdeSOMlJpSQZN6zPJOiOvFnxeBNFkraGvlsI3fp4FR Ciab2YzTxI4fdE4pzgztrguZVmSSNE8Tc4cJhraH0/JXHHtIoL63z91jiec1tBdqPMyx uC7g== 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:to:from :dkim-signature; bh=aUVIUDOBJjewxQZLEC2oxAIDoAYdV8z1nH2gwPLp+kk=; fh=d9G4dsZtlI8UONIvGKwhW94hCYEPGxy6CqYeKEG646A=; b=Vymojcy+3w3GQuKbK3nFGaG2gpQ+3ekx5wSXIRC63DSFvH08WKe47/61/ZbtjbfjWh YAEps5vCP6dMNa+dDV9g5klsFEIpl53DvHl1GFDE+f35YQwzqbebWl/K9B7MeAzeI7Qo LMONlzY/FIQOKF8TNEY3pzjKQ02ijFk2qD+lpYSngj1BXA1yC8PD0Xh7SC3TjLMFdWVF W8ruOjBhKRSzVoxsiFt7a6h6orH0EOHYjoc8OAtf3OpyNX4NGOe6307cLF+b2k33QWQh tVH2yn2yg4rgvPCA0N1G3sC0P7cu/sDa9gz41HmccdBl/rya4LUCbIk4Y0EJPXboIrk+ UETQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V5A5Tg+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id ix21-20020a170902f81500b001cf5d324819si333969plb.154.2023.11.22.20.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 20:05:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=V5A5Tg+u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8E84983B2E25; Wed, 22 Nov 2023 20:05:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344649AbjKWEEW (ORCPT + 99 others); Wed, 22 Nov 2023 23:04:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232850AbjKWEDw (ORCPT ); Wed, 22 Nov 2023 23:03:52 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61D7A1BD; Wed, 22 Nov 2023 20:03:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700712238; x=1732248238; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=nB3piPN6pBa37Ro7iZ9FfSCJftl4I3O6fnufAVoLSTM=; b=V5A5Tg+uz8c5gpBOORG3V5OhRMfRowV/utYa5GqggLbJbtOvSJoI+V6i o+77Z8/FgYRn5TbkUEIi130SfFSlArjf3BpDm4zhj6ccJQBtoavK3zOO3 FuVDjMzC1pxrmOjFSpSzBdvzMQIEkoEAEjcLOdadCEQRN9IcJA2dFe7GU 7GTidcPxUY1LEAQ3NZ9u0KSkyfDSlcg5MBRxJ/u/6N2x5bG/UJv5WeS5U eQXO3MA4cF4WfuPtI96dLtZZHD05Y7VDM+qyJSXAJCU+NVvULfWVDF/e9 4enKqC1BGT7ZV8wRLNyy0RosTy9FY9rRRWuBhXVRE/QajCunjlkzUEif8 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="389347943" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="389347943" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 20:03:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="801925646" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="801925646" Received: from linux.intel.com ([10.54.29.200]) by orsmga001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 20:03:55 -0800 Received: from debox1-desk4.lan (snpatel1-mobl.amr.corp.intel.com [10.209.89.91]) by linux.intel.com (Postfix) with ESMTP id 9B8D1580D7B; Wed, 22 Nov 2023 20:03:55 -0800 (PST) From: "David E. Box" To: linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, ilpo.jarvinen@linux.intel.com, rajvi.jingar@linux.intel.com Subject: [PATCH V5 02/20] platform/x86/intel/vsec: Move structures to header Date: Wed, 22 Nov 2023 20:03:37 -0800 Message-Id: <20231123040355.82139-3-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231123040355.82139-1-david.e.box@linux.intel.com> References: <20231123040355.82139-1-david.e.box@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 22 Nov 2023 20:05:00 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783326109940939844 X-GMAIL-MSGID: 1783326109940939844 In preparation for exporting an API to register Intel Vendor Specific Extended Capabilities (VSEC) from other drivers, move needed structures to the header file. Signed-off-by: David E. Box Reviewed-by: Ilpo Järvinen --- V5 - No change V4 - No change V3 - No change V2 - New patch splitting previous PATCH 1 drivers/platform/x86/intel/vsec.c | 35 ------------------------------ drivers/platform/x86/intel/vsec.h | 36 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 35 deletions(-) diff --git a/drivers/platform/x86/intel/vsec.c b/drivers/platform/x86/intel/vsec.c index ae811bb65910..6bb233a23414 100644 --- a/drivers/platform/x86/intel/vsec.c +++ b/drivers/platform/x86/intel/vsec.c @@ -24,13 +24,6 @@ #include "vsec.h" -/* Intel DVSEC offsets */ -#define INTEL_DVSEC_ENTRIES 0xA -#define INTEL_DVSEC_SIZE 0xB -#define INTEL_DVSEC_TABLE 0xC -#define INTEL_DVSEC_TABLE_BAR(x) ((x) & GENMASK(2, 0)) -#define INTEL_DVSEC_TABLE_OFFSET(x) ((x) & GENMASK(31, 3)) -#define TABLE_OFFSET_SHIFT 3 #define PMT_XA_START 0 #define PMT_XA_MAX INT_MAX #define PMT_XA_LIMIT XA_LIMIT(PMT_XA_START, PMT_XA_MAX) @@ -39,34 +32,6 @@ static DEFINE_IDA(intel_vsec_ida); static DEFINE_IDA(intel_vsec_sdsi_ida); static DEFINE_XARRAY_ALLOC(auxdev_array); -/** - * struct intel_vsec_header - Common fields of Intel VSEC and DVSEC registers. - * @rev: Revision ID of the VSEC/DVSEC register space - * @length: Length of the VSEC/DVSEC register space - * @id: ID of the feature - * @num_entries: Number of instances of the feature - * @entry_size: Size of the discovery table for each feature - * @tbir: BAR containing the discovery tables - * @offset: BAR offset of start of the first discovery table - */ -struct intel_vsec_header { - u8 rev; - u16 length; - u16 id; - u8 num_entries; - u8 entry_size; - u8 tbir; - u32 offset; -}; - -enum intel_vsec_id { - VSEC_ID_TELEMETRY = 2, - VSEC_ID_WATCHER = 3, - VSEC_ID_CRASHLOG = 4, - VSEC_ID_SDSI = 65, - VSEC_ID_TPMI = 66, -}; - static const char *intel_vsec_name(enum intel_vsec_id id) { switch (id) { diff --git a/drivers/platform/x86/intel/vsec.h b/drivers/platform/x86/intel/vsec.h index 0a6201b4a0e9..c242c07ea69c 100644 --- a/drivers/platform/x86/intel/vsec.h +++ b/drivers/platform/x86/intel/vsec.h @@ -11,9 +11,45 @@ #define VSEC_CAP_SDSI BIT(3) #define VSEC_CAP_TPMI BIT(4) +/* Intel DVSEC offsets */ +#define INTEL_DVSEC_ENTRIES 0xA +#define INTEL_DVSEC_SIZE 0xB +#define INTEL_DVSEC_TABLE 0xC +#define INTEL_DVSEC_TABLE_BAR(x) ((x) & GENMASK(2, 0)) +#define INTEL_DVSEC_TABLE_OFFSET(x) ((x) & GENMASK(31, 3)) +#define TABLE_OFFSET_SHIFT 3 + struct pci_dev; struct resource; +enum intel_vsec_id { + VSEC_ID_TELEMETRY = 2, + VSEC_ID_WATCHER = 3, + VSEC_ID_CRASHLOG = 4, + VSEC_ID_SDSI = 65, + VSEC_ID_TPMI = 66, +}; + +/** + * struct intel_vsec_header - Common fields of Intel VSEC and DVSEC registers. + * @rev: Revision ID of the VSEC/DVSEC register space + * @length: Length of the VSEC/DVSEC register space + * @id: ID of the feature + * @num_entries: Number of instances of the feature + * @entry_size: Size of the discovery table for each feature + * @tbir: BAR containing the discovery tables + * @offset: BAR offset of start of the first discovery table + */ +struct intel_vsec_header { + u8 rev; + u16 length; + u16 id; + u8 num_entries; + u8 entry_size; + u8 tbir; + u32 offset; +}; + enum intel_vsec_quirks { /* Watcher feature not supported */ VSEC_QUIRK_NO_WATCHER = BIT(0),