From 031ab223a0559fea6b22e818e17164e981d57c4b Mon Sep 17 00:00:00 2001 From: Lech Betlej Date: Wed, 29 Jan 2020 15:30:57 +0100 Subject: [PATCH] cavs: enable power gating of unused memory banks for cavs 2.x hw The change adds power gating of unused memory banks for cavs 2.0/2.5 hardware on top of previously enabled flow for cavs 1.8. Signed-off-by: Lech Betlej --- src/arch/xtensa/boot_loader.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/arch/xtensa/boot_loader.c b/src/arch/xtensa/boot_loader.c index a6d741408..adae1c596 100644 --- a/src/arch/xtensa/boot_loader.c +++ b/src/arch/xtensa/boot_loader.c @@ -4,6 +4,7 @@ // // Author: Liam Girdwood +#include #include #include #include @@ -168,8 +169,7 @@ static void parse_manifest(void) } #endif - -#if CONFIG_CANNONLAKE +#if CAVS_VERSION >= CAVS_VERSION_1_8 /* function powers up a number of memory banks provided as an argument and * gates remaining memory banks */ @@ -178,6 +178,7 @@ static int32_t hp_sram_pm_banks(uint32_t banks) int delay_count = 256; uint32_t status; uint32_t ebb_mask0, ebb_mask1, ebb_avail_mask0, ebb_avail_mask1; + uint32_t total_banks_count = PLATFORM_HPSRAM_EBB_COUNT; shim_write(SHIM_LDOCTL, SHIM_LDOCTL_HPSRAM_LDO_ON); @@ -187,12 +188,12 @@ static int32_t hp_sram_pm_banks(uint32_t banks) /* bit masks reflect total number of available EBB (banks) in each * segment; current implementation supports 2 segments 0,1 */ - if (PLATFORM_HPSRAM_EBB_COUNT > EBB_SEGMENT_SIZE) { + if (total_banks_count > EBB_SEGMENT_SIZE) { ebb_avail_mask0 = (uint32_t)MASK(EBB_SEGMENT_SIZE - 1, 0); - ebb_avail_mask1 = (uint32_t)MASK(PLATFORM_HPSRAM_EBB_COUNT - + ebb_avail_mask1 = (uint32_t)MASK(total_banks_count - EBB_SEGMENT_SIZE - 1, 0); } else{ - ebb_avail_mask0 = (uint32_t)MASK(PLATFORM_HPSRAM_EBB_COUNT - 1, + ebb_avail_mask0 = (uint32_t)MASK(total_banks_count - 1, 0); ebb_avail_mask1 = 0; }