summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/vboot/efs2.c12
-rw-r--r--include/vboot.h5
2 files changed, 11 insertions, 6 deletions
diff --git a/common/vboot/efs2.c b/common/vboot/efs2.c
index 7c04d2460e..e5c3b64f04 100644
--- a/common/vboot/efs2.c
+++ b/common/vboot/efs2.c
@@ -49,7 +49,7 @@ static bool is_valid_cr50_response(enum cr50_comm_err code)
&& (code >> 8) == CR50_COMM_ERR_PREFIX;
}
-static void enable_packet_mode(bool enable)
+__overridable void board_enable_packet_mode(bool enable)
{
/*
* This can be done by set_flags(INPUT|PULL_UP). We don't need it now
@@ -66,14 +66,14 @@ static enum cr50_comm_err send_to_cr50(const uint8_t *data, size_t size)
struct cr50_comm_response res = {};
/* This will wake up (if it's sleeping) and interrupt Cr50. */
- enable_packet_mode(true);
+ board_enable_packet_mode(true);
uart_flush_output();
uart_clear_input();
if (uart_shell_stop()) {
/* Failed to stop the shell. */
- enable_packet_mode(false);
+ board_enable_packet_mode(false);
return CR50_COMM_ERR_UNKNOWN;
}
@@ -122,7 +122,7 @@ static enum cr50_comm_err send_to_cr50(const uint8_t *data, size_t size)
#endif /* CONFIG_ZEPHYR */
/* Exit packet mode */
- enable_packet_mode(false);
+ board_enable_packet_mode(false);
CPRINTS("Received 0x%04x", res.error);
@@ -177,10 +177,10 @@ static enum cr50_comm_err verify_hash(void)
int rv;
/* Wake up Cr50 beforehand in case it's asleep. */
- enable_packet_mode(true);
+ board_enable_packet_mode(true);
CPRINTS("Ping Cr50");
msleep(1);
- enable_packet_mode(false);
+ board_enable_packet_mode(false);
rv = vboot_get_rw_hash(&hash);
if (rv)
diff --git a/include/vboot.h b/include/vboot.h
index 9c09e1aba2..52ccae6e90 100644
--- a/include/vboot.h
+++ b/include/vboot.h
@@ -87,6 +87,11 @@ __override_proto void show_critical_error(void);
*/
__override_proto void show_power_shortage(void);
+/*
+ * Board level packet mode enable function.
+ */
+__override_proto void board_enable_packet_mode(bool enable);
+
/**
* Interrupt handler for packet mode entry.
*