ti: AM335x: Use generic EEPROM detection logic

Use the generic EEPROM detection logic instead of duplicating the AM
eeprom logic.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Steven Kipisz <s-kipisz2@ti.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/board/ti/am335x/board.h b/board/ti/am335x/board.h
index bc700d5..062c345 100644
--- a/board/ti/am335x/board.h
+++ b/board/ti/am335x/board.h
@@ -11,53 +11,40 @@
 #ifndef _BOARD_H_
 #define _BOARD_H_
 
-/*
- * TI AM335x parts define a system EEPROM that defines certain sub-fields.
- * We use these fields to in turn see what board we are on, and what
- * that might require us to set or not set.
- */
-#define HDR_NO_OF_MAC_ADDR	3
-#define HDR_ETH_ALEN		6
-#define HDR_NAME_LEN		8
-
-struct am335x_baseboard_id {
-	unsigned int  magic;
-	char name[HDR_NAME_LEN];
-	char version[4];
-	char serial[12];
-	char config[32];
-	char mac_addr[HDR_NO_OF_MAC_ADDR][HDR_ETH_ALEN];
-};
-
-static inline int board_is_bone(struct am335x_baseboard_id *header)
+static inline int board_is_bone(void)
 {
-	return !strncmp(header->name, "A335BONE", HDR_NAME_LEN);
+	return board_ti_is("A335BONE");
 }
 
-static inline int board_is_bone_lt(struct am335x_baseboard_id *header)
+static inline int board_is_bone_lt(void)
 {
-	return !strncmp(header->name, "A335BNLT", HDR_NAME_LEN);
+	return board_ti_is("A335BNLT");
 }
 
-static inline int board_is_evm_sk(struct am335x_baseboard_id *header)
+static inline int board_is_bbg1(void)
 {
-	return !strncmp("A335X_SK", header->name, HDR_NAME_LEN);
+	return board_is_bone_lt() && !strncmp(board_ti_get_rev(), "BBG1", 4);
 }
 
-static inline int board_is_idk(struct am335x_baseboard_id *header)
+static inline int board_is_evm_sk(void)
 {
-	return !strncmp(header->config, "SKU#02", 6);
+	return board_ti_is("A335X_SK");
 }
 
-static inline int board_is_gp_evm(struct am335x_baseboard_id *header)
+static inline int board_is_idk(void)
 {
-	return !strncmp("A33515BB", header->name, HDR_NAME_LEN);
+	return !strncmp(board_ti_get_config(), "SKU#02", 6);
 }
 
-static inline int board_is_evm_15_or_later(struct am335x_baseboard_id *header)
+static inline int board_is_gp_evm(void)
 {
-	return (board_is_gp_evm(header) &&
-		strncmp("1.5", header->version, 3) <= 0);
+	return board_ti_is("A33515BB");
+}
+
+static inline int board_is_evm_15_or_later(void)
+{
+	return (board_is_gp_evm() &&
+		strncmp("1.5", board_ti_get_rev(), 3) <= 0);
 }
 
 /*
@@ -73,5 +60,5 @@
 void enable_uart4_pin_mux(void);
 void enable_uart5_pin_mux(void);
 void enable_i2c0_pin_mux(void);
-void enable_board_pin_mux(struct am335x_baseboard_id *header);
+void enable_board_pin_mux(void);
 #endif