summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/cr50/factory_mode.c19
-rw-r--r--chip/g/board_id.c19
-rw-r--r--chip/g/board_id.h8
3 files changed, 27 insertions, 19 deletions
diff --git a/board/cr50/factory_mode.c b/board/cr50/factory_mode.c
index 520105c241..dfd5c14175 100644
--- a/board/cr50/factory_mode.c
+++ b/board/cr50/factory_mode.c
@@ -14,25 +14,6 @@
#define CPRINTF(format, args...) cprintf(CC_CCD, format, ## args)
-static int board_id_is_erased(void)
-{
- struct board_id id;
- /*
- * If we can't read the board id for some reason, return 0 just to be
- * safe
- */
- if (read_board_id(&id) != EC_SUCCESS) {
- CPRINTS("%s: BID read error", __func__);
- return 0;
- }
-
- if (board_id_is_blank(&id)) {
- CPRINTS("BID erased");
- return 1;
- }
- return 0;
-}
-
static int inactive_image_is_guc_image(void)
{
enum system_image_copy_t inactive_copy;
diff --git a/chip/g/board_id.c b/chip/g/board_id.c
index 588676c41e..0eb6efc0b5 100644
--- a/chip/g/board_id.c
+++ b/chip/g/board_id.c
@@ -40,6 +40,25 @@ int board_id_is_blank(const struct board_id *id)
return board_id_type_is_blank(id) && board_id_flags_are_blank(id);
}
+int board_id_is_erased(void)
+{
+ struct board_id id;
+ /*
+ * If we can't read the board id for some reason, return 0 just to be
+ * safe
+ */
+ if (read_board_id(&id) != EC_SUCCESS) {
+ CPRINTS("%s: BID read error", __func__);
+ return 0;
+ }
+
+ if (board_id_is_blank(&id)) {
+ CPRINTS("BID erased");
+ return 1;
+ }
+ return 0;
+}
+
uint32_t check_board_id_vs_header(const struct board_id *id,
const struct SignedHeader *h)
{
diff --git a/chip/g/board_id.h b/chip/g/board_id.h
index 01cb7e5028..fbac4cb357 100644
--- a/chip/g/board_id.h
+++ b/chip/g/board_id.h
@@ -68,4 +68,12 @@ int board_id_is_blank(const struct board_id *id);
* @return True if the board id type and type_inv are 0xffffffff.
*/
int board_id_type_is_blank(const struct board_id *id);
+
+/**
+ * Check if board id space in INFO1 is erased.
+ *
+ * @return True if INFO1 board ID space is erased, False otherwise.
+ */
+int board_id_is_erased(void);
+
#endif /* ! __EC_CHIP_G_BOARD_ID_H */