Skip to content

Commit 250748b

Browse files
Flavio Ceolinnashif
authored andcommitted
intel_adsp: Add option about switch off hpsram
Add an option to control whether or not hpsram banks should be switched off during the power down. This is particular useful when running tests because we don't want to lose the contents of the memory window before we capture it. Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 56a8123 commit 250748b

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

soc/xtensa/intel_adsp/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ config ADSP_INIT_HPSRAM
9595
help
9696
Need to init HP SRAM.
9797

98+
config ADSP_POWER_DOWN_HPSRAM
99+
bool
100+
default n if ZTEST
101+
default y
102+
help
103+
Switch off HP SRAM during power down.
104+
98105
config ADSP_DISABLE_L2CACHE_AT_BOOT
99106
bool
100107

soc/xtensa/intel_adsp/ace/power.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,12 @@ void pm_state_set(enum pm_state state, uint8_t substate_id)
282282
(void *)rom_entry;
283283
sys_cache_data_flush_range(imr_layout, sizeof(*imr_layout));
284284
#endif /* CONFIG_ADSP_IMR_CONTEXT_SAVE */
285+
uint32_t hpsram_mask = 0;
286+
#ifdef CONFIG_ADSP_POWER_DOWN_HPSRAM
285287
/* turn off all HPSRAM banks - get a full bitmap */
286288
uint32_t ebb_banks = ace_hpsram_get_bank_count();
287-
uint32_t hpsram_mask = (1 << ebb_banks) - 1;
289+
hpsram_mask = (1 << ebb_banks) - 1;
290+
#endif /* CONFIG_ADSP_POWER_DOWN_HPSRAM */
288291
/* do power down - this function won't return */
289292
power_down(true, uncache_to_cache(&hpsram_mask),
290293
true);

soc/xtensa/intel_adsp/cavs/power.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void pm_state_set(enum pm_state state, uint8_t substate_id)
8787
soc_cpus_active[cpu] = false;
8888
sys_cache_data_flush_and_invd_all();
8989
if (cpu == 0) {
90-
uint32_t hpsram_mask[HPSRAM_SEGMENTS];
90+
uint32_t hpsram_mask[HPSRAM_SEGMENTS] = {0};
9191

9292
struct imr_header hdr = {
9393
.adsp_imr_magic = ADSP_IMR_MAGIC_VALUE,
@@ -97,9 +97,11 @@ void pm_state_set(enum pm_state state, uint8_t substate_id)
9797
arch_xtensa_uncached_ptr((struct imr_layout *)L3_MEM_BASE_ADDR);
9898
imr_layout->imr_state.header = hdr;
9999

100+
#ifdef CONFIG_ADSP_POWER_DOWN_HPSRAM
100101
/* turn off all HPSRAM banks - get a full bitmap */
101102
for (int i = 0; i < HPSRAM_SEGMENTS; i++)
102103
hpsram_mask[i] = HPSRAM_MEMMASK(i);
104+
#endif /* CONFIG_ADSP_POWER_DOWN_HPSRAM */
103105
/* do power down - this function won't return */
104106
power_down_cavs(true, uncache_to_cache(&hpsram_mask[0]));
105107
} else {

0 commit comments

Comments
 (0)