背景:底板回来了,直接调试底板时遇到无法开机问题,死在XBL的电池温度检测阶段了。
0.编译release版本 XBL,无法开机,死在XBL的电池温度检测阶段。
python -u boot_images/QcomPkg/buildit.py --variant LA -r RELEASE -t Sdm660Pkg, QcomToolsPkg
python -u boot_images/QcomPkg/buildit.py --variant LA -r RELEASE -t Sdm660Pkg, QcomToolsPkg --build_flags=cleanall
Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.XF.1.4-00277-S660LZB-1
S - IMAGE_VARIANT_STRING=Sdm660LA
S - OEM_IMAGE_VERSION_STRING=ubuntu-dell
S - Boot Interface: eMMC
S - Secure Boot: Off
S - Boot Config @ 0x00786070 = 0x000001c1
S - JTAG ID @ 0x00786130 = 0x0008c0e1
S - OEM ID @ 0x00786138 = 0x00000000
S - Serial Number @ 0x00784138 = 0x79a732b2
S - OEM Config Row 0 @ 0x00784188 = 0x0000000000000000
S - OEM Config Row 1 @ 0x00784190 = 0x0000000000000000
S - Feature Config Row 0 @ 0x007841a0 = 0x0050200010f80000
S - Feature Config Row 1 @ 0x007841a8 = 0x00000000000000c0
S - Core 0 Frequency, 3715 MHz
S - PBL Patch Ver: 5
S - I-cache: On
S - D-cache: On
B - 0 - PBL, Start
B - 7027 - bootable_media_detect_entry, Start
B - 69585 - bootable_media_detect_success, Start
B - 69590 - elf_loader_entry, Start
B - 71194 - auth_hash_seg_entry, Start
B - 71527 - auth_hash_seg_exit, Start
B - 121869 - elf_segs_hash_verify_entry, Start
B - 171591 - elf_segs_hash_verify_exit, Start
B - 171605 - auth_xbl_sec_hash_seg_entry, Start
B - 200776 - auth_xbl_sec_hash_seg_exit, Start
B - 200779 - xbl_sec_segs_hash_verify_entry, Start
B - 207590 - xbl_sec_segs_hash_verify_exit, Start
B - 207638 - PBL, End
B - 233691 - SBL1, Start
B - 357917 - usb: hs_phy_nondrive_start
B - 358222 - usb: hs_phy_nondrive_finish
B - 361120 - boot_flash_init, Start
D - 0 - boot_flash_init, Delta
B - 368470 - sbl1_ddr_set_default_params, Start
D - 122 - sbl1_ddr_set_default_params, Delta
B - 376461 - boot_config_data_table_init, Start
B - 395280 - Using default CDT
D - 14335 - boot_config_data_table_init, Delta - (0 Bytes)
B - 397232 - CDT Version:3,Platform ID:8,Major ID:1,Minor ID:0,Subtype:0
B - 402691 - Image Load, Start
D - 671 - Auth Metadata
D - 457 - Segments hash check
D - 12536 - PMIC Image Loaded, Delta - (34416 Bytes)
B - 418551 - pm_device_init, Start
B - 425749 - PM: PON REASON: PM0=0x4000008000000080:0x1000 PM1=0x400008000000020:0x0
B - 468846 - PM: SET_VAL:Skip
D - 46543 - pm_device_init, Delta
B - 470767 - pm_driver_init, Start
B - 477843 - PM: OCP Clearing for L4A is Skipped :PM660 is not supported the LDO4
D - 4148 - pm_driver_init, Delta
B - 484980 - pm_sbl_chg_init, Start
B - 490470 - PM: Trigger FG IMA Reset
B - 491904 - PM: Trigger FG IMA Reset.Completed
B - 496753 - PM: EntryVbat: 3944; EntrySOC: -1
B - 499895 - PM: Manually set USB500 mode for SDP and 1500 mA ICL for DCP
B - 1503741 - PM: BATT TEMP: -26 DegC
B - 1503772 - PM: BATT TEMP Read2: -26 DegC
B - 1506364 - PM: ERROR: Out of Bound Temp Conditon Occured, Performing AFP: VBATT TEMP : -26 DegC.; Min Limit: -20; Max Limit: 80;
1.修改XBL代码,绕过电池温度检测。
//BOOT.XF.1.4/boot_images/QcomPkg/Library/PmicLib/app/chg/src/pm_app_chgr.c
pm_err_flag_type
pm_app_chgr_check_batt_temp_limits(uint32 device_index, pm_sbl_schg_batt_therm_type *batt_therm_ptr)
{
pm_err_flag_type err_flag = PM_ERR_FLAG__SUCCESS;
int32 batt_temp;
CORE_VERIFY_PTR(batt_therm_ptr);
//Ensure Batt therm coefficents are confiugred for accurate temp reading
if( batt_therm_coeff_cfg_flag == FALSE )
{
return err_flag = PM_ERR_FLAG__FEATURE_NOT_SUPPORTED;
}
//Check if SW based Batt Therm monitoring is enabled
if (batt_therm_ptr->enable_batt_therm_cfg == PM_ENABLE_CONFIG)
{
err_flag |= pm_fg_batt_info_get_batt_temp(device_index, &batt_temp); //Read Batt Temp
pm_log_message("BATT TEMP: %d DegC", batt_temp);
//Check for outof bound limit
if(( batt_temp < batt_therm_ptr->batt_temp_limit.critical_low_limit) ||
( batt_temp > batt_therm_ptr->batt_temp_limit.critical_high_limit))
{
//Double check that the outofbound temp condition
err_flag |= pm_fg_batt_info_get_batt_temp(device_index, &batt_temp);
pm_log_message("BATT TEMP Read2: %d DegC", batt_temp);
if(( batt_temp < batt_therm_ptr->batt_temp_limit.critical_low_limit) ||
( batt_temp > batt_therm_ptr->batt_temp_limit.critical_high_limit))
{
pm_log_message("ERROR: Out of Bound Temp Conditon Occured, Performing AFP: VBATT TEMP : %d DegC.; Min Limit: %d; Max Limit: %d; ",
batt_temp, batt_therm_ptr->batt_temp_limit.critical_low_limit, batt_therm_ptr->batt_temp_limit.critical_high_limit);
+ /*
err_flag |= pm_busy_wait(PM_WEAK_BATTERY_CHARGING_AFP_DELAY); //Needed to give just enough time for UART logging
err_flag |= pm_schg_misc_en_afp(device_index); //perform AFP. Control does not return
+ */
}
}
}
2.强制启动成功,PBL-->XBL-->ABL(LinuxLoader)->Linux
Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset), D - Delta, S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.XF.1.4-00277-S660LZB-1
S - IMAGE_VARIANT_STRING=Sdm660LA
S - OEM_IMAGE_VERSION_STRING=ubuntu-dell
S - Boot Interface: eMMC
S - Secure Boot: Off
S - Boot Config @ 0x00786070 = 0x000001c1
S - JTAG ID @ 0x00786130 = 0x0008c0e1
S - OEM ID @ 0x00786138 = 0x00000000
S - Serial Number @ 0x00784138 = 0x79a732b2
S - OEM Config Row 0 @ 0x00784188 = 0x0000000000000000
S - OEM Config Row 1 @ 0x00784190 = 0x0000000000000000
S - Feature Config Row 0 @ 0x007841a0 = 0x0050200010f80000
S - Feature Config Row 1 @ 0x007841a8 = 0x00000000000000c0
S - Core 0 Frequency, 3715 MHz
S - PBL Patch Ver: 5
S - I-cache: On
S - D-cache: On
B - 0 - PBL, Start
B - 7027 - bootable_media_detect_entry, Start
B - 80118 - bootable_media_detect_success, Start
B - 80123 - elf_loader_entry, Start
B - 81648 - auth_hash_seg_entry, Start
B - 81981 - auth_hash_seg_exit, Start
B - 132302 - elf_segs_hash_verify_entry, Start
B - 182025 - elf_segs_hash_verify_exit, Start
B - 182038 - auth_xbl_sec_hash_seg_entry, Start
B - 211195 - auth_xbl_sec_hash_seg_exit, Start
B - 211197 - xbl_sec_segs_hash_verify_entry, Start
B - 218007 - xbl_sec_segs_hash_verify_exit, Start
B - 218055 - PBL, End
B - 244122 - SBL1, Start
B - 368318 - usb: hs_phy_nondrive_start
B - 368653 - usb: hs_phy_nondrive_finish
B - 371520 - boot_flash_init, Start
D - 30 - boot_flash_init, Delta
B - 378871 - sbl1_ddr_set_default_params, Start
D - 122 - sbl1_ddr_set_default_params, Delta
B - 386862 - boot_config_data_table_init, Start
B - 405467 - Using default CDT
D - 14121 - boot_config_data_table_init, Delta - (0 Bytes)
B - 407419 - CDT Version:3,Platform ID:8,Major ID:1,Minor ID:0,Subtype:0
B - 412878 - Image Load, Start
D - 671 - Auth Metadata
D - 457 - Segments hash check
D - 12536 - PMIC Image Loaded, Delta - (34416 Bytes)
B - 428738 - pm_device_init, Start
B - 435936 - PM: PON REASON: PM0=0x8000028000000001:0x0 PM1=0x8000088000000020:0x0
B - 479094 - PM: SET_VAL:Skip
D - 46604 - pm_device_init, Delta
B - 481015 - pm_driver_init, Start
B - 488122 - PM: OCP Clearing for L4A is Skipped :PM660 is not supported the LDO4
D - 4148 - pm_driver_init, Delta
B - 495259 - pm_sbl_chg_init, Start
B - 499864 - PM: ERROR: Invalid adcResult.eStatus
B - 502030 - PM: BOOTUP, NO Battery
D - 8235 - pm_sbl_chg_init, Delta
B - 510082 - vsense_init, Start
D - 0 - vsense_init, Delta
B - 575443 - Pre_DDR_clock_init, Start
D - 396 - Pre_DDR_clock_init, Delta
D - 0 - sbl1_ddr_set_params, Delta
B - 587155 - DSF version = 37.0, DSF RPM version = 22.0
B - 587186 - Max Frequency = 1804 MHz
B - 591364 - do_ddr_training, Start
B - 603625 - Bootup frequency set to 1296000
D - 8753 - do_ddr_training, Delta
B - 623511 - clock_init, Start
D - 274 - clock_init, Delta
B - 625982 - Image Load, Start
D - 2501 - APDP Image Loaded, Delta - (0 Bytes)
B - 631533 - usb: EMMC Serial - c153d4f0
B - 636321 - usb: fedl, vbus_low
B - 643550 - PM: 0: PON=0x1:HARD_RESET: ON=0x80:PON_SEQ: POFF=0x2:PS_HOLD: OFF=0x80:POFF_SEQ
B - 643641 - PM: 1: PON=0x20:PON1: ON=0x80:PON_SEQ: POFF=0x8:GP1: OFF=0x80:POFF_SEQ
B - 651907 - PM: SMEM Chgr Info Write Success
B - 659379 - sbl1_efs_handle_cookies, Start
D - 701 - sbl1_efs_handle_cookies, Delta
B - 667858 - Image Load, Start
D - 2806 - Auth Metadata
D - 793 - Segments hash check
D - 10401 - QSEE Dev Config Image Loaded, Delta - (42076 Bytes)
B - 681156 - Image Load, Start
D - 610 - SEC Image Loaded, Delta - (4096 Bytes)
B - 690001 - Image Load, Start
D - 23485 - Auth Metadata
D - 18453 - Segments hash check
D - 64386 - QSEE Image Loaded, Delta - (1949080 Bytes)
B - 756186 - Image Load, Start
D - 2836 - Auth Metadata
D - 3813 - Segments hash check
D - 16806 - QHEE Image Loaded, Delta - (273136 Bytes)
B - 774974 - Image Load, Start
D - 2928 - Auth Metadata
D - 2044 - Segments hash check
D - 16226 - RPM Image Loaded, Delta - (219436 Bytes)
B - 793915 - Image Load, Start
D - 4361 - STI Image Loaded, Delta - (0 Bytes)
B - 801814 - Image Load, Start
D - 2867 - Auth Metadata
D - 1373 - Segments hash check
D - 11254 - ABL Image Loaded, Delta - (146000 Bytes)
B - 815356 - Image Load, Start
D - 3447 - Auth Metadata
D - 13878 - Segments hash check
D - 33885 - APPSBL Image Loaded, Delta - (1792000 Bytes)
B - 851621 - SBL1, End
D - 612379 - SBL1, Delta
S - Flash Throughput, 96000 KB/s (4465452 Bytes, 46443 us)
S - DDR Frequency, 1296 MHz
UEFI Start [ 1027] SEC
PROD Mode : Off
DEBUG Mode : On
ASLR : On
Timer Delta : +7 mS
RAM Entry 0 : Base 0x0000000040000000 Size 0x0000000060000000
RAM Entry 1 : Base 0x00000000A0000000 Size 0x000000005E9C0000
CONF File : uefiplatLA.cfg
UEFI Ver : 4.2.191224.BOOT.XF.1.4-00277-S660LZB-1
Build Info : 64b Dec 24 2019 09:12:10
Boot Device : eMMC
- 0x09C3D5000 [ 1098] DxeCore.efi
Loading DxeCore at 0x009C3D5000 EntryPoint=0x009C3D6840
HOBLIST address in DXE = 0x9C1C6018
FV Hob 0x9FC00000 - 0x9FDB57FF
FV Hob 0x9C884000 - 0x9CCEAFFF
FV2 Hob 0x9C884000 - 0x9CCEAFFF
- 0x09C372000 [ 1107] EnvDxe.efi
- 0x09C36A000 [ 1108] ReportStatusCodeRouterRuntimeDxe.efi
- 0x09C361000 [ 1108] StatusCodeHandlerRuntimeDxe.efi
- 0x09BC76000 [ 1108] RuntimeDxe.efi
- 0x09C351000 [ 1109] ArmCpuDxe.efi
- 0x09C349000 [ 1110] ArmGicDxe.efi
- 0x09C342000 [ 1117] ArmTimerDxe.efi
- 0x09C33B000 [ 1117] WatchdogTimer.efi
- 0x09C321000 [ 1117] SecurityDxe.efi
- 0x09C318000 [ 1118] ASN1X509Dxe.efi
- 0x09C30F000 [ 1118] SecRSADxe.efi
- 0x09C301000 [ 1118] VerifiedBootDxe.efi
- 0x09C2F9000 [ 1119] SmemDxe.efi
- 0x09C2D1000 [ 1119] DALSys.efi
- 0x09C2C9000 [ 1120] HWIODxeDriver.efi
- 0x09C2C0000 [ 1120] ChipInfo.efi
- 0x09C2B9000 [ 1121] PlatformInfoDxeDriver.efi
- 0x09C2B2000 [ 1121] MetronomeDxe.efi
- 0x09C2A6000 [ 1122] GlinkDxe.efi
- 0x09C293000 [ 1122] ULogDxe.efi
- 0x09C27A000 [ 1123] NpaDxe.efi
- 0x09C25C000 [ 1123] ClockDxe.efi
DALLOG Device [0x2000145]: Cannot turn on source[ACPL
- 0x09C254000 [ 1136] DiskIoDxe.efi
- 0x09C249000 [ 1136] PartitionDxe.efi
- 0x09BC06000 [ 1136] SdccDxe.efi
- 0x09C233000 [ 1167] UFSDxe.efi
- 0x09C224000 [ 1167] Fat.efi
- 0x09C21D000 [ 1168] EnglishDxe.efi
- 0x09C213000 [ 1168] FvSimpleFileSystem.efi
- 0x09C206000 [ 1169] QdssDxe.efi
- 0x09BB83000 [ 1169] EmuVariableRuntimeDxe.efi
- 0x09BB7C000 [ 1170] EmbeddedMonotonicCounter.efi
- 0x09BB8D000 [ 1170] ResetRuntimeDxe.efi
- 0x09BB6B000 [ 1171] RealTimeClock.efi
- 0x09C1FD000 [ 1171] PrintDxe.efi
- 0x09C1EB000 [ 1172] DevicePathDxe.efi
- 0x09BB55000 [ 1172] CapsuleRuntimeDxe.efi
- 0x09BB14000 [ 1173] HiiDatabase.efi
- 0x09C1E2000 [ 1173] FontDxe.efi
- 0x09BA81000 [ 1180] QcomBds.efi
- 0x09C1D9000 [ 1181] DALTLMM.efi
- 0x09C1CE000 [ 1181] I2C.efi
- 0x09BB0C000 [ 1182] SPMI.efi
- 0x09BAF1000 [ 1183] SPI.efi
- 0x09B9F3000 [ 1183] PmicDxe.efi
- 0x09BAC7000 [ 1188] AdcDxe.efi
- 0x09BA2B000 [ 1189] QcomChargerDxeLA.efi
Locate SCM Protocol failed, Status = (0xE)
Mounting FAT Volume: logfs
Locate SCM Protocol failed, Status = (0xE)
PmicDxe:: PmicFgSram_SramHealthy SRAM contents are good
- 0x09B959000 [ 2777] UsbfnDwc3Dxe.efi
- 0x09B94B000 [ 2777] UsbConfigDxe.efi
- 0x09B981000 [ 2778] SimpleTextInOutSerial.efi
- 0x09B970000 [ 2779] ConPlatformDxe.efi
- 0x09B932000 [ 2779] ConSplitterDxe.efi
- 0x09B927000 [ 2780] GraphicsConsoleDxe.efi
- 0x09B978000 [ 2781] ButtonsDxe.efi
- 0x09B920000 [ 2781] TsensDxe.efi
- 0x09B8AD000 [ 2782] DisplayDxe.efi
Mounting FAT Volume: logfs
Locate SCM Protocol failed, Status = (0xE)
DisplayUtils: mount logfs system failed with status 14!
Mounting FAT Volume: logfs
Locate SCM Protocol failed, Status = (0xE)
DisplayUtils: mount logfs system failed with status 14!
CheckPanelOverride
MDP_Display_GetVariable
Mounting FAT Volume: logfs
Locate SCM Protocol failed, Status = (0xE)
DisplayUtils: mount logfs system failed with status 14!
MDPLib : SetClockFreqHz: Clock "mmss_mdss_axi_clk" to 240000000Hz returned an error!
DisplayDxe: Panel ID:0x00000000 (detection time: 0ms) [LCD]
uDynamicBitClkFreq[0]=798240576
uDynamicBitClkFreq[1]=801594528
uDynamicBitClkFreq[2]=804948480
uDynamicBitClkFreq[3]=808302432
uDynamicBitClkFreq[4]=811656384
Dynamic refresh calibration: DeviceId=0, cost_time=6244 us
uDynamicBitClkFreq[0]=798240576
uDynamicBitClkFreq[1]=801594528
uDynamicBitClkFreq[2]=804948480
uDynamicBitClkFreq[3]=808302432
uDynamicBitClkFreq[4]=811656384
Dynamic refresh calibration: DeviceId=1, cost_time=5490 us
Render Splash [ 3178]
EnvDxe Render Callback
- 0x09B6C1000 [ 3178] TzDxe.efi
Mounting FAT Volume: tzapps
AppReg Init:7 mS
LoadSecureApps: Load app from partition(keymaster): Status = 0x0, AppId = 65537
- 0x09B528000 [ 3293] LimitsDxe.efi
APC1 IDDQ WC 0 , L2:0, CPU[0]:175, CPU[1]:175, CPU[2]:175, CPU[3]:175
APC1 Total 700
Load CPU 0 Slp: 0x8D, Int: 0x0
Load CPU 1 Slp: 0x1, Int: 0x0
Load CPU 2 Slp: 0xBF, Int: 0xFFFFFFF2
Load CPU 3 Slp: 0x1, Int: 0x0
GLD IDDQ WC 0
CPU PART GOOD [0x0] SUB_BIN[0x0]
- 0x09B50B000 [ 3296] MdtpDxe.efi
- 0x09B4E8000 [ 3297] HashDxe.efi
- 0x09B8E6000 [ 3297] RngDxe.efi
- 0x09B521000 [ 3298] MpPowerDxe.efi
- 0x09B51A000 [ 3299] ChargerExDxe.efi
- 0x09B4DB000 [ 3299] UsbMsdDxe.efi
- 0x09B533000 [ 3300] UsbDeviceDxe.efi
-----------------------------
Platform Init [ 3320] BDS
UEFI Ver : 4.2.191224.BOOT.XF.1.4-00277-S660LZB-1
Platform : MTP
Chip Name : SDM660
Chip Ver : 1.0
Core 0 Freq: 1382400 MHz
Mounting FAT Volume: logfs
-----------------------------
[ethan] LoadImage start
- 0x09B3E9000 [ 3328] QcomChargerApp.efi
[ethan] StartImage start
[ethan] StartImage end
UEFI Total : 4328 ms
POST Time [ 5355] OS Loader
[ethan] LoadImage start
- 0x09B270000 [ 5356] LinuxLoader.efi
[ethan] StartImage start
Loader Build Info: Dec 25 2019 18:25:12
VB: RWDeviceState: Succeed using devinfo!
Booting from slot (_a)
Loading Image Start : 5362 ms
Loading Image Done : 5363 ms
Total Image Read size : 4096 Bytes
Loading Image Start : 5363 ms
Loading Image Done : 5685 ms
Total Image Read size : 55287808 Bytes
No dtbo partition is found, Skip dtbo
VB: DeviceInit: Device is unlocked! Skipping verification!
VB: VerifyImage: Image verification done! boot state is: ORANGE
VB:VerifyImage time spent: 0 mS
Exit key detection timer
No Ffbm cookie found, ignore: Not Found
Memory Base Address: 0x40000000
Decompressing kernel image start: 15956 ms
Decompressing kernel image done: 16411 ms
BootLinux: failed to get dtbo image
Best match DTB tags 317/00000008/0x00000000/0/1001B/102001A/0/0/(offset)0x9AA8603F/(size)0x0004FC8B
Using pmic info 0x1001B/0x102001A/0x0/0x0 for device 0x2001B/0x102001A/0x0/0x0
Memory Base Address: 0x40000000
PON Reason is 1 cold_boot:1 charger path: 0
Cmdline: console=ttyMSM0,115200,n8 androidboot.console=ttyMSM0 earlycon=msm_serial_dm,0xc170000 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 sched_enable_hmp=1 sched_enable_power_aware=1 service_l
RAM Partitions
Add Base: 0x0000000040000000 Available Length: 0x0000000060000000
Add Base: 0x00000000A0000000 Available Length: 0x000000005E9C0000
WARNING: Could not find mem-offline node.
kaslr-Seed is added to chosen node
Shutting Down UEFI Boot Services: 16494 ms
BDS: LogFs sync skipped, Unsupported
App Log Flush : 18 ms
Exit BS [16515] UEFI End
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Initializing cgroup subsys schedtune
[ 0.000000] Linux version 4.4.153 (ethan@beyond-Vostro-5090-China-HDD-Protection) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #14 SMP PREEMPT Thu Dec 26 15:03:04 CST 2019
[ 0.000000] Boot CPU: AArch64 Processor [51af8014]
[ 0.000000] Machine: Qualcomm Technologies, Inc. SDM 660 PM660 + PM660L MTP
[ 0.000000] earlycon: Early serial console at MMIO 0xc170000 (options '')
[ 0.000000] bootconsole [uart0] enabled