File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff 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+
98105config ADSP_DISABLE_L2CACHE_AT_BOOT
99106 bool
100107
Original file line number Diff line number Diff 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);
Original file line number Diff line number Diff 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 {
You can’t perform that action at this time.
0 commit comments