diff --git a/soc/xtensa/intel_adsp/common/bootloader/boot_loader.c b/soc/xtensa/intel_adsp/common/bootloader/boot_loader.c index a2f88ff9b61..3319db295ee 100644 --- a/soc/xtensa/intel_adsp/common/bootloader/boot_loader.c +++ b/soc/xtensa/intel_adsp/common/bootloader/boot_loader.c @@ -27,6 +27,7 @@ extern void __start(void); #if !defined(CONFIG_SOC_INTEL_S1000) #define MANIFEST_SEGMENT_COUNT 3 +#undef UNUSED_MEMORY_CALCULATION_HAS_BEEN_FIXED static inline void idelay(int n) { @@ -125,6 +126,7 @@ static void parse_module(struct sof_man_fw_header *hdr, #define MAN_SKIP_ENTRIES 1 #endif +#ifdef UNUSED_MEMORY_CALCULATION_HAS_BEEN_FIXED static uint32_t get_fw_size_in_use(void) { struct sof_man_fw_desc *desc = @@ -153,6 +155,7 @@ static uint32_t get_fw_size_in_use(void) return fw_size_in_use; } +#endif /* parse FW manifest and copy modules */ static void parse_manifest(void) @@ -256,11 +259,13 @@ static uint32_t hp_sram_power_on_memory(uint32_t memory_size) return hp_sram_pm_banks(ebb_in_use); } +#ifdef UNUSED_MEMORY_CALCULATION_HAS_BEEN_FIXED static int32_t hp_sram_power_off_unused_banks(uint32_t memory_size) { /* keep enabled only memory banks used by FW */ return hp_sram_power_on_memory(memory_size); } +#endif static int32_t hp_sram_init(void) { @@ -269,10 +274,12 @@ static int32_t hp_sram_init(void) #else +#ifdef UNUSED_MEMORY_CALCULATION_HAS_BEEN_FIXED static int32_t hp_sram_power_off_unused_banks(uint32_t memory_size) { return 0; } +#endif static uint32_t hp_sram_init(void) { @@ -340,7 +347,9 @@ void boot_master_core(void) /* parse manifest and copy modules */ parse_manifest(); +#ifdef UNUSED_MEMORY_CALCULATION_HAS_BEEN_FIXED hp_sram_power_off_unused_banks(get_fw_size_in_use()); +#endif #endif /* now call SOF entry */ __start();