arch: xtensa: move bootloader to cAVS platform files

Bootloader is something cAVS specific and uses many platform specific
definitions and procedures. With new platform family in the future
it will be hard to maintain it in the architecture directory.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
Tomasz Lauda 2020-05-26 10:36:11 +02:00 committed by Tomasz Lauda
parent e5c71007d4
commit 90ddae9ebe
3 changed files with 9 additions and 7 deletions

View File

@ -31,6 +31,10 @@ elseif(CONFIG_IMX8M)
set(platform_folder imx8m)
endif()
if(CONFIG_CAVS)
set(family_path intel/cavs)
endif()
set(fw_name ${CONFIG_FIRMWARE_SHORT_NAME})
if(CONFIG_BOOT_LOADER)
@ -232,7 +236,7 @@ add_custom_target(bin_extras)
if(build_bootloader)
add_executable(bootloader "")
target_link_libraries(bootloader PRIVATE sof_options)
add_local_sources(bootloader xtos/_vectors.S boot_entry.S boot_loader.c)
add_local_sources(bootloader xtos/_vectors.S ${PROJECT_SOURCE_DIR}/src/platform/${family_path}/boot_entry.S ${PROJECT_SOURCE_DIR}/src/platform/${family_path}/boot_loader.c)
target_link_libraries(bootloader PRIVATE reset)
target_link_libraries(bootloader PRIVATE hal)
target_link_libraries(bootloader PRIVATE "-T${PROJECT_BINARY_DIR}/${platform_bootldr_ld_script}")

View File

@ -8,7 +8,7 @@
/*
* Entry point from ROM - assumes :-
*
* 1) C runtime environment is initalised by ROM.
* 1) C runtime environment is initialised by ROM.
* 2) Stack is in first HPSRAM bank.
*/

View File

@ -78,14 +78,13 @@ static inline void bbzero(void *dest, size_t bytes)
}
static void parse_module(struct sof_man_fw_header *hdr,
struct sof_man_module *mod)
struct sof_man_module *mod)
{
int i;
uint32_t bias;
/* each module has 3 segments */
for (i = 0; i < MANIFEST_SEGMENT_COUNT; i++) {
trace_point(TRACE_BOOT_LDR_PARSE_SEGMENT + i);
switch (mod->segment[i].flags.r.type) {
case SOF_MAN_SEGMENT_TEXT:
@ -160,7 +159,6 @@ static void parse_manifest(void)
/* copy module to SRAM - skip bootloader module */
for (i = MAN_SKIP_ENTRIES; i < hdr->num_module_entries; i++) {
trace_point(TRACE_BOOT_LDR_PARSE_MODULE + i);
mod = (struct sof_man_module *)((char *)desc +
SOF_MAN_MODULE_OFFSET(i));
@ -192,7 +190,7 @@ static int32_t hp_sram_pm_banks(uint32_t banks)
ebb_avail_mask0 = (uint32_t)MASK(EBB_SEGMENT_SIZE - 1, 0);
ebb_avail_mask1 = (uint32_t)MASK(total_banks_count -
EBB_SEGMENT_SIZE - 1, 0);
} else{
} else {
ebb_avail_mask0 = (uint32_t)MASK(total_banks_count - 1,
0);
ebb_avail_mask1 = 0;
@ -203,7 +201,7 @@ static int32_t hp_sram_pm_banks(uint32_t banks)
ebb_mask0 = (uint32_t)MASK(EBB_SEGMENT_SIZE - 1, 0);
ebb_mask1 = (uint32_t)MASK(banks - EBB_SEGMENT_SIZE - 1,
0);
} else{
} else {
/* assumption that ebb_in_use is > 0 */
ebb_mask0 = (uint32_t)MASK(banks - 1, 0);
ebb_mask1 = 0;