From nobody Wed Oct 8 19:04:37 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 C95391A08BC; Wed, 25 Jun 2025 06:31:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833111; cv=none; b=ivBCh1fkbfXrfK0Y7WZKojaNh73cLLn2NhkuTGohwcDujUwtUMtas1aR4jFFL+9Fv7CiO18c8ab5AGVO4bmmxZX0F0ph+p3TwHXEf2Md0WlKVpe1ZKPl+DYO2NaSTzjAsHMgtYM+tGetRX6HkAGTcHd/jcYUjQGU4D1RW4VVj7w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833111; c=relaxed/simple; bh=gili3zJVF7ZQ9a+PUONOkac6Rm442IXQ0FJb+Dn1TgA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q0hMmFnDYIWgiDJG3fmmpoXZhBftpKP6cgDWnj41WERijicGDIIE2n4NEv9pGnvfUJmMl7Sut2sbwZxAqUdAhIZLDyKsqsbRyf6c3siQ0KNtMC+2jyy9spkH3+BRoPfsr3zIDvzQaCzTb8jgNcUG0knXfMizgADcbhilGNJdD3E= 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=LYM43tQX; arc=none smtp.client-ip=198.175.65.16 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="LYM43tQX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750833110; x=1782369110; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=gili3zJVF7ZQ9a+PUONOkac6Rm442IXQ0FJb+Dn1TgA=; b=LYM43tQXynulpfj1efVcfS8oTV0OQh2lqPA6P35Hw01Hm6hmLbmU+mi6 H013fReh1Nf+uTo4XjhRG0tJ0s0JfT9mSBQdadhPixSzBgX4LXi+JGFnc xYU0KAaiJPX9P0r5VsEswwVbC1kfHw+HU4cgvmjhllZ/yEbYoWS+wvzZh f8YMWjk0NvN6P7AkC2P00PdtpXK3FFvJYezrqBS62vwZYpYW19wKQbFq2 pMyERoPGeQ36cVlMc0PjMZf9dUF9nlvzy0+YfLoYYWfkvpgGZHt9xK2Ls T4Ir64hK7X6TZWhsrMyXK6txh+wYYBdqEI1dzfP/GaxfRXaKo1V4v/hNS Q==; X-CSE-ConnectionGUID: 4hpAklPFQTaIbKIUIhZuOA== X-CSE-MsgGUID: NZNGkdKqSvqtPtQGe8ucjg== X-IronPort-AV: E=McAfee;i="6800,10657,11474"; a="53187458" X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="53187458" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:49 -0700 X-CSE-ConnectionGUID: UjqQZ+DxT2+emUl8ZHy0Qg== X-CSE-MsgGUID: +igOKoMORrKQpR8KzakBWQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="152257574" Received: from daliomra-mobl3.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.223.140]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:48 -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 v2 1/5] platform/x86:intel/pmc: Enable SSRAM support for Lunar Lake Date: Tue, 24 Jun 2025 23:31:38 -0700 Message-ID: <20250625063145.624585-2-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250625063145.624585-1-xi.pardee@linux.intel.com> References: <20250625063145.624585-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 Reviewed-by: Ilpo J=C3=A4rvinen --- 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 Wed Oct 8 19:04:37 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 E62B61E22E9; Wed, 25 Jun 2025 06:31:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833112; cv=none; b=RF53FcNBGxaEYLRB8aRIPnFzvOXyHW37NkYICpuPD3wpSl2dgs3dg+yA/c3sfq0ovPM9/bBttnVxVNzG4fTiW6ZtRRjre8wbe4V2k7+5Xmc3jBjtFJMaASjWHq8JXlwpppHnb3YZqmQ87lQrWhV39VXYYdVGsGuW0POmOGK3GXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833112; c=relaxed/simple; bh=pDEK6l4tV93DlVFZwk/S5bgrjdnLgvhPs43YW/brNi4=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iYwso4TVtAoMNN89+A4F2ZGqWIRgc88orFZ9j4goy/AiJ+dFMEGYjbx7ZJyA57IIeEcxyDwoR8uK5wPFgl9wuE11fxjRiPd3lg9QCTg0RDDRbiCWR+2++gtnNbYTu8GJyVNmsISyOlYtfkOTY3WQb/FhSrZm1H2/8BdC+LOYdU4= 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=QDbrp29X; arc=none smtp.client-ip=198.175.65.16 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="QDbrp29X" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750833112; x=1782369112; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=pDEK6l4tV93DlVFZwk/S5bgrjdnLgvhPs43YW/brNi4=; b=QDbrp29Xlk8MOEASMYIeIDsA2WnerDRfjcIdwWPpV/fsLaHMnFAH/m95 Ou/zP3TvXndQNlpHwdrFu39wfH0rd+XjrOIhZZQFlfSboFDyoAcQbwnU4 ETlmlG8qbWoz9rG1uEiwghzL3w4FSiFW0Mh3GGEwWl3i6nTqxoIP+pOvg 4N0cg+W8KQGftZpxU3UuhunbFMYidKnj4cpwS9cg9HDre2BcWoFkyAh+7 kxcLrOGZqH22UEWQag2MGSNtDVMtRnwUzRGaxXvZ6a+kvBxF6ruHHmW2Q UMR9TAx57CnwTXExsJLwoB0Ap0dMeAeOqCC9SHxp5kjxkTUvvBa0I15pE A==; X-CSE-ConnectionGUID: EuWH1H17S4K2bIXWQe7Yqw== X-CSE-MsgGUID: Zm7LVW7eRtevZQJd1R7jrQ== X-IronPort-AV: E=McAfee;i="6800,10657,11474"; a="53187461" X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="53187461" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:49 -0700 X-CSE-ConnectionGUID: 2o8KMEkeS++ANpOKFzA6GA== X-CSE-MsgGUID: ssO2ghDtTTmZPLOeCx5BcQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="152257576" Received: from daliomra-mobl3.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.223.140]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:48 -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 v2 2/5] platform/x86:intel/pmc: Move telemetry endpoint register handling Date: Tue, 24 Jun 2025 23:31:39 -0700 Message-ID: <20250625063145.624585-3-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250625063145.624585-1-xi.pardee@linux.intel.com> References: <20250625063145.624585-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 Reviewed-by: Ilpo J=C3=A4rvinen --- 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 Wed Oct 8 19:04:37 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 58E381EB5DA; Wed, 25 Jun 2025 06:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833113; cv=none; b=ZejCijPDAV74ZazLR/2iudCIWszZPhUev+2Gcuxv7kxiXdJRQ+YKeAacWDGr2iFSBj+YNXnwCnpOMA0nXiWWsmOVK653/lwmNoRpR9IyPpmdSkcxjdeMcibQw9KZ9pQufyuBAqYsOobg3p/uDKkBw5CkrmIiNAonInOP4oiQzWA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833113; c=relaxed/simple; bh=CDe/iMsRALBkORDbKS3tYGiYIGj+1h732grU6OFaPI8=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R10WgS/D/nT7h/Gm+OgmFEJ7I2vKJw1uPr0hWcyDvuZL6on5T5SqW9s/pI7Kqkg21tsBXj6md3b2z3x4STcktqo2iHFH6wAmgyurZmqtUiGQUWVtkSdhub1vFSBfClaXQ+WzEgs4muM49VKxCb/QGZvti0Qb5815M2ibw5jbTK0= 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=OC2rc6On; arc=none smtp.client-ip=198.175.65.16 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="OC2rc6On" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750833112; x=1782369112; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=CDe/iMsRALBkORDbKS3tYGiYIGj+1h732grU6OFaPI8=; b=OC2rc6OnM91/OQPXfGz8nC6pJ+F/5PU4QZDepswzSUtzZwfPI0VD1Kd9 wjh+WpKtnLQGjzF5hMnzkSqGG3u+IjKjPZeW5DXVI+C3hsUI4fc24/sD7 uf0t9GF/sf3g/9yJqpog+nQ+5QOhE0g5KnlKy6SMAHDElWBkQ61bJ9zww LWJ4A4ZpFDbpiw3RaGowPqTUVObnp2Bhxr3j1QbYlIoS/28WCHGxX6x0e +niMXOdmTDBUWTih3jNHzZZSkwXfH6aKVAleIBAmzYBTyvr135Z5dorLA f/JyGHfb3qqobZ5zR5zLCXri3DrfVwhNFmYpDEgpMBvLeVP0wwFg0GkH3 w==; X-CSE-ConnectionGUID: 6ehMkWe8QeOPnt3xToX0Qw== X-CSE-MsgGUID: 8oq0U9aAQoaya84HKS/jCA== X-IronPort-AV: E=McAfee;i="6800,10657,11474"; a="53187465" X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="53187465" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:50 -0700 X-CSE-ConnectionGUID: 0txCQb95QwCJe/yJO2vm6Q== X-CSE-MsgGUID: drbRQfVyTxem56/k96dxEg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="152257578" Received: from daliomra-mobl3.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.223.140]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:49 -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 v2 3/5] platform/x86:intel/pmc: Improve function to show substate header Date: Tue, 24 Jun 2025 23:31:40 -0700 Message-ID: <20250625063145.624585-4-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250625063145.624585-1-xi.pardee@linux.intel.com> References: <20250625063145.624585-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 Wed Oct 8 19:04:37 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 809891F4199; Wed, 25 Jun 2025 06:31:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833113; cv=none; b=OgI6QvR8eK+9RdXMjPj9QljxiUvgvm97G7Zhv+J+RtXYAsXRAkXWRPSSt0/fxLBSqLIRCOS19EqHRmfSYkfH5KV2vG5EQhZY5GV9EwLsd6E+YRiKTWaLGDw7VxwiJqp9S4GJurX446Np+RQuc5PerhnqYEu1izyuqR9oBUIqS1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833113; c=relaxed/simple; bh=rLFqZHzLRZGHLvWE5iWO/CiTX4wAkGordgpDcx+vbjI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jSBH0etM4dk6MAP5J1ayExhF5OHI4laCCTLqwZIAYeHE6WWRW6u2fO/NYboBGk7cVuynuxjsROsOjEsuLo5xWAhWRvf0+WLU0zNHH/2tmCBVc1102XqcxTz20LZL/jSPmQl9YgPb0IC9e6dCaqkX8XbsfDOUGLSs90S8GhohtI0= 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=DByNxFb9; arc=none smtp.client-ip=198.175.65.16 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="DByNxFb9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750833112; x=1782369112; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=rLFqZHzLRZGHLvWE5iWO/CiTX4wAkGordgpDcx+vbjI=; b=DByNxFb9NeCw9HrJGByd0Pp/fWrUbWo5SQBbPvQ025kbdX0n1Mvp0Q/8 K/JAT6Zj8LuShCIDQdNylpzcwauqgC2xRNFn6aoCfTo2bILirls7JEst0 eLxCUOHiLzO8Qq1344Q+rjOHc+ON0p3O7ef4VxJZcI5LvyFCnXt56S5UI tXJxNX7UeTYZU+d7V+PyoQs1/+GlVidladN0SM4QS46kNMNTMpEeFlMvA X9r7s07fjdSSPncePhCQEnzsh5VgZ58KUvyyM20wB9dRQLWYFAoWxmyt7 xfijh0gpZP4uOlXlr/trUj9RztH7CKhYU7o2XLx+D5sP2rVEJTdUT+Vzw A==; X-CSE-ConnectionGUID: F3pj0RPRQuy1h21qaA1r4A== X-CSE-MsgGUID: JtL0M+ttTw2v7+UeoDQbqQ== X-IronPort-AV: E=McAfee;i="6800,10657,11474"; a="53187469" X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="53187469" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:50 -0700 X-CSE-ConnectionGUID: VdJ5QTYkRyekoS98TsgGow== X-CSE-MsgGUID: MvHROPlPQ/OpgB5SBJaRlQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="152257580" Received: from daliomra-mobl3.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.223.140]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:49 -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 v2 4/5] platform/x86:intel/pmc: Show substate requirement for S0ix blockers Date: Tue, 24 Jun 2025 23:31:41 -0700 Message-ID: <20250625063145.624585-5-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250625063145.624585-1-xi.pardee@linux.intel.com> References: <20250625063145.624585-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 | 2 + drivers/platform/x86/intel/pmc/core.c | 111 ++++++++++++++++++++++++-- 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, 121 insertions(+), 6 deletions(-) diff --git a/drivers/platform/x86/intel/pmc/arl.c b/drivers/platform/x86/in= tel/pmc/arl.c index 9d66d65e75779..1852876be234f 100644 --- a/drivers/platform/x86/intel/pmc/arl.c +++ b/drivers/platform/x86/intel/pmc/arl.c @@ -722,6 +722,7 @@ static int arl_h_core_init(struct pmc_dev *pmcdev, stru= ct pmc_dev_info *pmc_dev_ =20 struct pmc_dev_info arl_pmc_dev =3D { .pci_func =3D 0, + .telem_info =3D SUB_REQ_LPM, .dmu_guid =3D ARL_PMT_DMU_GUID, .regmap_list =3D arl_pmc_info_list, .map =3D &arl_socs_reg_map, @@ -732,6 +733,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..e9d281b064462 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_kcalloc(&pmcdev->pdev->dev, + num_blocker, sizeof(u32), + GFP_KERNEL); + if (!pmc->blk_sub_req_regs) + return -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 0; +} + +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,26 @@ 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); + if (telem_info & SUB_REQ_LPM) { + ret =3D pmc_core_pmt_get_lpm_req(pmcdev, pmc, ep); + if (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); - if (ret) - return ret; } =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 +1682,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 Wed Oct 8 19:04:37 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 D254D1F7060; Wed, 25 Jun 2025 06:31:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833114; cv=none; b=DxX05dLMCwWqRkCbS9tDmmqNvlq9Tuv+BvSdhkELmQfkOpSbxFu6uT9kZb/qPrVbIDtmk3fQbddGfXrtCLxPJC2M93BJvxB7t9xrvruLJZRTIaDIObJs3z3Gzn8HfZm7J1CV21ywgEqsq6g8+nj/fjM4vKXoqgWDbvPf4488ZLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750833114; c=relaxed/simple; bh=SMiK8R4rvJPitqeDKcJiQw7hgXniGdGbaSll/QfassA=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IBkwQ1y2X969sG/Pt9c4rvRdqqJm9zbJ0xB0exCg7qm6chIQPmsA+/keLIJ5NsRa/LrayW5ZRt4LF4yHql1PE/p9ONGkAoEb0XVkZbMAI15nIbZf86DNCLcAsHm0xz5AJPrH7cMRQIJrlzSzpOLZrj0SRJ88lECqpUu/Fjus7RA= 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=Ce93dUPU; arc=none smtp.client-ip=198.175.65.16 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="Ce93dUPU" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1750833113; x=1782369113; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=SMiK8R4rvJPitqeDKcJiQw7hgXniGdGbaSll/QfassA=; b=Ce93dUPUmeK2ADq/PXQHI0pQfFNFWHlz45pXFGZ+bFMRDszpioCIty8I ZVJnSs+1ecEyyAvdVBL9zTyHYw92J/Ba18vY+bf91Dhw0RQ31iqtpVIc9 RwVkjPL4A7pQA1kh9FLh+LPAzJ6MvSKyL771cfL4nDSXJ3Z2/k+ufCMgg eMGaQEGa7dvJpf94tWsFPGJ9MoRBRJudSH6DOMJnMbdkZZksTOf4ITx1s l9K8xWkKXnpwLsS7InpJMskNmr6Bb6b8FvZbVoCNFTvMEs627yMh2lliH 3/Ub7pWPImRNZWaFo7ADhWCOtJwjzE0zJ3FVsvNJD7SKdJVGa7m3Xle8i w==; X-CSE-ConnectionGUID: 6qQFeM5eSJy3kCilHHMXZA== X-CSE-MsgGUID: unC6ecZ+ToWtvwQgwf0PGQ== X-IronPort-AV: E=McAfee;i="6800,10657,11474"; a="53187472" X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="53187472" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:51 -0700 X-CSE-ConnectionGUID: aKc48rkyTwOrIAwOnLYbRQ== X-CSE-MsgGUID: L991gemuTMCOYIYmXeBdSA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.16,264,1744095600"; d="scan'208";a="152257582" Received: from daliomra-mobl3.amr.corp.intel.com (HELO xpardee-desk.intel.com) ([10.124.223.140]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jun 2025 23:31:50 -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 v2 5/5] platform/x86:intel/pmc: Enable SSRAM support for Panther Lake Date: Tue, 24 Jun 2025 23:31:42 -0700 Message-ID: <20250625063145.624585-6-xi.pardee@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250625063145.624585-1-xi.pardee@linux.intel.com> References: <20250625063145.624585-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 Reviewed-by: Ilpo J=C3=A4rvinen --- 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