Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34327 )
Change subject: [WIP] soc/intel: Use config_of_path(PCH_DEV_PMC) ......................................................................
[WIP] soc/intel: Use config_of_path(PCH_DEV_PMC)
Change-Id: I4b5195827fb32ec1dbd0bd6c9e243f4f9a4775ca Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/soc/intel/cannonlake/finalize.c M src/soc/intel/icelake/finalize.c 2 files changed, 2 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/34327/1
diff --git a/src/soc/intel/cannonlake/finalize.c b/src/soc/intel/cannonlake/finalize.c index d099d77..6083cab 100644 --- a/src/soc/intel/cannonlake/finalize.c +++ b/src/soc/intel/cannonlake/finalize.c @@ -56,7 +56,6 @@
static void pch_finalize(void) { - struct device *dev; uint32_t reg32; uint8_t *pmcbase; config_t *config; @@ -74,8 +73,7 @@ * point and hence removed from the root bus. pcidev_path_on_root thus * returns NULL for PCH_DEV_PMC device. */ - dev = SA_DEV_ROOT; - config = dev->chip_info; + config = config_of_path(SA_DEVFN_ROOT); pmcbase = pmc_mmio_regs(); if (config->PmTimerDisabled) { reg8 = read8(pmcbase + PCH_PWRM_ACPI_TMR_CTL); diff --git a/src/soc/intel/icelake/finalize.c b/src/soc/intel/icelake/finalize.c index e035c95..c969f3b 100644 --- a/src/soc/intel/icelake/finalize.c +++ b/src/soc/intel/icelake/finalize.c @@ -54,7 +54,6 @@
static void pch_finalize(void) { - struct device *dev; uint32_t reg32; uint8_t *pmcbase; config_t *config; @@ -74,8 +73,7 @@ * point and hence removed from the root bus. pcidev_path_on_root thus * returns NULL for PCH_DEV_PMC device. */ - dev = SA_DEV_ROOT; - config = dev->chip_info; + config = config_of_path(SA_DEVFN_ROOT); pmcbase = pmc_mmio_regs(); if (config->PmTimerDisabled) { reg8 = read8(pmcbase + PCH_PWRM_ACPI_TMR_CTL);
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34327 )
Change subject: [WIP] soc/intel: Use config_of_path(PCH_DEV_PMC) ......................................................................
Patch Set 1:
Furquan, will you take care of this? Not sure which way you want to do it.
Hello Patrick Rudolph, build bot (Jenkins), Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34327
to look at the new patch set (#2).
Change subject: [WIP] soc/intel: Fix chip_info for PCH_DEV_PMC ......................................................................
[WIP] soc/intel: Fix chip_info for PCH_DEV_PMC
Change-Id: I4b5195827fb32ec1dbd0bd6c9e243f4f9a4775ca Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/soc/intel/cannonlake/finalize.c M src/soc/intel/cannonlake/pmutil.c M src/soc/intel/icelake/finalize.c M src/soc/intel/icelake/pmutil.c 4 files changed, 4 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/34327/2
Hello Patrick Rudolph, build bot (Jenkins), Furquan Shaikh,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34327
to look at the new patch set (#3).
Change subject: soc/intel: Fix chip_info for PCH_DEV_PMC ......................................................................
soc/intel: Fix chip_info for PCH_DEV_PMC
Since PCH_DEVFN_PMC device is a PCI device that may be hidden from enumeration, use SA_DEVFN_ROOT instead to locate the SOC configuration.
Change-Id: I4b5195827fb32ec1dbd0bd6c9e243f4f9a4775ca Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/soc/intel/cannonlake/finalize.c M src/soc/intel/cannonlake/pmutil.c M src/soc/intel/icelake/finalize.c M src/soc/intel/icelake/pmutil.c 4 files changed, 4 insertions(+), 21 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/27/34327/3
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34327 )
Change subject: soc/intel: Fix chip_info for PCH_DEV_PMC ......................................................................
Patch Set 3: Code-Review+2
Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34327 )
Change subject: soc/intel: Fix chip_info for PCH_DEV_PMC ......................................................................
Patch Set 3: Code-Review+2
Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/34327 )
Change subject: soc/intel: Fix chip_info for PCH_DEV_PMC ......................................................................
soc/intel: Fix chip_info for PCH_DEV_PMC
Since PCH_DEVFN_PMC device is a PCI device that may be hidden from enumeration, use SA_DEVFN_ROOT instead to locate the SOC configuration.
Change-Id: I4b5195827fb32ec1dbd0bd6c9e243f4f9a4775ca Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/34327 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Duncan Laurie dlaurie@chromium.org Reviewed-by: Furquan Shaikh furquan@google.com --- M src/soc/intel/cannonlake/finalize.c M src/soc/intel/cannonlake/pmutil.c M src/soc/intel/icelake/finalize.c M src/soc/intel/icelake/pmutil.c 4 files changed, 4 insertions(+), 21 deletions(-)
Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, approved Furquan Shaikh: Looks good to me, approved
diff --git a/src/soc/intel/cannonlake/finalize.c b/src/soc/intel/cannonlake/finalize.c index d099d77..6083cab 100644 --- a/src/soc/intel/cannonlake/finalize.c +++ b/src/soc/intel/cannonlake/finalize.c @@ -56,7 +56,6 @@
static void pch_finalize(void) { - struct device *dev; uint32_t reg32; uint8_t *pmcbase; config_t *config; @@ -74,8 +73,7 @@ * point and hence removed from the root bus. pcidev_path_on_root thus * returns NULL for PCH_DEV_PMC device. */ - dev = SA_DEV_ROOT; - config = dev->chip_info; + config = config_of_path(SA_DEVFN_ROOT); pmcbase = pmc_mmio_regs(); if (config->PmTimerDisabled) { reg8 = read8(pmcbase + PCH_PWRM_ACPI_TMR_CTL); diff --git a/src/soc/intel/cannonlake/pmutil.c b/src/soc/intel/cannonlake/pmutil.c index 9997d16..1626e30 100644 --- a/src/soc/intel/cannonlake/pmutil.c +++ b/src/soc/intel/cannonlake/pmutil.c @@ -175,14 +175,7 @@ void soc_get_gpi_gpe_configs(uint8_t *dw0, uint8_t *dw1, uint8_t *dw2) { DEVTREE_CONST struct soc_intel_cannonlake_config *config; - - /* Look up the device in devicetree */ - DEVTREE_CONST struct device *dev = pcidev_path_on_root(PCH_DEVFN_PMC); - if (!dev || !dev->chip_info) { - printk(BIOS_ERR, "BUG! Could not find SOC devicetree config\n"); - return; - } - config = dev->chip_info; + config = config_of_path(SA_DEVFN_ROOT);
/* Assign to out variable */ *dw0 = config->gpe0_dw0; diff --git a/src/soc/intel/icelake/finalize.c b/src/soc/intel/icelake/finalize.c index e035c95..c969f3b 100644 --- a/src/soc/intel/icelake/finalize.c +++ b/src/soc/intel/icelake/finalize.c @@ -54,7 +54,6 @@
static void pch_finalize(void) { - struct device *dev; uint32_t reg32; uint8_t *pmcbase; config_t *config; @@ -74,8 +73,7 @@ * point and hence removed from the root bus. pcidev_path_on_root thus * returns NULL for PCH_DEV_PMC device. */ - dev = SA_DEV_ROOT; - config = dev->chip_info; + config = config_of_path(SA_DEVFN_ROOT); pmcbase = pmc_mmio_regs(); if (config->PmTimerDisabled) { reg8 = read8(pmcbase + PCH_PWRM_ACPI_TMR_CTL); diff --git a/src/soc/intel/icelake/pmutil.c b/src/soc/intel/icelake/pmutil.c index 45f2a70..a70840b 100644 --- a/src/soc/intel/icelake/pmutil.c +++ b/src/soc/intel/icelake/pmutil.c @@ -174,13 +174,7 @@ { DEVTREE_CONST struct soc_intel_icelake_config *config;
- /* Look up the device in devicetree */ - DEVTREE_CONST struct device *dev = pcidev_path_on_root(PCH_DEVFN_PMC); - if (!dev || !dev->chip_info) { - printk(BIOS_ERR, "BUG! Could not find SOC devicetree config\n"); - return; - } - config = dev->chip_info; + config = config_of_path(SA_DEVFN_ROOT);
/* Assign to out variable */ *dw0 = config->gpe0_dw0;