From patchwork Fri Sep 22 21:30:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "David E. Box" X-Patchwork-Id: 143789 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:910f:0:b0:403:3b70:6f57 with SMTP id r15csp47126vqg; Fri, 22 Sep 2023 19:47:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4RoHShBTNcxC7YYlJ58IVOlCzLc1ygbkpRui78P1/yd6QwFmLnoRY2t7pI40ekJltwsrb X-Received: by 2002:a17:902:7881:b0:1c5:7aa1:3a52 with SMTP id q1-20020a170902788100b001c57aa13a52mr885493pll.2.1695437238054; Fri, 22 Sep 2023 19:47:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695437238; cv=none; d=google.com; s=arc-20160816; b=cvh4lFwKXwJBUd0+Bc6h73OqYT+rM1QrO8Z5PEZniCv4KxRhYtb7HkEgXdGa+8J6lN ahT7OM4yRuuM8RXWOeMyU3bG19NJdjfuJczettEp9qE+smFgZ2kuyHblKVgr5x5KwWkX fvQSZMjc+ZlJSHweL0bSpyE1IQeRYt6rfD0ibS1x6mY2BUdBfKr4WaDnF8nsGnyeE1M7 6iSk8S/mcWGpAR8Vy5f/RiZmQl/oSepcu+1G75OcOkCPdOIkVblZqtqO79G02ypudGzW 67vJeX89fyqimlncp+UbYmbVBqwTA7SWKB3uTSHvaajvFSwMuSQ78jqPgAIgNgzrRdR4 EM5g== 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=yhSs/skg+k0BHAbbKX/V/H6zmyzaefHFO2jAduFVMz0=; fh=WoyaDCqoIurK3gigUbTB/Xr+1NkeBdRjn5eZTIYeUNs=; b=ChYh+UEEvb/MNHQuzwfXyKHhriUzVqTicZBGswsbUrOAILtsorcOJp5qb5vViOFQ3F NGz5zt9tMWMYzoCGKZBr/OvORaioc3vFEBGRYkGqhbA9pNqO9I14aomd8OunqLZM9sUW iLYNq1IAOxnwaXg9i+xTnB2xFeTqlJdRnZnK20A9PVgHbAHRq11FopEYPsTBG83b3iLD u+qwdpy9qtom15qJXTprPa9uVRBuEqzvI9hvmoH87tRTEbXn1b5lrAGBF2hI7yTauAus okHZC/FD41cUzeGgAC51lfzd98q+7LPAJhALt/CAuh3I3VbaLRdZnmu09nhyaa44KOPC fitA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L2kIgiJA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u3-20020a170902e80300b001b9e2ce5723si571150plg.495.2023.09.22.19.47.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 19:47:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=L2kIgiJA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id D5C5080ACFC1; Fri, 22 Sep 2023 14:30:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbjIVVar (ORCPT + 28 others); Fri, 22 Sep 2023 17:30:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229944AbjIVVak (ORCPT ); Fri, 22 Sep 2023 17:30:40 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFC43C1; Fri, 22 Sep 2023 14:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695418234; x=1726954234; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=ShdByvzHZrIatOiiLohtDB7ahuIepttl4FPmXc1tWd0=; b=L2kIgiJAHiWoqzcB+ojIgpaqg5V9hZNZcNXdEm4qW+js73H3Px64mLir xZSiKNvWQs0yJfHUN+bgefWZRU2hoCCFSjVz5bvDGjDoYnZQGujr8mArF sbJhTgMCY72FdyaOMQuj2V/vdTpUMeqvvj7Iwtsrd9ttDLJKOfcBzBKfh RAOt53x1PQoMQR77fAS7jbncgbvfU6PxNKC7RJf9eY0uEgxjkJNoB8K3k RIsT1PcMr3tzMttwrJKT0sqMYftaZ39EwjH7YYO9nePeCYBcJ99RqG26m ud7xhFt6peY5wYfj7SBAOp4WM30dOUD3cK1NRHC3N8YOBQTZ6KLwYUf2o g==; X-IronPort-AV: E=McAfee;i="6600,9927,10841"; a="379828421" X-IronPort-AV: E=Sophos;i="6.03,169,1694761200"; d="scan'208";a="379828421" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 14:30:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10841"; a="813237856" X-IronPort-AV: E=Sophos;i="6.03,169,1694761200"; d="scan'208";a="813237856" Received: from linux.intel.com ([10.54.29.200]) by fmsmga008.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2023 14:30:34 -0700 Received: from debox1-desk4.intel.com (unknown [10.212.188.234]) by linux.intel.com (Postfix) with ESMTP id E98B8580DB2; Fri, 22 Sep 2023 14:30:33 -0700 (PDT) From: "David E. Box" To: linux-kernel@vger.kernel.org, david.e.box@linux.intel.com, platform-driver-x86@vger.kernel.org, ilpo.jarvinen@linux.intel.com, rajvi.jingar@linux.intel.com Subject: [PATCH 10/11] platform/x86/intel/pmc: Read low power mode requirements for MTL-M and MTL-P Date: Fri, 22 Sep 2023 14:30:31 -0700 Message-Id: <20230922213032.1770590-11-david.e.box@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230922213032.1770590-1-david.e.box@linux.intel.com> References: <20230922213032.1770590-1-david.e.box@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 22 Sep 2023 14:30:49 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777794797446719399 X-GMAIL-MSGID: 1777794797446719399 From: Xi Pardee Add support to read the low power mode requirements for Meteor Lake M and Meteor Lake P. Signed-off-by: Xi Pardee Signed-off-by: David E. Box --- drivers/platform/x86/intel/pmc/mtl.c | 39 +++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c index 780874142a90..c2ac50cfdd51 100644 --- a/drivers/platform/x86/intel/pmc/mtl.c +++ b/drivers/platform/x86/intel/pmc/mtl.c @@ -11,6 +11,13 @@ #include #include "core.h" +/* PMC SSRAM PMT Telemetry GUIDS */ +#define SOCP_LPM_REQ_GUID 0x2625030 +#define IOEM_LPM_REQ_GUID 0x4357464 +#define IOEP_LPM_REQ_GUID 0x5077612 + +static const u8 MTL_LPM_REG_INDEX[] = {0, 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20}; + /* * Die Mapping to Product. * Product SOCDie IOEDie PCHDie @@ -465,6 +472,7 @@ const struct pmc_reg_map mtl_socm_reg_map = { .lpm_sts = mtl_socm_lpm_maps, .lpm_status_offset = MTL_LPM_STATUS_OFFSET, .lpm_live_status_offset = MTL_LPM_LIVE_STATUS_OFFSET, + .lpm_reg_index = MTL_LPM_REG_INDEX, }; const struct pmc_bit_map mtl_ioep_pfear_map[] = { @@ -782,6 +790,13 @@ const struct pmc_reg_map mtl_ioep_reg_map = { .ltr_show_sts = mtl_ioep_ltr_show_map, .ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET, .ltr_ignore_max = ADL_NUM_IP_IGN_ALLOWED, + .lpm_num_maps = ADL_LPM_NUM_MAPS, + .lpm_res_counter_step_x2 = TGL_PMC_LPM_RES_COUNTER_STEP_X2, + .lpm_residency_offset = MTL_LPM_RESIDENCY_OFFSET, + .lpm_priority_offset = MTL_LPM_PRI_OFFSET, + .lpm_en_offset = MTL_LPM_EN_OFFSET, + .lpm_sts_latch_en_offset = MTL_LPM_STATUS_LATCH_EN_OFFSET, + .lpm_reg_index = MTL_LPM_REG_INDEX, }; const struct pmc_bit_map mtl_ioem_pfear_map[] = { @@ -922,6 +937,13 @@ const struct pmc_reg_map mtl_ioem_reg_map = { .ltr_show_sts = mtl_ioep_ltr_show_map, .ltr_ignore_offset = CNP_PMC_LTR_IGNORE_OFFSET, .ltr_ignore_max = ADL_NUM_IP_IGN_ALLOWED, + .lpm_sts_latch_en_offset = MTL_LPM_STATUS_LATCH_EN_OFFSET, + .lpm_num_maps = ADL_LPM_NUM_MAPS, + .lpm_priority_offset = MTL_LPM_PRI_OFFSET, + .lpm_en_offset = MTL_LPM_EN_OFFSET, + .lpm_res_counter_step_x2 = TGL_PMC_LPM_RES_COUNTER_STEP_X2, + .lpm_residency_offset = MTL_LPM_RESIDENCY_OFFSET, + .lpm_reg_index = MTL_LPM_REG_INDEX, }; #define PMC_DEVID_SOCM 0x7e7f @@ -929,16 +951,19 @@ const struct pmc_reg_map mtl_ioem_reg_map = { #define PMC_DEVID_IOEM 0x7ebf static struct pmc_info mtl_pmc_info_list[] = { { - .devid = PMC_DEVID_SOCM, - .map = &mtl_socm_reg_map, + .guid = SOCP_LPM_REQ_GUID, + .devid = PMC_DEVID_SOCM, + .map = &mtl_socm_reg_map, }, { - .devid = PMC_DEVID_IOEP, - .map = &mtl_ioep_reg_map, + .guid = IOEP_LPM_REQ_GUID, + .devid = PMC_DEVID_IOEP, + .map = &mtl_ioep_reg_map, }, { - .devid = PMC_DEVID_IOEM, - .map = &mtl_ioem_reg_map + .guid = IOEM_LPM_REQ_GUID, + .devid = PMC_DEVID_IOEM, + .map = &mtl_ioem_reg_map }, {} }; @@ -1012,5 +1037,7 @@ int mtl_core_init(struct pmc_dev *pmcdev) dev_dbg(&pmcdev->pdev->dev, "ignoring GBE LTR\n"); pmc_core_send_ltr_ignore(pmcdev, 3); + ret = pmc_core_ssram_get_lpm_reqs(pmcdev); + return 0; }