Skip to content

Commit 23e74e3

Browse files
xpardee-createjwrdegoede
authored andcommitted
platform/x86:intel/pmc: Use SSRAM to discover pwrm base address of primary PMC
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> Link: https://lore.kernel.org/r/20230613225347.2720665-7-rajvi.jingar@linux.intel.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent 1b8c7b8 commit 23e74e3

File tree

1 file changed

+13
-6
lines changed
  • drivers/platform/x86/intel/pmc

1 file changed

+13
-6
lines changed

drivers/platform/x86/intel/pmc/mtl.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,12 @@ const struct pmc_reg_map mtl_socm_reg_map = {
467467
.lpm_live_status_offset = MTL_LPM_LIVE_STATUS_OFFSET,
468468
};
469469

470+
#define PMC_DEVID_SOCM 0x7e7f
470471
static struct pmc_info mtl_pmc_info_list[] = {
472+
{
473+
.devid = PMC_DEVID_SOCM,
474+
.map = &mtl_socm_reg_map,
475+
},
471476
{}
472477
};
473478

@@ -513,9 +518,7 @@ static int mtl_resume(struct pmc_dev *pmcdev)
513518
int mtl_core_init(struct pmc_dev *pmcdev)
514519
{
515520
struct pmc *pmc = pmcdev->pmcs[PMC_IDX_SOC];
516-
int ret;
517-
518-
pmc->map = &mtl_socm_reg_map;
521+
int ret = 0;
519522

520523
mtl_d3_fixup();
521524

@@ -524,9 +527,13 @@ int mtl_core_init(struct pmc_dev *pmcdev)
524527
pmcdev->regmap_list = mtl_pmc_info_list;
525528
pmc_core_ssram_init(pmcdev);
526529

527-
ret = get_primary_reg_base(pmc);
528-
if (ret)
529-
return ret;
530+
/* If regbase not assigned, set map and discover using legacy method */
531+
if (!pmc->regbase) {
532+
pmc->map = &mtl_socm_reg_map;
533+
ret = get_primary_reg_base(pmc);
534+
if (ret)
535+
return ret;
536+
}
530537

531538
/* Due to a hardware limitation, the GBE LTR blocks PC10
532539
* when a cable is attached. Tell the PMC to ignore it.

0 commit comments

Comments
 (0)