From: Rajvi Jingar <rajvi.jingar@linux.intel.com>
To: david.e.box@linux.intel.com, ilpo.jarvinen@linux.intel.com,
irenic.rajneesh@gmail.com, linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org, hdegoede@redhat.com
Cc: xi.pardee@intel.com
Subject: [PATCH 6/8] platform/x86:intel/pmc: Use SSRAM to discover pwrm base address of primary PMC
Date: Tue, 13 Jun 2023 15:53:45 -0700 [thread overview]
Message-ID: <20230613225347.2720665-7-rajvi.jingar@linux.intel.com> (raw)
In-Reply-To: <20230613225347.2720665-1-rajvi.jingar@linux.intel.com>
From: Xi Pardee <xi.pardee@intel.com>
On older platforms, the base address for PMC was hardcoded in the
driver. Newer platforms can now retrieve the base address from SSRAM.
Use SSRAM to discover pwrm base address on Meteor Lake platform. If
this method fails, it will fall back to the hardcoded value.
Signed-off-by: Xi Pardee <xi.pardee@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/platform/x86/intel/pmc/mtl.c | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/x86/intel/pmc/mtl.c b/drivers/platform/x86/intel/pmc/mtl.c
index e53dc7900dbf..b5552bb146c9 100644
--- a/drivers/platform/x86/intel/pmc/mtl.c
+++ b/drivers/platform/x86/intel/pmc/mtl.c
@@ -467,7 +467,12 @@ const struct pmc_reg_map mtl_socm_reg_map = {
.lpm_live_status_offset = MTL_LPM_LIVE_STATUS_OFFSET,
};
+#define PMC_DEVID_SOCM 0x7e7f
static struct pmc_info mtl_pmc_info_list[] = {
+ {
+ .devid = PMC_DEVID_SOCM,
+ .map = &mtl_socm_reg_map,
+ },
{}
};
@@ -513,9 +518,7 @@ static int mtl_resume(struct pmc_dev *pmcdev)
int mtl_core_init(struct pmc_dev *pmcdev)
{
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC];
- int ret;
-
- pmc->map = &mtl_socm_reg_map;
+ int ret = 0;
mtl_d3_fixup();
@@ -524,9 +527,13 @@ int mtl_core_init(struct pmc_dev *pmcdev)
pmcdev->regmap_list = mtl_pmc_info_list;
pmc_core_ssram_init(pmcdev);
- ret = get_primary_reg_base(pmc);
- if (ret)
- return ret;
+ /* If regbase not assigned, set map and discover using legacy method */
+ if (!pmc->regbase) {
+ pmc->map = &mtl_socm_reg_map;
+ ret = get_primary_reg_base(pmc);
+ if (ret)
+ return ret;
+ }
/* Due to a hardware limitation, the GBE LTR blocks PC10
* when a cable is attached. Tell the PMC to ignore it.
--
2.25.1
next prev parent reply other threads:[~2023-06-13 22:51 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 22:53 [PATCH 0/8] Add multiple PMCs support in pmc core driver Rajvi Jingar
2023-06-13 22:53 ` [PATCH 1/8] platform/x86:intel/pmc: Update maps for Meteor Lake P/M platforms Rajvi Jingar
2023-06-13 22:53 ` [PATCH 2/8] platform/x86:intel/pmc: Combine core_init() and core_configure() Rajvi Jingar
2023-06-13 22:53 ` [PATCH 3/8] platform/x86:intel/pmc: Add support to handle multiple PMCs Rajvi Jingar
2023-06-13 22:53 ` [PATCH 4/8] platform/x86:intel/pmc: Enable debugfs multiple PMC support Rajvi Jingar
2023-06-13 22:53 ` [PATCH 5/8] platform/x86:intel/pmc: Discover PMC devices Rajvi Jingar
2023-06-13 22:53 ` Rajvi Jingar [this message]
2023-06-13 22:53 ` [PATCH 7/8] platform/x86:intel/pmc: Add Meteor Lake IOE-P PMC related maps Rajvi Jingar
2023-06-13 22:53 ` [PATCH 8/8] platform/x86:intel/pmc: Add Meteor Lake IOE-M " Rajvi Jingar
2023-06-20 10:56 ` [PATCH 0/8] Add multiple PMCs support in pmc core driver Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230613225347.2720665-7-rajvi.jingar@linux.intel.com \
--to=rajvi.jingar@linux.intel.com \
--cc=david.e.box@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=irenic.rajneesh@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=xi.pardee@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®