ZHCAB93 July 2021 DRA821U , DRA821U-Q1 , DRA829J , DRA829V , DRA829V-Q1 , TDA4VM , TDA4VM-Q1
“Boot_App()”的代码可以在 $J7SDK/ti-processor-sdk-rtos-j721e-evm-xx_xx_xx_xx/mcusw/mcuss_demos/boot_app_mcu_rtos/boot.c 函数 Boot_App() 中找到。
以下是 Boot_App 函数的代码片段。
/* Main Boot task */
static sint32 Boot_App()
{
sint32 retVal;
cpu_core_id_t core_id, *boot_array;
uint8 i, j, num_cores_to_boot, num_booted_cores = 0;
MainDomainBootSetup();
SBL_SPI_init();
SBL_ospiInit(&boardHandle);
/* Initialize the entry point array to 0.*/
for (core_id = MPU1_CPU0_ID; core_id < NUM_CORES; core_id ++) {
(&k3xx_evmEntry)->CpuEntryPoint[core_id] = SBL_INVALID_ENTRY_ADDR;
}
for (j = 0; j < NUM_BOOT_STAGES; j++) {
retVal = RequestStageCores(j);
if (retVal != CSL_PASS) {
ReleaseStageCores(j);
} else {
retVal = OSPIBootStageImage(&k3xx_evmEntry, ospi_main_domain_flash_rtos_images[j]);
if (retVal != CSL_PASS){
} else {
retVal = ReleaseStageCores(j);
if (retVal != CSL_PASS) {
}
}
} /* if (retVal != CSL_PASS) */
if (retVal == CSL_PASS) {
/* Start the individual cores for the boot stage */
num_cores_to_boot = num_cores_per_boot_stage[j];
boot_array = boot_array_stage[j];
for (i = 0; i < num_cores_to_boot; i++) {
core_id = boot_array[i];
/* Try booting all cores other than the cluster running the SBL */
if ((k3xx_evmEntry.CpuEntryPoint[core_id] != SBL_INVALID_ENTRY_ADDR) &&
((core_id != MCU1_CPU1_ID) && (core_id != MCU1_CPU0_ID))) {
SBL_SlaveCoreBoot(core_id, NULL, &k3xx_evmEntry,SBL_REQUEST_CORE);
num_booted_cores++;
}
}
} /* if (retVal == CSL_PASS) */
} /* for (j = 0; j < NUM_BOOT_STAGES; j++) */
SBL_ospiClose(&boardHandle);
return (retVal);
}