aboutsummaryrefslogtreecommitdiff
path: root/board/ti/common/board_detect.c
diff options
context:
space:
mode:
authorCooper Jr., Franklin2017-06-16 17:25:08 -0500
committerTom Rini2017-07-10 14:25:53 -0400
commit69e8d4ba7f183fcde32ffff1f3136cd10c30dda9 (patch)
tree5696d7246dc343159c6690b8a8949db0e257520f /board/ti/common/board_detect.c
parent2059ecf30f389ec0e396fccc067f6f9fecb36a2c (diff)
ti: common: board_detect: Add function to determine if EEPROM was read
When the EEPROM is first read its contents are stored in memory as a cache to avoid further I2C operations. To determine if the EEPROM was previously read the easiest way is to check the memory to see if the EEPROM's magic header value is set. Create a new function that can determine if the EEPROM was previously read or not without having to perform a I2C transaction. Signed-off-by: Franklin S Cooper Jr <fcooper@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'board/ti/common/board_detect.c')
-rw-r--r--board/ti/common/board_detect.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c
index bf594cb1ab3..1da5ace9236 100644
--- a/board/ti/common/board_detect.c
+++ b/board/ti/common/board_detect.c
@@ -457,3 +457,13 @@ void board_ti_set_ethaddr(int index)
}
}
}
+
+bool __maybe_unused board_ti_was_eeprom_read(void)
+{
+ struct ti_common_eeprom *ep = TI_EEPROM_DATA;
+
+ if (ep->header == TI_EEPROM_HEADER_MAGIC)
+ return true;
+ else
+ return false;
+}