bootloader-sbl1-1
2017-01-04 18:57:08 0 举报
bootloader-sbl1-1是一个引导加载程序,它是嵌入式系统中负责加载和启动操作系统内核的关键组件。它通常位于硬件设备的闪存中,当设备上电或复位时,bootloader-sbl1-1会被自动执行。其主要功能包括:检查硬件设备的状态,验证系统完整性,加载和启动操作系统内核,以及提供用户界面以供用户选择不同的启动选项。bootloader-sbl1-1的设计和实现需要考虑到系统的可靠性、安全性和性能等因素,因此它是一个复杂而重要的软件模块。
作者其他创作
大纲/内容
bootloader_sbl1_1
(boot_images\\core\\api\\boot\\boot_error_if.h)boot_error_handler_ptr_type error_handler;
(boot_images/core/boot/secboot3/src/boot_extern_pmic_interface.c)pm_err_flag_type boot_pm_driver_init(void){ return pm_driver_init();}//所有的PMIC API都是在函数sbl1_hw_init_secondary调用boot_pm_dirver_init()之后再被调用
(boot_images\\core\\boot\\secboot3\\src\\Boot_config_data.c)//此函数主要初始化配置数据表,如果eeprom/emmc中存在cdt,则更新编译时链入的cdt表void boot_config_data_table_init(bl_shared_data_type* bl_shared_data){ char bootlog_buffer[BOOT_LOG_TEMP_BUFFER_SIZE]; uint32 bytes_read = 0; /* Reset the flash byte counter so the number of bytes read from flash can be retreived later. */ boot_statistics_reset_flash_byte_counter(); boot_log_message(\
(boot_images\\core\\boot\\secboot3\\src\\boot_api.h)#define BOOT_ERR_FATAL() boot_err_fatal()
(boot_images\\core\\boot\\secboot3\\src\\boot_errorhandler.c)void boot_err_fatal( void ){ BL_ERR_FATAL( BL_ERR_OTHERS );}
(boot_images\\core\\systemdrivers\\pmic\\target\\msm8909_pm8909\\system\\src\\pm_sbl_boot.c)pm_driver_post_init (void){ pm_err_flag_type err = PM_ERR_FLAG__SUCCESS; /* Dead battery charging is NOT enabled in PRE-SIL platforms like RUMI/VIRTIO */ if ( (DalPlatformInfo_Platform() == DALPLATFORMINFO_TYPE_RUMI) || (DalPlatformInfo_Platform() == DALPLATFORMINFO_TYPE_VIRTIO) ) { return err; } err = pm_chg_sbl_charging_state_entry(); //Enable SBL Dead/Weak battery Charging#ifdef PM_TEST_FRAMEWORK_DRIVER err = pm_test_framework ();#endif return err;}
(boot_images\\core\\systemdrivers\\pmic\\framework\\src\\pm_init.c)pm_err_flag_type pm_driver_init( void ){ pm_err_flag_type err_flag = PM_ERR_FLAG__SUCCESS; pm_resource_manager_init(); pm_driver_post_init (); return err_flag;}
DDR配置ddr相关的东西我很少动, 也就不深入分析了,列出几个关键函数,如果需要深入了解的话再分析。ddr初始化主要涉及3个函数
(boot_images\\core\\sysremdrivers\\pmic\\app\\chg\\src\\pm_app_chg_alg.c)/** * @name: pm_chg_sbl_charging_state_entry() * * @description : This function is the main entry function to * the charger state machine. It is called at the * end of PMIC driver initialization: * pm_driver_init() * */pm_err_flag_type pm_chg_sbl_charging_state_entry(void) //called at the end of pm_driver_init{ pm_err_flag_type err_flag = PM_ERR_FLAG__SUCCESS; pm_chg_status.previous_state = PM_CHG_ENTRY_STATE; pm_chg_status.current_state = PM_CHG_ENTRY_STATE; pm_chg_status.batt_level = 0; //Get handle for charger algorithm specific data (from Dal config) sbl_chg_app_ds = (uint16*)pm_target_information_get_specific_info((uint32)PM_PROP_CHG_APP_LUT); //Check Battery/Debug board presence next_state_ptr = &pm_chg_state__battery_and_debug_board_detect; err_flag |= pm_chg_sbl_charging_initialize(); err_flag |= pm_chg_process_sbl_charger_states(); //Process next sbl charging state if( err_flag != PM_ERR_FLAG__SUCCESS) {//Handle All SBL charger algorithm errors BOOT_ERR_FATAL(); // sbl充电状态异常的话,调用此函数,此函数其实就是一个空的while(1),如果执行到此步,机器则死机,必须断电才能继续工作 } return err_flag;}
(boot_images\\core\\systemdrivers\\pmic\\app\\chg\\src\\pm_app_chg_alg.c)//pm_chg_process_sbl_charger_states函数也是启动过程中非常重要的一个函数,此函数里面有一个死循环,用来更新充电状态或者关机,其被pm_chg_sbl_charging_state_entry函数调用(见上调用关系)。插上充电器开机前几秒就出现的重启问题, 多半是此部分出了状况。代码如下 static pm_err_flag_type pm_chg_process_sbl_charger_states(void){ pm_err_flag_type err_flag = PM_ERR_FLAG__SUCCESS; pm_chg_state_alg_ptr_type next_state = NULL; //Process SBL charging states transitions while( (next_state_ptr != NULL) ) { pm_chg_status.previous_state = pm_chg_status.current_state; pm_chg_status.current_state = next_state_ptr-current_chg_state; next_state = next_state_ptr-next_chg_state_alg; if (next_state) { err_flag = next_state(); //transition to next state } if ( ( err_flag != PM_ERR_FLAG__SUCCESS ) || ( pm_chg_status.current_state == PM_CHG_BOOTUP_STATE ) || ( pm_chg_status.current_state == PM_CHG_SHUTDOWN_STATE ) //Shutdown state condition will never happen but we have it for sake of being complete ) { boot_log_message_uart(\"Current status\
0 条评论
下一页