/* Write PBL timestamp milestones into beginning of log */ boot_pbl_log_milestones(pbl_shared);
/* Set the reference time to 0 as the start of boot*/ boot_log_set_ref_time(0);
/* Add SBL start entry using stored time from beginning of sbl1_main_ctl */ boot_log_message_raw("SBL1, Start", sbl_start_time, LOG_MSG_TYPE_BOOT, NULL);
voidboot_log_init(boot_log_init_data *init_data) { /*we must first set meta info becasue boot_log_init_ram and * boot_log_init_timer will use the meta info structure*/ boot_log_set_meta_info(init_data->meta_info_start); boot_log_init_ram(init_data); // 初始化ram log boot_init_timer(init_data); // 初始化时钟 boot_log_init_uart();// 初始化串口
/* Write image version values out to the log. */ boot_log_image_version();
/* Write the Boot Config register out to the log. */ boot_log_boot_config_register();
/* Write the Core 0 Apps frequency out to the log. */ boot_log_apps_frequency(0); }/* boot_log_init */
boolean status = FALSE; /* Check whether USB D+ line is grounded. If it is, then enter PBL Download mode */ if(boot_usb_al_check_for_pbl_dload(0)) { boot_dload_transition_pbl_forced_dload(); //进入PBL下载模式 }
/* Determine if the downloader should be entered at this time, instead of continuing with the normal boot process. */ if ( boot_dload_entry( ) == TRUE ) { /* Check the UEFI ram dump cookie, we enter download mode only if UEFI ram dump cookie is NOT set*/ if ( !( boot_shared_imem_cookie_ptr != NULL && boot_shared_imem_cookie_ptr->uefi_ram_dump_magic == UEFI_CRASH_DUMP_MAGIC_NUM ) ) { /* Enter downloader for QPST */ sbl_dload_entry(); // 进入QPST下载模式,即普通下载模式 } } /* Check if PMIC warm reset occured */ BL_VERIFY((boot_pm_pon_warm_reset_status(0, &status) == PM_ERR_FLAG__SUCCESS), BL_ERR_SBL);
/* If status is true, set abonormal reset cookie and clear the warm reset status in PMIC */ if(status) { if ( boot_shared_imem_cookie_ptr != NULL ) boot_shared_imem_cookie_ptr->abnormal_reset_occurred = ABNORMAL_RESET_ENABLED;
# boot_images\core\boot\secboot3\src\boot_dload.c voidboot_dload_transition_pbl_forced_dload( void ) { /* PBL uses the last four bits of BOOT_MISC_DETECT to trigger forced download. Preserve the other bits of the register. */
/* Only execute the pre-dload procedures the first time we try to enter * dload in case there is an error within these procedures. */ if( dload_entry_count == 1 && &bl_shared_data != NULL ) { /* Entering dload routine for the first time */ boot_do_procedures( &bl_shared_data, sbl1_pre_dload_procs ); } /* Enter boot Sahara */ boot_dload_transition_enter_sahara(); }/* sbl_dload_entry() */