From 7bc4dc5648c6ff37a847e99d7acee11e3e72a79d Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 17 May 2018 18:40:32 +0530 Subject: soc/intel/common/block: Move tco common functions into block/smbus MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch cleans soc/intel/{apl/cnl/icl/skl} by moving common soc code into common/block/smbus. BUG=b:78109109 BRANCH=NONE TEST=Build and boot KBL/CNL/APL/ICL platform. Change-Id: I34b33922cafee9f31702587e0f9c03b64f0781b8 Signed-off-by: Subrata Banik Signed-off-by: Maulik V Vaghela Reviewed-on: https://review.coreboot.org/c/26166 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki --- src/soc/intel/icelake/pmutil.c | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'src/soc/intel/icelake/pmutil.c') diff --git a/src/soc/intel/icelake/pmutil.c b/src/soc/intel/icelake/pmutil.c index c020bf61d6..abd52c4ff0 100644 --- a/src/soc/intel/icelake/pmutil.c +++ b/src/soc/intel/icelake/pmutil.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -153,38 +154,6 @@ uint8_t *pmc_mmio_regs(void) return (void *)(uintptr_t)PCH_PWRM_BASE_ADDRESS; } -uint16_t smbus_tco_regs(void) -{ - uint16_t reg16; - - reg16 = pci_read_config16(PCH_DEV_SMBUS, TCOBASE); - - return ALIGN_DOWN(reg16, 0x20); -} - -uint32_t soc_reset_tco_status(void) -{ - u16 tco1_sts; - u16 tco2_sts; - u16 tcobase; - - tcobase = smbus_tco_regs(); - - /* TCO Status 2 register */ - tco2_sts = inw(tcobase + TCO2_STS); - tco2_sts |= TCO2_STS_SECOND_TO; - outw(tco2_sts, tcobase + TCO2_STS); - - /* TCO Status 1 register */ - tco1_sts = inw(tcobase + TCO1_STS); - - /* Clear SECOND_TO_STS bit */ - if (tco2_sts & TCO2_STS_SECOND_TO) - outw(tco2_sts & ~TCO2_STS_SECOND_TO, tcobase + TCO2_STS); - - return (tco2_sts << 16) | tco1_sts; -} - uintptr_t soc_read_pmc_base(void) { return (uintptr_t)pmc_mmio_regs(); -- cgit v1.2.3