From patchwork Sun Jan 19 07:10:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joel Johnson X-Patchwork-Id: 239756 List-Id: U-Boot discussion From: mrjoel at lixil.net (Joel Johnson) Date: Sun, 19 Jan 2020 00:10:47 -0700 Subject: [PATCH 1/4] cmd: sys_eeprom: add missing implicit header In-Reply-To: <20200119071050.16240-1-mrjoel@lixil.net> References: <20200119071050.16240-1-mrjoel@lixil.net> Message-ID: <20200119071050.16240-2-mrjoel@lixil.net> This addresses the following compiler warning: ../cmd/sys_eeprom.c: In function ‘is_checksum_valid’: ../cmd/sys_eeprom.c:96:13: warning: implicit declaration of function ‘crc32’ [-Wimplicit-function-declaration] calc_crc = crc32(0, (void *)eeprom, ^~~~~ Signed-off-by: Joel Johnson --- cmd/sys_eeprom.c | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/sys_eeprom.c b/cmd/sys_eeprom.c index 373673a526..9e9c1ae8ff 100644 --- a/cmd/sys_eeprom.c +++ b/cmd/sys_eeprom.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "sys_eeprom.h" From patchwork Sun Jan 19 07:10:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Johnson X-Patchwork-Id: 239757 List-Id: U-Boot discussion From: mrjoel at lixil.net (Joel Johnson) Date: Sun, 19 Jan 2020 00:10:48 -0700 Subject: [PATCH 2/4] cmd: sys_eeprom reflect I2C dependency in Kconfig In-Reply-To: <20200119071050.16240-1-mrjoel@lixil.net> References: <20200119071050.16240-1-mrjoel@lixil.net> Message-ID: <20200119071050.16240-3-mrjoel@lixil.net> Given that {read,write}_sys_eeprom hardcode reading from I2C EEPROM devices, make the config dependency reflect this fact. This allows config to handle cases such as the following, which previously failed to build. CONFIG_SPL_DRIVERS_MISC_SUPPORT=n CONFIG_CMD_SYS_EEPROM=y CONFIG_SPL_CMD_SYS_EEPROM=y CONFIG_I2C_EEPROM=y CONFIG_SPL_I2C_EEPROM=y Signed-off-by: Joel Johnson --- cmd/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index 1965245f90..e37c1c6f58 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -250,6 +250,7 @@ config CMD_SYS_EEPROM config SPL_CMD_SYS_EEPROM bool "sys_eeprom for SPL" + depends on SPL_DRIVERS_MISC_SUPPORT depends on SPL_I2C_EEPROM help Read system EEPROM data block. From patchwork Sun Jan 19 07:10:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Johnson X-Patchwork-Id: 239755 List-Id: U-Boot discussion From: mrjoel at lixil.net (Joel Johnson) Date: Sun, 19 Jan 2020 00:10:49 -0700 Subject: [PATCH 3/4] arm: mvebu: clearfog: don't set SPL misc In-Reply-To: <20200119071050.16240-1-mrjoel@lixil.net> References: <20200119071050.16240-1-mrjoel@lixil.net> Message-ID: <20200119071050.16240-4-mrjoel@lixil.net> With SPL_DRIVERS_MISC_SUPPORT being depended on by SPL_CMD_SYS_EEPROM, there is no longer a need to set it separately. Signed-off-by: Joel Johnson --- configs/clearfog_defconfig | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/clearfog_defconfig b/configs/clearfog_defconfig index e932f9c195..9483bbc546 100644 --- a/configs/clearfog_defconfig +++ b/configs/clearfog_defconfig @@ -13,7 +13,6 @@ CONFIG_SPL_MMC_SUPPORT=y CONFIG_SPL_SERIAL_SUPPORT=y CONFIG_ENV_SIZE=0x10000 CONFIG_ENV_OFFSET=0xF0000 -CONFIG_SPL_DRIVERS_MISC_SUPPORT=y CONFIG_NR_DRAM_BANKS=2 CONFIG_SPL=y CONFIG_DEBUG_UART_BASE=0xd0012000 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)