From patchwork Sun Jan 19 07:10:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Johnson X-Patchwork-Id: 239758 List-Id: U-Boot discussion From: mrjoel at lixil.net (Joel Johnson) Date: Sun, 19 Jan 2020 00:10:50 -0700 Subject: [PATCH 4/4] arm: mvebu: clearfog: fix compile w/o EEPROM In-Reply-To: <20200119071050.16240-1-mrjoel@lixil.net> References: <20200119071050.16240-1-mrjoel@lixil.net> Message-ID: <20200119071050.16240-5-mrjoel@lixil.net> Add conditional checks to ensure still builds without warnings when the EEPROM runtime detection is disabled via config. Signed-off-by: Joel Johnson --- board/solidrun/clearfog/clearfog.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/board/solidrun/clearfog/clearfog.c b/board/solidrun/clearfog/clearfog.c index f407f744bf..031accaf64 100644 --- a/board/solidrun/clearfog/clearfog.c +++ b/board/solidrun/clearfog/clearfog.c @@ -87,6 +87,18 @@ static struct mv_ddr_topology_map board_topology_map = { 0x3, /* clock enable mask */ }; +static bool sr_product_is(const char *product) +{ + /* Allow prefix sub-string match */ + if (strncmp(tlv_product_name[0], product, strlen(product)) == 0) + return true; + if (strncmp(tlv_product_name[1], product, strlen(product)) == 0) + return true; + + return false; +} + +#if defined (CONFIG_SPL_CMD_SYS_EEPROM) static void store_product_name(tlvinfo_tlv_t *tlv_entry) { int len; @@ -104,17 +116,6 @@ static void store_product_name(tlvinfo_tlv_t *tlv_entry) memcpy(dest, tlv_entry->value, len); } -static bool sr_product_is(const char *product) -{ - /* Allow prefix sub-string match */ - if (strncmp(tlv_product_name[0], product, strlen(product)) == 0) - return true; - if (strncmp(tlv_product_name[1], product, strlen(product)) == 0) - return true; - - return false; -} - static void parse_tlv_vendor_ext(tlvinfo_tlv_t *tlv_entry) { struct if_params *ifp = &board_topology_map.interface_params[0]; @@ -172,9 +173,11 @@ static void parse_tlv_data(uint8_t *eeprom, tlvinfo_header_t *hdr, tlv_offset += sizeof(tlvinfo_tlv_t) + entry->length; } } +#endif static void read_tlv_data(void) { +#if defined (CONFIG_SPL_CMD_SYS_EEPROM) uint8_t eeprom_data[TLV_TOTAL_LEN_MAX]; tlvinfo_header_t *tlv_hdr; tlvinfo_tlv_t *tlv_entry; @@ -204,6 +207,7 @@ static void read_tlv_data(void) board_serdes_map[4].serdes_speed = SERDES_SPEED_5_GBPS; board_serdes_map[4].serdes_mode = SERDES_DEFAULT_MODE; } +#endif } struct mv_ddr_topology_map *mv_ddr_topology_map_get(void)