aboot: mdtp: add delay before MDTP PIN is compared
If the correct PIN was entered, the LK menu is displayed.
When there's no delay, the previous "OK" press in MDTP UI
is considered again, causing the LK menu to be stuck until
the user performs additional operations or reboots the device.
Change-Id: I9452a39f8ec4b9fdd8b7a549210ab22df15e3ca6
diff --git a/app/aboot/mdtp.c b/app/aboot/mdtp.c
index 21abc12..d44efa3 100644
--- a/app/aboot/mdtp.c
+++ b/app/aboot/mdtp.c
@@ -50,6 +50,8 @@
#define MDTP_MAJOR_VERSION (0)
#define MDTP_MINOR_VERSION (2)
+#define MDTP_CORRECT_PIN_DELAY_MSEC (1000)
+
/** Extract major version number from complete version. */
#define MDTP_GET_MAJOR_VERSION(version) ((version) >> 16)
@@ -62,6 +64,7 @@
int check_aboot_addr_range_overlap(uint32_t start, uint32_t size);
int scm_random(uint32_t * rbuf, uint32_t r_len);
+extern void mdelay(unsigned msecs);
void free_mdtp_image(void);
/********************************************************************************/
@@ -445,6 +448,7 @@
out:
display_image_on_screen();
free_mdtp_image();
+ mdelay(MDTP_CORRECT_PIN_DELAY_MSEC);
}
/* Verify the boot or recovery partitions using boot_verifier. */