summaryrefslogtreecommitdiffstats
path: root/src/soc/amd/cezanne/fch.c
diff options
context:
space:
mode:
authorJulian Schroeder <julianmarcusschroeder@gmail.com>2021-10-12 10:58:49 -0500
committerFelix Held <felix-coreboot@felixheld.de>2021-10-13 22:01:52 +0000
commit5412a81485b27a04c004acdb623d017ffa9bb587 (patch)
tree6f6872b4e1fbc637ae28ce3ab2bff49c2d5bb4b1 /src/soc/amd/cezanne/fch.c
parent07bf6ff781193081e45e2920682ea2cf08e69cc6 (diff)
downloadcoreboot-5412a81485b27a04c004acdb623d017ffa9bb587.tar.gz
coreboot-5412a81485b27a04c004acdb623d017ffa9bb587.tar.bz2
coreboot-5412a81485b27a04c004acdb623d017ffa9bb587.zip
src/soc/amd/cezanne: enable clock gating
Enabling clock gating for CGPLL to lower power consumption in S3 and S0i3 states. See also: Cezanne PPR chapter 7, rev 3.03. BUG=b:185273565 TEST=iotools mmio_read32 0xfed80e2c and 0e30 show clk gating enabled and suspend_stress_test works. Change-Id: I33cbdeec62e49db90b680da37e5028df03a9c015 Signed-off-by: Julian Schroeder <julianmarcusschroeder@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/58279 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd/cezanne/fch.c')
-rw-r--r--src/soc/amd/cezanne/fch.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/soc/amd/cezanne/fch.c b/src/soc/amd/cezanne/fch.c
index ac79cc9e115e..dd19c310bc57 100644
--- a/src/soc/amd/cezanne/fch.c
+++ b/src/soc/amd/cezanne/fch.c
@@ -169,6 +169,28 @@ static void gpp_clk_setup(void)
misc_write32(GPP_CLK_CNTRL, gpp_clk_ctl);
}
+static void cgpll_clock_gate_init(void)
+{
+ uint32_t t;
+
+ t = misc_read32(MISC_CLKGATEDCNTL);
+ t |= ALINKCLK_GATEOFFEN;
+ t |= BLINKCLK_GATEOFFEN;
+ t |= XTAL_PAD_S3_TURNOFF_EN;
+ t |= XTAL_PAD_S5_TURNOFF_EN;
+ misc_write32(MISC_CLKGATEDCNTL, t);
+
+ t = misc_read32(MISC_CGPLL_CONFIGURATION0);
+ t |= USB_PHY_CMCLK_S3_DIS;
+ t |= USB_PHY_CMCLK_S0I3_DIS;
+ t |= USB_PHY_CMCLK_S5_DIS;
+ misc_write32(MISC_CGPLL_CONFIGURATION0, t);
+
+ t = pm_read32(PM_ISACONTROL);
+ t |= ABCLKGATEEN;
+ pm_write32(PM_ISACONTROL, t);
+}
+
void fch_init(void *chip_info)
{
fch_init_resets();
@@ -181,6 +203,7 @@ void fch_init(void *chip_info)
gpp_clk_setup();
fch_clk_output_48Mhz();
+ cgpll_clock_gate_init();
}
void fch_final(void *chip_info)