From nobody Thu Oct 9 01:09:55 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E695427145B; Sat, 21 Jun 2025 21:05:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539939; cv=none; b=KqUVpJGMGREuZz515u4TNoMuqpzMWfWjjlhd9GdfoinUe/sDC+U4DXVKO23r6A+U3xQwIpiFR9zG5U6ThdYm6VkwbnCSIr2sNWNiZWhQaJoZFuM5UubnMdlZ7PL1vSYyZdd61OGNVKrRfE6/ySQ3R2SgRfcZNsUnQn9Hn0kJUvY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539939; c=relaxed/simple; bh=gili3zJVF7ZQ9a+PUONOkac6Rm442IXQ0FJb+Dn1TgA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kWaFP7EzCjqxAyuzIGG7noVYv+lVxemN95w315mUUD98S3U6XZadcvXl0YZiFD3P6dFD3rumehRiqMRZbKII2/BKCckUUNGVQUq0ENH9tx2bnJKI4/DGEGCc/qytrQhXxcmFnjfo8lUDdpkh+WoWXBhOMjJHGGGWom2ClZrpfG0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=h8GIuL/U; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="h8GIuL/U" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750539938; x=1782075938; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=gili3zJVF7ZQ9a+PUONOkac6Rm442IXQ0FJb+Dn1TgA=; b=h8GIuL/UEOHFqLJu1dyoGuEERjQEiL7eTU+Y6PjhhXu94VgRfY+DLz2s EJZJKa3ogPSKcFD2stTNgrXlrFX1LjHi2Z0SfbBA41JC9QvxpADeGCV1o 9IaOnwMEsLqKVlNOJp7krxbH8nZtkvgq5I8nRdsI+codcmhcd6HCVSaxS PkPkRNDqFlJnb6Z+sOklQ9TGgEgvdvHWlMdxczYLLmQwBU3Ta4q/UMUnI hr6A1di8keubbCfKsPSlekN3z6tUu6E3StkYYKVnmOdZLuQeUAz/baig/ wAsEtipwBNMa4K0Re1/vvqIPayh0DX5WbyT2mGNizzpkx4krpaC+mY9+2 Q==; X-CSE-ConnectionGUID: hb2PXp8WSNOsnG5BHNkCVg== X-CSE-MsgGUID: 8aIPXom8SEKZdxwN3Q5yVA== X-IronPort-AV: E=McAfee;i="6800,10657,11470"; a="63826248" X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="63826248" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:36 -0700 X-CSE-ConnectionGUID: 0bKJoyXJR8yuNDQ2ZOhVYA== X-CSE-MsgGUID: p3GtArLsR46iChr1FrJeuQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="155775322" Received: from mdroper-mobl2.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.222.74]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:33 -0700 From: Xi Pardee To: xi.pardee@linux.intel.com, irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1 1/5] platform/x86:intel/pmc: Enable SSRAM support for Lunar Lake Date: Sat, 21 Jun 2025 14:05:21 -0700 Message-ID: <20250621210529.237964-2-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250621210529.237964-1-xi.pardee@linux.intel.com> References: <20250621210529.237964-1-xi.pardee@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Enable Lunar Lake platforms to achieve PMC information from Intel PMC SSRAM Telemetry driver and substate requirements data from telemetry region. Signed-off-by: Xi Pardee --- drivers/platform/x86/intel/pmc/lnl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/platform/x86/intel/pmc/lnl.c b/drivers/platform/x86/in= tel/pmc/lnl.c index da513c234714b..e08a77c778c2c 100644 --- a/drivers/platform/x86/intel/pmc/lnl.c +++ b/drivers/platform/x86/intel/pmc/lnl.c @@ -13,6 +13,10 @@ =20 #include "core.h" =20 +#define SOCM_LPM_REQ_GUID 0x15099748 + +static const u8 LNL_LPM_REG_INDEX[] =3D {0, 4, 5, 6, 8, 9, 10, 11, 12, 13,= 14, 15, 16, 20}; + static const struct pmc_bit_map lnl_ltr_show_map[] =3D { {"SOUTHPORT_A", CNP_PMC_LTR_SPA}, {"SOUTHPORT_B", CNP_PMC_LTR_SPB}, @@ -528,6 +532,16 @@ static const struct pmc_reg_map lnl_socm_reg_map =3D { .lpm_live_status_offset =3D MTL_LPM_LIVE_STATUS_OFFSET, .s0ix_blocker_maps =3D lnl_blk_maps, .s0ix_blocker_offset =3D LNL_S0IX_BLOCKER_OFFSET, + .lpm_reg_index =3D LNL_LPM_REG_INDEX, +}; + +static struct pmc_info lnl_pmc_info_list[] =3D { + { + .guid =3D SOCM_LPM_REQ_GUID, + .devid =3D PMC_DEVID_LNL_SOCM, + .map =3D &lnl_socm_reg_map, + }, + {} }; =20 #define LNL_NPU_PCI_DEV 0x643e @@ -557,6 +571,8 @@ static int lnl_core_init(struct pmc_dev *pmcdev, struct= pmc_dev_info *pmc_dev_in } =20 struct pmc_dev_info lnl_pmc_dev =3D { + .pci_func =3D 2, + .regmap_list =3D lnl_pmc_info_list, .map =3D &lnl_socm_reg_map, .suspend =3D cnl_suspend, .resume =3D lnl_resume, --=20 2.43.0 From nobody Thu Oct 9 01:09:55 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2085C271464; Sat, 21 Jun 2025 21:05:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539940; cv=none; b=Oh0xDrHU5hPcVXjciU3Iw9+fGqYkGJfq2CQttGPNE8do8321HNC7Wbzfv6ewtVSB4RblCfyfbY0y8E2RGcNHlpB5k2oqSqE4GsJQoiGZRLZUfc3o9oX3upMmShiPGzrd8Z4C5YspqfWyhrJLCuvlBEbL+nQbZVKlLfZw9+NS+x4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539940; c=relaxed/simple; bh=pDEK6l4tV93DlVFZwk/S5bgrjdnLgvhPs43YW/brNi4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BuOi6g+k4Z8ScX/2xhDbkV+FvjgjWf/WhTlm7niMJOHbkPqrpD1sWOL3UFSacYFhgpOFWbj6fsmp69RJqmZyRvtIxp83Sv6xC8lDvDeBd7iwS/Yarq+/NwaU9WQxfQCNMkwYJpwMgFda1rCpeoo9GThr7T49CWDKgsZqof5PVQY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=CwdfdXZ8; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="CwdfdXZ8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750539938; x=1782075938; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=pDEK6l4tV93DlVFZwk/S5bgrjdnLgvhPs43YW/brNi4=; b=CwdfdXZ87wvswANysRfNcgQ27juTiM9lJuqb5Uu0QGAIyTp9V7jigVNl jPF8FpaHcEdsWv+TV8H7AE80VNIDXRsRhmfGVyqJzV7aQAHjByTT+zFWG kOGUj/ZO8r3hRlXQtTF5RKEvKSlUDRqP83KsOqNOPUcCtOW2IB6bkiT51 2wvhOlkft8sEfGZ8DWZJPF8J2KXOUjt2NIlhpVvi1mry3W8hDI4dEHCM0 pO5MQZuCVkli0zZo2WkhBecV+WpX2ic4Pe6crP/g6jOhwOKFSKvHMZjck jVlRLYtdY6nqguFhRx4JG1tuBzmqgHAytH+7ASNjzvd1CBwHg8D37SDvl w==; X-CSE-ConnectionGUID: mehO/kGETy2zv6uMD0/qlg== X-CSE-MsgGUID: ndH/kw/zQ+Kdw0Cxv71i8A== X-IronPort-AV: E=McAfee;i="6800,10657,11470"; a="63826253" X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="63826253" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:38 -0700 X-CSE-ConnectionGUID: UdRUQIrlRGysdk2ovDp2uQ== X-CSE-MsgGUID: g05OrzokQZ6sQuze66kJ0w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="155775325" Received: from mdroper-mobl2.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.222.74]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:36 -0700 From: Xi Pardee To: xi.pardee@linux.intel.com, irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1 2/5] platform/x86:intel/pmc: Move telemetry endpoint register handling Date: Sat, 21 Jun 2025 14:05:22 -0700 Message-ID: <20250621210529.237964-3-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250621210529.237964-1-xi.pardee@linux.intel.com> References: <20250621210529.237964-1-xi.pardee@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move telemetry endpoint handling to pmc_core_get_telem_info(). This is a preparation patch to introduce a new table to obtain Low Power Mode substate requirement data for platforms starting from Panther Lake. Signed-off-by: Xi Pardee --- drivers/platform/x86/intel/pmc/core.c | 51 +++++++++++++-------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/i= ntel/pmc/core.c index 540cd2fb0673b..a1dd80bdbd413 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -1399,36 +1399,23 @@ static u32 pmc_core_find_guid(struct pmc_info *list= , const struct pmc_reg_map *m * +----+---------------------------------------------------------+ * */ -static int pmc_core_get_lpm_req(struct pmc_dev *pmcdev, struct pmc *pmc, s= truct pci_dev *pcidev) +static int pmc_core_pmt_get_lpm_req(struct pmc_dev *pmcdev, struct pmc *pm= c, + struct telem_endpoint *ep) { - struct telem_endpoint *ep; const u8 *lpm_indices; int num_maps, mode_offset =3D 0; int ret, mode; int lpm_size; - u32 guid; =20 lpm_indices =3D pmc->map->lpm_reg_index; num_maps =3D pmc->map->lpm_num_maps; lpm_size =3D LPM_MAX_NUM_MODES * num_maps; =20 - guid =3D pmc_core_find_guid(pmcdev->regmap_list, pmc->map); - if (!guid) - return -ENXIO; - - ep =3D pmt_telem_find_and_register_endpoint(pcidev, guid, 0); - if (IS_ERR(ep)) { - dev_dbg(&pmcdev->pdev->dev, "couldn't get telem endpoint %pe", ep); - return -EPROBE_DEFER; - } - pmc->lpm_req_regs =3D devm_kzalloc(&pmcdev->pdev->dev, lpm_size * sizeof(u32), GFP_KERNEL); - if (!pmc->lpm_req_regs) { - ret =3D -ENOMEM; - goto unregister_ep; - } + if (!pmc->lpm_req_regs) + return -ENOMEM; =20 mode_offset =3D LPM_HEADER_OFFSET + LPM_MODE_OFFSET; pmc_for_each_mode(mode, pmcdev) { @@ -1442,23 +1429,21 @@ static int pmc_core_get_lpm_req(struct pmc_dev *pmc= dev, struct pmc *pmc, struct if (ret) { dev_err(&pmcdev->pdev->dev, "couldn't read Low Power Mode requirements: %d\n", ret); - goto unregister_ep; + return ret; } ++req_offset; } mode_offset +=3D LPM_REG_COUNT + LPM_MODE_OFFSET; } - -unregister_ep: - pmt_telem_unregister_endpoint(ep); - return ret; } =20 -static int pmc_core_ssram_get_lpm_reqs(struct pmc_dev *pmcdev, int func) +static int pmc_core_get_telem_info(struct pmc_dev *pmcdev, int func) { struct pci_dev *pcidev __free(pci_dev_put) =3D NULL; + struct telem_endpoint *ep; unsigned int i; + u32 guid; int ret; =20 pcidev =3D pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(20, func)); @@ -1466,10 +1451,24 @@ static int pmc_core_ssram_get_lpm_reqs(struct pmc_d= ev *pmcdev, int func) return -ENODEV; =20 for (i =3D 0; i < ARRAY_SIZE(pmcdev->pmcs); ++i) { - if (!pmcdev->pmcs[i]) + struct pmc *pmc; + + pmc =3D pmcdev->pmcs[i]; + if (!pmc) continue; =20 - ret =3D pmc_core_get_lpm_req(pmcdev, pmcdev->pmcs[i], pcidev); + guid =3D pmc_core_find_guid(pmcdev->regmap_list, pmc->map); + if (!guid) + return -ENXIO; + + ep =3D pmt_telem_find_and_register_endpoint(pcidev, guid, 0); + if (IS_ERR(ep)) { + dev_dbg(&pmcdev->pdev->dev, "couldn't get telem endpoint %pe", ep); + return -EPROBE_DEFER; + } + + ret =3D pmc_core_pmt_get_lpm_req(pmcdev, pmc, ep); + pmt_telem_unregister_endpoint(ep); if (ret) return ret; } @@ -1583,7 +1582,7 @@ int generic_core_init(struct pmc_dev *pmcdev, struct = pmc_dev_info *pmc_dev_info) pmc_core_punit_pmt_init(pmcdev, pmc_dev_info->dmu_guid); =20 if (ssram) { - ret =3D pmc_core_ssram_get_lpm_reqs(pmcdev, pmc_dev_info->pci_func); + ret =3D pmc_core_get_telem_info(pmcdev, pmc_dev_info->pci_func); if (ret) goto unmap_regbase; } --=20 2.43.0 From nobody Thu Oct 9 01:09:55 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C35DE271A9D; Sat, 21 Jun 2025 21:05:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539941; cv=none; b=Jg/5jyaEWBJUYoRXYmwUwvUONCA8JNgsj7BnQGdXI7CIQ9kdBNMAaeAxCmD34Nfn5PN85o3bQIn5d7+kGml3gwrN+cjFlo29S+QS/oCEaoHvK0QOcIT30lofLrceGcaajqSjSIhaFbR5vRDwUNwJB4zp0xHg2/khAKF/6MLPImI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539941; c=relaxed/simple; bh=CDe/iMsRALBkORDbKS3tYGiYIGj+1h732grU6OFaPI8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=e1ImrvrGZgZBdS1rxGpb9V12EQdq1Nk2ahWO3L8aCgGPUB7BpUcNk4QFnjsBdcBI3BgjHsLilXFaYeNesdQz007RwaSKjquVnfjNHKWdPBegBjlG10tVc+GN9wEdqBUvfTTfPvy7w5nM0bu3MmX3gABfqTHtuC0S6C4KV4dGMjI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=U8MC4hAX; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="U8MC4hAX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750539940; x=1782075940; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=CDe/iMsRALBkORDbKS3tYGiYIGj+1h732grU6OFaPI8=; b=U8MC4hAXsN1ZPlyend16DD8c5GdIyZUIyPzF4U+h6VDZYwq8ug44QV5I P3h1TEiRyG5UVmm/kEUgFu4ibAnJm+lQ38qZd7G95HinV/QoCfcDHx1aK KZ3XBHgz0yJHlrd1FfmtLnhnLXlVTdE9F4fBfpBFfIzunryL+jNZNE21S ixsRNuiyNzT52d8KehP36pffLMbIRg+rzHVWFEkps55tKzqLU+RFssjjH x/J/zjnFs+3I+AhYlGcLSM1Mjg96o7JQTGgf23yZ9+rq6FCLWjolcqTto yiGsQBep6lWQHyyRpHageugiiqMjishYM9835xJfgjuX+83rrF6gpB8P8 A==; X-CSE-ConnectionGUID: jvD1iIr6RxKugaUcudOcMg== X-CSE-MsgGUID: 1ugwhpxgSUqwH+eWHNLcjQ== X-IronPort-AV: E=McAfee;i="6800,10657,11470"; a="63826256" X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="63826256" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:40 -0700 X-CSE-ConnectionGUID: C3/LBdpEQ3CQShF7K53bJQ== X-CSE-MsgGUID: 2JygPBjDS8q1+3IYj6ox9A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="155775326" Received: from mdroper-mobl2.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.222.74]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:37 -0700 From: Xi Pardee To: xi.pardee@linux.intel.com, irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1 3/5] platform/x86:intel/pmc: Improve function to show substate header Date: Sat, 21 Jun 2025 14:05:23 -0700 Message-ID: <20250621210529.237964-4-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250621210529.237964-1-xi.pardee@linux.intel.com> References: <20250621210529.237964-1-xi.pardee@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Refactor pmc_core_substate_req_header_show() to accept a new argument. This is a preparation patch to introduce a new way to show Low Power Mode substate requirement data for platforms starting from Panther Lake. Increased the size for the name column as the Low Power Mode requirement register name is longer in newer platforms. Signed-off-by: Xi Pardee --- drivers/platform/x86/intel/pmc/core.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/i= ntel/pmc/core.c index a1dd80bdbd413..47cc5120e7dd6 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -828,17 +828,20 @@ static int pmc_core_substate_l_sts_regs_show(struct s= eq_file *s, void *unused) } DEFINE_SHOW_ATTRIBUTE(pmc_core_substate_l_sts_regs); =20 -static void pmc_core_substate_req_header_show(struct seq_file *s, int pmc_= index) +static void pmc_core_substate_req_header_show(struct seq_file *s, int pmc_= index, char *name) { struct pmc_dev *pmcdev =3D s->private; int mode; =20 - seq_printf(s, "%30s |", "Element"); + seq_printf(s, "%40s |", "Element"); pmc_for_each_mode(mode, pmcdev) seq_printf(s, " %9s |", pmc_lpm_modes[mode]); =20 - seq_printf(s, " %9s |", "Status"); - seq_printf(s, " %11s |\n", "Live Status"); + if (!strcmp(name, "Status")) { + seq_printf(s, " %9s |", name); + seq_printf(s, " %11s |\n", "Live Status"); + } else + seq_printf(s, " %9s |\n", name); } =20 static int pmc_core_substate_req_regs_show(struct seq_file *s, void *unuse= d) @@ -872,7 +875,7 @@ static int pmc_core_substate_req_regs_show(struct seq_f= ile *s, void *unused) continue; =20 /* Display the header */ - pmc_core_substate_req_header_show(s, pmc_index); + pmc_core_substate_req_header_show(s, pmc_index, "Status"); =20 /* Loop over maps */ for (mp =3D 0; mp < num_maps; mp++) { @@ -910,7 +913,7 @@ static int pmc_core_substate_req_regs_show(struct seq_f= ile *s, void *unused) } =20 /* Display the element name in the first column */ - seq_printf(s, "pmc%d: %26s |", pmc_index, map[i].name); + seq_printf(s, "pmc%d: %34s |", pmc_index, map[i].name); =20 /* Loop over the enabled states and display if required */ pmc_for_each_mode(mode, pmcdev) { --=20 2.43.0 From nobody Thu Oct 9 01:09:55 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 716F5272E68; Sat, 21 Jun 2025 21:05:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539943; cv=none; b=GEsPZeRBG+RpGERdvkg58o0tbkXjjlfNKBKdXwcFRiwy9yF/hl/RUshp7/+OJqD60KnI5VbXs2u5XWhZBvedj0n8QW1s4fiR951vE3mxWkI//q8udJEdLsRB0Qz+7BKFKUoXDsWHh7k5THzbpt9kqv7R/bMzSz5ExHyQwQsTC3Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539943; c=relaxed/simple; bh=4rh1FkmrzxmZC2GZTnzljFNknjhz71lLWDiIEsI/sCE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VO7a7Eg8XcD06LrVfPSvBHYpaL3bqOaoNrq0dXUOGViSn44RlzSR//cTF6WnsiZOc7/CmYHc2tcg8xL+qkurKIA5Pr1DRHmTSdFKRZC92rc/o/bG9xySqUIQwhUIDoD2d/p6cNhx+9besIdXpyYUJRMVGIGR5qIdF3Ge5nxb6wk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=WJxFdRqB; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="WJxFdRqB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750539942; x=1782075942; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=4rh1FkmrzxmZC2GZTnzljFNknjhz71lLWDiIEsI/sCE=; b=WJxFdRqBOQj71uqhw2hqbw6Xhr3dgOPhJjqK5jE7+yo28QomdyrUaVrk tL7RoL27IlgdLuFzeGBuNfQ7uUu+07q2z8zdohLlVCo3wSbROxvoL9UZ6 E7W5qP9DntiFcjGXE7ybkKycAiFgPOLKCxq9Wd7HwKNQxs7/VFU3+hKV3 v35JAkRNB38aMzoxUxMlKMKWxJNvQmK9BmdchpLLAyxKPCqe26/fgirt8 y6PQwUKa52gj8wG2eflYaRNK00gQah+MYCFAwskC1BgsuFJYL0Y5qhK5i q7BrrsL9ZvHWf37htZkOgGr2VfbQCORjDReFczlbVgZEcqtDxCELMmYNQ Q==; X-CSE-ConnectionGUID: v64KvIYpRwaFZHhBQTxVgg== X-CSE-MsgGUID: 1ozVjUCWS16o/uqLLUkyxg== X-IronPort-AV: E=McAfee;i="6800,10657,11470"; a="63826260" X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="63826260" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:41 -0700 X-CSE-ConnectionGUID: 1ghN2tHFSYWPV2quer8YXQ== X-CSE-MsgGUID: oK3TAf2aQCuL+vj8hPeoyg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="155775327" Received: from mdroper-mobl2.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.222.74]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:39 -0700 From: Xi Pardee To: xi.pardee@linux.intel.com, irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1 4/5] platform/x86:intel/pmc: Show substate requirement for S0ix blockers Date: Sat, 21 Jun 2025 14:05:24 -0700 Message-ID: <20250621210529.237964-5-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250621210529.237964-1-xi.pardee@linux.intel.com> References: <20250621210529.237964-1-xi.pardee@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support to read and show S0ix blocker substate requirements. Starting from Panther Lake, substate requirement data is provided based on S0ix blockers instead of all low power mode requirements. For platforms that support this new feature, add support to display substate requirements based on S0ix blockers. Change the "substate_requirements" attribute of Intel PMC Core driver to show the substate requirements for each S0ix blocker and the corresponding S0ix blocker value. Signed-off-by: Xi Pardee --- drivers/platform/x86/intel/pmc/arl.c | 1 + drivers/platform/x86/intel/pmc/core.c | 109 ++++++++++++++++++++++++-- drivers/platform/x86/intel/pmc/core.h | 12 +++ drivers/platform/x86/intel/pmc/lnl.c | 1 + drivers/platform/x86/intel/pmc/mtl.c | 1 + 5 files changed, 118 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/arl.c b/drivers/platform/x86/in= tel/pmc/arl.c index 9d66d65e75779..f04c67738d721 100644 --- a/drivers/platform/x86/intel/pmc/arl.c +++ b/drivers/platform/x86/intel/pmc/arl.c @@ -732,6 +732,7 @@ struct pmc_dev_info arl_pmc_dev =3D { =20 struct pmc_dev_info arl_h_pmc_dev =3D { .pci_func =3D 2, + .telem_info =3D SUB_REQ_LPM, .dmu_guid =3D ARL_PMT_DMU_GUID, .regmap_list =3D arl_pmc_info_list, .map =3D &mtl_socm_reg_map, diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/i= ntel/pmc/core.c index 47cc5120e7dd6..026a28bb7509c 100644 --- a/drivers/platform/x86/intel/pmc/core.c +++ b/drivers/platform/x86/intel/pmc/core.c @@ -844,6 +844,56 @@ static void pmc_core_substate_req_header_show(struct s= eq_file *s, int pmc_index, seq_printf(s, " %9s |\n", name); } =20 +static int pmc_core_substate_blk_req_show(struct seq_file *s, void *unused) +{ + struct pmc_dev *pmcdev =3D s->private; + unsigned int pmc_index; + u32 *blk_sub_req_regs; + + for (pmc_index =3D 0; pmc_index < ARRAY_SIZE(pmcdev->pmcs); pmc_index++) { + const struct pmc_bit_map **maps; + unsigned int arr_size, r_idx; + u32 offset, counter; + struct pmc *pmc; + + pmc =3D pmcdev->pmcs[pmc_index]; + if (!pmc || !pmc->blk_sub_req_regs) + continue; + + blk_sub_req_regs =3D pmc->blk_sub_req_regs; + maps =3D pmc->map->s0ix_blocker_maps; + offset =3D pmc->map->s0ix_blocker_offset; + arr_size =3D pmc_core_lpm_get_arr_size(maps); + + /* Display the header */ + pmc_core_substate_req_header_show(s, pmc_index, "Value"); + + for (r_idx =3D 0; r_idx < arr_size; r_idx++) { + const struct pmc_bit_map *map; + + for (map =3D maps[r_idx]; map->name; map++) { + int mode; + + if (!map->blk) + continue; + + counter =3D pmc_core_reg_read(pmc, offset); + seq_printf(s, "pmc%d: %34s |", pmc_index, map->name); + pmc_for_each_mode(mode, pmcdev) { + bool required =3D *blk_sub_req_regs & BIT(mode); + + seq_printf(s, " %9s |", required ? "Required" : " "); + } + seq_printf(s, " %9d |\n", counter); + offset +=3D map->blk * S0IX_BLK_SIZE; + blk_sub_req_regs++; + } + } + } + return 0; +} +DEFINE_SHOW_ATTRIBUTE(pmc_core_substate_blk_req); + static int pmc_core_substate_req_regs_show(struct seq_file *s, void *unuse= d) { struct pmc_dev *pmcdev =3D s->private; @@ -1335,7 +1385,10 @@ static void pmc_core_dbgfs_register(struct pmc_dev *= pmcdev) debugfs_create_file("substate_requirements", 0444, pmcdev->dbgfs_dir, pmcdev, &pmc_core_substate_req_regs_fops); - } + } else if (primary_pmc->blk_sub_req_regs) + debugfs_create_file("substate_requirements", 0444, + pmcdev->dbgfs_dir, pmcdev, + &pmc_core_substate_blk_req_fops); =20 if (primary_pmc->map->pson_residency_offset && pmc_core_is_pson_residency= _enabled(pmcdev)) { debugfs_create_file("pson_residency_usec", 0444, @@ -1441,7 +1494,38 @@ static int pmc_core_pmt_get_lpm_req(struct pmc_dev *= pmcdev, struct pmc *pmc, return ret; } =20 -static int pmc_core_get_telem_info(struct pmc_dev *pmcdev, int func) +static int pmc_core_pmt_get_blk_sub_req(struct pmc_dev *pmcdev, struct pmc= *pmc, + struct telem_endpoint *ep) +{ + u32 num_blocker, sample_id; + unsigned int index; + u32 *req_offset; + int ret; + + num_blocker =3D pmc->map->num_s0ix_blocker; + sample_id =3D pmc->map->blocker_req_offset; + + pmc->blk_sub_req_regs =3D devm_kzalloc(&pmcdev->pdev->dev, + num_blocker * sizeof(u32), + GFP_KERNEL); + if (!pmc->blk_sub_req_regs) + ret =3D -ENOMEM; + + req_offset =3D pmc->blk_sub_req_regs; + for (index =3D 0; index < num_blocker; index++) { + ret =3D pmt_telem_read32(ep, sample_id, req_offset, 1); + if (ret) { + dev_err(&pmcdev->pdev->dev, + "couldn't read Low Power Mode requirements: %d\n", ret); + return ret; + } + sample_id++; + req_offset++; + } + return ret; +} + +static int pmc_core_get_telem_info(struct pmc_dev *pmcdev, int func, unsig= ned int telem_info) { struct pci_dev *pcidev __free(pci_dev_put) =3D NULL; struct telem_endpoint *ep; @@ -1470,13 +1554,24 @@ static int pmc_core_get_telem_info(struct pmc_dev *= pmcdev, int func) return -EPROBE_DEFER; } =20 - ret =3D pmc_core_pmt_get_lpm_req(pmcdev, pmc, ep); - pmt_telem_unregister_endpoint(ep); + if (telem_info & SUB_REQ_LPM) + ret =3D pmc_core_pmt_get_lpm_req(pmcdev, pmc, ep); if (ret) - return ret; + goto unregister_ep; + + if (telem_info & SUB_REQ_BLK) + ret =3D pmc_core_pmt_get_blk_sub_req(pmcdev, pmc, ep); + if (ret) + goto unregister_ep; + + pmt_telem_unregister_endpoint(ep); } =20 return 0; + +unregister_ep: + pmt_telem_unregister_endpoint(ep); + return ret; } =20 static const struct pmc_reg_map *pmc_core_find_regmap(struct pmc_info *lis= t, u16 devid) @@ -1585,7 +1680,9 @@ int generic_core_init(struct pmc_dev *pmcdev, struct = pmc_dev_info *pmc_dev_info) pmc_core_punit_pmt_init(pmcdev, pmc_dev_info->dmu_guid); =20 if (ssram) { - ret =3D pmc_core_get_telem_info(pmcdev, pmc_dev_info->pci_func); + ret =3D pmc_core_get_telem_info(pmcdev, + pmc_dev_info->pci_func, + pmc_dev_info->telem_info); if (ret) goto unmap_regbase; } diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/i= ntel/pmc/core.h index 4a94a4ee031e6..d8c7b28493055 100644 --- a/drivers/platform/x86/intel/pmc/core.h +++ b/drivers/platform/x86/intel/pmc/core.h @@ -29,6 +29,10 @@ struct telem_endpoint; #define LPM_REG_COUNT 28 #define LPM_MODE_OFFSET 1 =20 +/* Telemetry Endpoint Info bits */ +#define SUB_REQ_LPM 0x01 /* Substate requirement for low power mode requi= rements */ +#define SUB_REQ_BLK 0x02 /* Substate requirement for S0ix blockers */ + /* Sunrise Point Power Management Controller PCI Device ID */ #define SPT_PMC_PCI_DEVICE_ID 0x9d21 #define SPT_PMC_BASE_ADDR_OFFSET 0x48 @@ -344,6 +348,8 @@ struct pmc_bit_map { * @pm_read_disable_bit: Bit index to read PMC_READ_DISABLE * @slps0_dbg_offset: PWRMBASE offset to SLP_S0_DEBUG_REG* * @s0ix_blocker_offset PWRMBASE offset to S0ix blocker counter + * @num_s0ix_blocker: Number of S0ix blockers + * @blocker_req_offset: Telemetry offset to S0ix blocker low power mode su= bstate requirement table * * Each PCH has unique set of register offsets and bit indexes. This struc= ture * captures them to have a common implementation. @@ -369,6 +375,8 @@ struct pmc_reg_map { const u32 ltr_ignore_max; const u32 pm_vric1_offset; const u32 s0ix_blocker_offset; + const u32 num_s0ix_blocker; + const u32 blocker_req_offset; /* Low Power Mode registers */ const int lpm_num_maps; const int lpm_num_modes; @@ -404,6 +412,7 @@ struct pmc_info { * @map: pointer to pmc_reg_map struct that contains platform * specific attributes * @lpm_req_regs: List of substate requirements + * @blk_sub_req_reqs: List of registers showing substate requirements for = S0ix blockers * @ltr_ign: Holds LTR ignore data while suspended * * pmc contains info about one power management controller device. @@ -413,6 +422,7 @@ struct pmc { void __iomem *regbase; const struct pmc_reg_map *map; u32 *lpm_req_regs; + u32 *blk_sub_req_regs; u32 ltr_ign; }; =20 @@ -468,6 +478,7 @@ enum pmc_index { /** * struct pmc_dev_info - Structure to keep PMC device info * @pci_func: Function number of the primary PMC + * @telem_info: Bitmask to indicate which telemetry info is available * @dmu_guid: Die Management Unit GUID * @regmap_list: Pointer to a list of pmc_info structure that could be * available for the platform. When set, this field implies @@ -480,6 +491,7 @@ enum pmc_index { */ struct pmc_dev_info { u8 pci_func; + u8 telem_info; u32 dmu_guid; struct pmc_info *regmap_list; const struct pmc_reg_map *map; diff --git a/drivers/platform/x86/intel/pmc/lnl.c b/drivers/platform/x86/in= tel/pmc/lnl.c index e08a77c778c2c..ec9e79f6cd913 100644 --- a/drivers/platform/x86/intel/pmc/lnl.c +++ b/drivers/platform/x86/intel/pmc/lnl.c @@ -572,6 +572,7 @@ static int lnl_core_init(struct pmc_dev *pmcdev, struct= pmc_dev_info *pmc_dev_in =20 struct pmc_dev_info lnl_pmc_dev =3D { .pci_func =3D 2, + .telem_info =3D SUB_REQ_LPM, .regmap_list =3D lnl_pmc_info_list, .map =3D &lnl_socm_reg_map, .suspend =3D cnl_suspend, diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/in= tel/pmc/mtl.c index faa13a7ee688f..c58a871e2e0df 100644 --- a/drivers/platform/x86/intel/pmc/mtl.c +++ b/drivers/platform/x86/intel/pmc/mtl.c @@ -994,6 +994,7 @@ static int mtl_core_init(struct pmc_dev *pmcdev, struct= pmc_dev_info *pmc_dev_in =20 struct pmc_dev_info mtl_pmc_dev =3D { .pci_func =3D 2, + .telem_info =3D SUB_REQ_LPM, .dmu_guid =3D MTL_PMT_DMU_GUID, .regmap_list =3D mtl_pmc_info_list, .map =3D &mtl_socm_reg_map, --=20 2.43.0 From nobody Thu Oct 9 01:09:55 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D7F2273D7F; Sat, 21 Jun 2025 21:05:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539944; cv=none; b=KJgTK1DVl0gf3hIhVmKdnq+bm6H9aWUUWpCV+IZwPhwsf55n0UuPOCoUzLUDi7InslV8/anlkh2LXK5kgrraB5pFlnaxZqnEJF1Om0ja0XjY1vMy3eYu2fNrabe1dfbD5iONtKLj4/fgcZK1no6WddIuqWu/Z3/CeOwzJQi49zA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750539944; c=relaxed/simple; bh=SMiK8R4rvJPitqeDKcJiQw7hgXniGdGbaSll/QfassA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qEP9V/D/rBJsMG3QMyBSPPXrfvyhK9t/cw60F0llJ7n6wyyLwOJwgqr/xNf98dR7xdjSlrqk528LSKR4rkZKD2FNlTfQtkjw9y6peIrBHN5Mo3A/B/RN97VgVOuKfWNzmf1MgSCuhCyMk2ZkKYmVAWgpd/T6x40wQCFNNBo3CRg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Kc3WlPrY; arc=none smtp.client-ip=198.175.65.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Kc3WlPrY" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750539944; x=1782075944; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=SMiK8R4rvJPitqeDKcJiQw7hgXniGdGbaSll/QfassA=; b=Kc3WlPrYRDodOvYwCix9g9qjrjIccScDNrM+JElYmCKb2yvPiXNR1dM3 zcjEyDQR7p/Pxby35ERcl/9tqfcDRzDWn+fadAXhI4H/IAvvU/LiUd9KL S7U2FQuqbFcwEHUYvup0bK7XgF7OCgBNvAyBM0dN0naccmb/1PVn7eK4w VwQaZPa8OKJ+fsKxPrJ3cliIzKaHlBjDDV+DY+x508kzee6+KkZHhCl7X LBmJ4JIZxuLSGyvx52GC8zrg5WeGZLUwSiVxOFTLVnKBThD3VyKc4vzs9 1sWstv7S8pkKfYjISVlq4sDpoDP+ZfmaC1md5evIeUk39zdLhp2D6pS2x Q==; X-CSE-ConnectionGUID: 6gDswicOSkGJpbNUPo8mGA== X-CSE-MsgGUID: xfXqSYAyTiyVkRpNjEB9+g== X-IronPort-AV: E=McAfee;i="6800,10657,11470"; a="63826263" X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="63826263" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:43 -0700 X-CSE-ConnectionGUID: tC0UU2EmRqqfqw525sJZHg== X-CSE-MsgGUID: KTnUx5w6QIeXuFN7eQvtiQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,254,1744095600"; d="scan'208";a="155775328" Received: from mdroper-mobl2.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.222.74]) by orviesa004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jun 2025 14:05:41 -0700 From: Xi Pardee To: xi.pardee@linux.intel.com, irenic.rajneesh@gmail.com, david.e.box@linux.intel.com, hdegoede@redhat.com, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH v1 5/5] platform/x86:intel/pmc: Enable SSRAM support for Panther Lake Date: Sat, 21 Jun 2025 14:05:25 -0700 Message-ID: <20250621210529.237964-6-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250621210529.237964-1-xi.pardee@linux.intel.com> References: <20250621210529.237964-1-xi.pardee@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Enable Panther Lake platforms to achieve PMC information from Intel PMC SSRAM Telemetry driver and substate requirements data from telemetry region. Signed-off-by: Xi Pardee --- drivers/platform/x86/intel/pmc/core.h | 2 ++ drivers/platform/x86/intel/pmc/ptl.c | 30 +++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/i= ntel/pmc/core.h index d8c7b28493055..cdb32f2203cff 100644 --- a/drivers/platform/x86/intel/pmc/core.h +++ b/drivers/platform/x86/intel/pmc/core.h @@ -301,6 +301,8 @@ enum ppfear_regs { #define PTL_PMC_LTR_CUR_ASLT 0x1C28 #define PTL_PMC_LTR_CUR_PLT 0x1C2C #define PTL_PCD_PMC_MMIO_REG_LEN 0x31A8 +#define PTL_NUM_S0IX_BLOCKER 106 +#define PTL_BLK_REQ_OFFSET 55 =20 /* SSRAM PMC Device ID */ /* LNL */ diff --git a/drivers/platform/x86/intel/pmc/ptl.c b/drivers/platform/x86/in= tel/pmc/ptl.c index 394515af60d60..48be79b4e769f 100644 --- a/drivers/platform/x86/intel/pmc/ptl.c +++ b/drivers/platform/x86/intel/pmc/ptl.c @@ -10,6 +10,17 @@ =20 #include "core.h" =20 +/* PMC SSRAM PMT Telemetry GUIDS */ +#define PCDP_LPM_REQ_GUID 0x47179370 + +/* + * Die Mapping to Product. + * Product PCDDie + * PTL-H PCD-H + * PTL-P PCD-P + * PTL-U PCD-P + */ + static const struct pmc_bit_map ptl_pcdp_pfear_map[] =3D { {"PMC_0", BIT(0)}, {"FUSE_OSSE", BIT(1)}, @@ -515,6 +526,22 @@ static const struct pmc_reg_map ptl_pcdp_reg_map =3D { .lpm_live_status_offset =3D MTL_LPM_LIVE_STATUS_OFFSET, .s0ix_blocker_maps =3D ptl_pcdp_blk_maps, .s0ix_blocker_offset =3D LNL_S0IX_BLOCKER_OFFSET, + .num_s0ix_blocker =3D PTL_NUM_S0IX_BLOCKER, + .blocker_req_offset =3D PTL_BLK_REQ_OFFSET, +}; + +static struct pmc_info ptl_pmc_info_list[] =3D { + { + .guid =3D PCDP_LPM_REQ_GUID, + .devid =3D PMC_DEVID_PTL_PCDH, + .map =3D &ptl_pcdp_reg_map, + }, + { + .guid =3D PCDP_LPM_REQ_GUID, + .devid =3D PMC_DEVID_PTL_PCDP, + .map =3D &ptl_pcdp_reg_map, + }, + {} }; =20 #define PTL_NPU_PCI_DEV 0xb03e @@ -543,6 +570,9 @@ static int ptl_core_init(struct pmc_dev *pmcdev, struct= pmc_dev_info *pmc_dev_in } =20 struct pmc_dev_info ptl_pmc_dev =3D { + .pci_func =3D 2, + .telem_info =3D SUB_REQ_BLK, + .regmap_list =3D ptl_pmc_info_list, .map =3D &ptl_pcdp_reg_map, .suspend =3D cnl_suspend, .resume =3D ptl_resume, --=20 2.43.0