8939sbl部分关闭LDO6电源延迟120ms之后再打开

2019-04-13 16:33发布

0x00004055BMS_VM_S1_SAMPLE_INTERVAL_CTL Type: RW Clock:pbus_wrclk Reset State: 0x0AReset Name: PERPH_RB Bits Name Description 7:0SAMPLE_INTERVAL_NOR-MAL_STATE Sample delay (10*value) in ms in betweenmeasurements normal state (S1). This is basically the sampling interval (ts) ofthe VADC measurements 0x0:SAMPLE_INTERVAL_NORMAL_0MS 0x1:SAMPLE_INTERVAL_NORMAL_10MS 0x2:SAMPLE_INTERVAL_NORMAL_20MS 0x3:SAMPLE_INTERVAL_NORMAL_30MS 0x4:SAMPLE_INTERVAL_NORMAL_40MS 0x5:SAMPLE_INTERVAL_NORMAL_50MS 0x6:SAMPLE_INTERVAL_NORMAL_60MS 0x7:SAMPLE_INTERVAL_NORMAL_70MS 0x8:SAMPLE_INTERVAL_NORMAL_80MS 0x9: SAMPLE_INTERVAL_NORMAL_90MS 0xA:SAMPLE_INTERVAL_NORMAL_100MS 。。。 0xFF: SAMPLE_INTERVAL_NORMAL_2550MS  上面寄存器导致在sbl部分,LDO6每隔100ms就会拉一下电源,导致无法关闭,通过延迟周期解决:
//---------boot_images/core/systemdrivers/pmic/framework/src/pm_init.c   pm_err_flag_type pm_oem_init( void ) {     pm_err_flag_type err_flag= PM_ERR_FLAG__SUCCESS;     uint8 data = 0;     char regdata[10];     pm_clk_sleep_smpl(0,PM_CLK_SLEEP, PM_ON, PM_DELAY_1P0_SEC);       pm_spmi_lite_write_byte(0,0x4055, 0xff, 0);     pm_clk_busy_wait(300*1000);     pm_spmi_lite_read_byte(0,0x4055, &data, 0);    sprintf(regdata,"data=%d ",data);     boot_log_message(regdata);           pm_ldo_sw_enable(0,PM_LDO_6, PM_OFF);     pm_clk_busy_wait(120*1000);     pm_ldo_sw_enable(0,PM_LDO_6, PM_ON);       pm_spmi_lite_write_byte(0,0x4055, 0x0A, 0);         pm_spmi_lite_read_byte(0,0x4055, &data, 0);    sprintf(regdata,"data=%d ",data);     boot_log_message(regdata);        return err_flag; }