diff options
-rw-r--r-- | src/mainboard/google/herobrine/boardid.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/mainboard/google/herobrine/boardid.c b/src/mainboard/google/herobrine/boardid.c index fc058e2b1a..1f0c88fcb8 100644 --- a/src/mainboard/google/herobrine/boardid.c +++ b/src/mainboard/google/herobrine/boardid.c @@ -11,6 +11,9 @@ uint32_t board_id(void) { static uint32_t id = UNDEFINED_STRAPPING_ID; + if (id != UNDEFINED_STRAPPING_ID) + return id; + gpio_t pins[3] = { 0 }; if (CONFIG(BOARD_GOOGLE_HEROBRINE_REV0)) { pins[2] = GPIO(75); @@ -22,20 +25,7 @@ uint32_t board_id(void) pins[0] = GPIO(48); } - if (id == UNDEFINED_STRAPPING_ID) - id = gpio_base3_value(pins, ARRAY_SIZE(pins)); - - printk(BIOS_INFO, "BoardID :%d - " - "Machine model: " - "Qualcomm Technologies, Inc. " - "sc7280 platform\n", id); - - return id; -} - -uint32_t ram_code(void) -{ - static uint32_t id = UNDEFINED_STRAPPING_ID; + id = gpio_base3_value(pins, ARRAY_SIZE(pins)); return id; } @@ -44,6 +34,14 @@ uint32_t sku_id(void) { static uint32_t id = UNDEFINED_STRAPPING_ID; + /* + * This means that we already retrieved the sku id from the EC once + * during this boot, so no need to do it again as we'll get the same + * value again. + */ + if (id != UNDEFINED_STRAPPING_ID) + return id; + /* Update modem status in 9th bit of sku id */ uint32_t mask = 1 << 9; id = google_chromeec_get_board_sku(); |