Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp41953pxy; Fri, 30 Jul 2021 23:12:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0VMzmchDN8h/MJBZmrA9BYvvI3+auZzDT8/+6awAbc2VBedkKIf4yTa64q66gURNc43JN X-Received: by 2002:a5d:96da:: with SMTP id r26mr5316830iol.47.1627711931374; Fri, 30 Jul 2021 23:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627711931; cv=none; d=google.com; s=arc-20160816; b=cdN43MHy3VViZM/x83phRqQlKqbbLeTmSBdiVKOw8+UxpcFo1qF5IBs0qfUbYzeJyS TU1v2r7blmxzb2XDpQyWfDja2ZaRN6nVjfY1egpc4nCD0UlD+1+wDhPuq1xSs4k/sIHY 7PujBB/ySZCA+4jo5z0aKEgw2Nijc0DOa9XUW2pJt/Qs0vvyGxqtl94Ou5yV5AbZ2tFq 3uatiHhYHsw5rmHlpyDXYhUDJbMNgAX5TuExOKU/fIBHtRJVhgc4tyUcmp27y8zVrWyN OlF4hUbVvvGMy5tluZP/QZRhnGTknmwhYZLC9JruVIIIxHOJ0PxuvLkxiOSDtPEfedqM xT0w== 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; bh=y18gakcCvgDHdmewLPX4gX6NReKek21MY2uruBpU+kM=; b=0q6HFAnovdmsNImxKouKSLORO61dSSkEiO9As5qHx2hAGeEigyTWUs8KAZThzVHuuA PTTPxAiWotvCIs3k55xVxsILQmtUf9IaNBwh7ppt/hvLZnhHnPz7/Ax2jMZ26/hnJJsG Hl6BA5Gs3PsGoi8RpJKDhs35IZcGY50ROt189OwNze5eodnVW4f9kLnSc6AEmFUR+hFF 8CvPclzV54LSO0/uv5hi61zAyA3etoLX+47k75pgQU6fZFhd3n1VVqEh+Qj+dgaRTJu9 IJf94FLu/iRcxCWqvwjTZZkBdfbK0VTHso5Geol7JLPrlane58LY31hpU6gQbF9UGDAu ZDZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r8si4342098jar.122.2021.07.30.23.11.37; Fri, 30 Jul 2021 23:12:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237212AbhGaGKy (ORCPT + 99 others); Sat, 31 Jul 2021 02:10:54 -0400 Received: from mga18.intel.com ([134.134.136.126]:54747 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236814AbhGaGKv (ORCPT ); Sat, 31 Jul 2021 02:10:51 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10061"; a="200417334" X-IronPort-AV: E=Sophos;i="5.84,284,1620716400"; d="scan'208";a="200417334" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2021 23:10:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,284,1620716400"; d="scan'208";a="508566304" Received: from otcpl-manager.jf.intel.com (HELO localhost.localdomain) ([10.54.39.234]) by FMSMGA003.fm.intel.com with ESMTP; 30 Jul 2021 23:10:45 -0700 From: Gayatri Kammela To: platform-driver-x86@vger.kernel.org Cc: mgross@linux.intel.com, hdegoede@redhat.com, irenic.rajneesh@gmail.com, andriy.shevchenko@linux.intel.com, vicamo.yang@canonical.com, srinivas.pandruvada@intel.com, david.e.box@intel.com, chao.qin@intel.com, linux-kernel@vger.kernel.org, tamar.mashiah@intel.com, gregkh@linuxfoundation.org, rajatja@google.com, Shyam-sundar.S-k@amd.com, Alexander.Deucher@amd.com, mlimonci@amd.com, Gayatri Kammela , Andy Shevchenko Subject: [PATCH v6 3/5] platform/x86/intel: pmc/core: Add Latency Tolerance Reporting (LTR) support to Alder Lake Date: Fri, 30 Jul 2021 23:07:14 -0700 Message-Id: <2c48da14f5926167c94c8396a76706557703f903.1627710766.git.gayatri.kammela@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support to show the Latency Tolerance Reporting for the IPs on the Alder Lake PCH as reported by the PMC. This LTR support on Alder Lake is slightly different from the Cannon lake PCH that is being reused by all platforms till Tiger Lake. Cc: Chao Qin Cc: Srinivas Pandruvada Cc: Andy Shevchenko Cc: David Box Tested-by: You-Sheng Yang Acked-by: Rajneesh Bhardwaj Reviewed-by: Hans de Goede Reviewed-by: Andy Shevchenko Signed-off-by: Gayatri Kammela --- drivers/platform/x86/intel/pmc/core.c | 39 +++++++++++++++++++++++++++ drivers/platform/x86/intel/pmc/core.h | 2 ++ 2 files changed, 41 insertions(+) diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c index d4be15897d04..f2646fdf6c90 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -699,10 +699,48 @@ static const struct pmc_bit_map *ext_adl_pfear_map[] = { NULL }; +static const struct pmc_bit_map adl_ltr_show_map[] = { + {"SOUTHPORT_A", CNP_PMC_LTR_SPA}, + {"SOUTHPORT_B", CNP_PMC_LTR_SPB}, + {"SATA", CNP_PMC_LTR_SATA}, + {"GIGABIT_ETHERNET", CNP_PMC_LTR_GBE}, + {"XHCI", CNP_PMC_LTR_XHCI}, + {"SOUTHPORT_F", ADL_PMC_LTR_SPF}, + {"ME", CNP_PMC_LTR_ME}, + /* EVA is Enterprise Value Add, doesn't really exist on PCH */ + {"SATA1", CNP_PMC_LTR_EVA}, + {"SOUTHPORT_C", CNP_PMC_LTR_SPC}, + {"HD_AUDIO", CNP_PMC_LTR_AZ}, + {"CNV", CNP_PMC_LTR_CNV}, + {"LPSS", CNP_PMC_LTR_LPSS}, + {"SOUTHPORT_D", CNP_PMC_LTR_SPD}, + {"SOUTHPORT_E", CNP_PMC_LTR_SPE}, + {"SATA2", CNP_PMC_LTR_CAM}, + {"ESPI", CNP_PMC_LTR_ESPI}, + {"SCC", CNP_PMC_LTR_SCC}, + {"ISH", CNP_PMC_LTR_ISH}, + {"UFSX2", CNP_PMC_LTR_UFSX2}, + {"EMMC", CNP_PMC_LTR_EMMC}, + /* + * Check intel_pmc_core_ids[] users of cnp_reg_map for + * a list of core SoCs using this. + */ + {"WIGIG", ICL_PMC_LTR_WIGIG}, + {"THC0", TGL_PMC_LTR_THC0}, + {"THC1", TGL_PMC_LTR_THC1}, + {"SOUTHPORT_G", CNP_PMC_LTR_RESERVED}, + + /* Below two cannot be used for LTR_IGNORE */ + {"CURRENT_PLATFORM", CNP_PMC_LTR_CUR_PLT}, + {"AGGREGATED_SYSTEM", CNP_PMC_LTR_CUR_ASLT}, + {} +}; + static const struct pmc_reg_map adl_reg_map = { .pfear_sts = ext_adl_pfear_map, .slp_s0_offset = ADL_PMC_SLP_S0_RES_COUNTER_OFFSET, .slp_s0_res_counter_step = TGL_PMC_SLP_S0_RES_COUNTER_STEP, + .ltr_show_sts = adl_ltr_show_map, .msr_sts = msr_map, .ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET, .regmap_length = CNP_PMC_MMIO_REG_LEN, @@ -710,6 +748,7 @@ static const struct pmc_reg_map adl_reg_map = { .ppfear_buckets = CNP_PPFEAR_NUM_ENTRIES, .pm_cfg_offset = CNP_PMC_PM_CFG_OFFSET, .pm_read_disable_bit = CNP_PMC_READ_DISABLE_BIT, + .ltr_ignore_max = ADL_NUM_IP_IGN_ALLOWED, }; static inline u32 pmc_core_reg_read(struct pmc_dev *pmcdev, int reg_offset) diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h index c0ca20b32c6b..45b352ece6db 100644 --- a/drivers/platform/x86/intel/pmc/core.h +++ b/drivers/platform/x86/intel/pmc/core.h @@ -197,6 +197,8 @@ enum ppfear_regs { #define TGL_NUM_IP_IGN_ALLOWED 23 #define TGL_PMC_LPM_RES_COUNTER_STEP_X2 61 /* 30.5us * 2 */ +#define ADL_PMC_LTR_SPF 0x1C00 +#define ADL_NUM_IP_IGN_ALLOWED 23 #define ADL_PMC_SLP_S0_RES_COUNTER_OFFSET 0x1098 /* -- 2.25.1