Merge "aboot: mdtp: Updated mdtp definitions." into lk.lnx.1.0-dev.1.0
diff --git a/project/msmtitanium.mk b/project/msmtitanium.mk
index dc275d7..d213104 100644
--- a/project/msmtitanium.mk
+++ b/project/msmtitanium.mk
@@ -89,6 +89,9 @@
CFLAGS += -Werror
+#enable user force reset feature
+DEFINES += USER_FORCE_RESET_SUPPORT=1
+
# Reset USB clock from target code
DEFINES += USB_RESET_FROM_CLK=1
diff --git a/target/msmtitanium/init.c b/target/msmtitanium/init.c
index 952b33f..9d53acd 100644
--- a/target/msmtitanium/init.c
+++ b/target/msmtitanium/init.c
@@ -348,12 +348,16 @@
return _emmc_recovery_init();
}
+#define SMBCHG_USB_RT_STS 0x21310
+#define USBIN_UV_RT_STS BIT(0)
unsigned target_pause_for_battery_charge(void)
{
uint8_t pon_reason = pm8x41_get_pon_reason();
uint8_t is_cold_boot = pm8x41_get_is_cold_boot();
- dprintf(INFO, "%s : pon_reason is %d cold_boot:%d\n", __func__,
- pon_reason, is_cold_boot);
+ bool usb_present_sts = !(USBIN_UV_RT_STS &
+ pm8x41_reg_read(SMBCHG_USB_RT_STS));
+ dprintf(INFO, "%s : pon_reason is:0x%x cold_boot:%d usb_sts:%d\n", __func__,
+ pon_reason, is_cold_boot, usb_present_sts);
/* In case of fastboot reboot,adb reboot or if we see the power key
* pressed we do not want go into charger mode.
* fastboot reboot is warm boot with PON hard reset bit not set
@@ -362,7 +366,7 @@
if (is_cold_boot &&
(!(pon_reason & HARD_RST)) &&
(!(pon_reason & KPDPWR_N)) &&
- ((pon_reason & USB_CHG) || (pon_reason & DC_CHG) || (pon_reason & CBLPWR_N)))
+ usb_present_sts)
return 1;
else
return 0;