From patchwork Thu Oct 12 02:38:25 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: 151651 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp942707vqb; Wed, 11 Oct 2023 19:39:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG8jIJPW8OOJ0pOqvFSjcYjvOT5+CX4eu8kk5QSb8m0gjfHTJ0NJws0b9YHoEOxomm1/FTt X-Received: by 2002:a92:db4f:0:b0:34e:2a69:883c with SMTP id w15-20020a92db4f000000b0034e2a69883cmr22780737ilq.1.1697078372315; Wed, 11 Oct 2023 19:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697078372; cv=none; d=google.com; s=arc-20160816; b=ZIYa1F+LLr7soAIDLvU3NS4Q0h7M9TLUwrG2yLTeo4jB0Quv5Ae7EiTa1b4w9XfhcT OQ1Ayv+JUdithBIFitA7mM3HE9t7+SR4ooi+LyIby9wKavO+YIfhmejZVmwcEobAu156 8+JAG4sqPBA/rPe1gMO4DD4orR5Qq6aEbK+fNjZrhRQlDvFiwAO78ZrS66+cTih5HwkH YJZUqtZ4Hid5TR/+aBtTzLfo8rR2FIHE36Hf3JE7AgulQ3kktPVY/Z0A2ZvCtXND5K3b sbUvp1Yqitp+tnFiAPvuy3HLfXx4GtLky75qHbbQ2tAB5u7Or3hiOcFXA/hfQT+CMr0v piqg== 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=hQuPadUfF8PiJCIktLu4qTUYs5TlkGN2ehVTg6PmRIs=; fh=d9G4dsZtlI8UONIvGKwhW94hCYEPGxy6CqYeKEG646A=; b=wgOd/RMCjvZgRh/+SO/dYYlG+7x4pYYo7HJh2oLidjUOCIxid62XmyzY+4WWrziMJ3 BgXSlpX2t8/lfjzE14rCN1iqA7pvz9+Y8h6QlLc68QRcBjHrDdgelDQp82V55tUTmSdD djH4MCraILn7lO7uM9fYjs5IiD5D25xCLsS6VCZ0/rP86fnclJJZDctlBevfrq5NtW7D 1w0fvJRM4gIqnB0QnZ2W0WQXJZeHW/B2tVyJyKXRGBGH/DDX7/sCcCIQMoCNLfHh6vrr D5nTpojlVPPr/7KszQs03BeLfBQ7oA2XDXCz6V+nkZwlqaYkctWP5nduqNJ56fgeXrwX YHeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SsMCzMHf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l125-20020a633e83000000b005702257f332si1236637pga.21.2023.10.11.19.39.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 19:39:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SsMCzMHf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (Postfix) with ESMTP id 059368026BD2; Wed, 11 Oct 2023 19:39:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234107AbjJLCio (ORCPT + 18 others); Wed, 11 Oct 2023 22:38:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232321AbjJLCin (ORCPT ); Wed, 11 Oct 2023 22:38:43 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0F14A9; Wed, 11 Oct 2023 19:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697078321; x=1728614321; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=1vjJ5BX03s5/aGfEOqXNECEgcR/vZRlNbtL4DnJaoeg=; b=SsMCzMHfjkF3d9FyT/jDDz81xiUptH79G3YqRmsPaijnsEdm45Yy6C52 NGDE7cp0SPTJuJnJ0uoG/fXxZ5w9jOUW+HNh8boCAsWRu3qHETh1XwcDi 63rNjvDnWQTtGOur+MffhHcpF+g4SmWCMdTFacrClWAx116zkIwz3NBqH TbwlRTyYDYmg4Yi8O+VoDG0JIbRk73gGqVpqTB4GkEPpEZ2Y9FjTxcVUB +Nqp7YsJ030z6uyaJHv15wBYsF2OmIb6ZZ+pYsK7h47+fmjhpaQcZHvey ujwFPoyedj21G3Sf6Ns+xeAn4ukK3HfZLJbUD8cqHJC3mmdRWArUWJTqH Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="365090366" X-IronPort-AV: E=Sophos;i="6.03,217,1694761200"; d="scan'208";a="365090366" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 19:38:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10860"; a="824411674" X-IronPort-AV: E=Sophos;i="6.03,217,1694761200"; d="scan'208";a="824411674" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2023 19:38:41 -0700 Received: from debox1-desk4.intel.com (unknown [10.209.105.238]) by linux.intel.com (Postfix) with ESMTP id C7AE9580D95; Wed, 11 Oct 2023 19:38:40 -0700 (PDT) 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 V3 01/16] platform/x86/intel/vsec: Move structures to header Date: Wed, 11 Oct 2023 19:38:25 -0700 Message-Id: <20231012023840.3845703-2-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231012023840.3845703-1-david.e.box@linux.intel.com> References: <20231012023840.3845703-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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Wed, 11 Oct 2023 19:39:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779515651136440287 X-GMAIL-MSGID: 1779515651136440287 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 --- 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),