summaryrefslogtreecommitdiff
path: root/src/soc/intel/tigerlake/bootblock
diff options
context:
space:
mode:
authorMaulik V Vaghela <maulik.v.vaghela@intel.corp-partner.google.com>2019-12-03 16:12:13 +0530
committerPatrick Georgi <pgeorgi@google.com>2019-12-16 09:36:49 +0000
commit8d9262a7e7c0b9ec8a48aee9792cef2bd15667d2 (patch)
tree78032679cb86947fc3957383d08f81c8ad3eedf4 /src/soc/intel/tigerlake/bootblock
parentb7eb1097e5d38cbf7fd6ee6001cde264f1e74984 (diff)
soc/intel/tigerlake: Pick correct pmc base reg from pch type
Update PMC shadow register base address for Jasperlake Correct PCH detection logic based on PCH ids and return correct base address based on PCH detected since our code supports both tgl and jsl. Change-Id: Iea3311b3dc8dc3ee5ea54db1148f386c2a5dd563 Signed-off-by: Maulik V Vaghela <maulik.v.vaghela@intel.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/37670 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aamir Bohra <aamir.bohra@intel.com>
Diffstat (limited to 'src/soc/intel/tigerlake/bootblock')
-rw-r--r--src/soc/intel/tigerlake/bootblock/pch.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/soc/intel/tigerlake/bootblock/pch.c b/src/soc/intel/tigerlake/bootblock/pch.c
index 1ef4928fa6..8599423f91 100644
--- a/src/soc/intel/tigerlake/bootblock/pch.c
+++ b/src/soc/intel/tigerlake/bootblock/pch.c
@@ -37,7 +37,8 @@
#include <soc/pcr_ids.h>
#include <soc/pm.h>
-#define PCR_PSF3_TO_SHDW_PMC_REG_BASE 0x0600
+#define PCR_PSF3_TO_SHDW_PMC_REG_BASE_TGP 0x0600
+#define PCR_PSF3_TO_SHDW_PMC_REG_BASE_JSP 0x0980
#define PCR_PSFX_TO_SHDW_BAR0 0
#define PCR_PSFX_TO_SHDW_BAR1 0x4
#define PCR_PSFX_TO_SHDW_BAR2 0x8
@@ -57,6 +58,20 @@
#define PCR_DMI_LPCIOD 0x2770
#define PCR_DMI_LPCIOE 0x2774
+static uint32_t get_pmc_reg_base(void)
+{
+ uint8_t pch_series;
+
+ pch_series = get_pch_series();
+
+ if (pch_series == PCH_TGP)
+ return PCR_PSF3_TO_SHDW_PMC_REG_BASE_TGP;
+ else if (pch_series == PCH_JSP)
+ return PCR_PSF3_TO_SHDW_PMC_REG_BASE_JSP;
+ else
+ return 0;
+}
+
static void soc_config_pwrmbase(void)
{
uint32_t reg32;
@@ -99,22 +114,23 @@ void bootblock_pch_early_init(void)
static void soc_config_acpibase(void)
{
uint32_t pmc_reg_value;
+ uint32_t pmc_base_reg;
+
+ pmc_base_reg = get_pmc_reg_base();
+ if (!pmc_base_reg)
+ die_with_post_code(POST_HW_INIT_FAILURE, "Invalid PMC base address\n");
- pmc_reg_value = pcr_read32(PID_PSF3, PCR_PSF3_TO_SHDW_PMC_REG_BASE +
- PCR_PSFX_TO_SHDW_BAR4);
+ pmc_reg_value = pcr_read32(PID_PSF3, pmc_base_reg + PCR_PSFX_TO_SHDW_BAR4);
if (pmc_reg_value != 0xffffffff) {
/* Disable Io Space before changing the address */
- pcr_rmw32(PID_PSF3, PCR_PSF3_TO_SHDW_PMC_REG_BASE +
- PCR_PSFX_T0_SHDW_PCIEN,
+ pcr_rmw32(PID_PSF3, pmc_base_reg + PCR_PSFX_T0_SHDW_PCIEN,
~PCR_PSFX_TO_SHDW_PCIEN_IOEN, 0);
/* Program ABASE in PSF3 PMC space BAR4*/
- pcr_write32(PID_PSF3, PCR_PSF3_TO_SHDW_PMC_REG_BASE +
- PCR_PSFX_TO_SHDW_BAR4,
+ pcr_write32(PID_PSF3, pmc_base_reg + PCR_PSFX_TO_SHDW_BAR4,
ACPI_BASE_ADDRESS);
/* Enable IO Space */
- pcr_rmw32(PID_PSF3, PCR_PSF3_TO_SHDW_PMC_REG_BASE +
- PCR_PSFX_T0_SHDW_PCIEN,
+ pcr_rmw32(PID_PSF3, pmc_base_reg + PCR_PSFX_T0_SHDW_PCIEN,
~0, PCR_PSFX_TO_SHDW_PCIEN_IOEN);
}
}