diff options
author | Subrata Banik <subratabanik@google.com> | 2022-01-31 21:55:51 +0530 |
---|---|---|
committer | Subrata Banik <subratabanik@google.com> | 2022-02-04 12:23:39 +0000 |
commit | 526cc3ed44aacdad7a03ba7009baebbca2a308e8 (patch) | |
tree | d9d8ad6ba02787fe70e4d12cd3e99aac5b8360c5 /src/soc/intel/common/block/cse/cse.c | |
parent | ebd75315b47619895725878682f84d0ae120e2c2 (diff) |
soc/intel/{adl, common}: Add routines into CSE IA-common code
This patch adds routines to keep CSE and other HECI devices into the
lower power device state (AKA D0I3).
- cse_set_to_d0i3 => Set CSE device state to D0I3
- heci_set_to_d0i3 => Function sets D0I3 for all HECI devices
Additionally, creates a config `MAX_HECI_DEVICES` to pass the HECI
device count info from SoC layer to common CSE block.
As per PCH EDS, the HECI device count for various SoCs are:
ADL/CNL/EHL/ICL/JSL/TGL => 6 (CSE, IDE-R, KT, CSE2, CSE3 and CSE4)
APL => 1 (CSE)
SKL/Xeon_SP => 5 (CSE, IDE-R, KT, CSE2 and CSE3)
BUG=b:211954778
TEST=Able to build and boot Brya.
Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: Ie32887196628fe6386896604e50338f4bc0bedfe
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61518
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/soc/intel/common/block/cse/cse.c')
-rw-r--r-- | src/soc/intel/common/block/cse/cse.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index 32f6d4f0c2..6dfe329fc4 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -988,6 +988,26 @@ bool set_cse_device_state(unsigned int devfn, enum cse_device_state requested_st return true; } +void cse_set_to_d0i3(void) +{ + if (!is_cse_devfn_visible(PCH_DEVFN_CSE)) + return; + + set_cse_device_state(PCH_DEVFN_CSE, DEV_IDLE); +} + +/* Function to set D0I3 for all HECI devices */ +void heci_set_to_d0i3(void) +{ + for (int i = 0; i < CONFIG_MAX_HECI_DEVICES; i++) { + pci_devfn_t dev = PCI_DEV(0, PCI_SLOT(PCH_DEV_SLOT_CSE), PCI_FUNC(i)); + if (!is_cse_devfn_visible(dev)) + continue; + + set_cse_device_state(dev, DEV_IDLE); + } +} + #if ENV_RAMSTAGE /* |