[PATCH 0/4] Updates for ClearFog EEPROM

This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Joel Johnson (4): cmd: sys_eeprom: add missing implicit header cmd: sys_eeprom reflect I2C dependency in Kconfig arm: mvebu: clearfog: don't set SPL misc arm: mvebu: clearfog: fix compile w/o EEPROM
board/solidrun/clearfog/clearfog.c | 26 +++++++++++++++----------- cmd/Kconfig | 1 + cmd/sys_eeprom.c | 1 + configs/clearfog_defconfig | 1 - 4 files changed, 17 insertions(+), 12 deletions(-)

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 mrjoel@lixil.net ---
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 <i2c_eeprom.h> #include <env.h> #include <linux/ctype.h> +#include <u-boot/crc.h>
#include "sys_eeprom.h"

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 mrjoel@lixil.net ---
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.

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 mrjoel@lixil.net ---
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

Add conditional checks to ensure still builds without warnings when the EEPROM runtime detection is disabled via config.
Signed-off-by: Joel Johnson mrjoel@lixil.net ---
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)

Hi Joel,
On Sun, Jan 19 2020, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Thank you very much.
I'm currently working on an updated series with some significant changes. These include rename of sys_eeprom to tlv_eeprom; move of TLV parse code to board/solidrun/common/; and support for TLV read in pre-relocation phase. I'll add your fixes where applicable.
I hope to post v2 in the coming week.
baruch
Joel Johnson (4): cmd: sys_eeprom: add missing implicit header cmd: sys_eeprom reflect I2C dependency in Kconfig arm: mvebu: clearfog: don't set SPL misc arm: mvebu: clearfog: fix compile w/o EEPROM
board/solidrun/clearfog/clearfog.c | 26 +++++++++++++++----------- cmd/Kconfig | 1 + cmd/sys_eeprom.c | 1 + configs/clearfog_defconfig | 1 - 4 files changed, 17 insertions(+), 12 deletions(-)

On 2020-01-19 00:22, Baruch Siach wrote:
Hi Joel,
On Sun, Jan 19 2020, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Thank you very much.
I'm currently working on an updated series with some significant changes. These include rename of sys_eeprom to tlv_eeprom; move of TLV parse code to board/solidrun/common/; and support for TLV read in pre-relocation phase. I'll add your fixes where applicable.
I hope to post v2 in the coming week.
baruch
Sounds good, thanks! I'm also getting ready to shoot out a V2 of my static ClearFog Base support which based on prior review I've rebased on your run-time config series. If it works for you, I'll go ahead and still send that out for review, modulo your further changes. Are you expecting the TLV/EEPROM change updates to be included in time for the current merge window?
Joel

Hi Joel,
On Sun, Jan 19 2020, Joel Johnson wrote:
On 2020-01-19 00:22, Baruch Siach wrote:
On Sun, Jan 19 2020, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Thank you very much.
I'm currently working on an updated series with some significant changes. These include rename of sys_eeprom to tlv_eeprom; move of TLV parse code to board/solidrun/common/; and support for TLV read in pre-relocation phase. I'll add your fixes where applicable.
I hope to post v2 in the coming week.
baruch
Sounds good, thanks! I'm also getting ready to shoot out a V2 of my static ClearFog Base support which based on prior review I've rebased on your run-time config series. If it works for you, I'll go ahead and still send that out for review, modulo your further changes. Are you expecting the TLV/EEPROM change updates to be included in time for the current merge window?
I hope to have TLV EEPROM ready for v2020.04.
baruch

On 2020-01-19 01:41, Baruch Siach wrote:
Hi Joel,
On Sun, Jan 19 2020, Joel Johnson wrote:
On 2020-01-19 00:22, Baruch Siach wrote:
On Sun, Jan 19 2020, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Thank you very much.
I'm currently working on an updated series with some significant changes. These include rename of sys_eeprom to tlv_eeprom; move of TLV parse code to board/solidrun/common/; and support for TLV read in pre-relocation phase. I'll add your fixes where applicable.
I hope to post v2 in the coming week.
baruch
Sounds good, thanks! I'm also getting ready to shoot out a V2 of my static ClearFog Base support which based on prior review I've rebased on your run-time config series. If it works for you, I'll go ahead and still send that out for review, modulo your further changes. Are you expecting the TLV/EEPROM change updates to be included in time for the current merge window?
I hope to have TLV EEPROM ready for v2020.04.
baruch
Hmm, I was hoping to have the static config for ClearFog Base merged in the current merge window, so just to be clear is that what you're targeting by v2020.04 as well?
With my recent rebasing, I believe I made the changes compatible between static and runtime configuration, but it's less important what order they're applied in - i.e. I can rebase again back on master and retain the alignment. Perhaps it would be possible to merge the static changes and then update the static config entries' help text with a subsequent merge of your runtime work?
Joel

Hi Joel,
On Sun, Jan 19 2020, Joel Johnson wrote:
On 2020-01-19 01:41, Baruch Siach wrote:
On Sun, Jan 19 2020, Joel Johnson wrote:
On 2020-01-19 00:22, Baruch Siach wrote:
On Sun, Jan 19 2020, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Thank you very much.
I'm currently working on an updated series with some significant changes. These include rename of sys_eeprom to tlv_eeprom; move of TLV parse code to board/solidrun/common/; and support for TLV read in pre-relocation phase. I'll add your fixes where applicable.
I hope to post v2 in the coming week.
baruch
Sounds good, thanks! I'm also getting ready to shoot out a V2 of my static ClearFog Base support which based on prior review I've rebased on your run-time config series. If it works for you, I'll go ahead and still send that out for review, modulo your further changes. Are you expecting the TLV/EEPROM change updates to be included in time for the current merge window?
I hope to have TLV EEPROM ready for v2020.04.
Hmm, I was hoping to have the static config for ClearFog Base merged in the current merge window, so just to be clear is that what you're targeting by v2020.04 as well?
Yes. Code merged in this merge windows will appear in the next release which is v2020.04.
I have just posted the updated series with your fixes squashed in, sometimes in a different form (like the non CMD_TLV_EEPROM build fix).
With my recent rebasing, I believe I made the changes compatible between static and runtime configuration, but it's less important what order they're applied in - i.e. I can rebase again back on master and retain the alignment. Perhaps it would be possible to merge the static changes and then update the static config entries' help text with a subsequent merge of your runtime work?
I'm not sure what you mean hear.
baruch

On 2020-01-20 05:25, Baruch Siach wrote:
Hi Joel,
On Sun, Jan 19 2020, Joel Johnson wrote:
On 2020-01-19 01:41, Baruch Siach wrote:
On Sun, Jan 19 2020, Joel Johnson wrote:
On 2020-01-19 00:22, Baruch Siach wrote:
On Sun, Jan 19 2020, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Thank you very much.
I'm currently working on an updated series with some significant changes. These include rename of sys_eeprom to tlv_eeprom; move of TLV parse code to board/solidrun/common/; and support for TLV read in pre-relocation phase. I'll add your fixes where applicable.
I hope to post v2 in the coming week.
baruch
Sounds good, thanks! I'm also getting ready to shoot out a V2 of my static ClearFog Base support which based on prior review I've rebased on your run-time config series. If it works for you, I'll go ahead and still send that out for review, modulo your further changes. Are you expecting the TLV/EEPROM change updates to be included in time for the current merge window?
I hope to have TLV EEPROM ready for v2020.04.
Hmm, I was hoping to have the static config for ClearFog Base merged in the current merge window, so just to be clear is that what you're targeting by v2020.04 as well?
Yes. Code merged in this merge windows will appear in the next release which is v2020.04.
I have just posted the updated series with your fixes squashed in, sometimes in a different form (like the non CMD_TLV_EEPROM build fix).
Sounds great, I'll get my static config series updated against your updates runtime detection series, and after a few days post the update, pending any other comments on the v2 series.
With my recent rebasing, I believe I made the changes compatible between static and runtime configuration, but it's less important what order they're applied in - i.e. I can rebase again back on master and retain the alignment. Perhaps it would be possible to merge the static changes and then update the static config entries' help text with a subsequent merge of your runtime work?
I'm not sure what you mean hear.
baruch
Just that if your TLC update wasn't available for the current merge window I may want to request merging my static changes first instead of the other way around. Since you clarified your schedule and posted the updated series, it no longer matters.
Joel

Hi Joel,
On 19.01.20 08:10, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Joel Johnson (4): cmd: sys_eeprom: add missing implicit header cmd: sys_eeprom reflect I2C dependency in Kconfig arm: mvebu: clearfog: don't set SPL misc arm: mvebu: clearfog: fix compile w/o EEPROM
board/solidrun/clearfog/clearfog.c | 26 +++++++++++++++----------- cmd/Kconfig | 1 + cmd/sys_eeprom.c | 1 + configs/clearfog_defconfig | 1 - 4 files changed, 17 insertions(+), 12 deletions(-)
Is it correct to assume, that this patchset is superseded by the Baruch's work? Can it be dropped?
Thanks, Stefan

Hi Stefan,
On Wed, Apr 15 2020, Stefan Roese wrote:
On 19.01.20 08:10, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Joel Johnson (4): cmd: sys_eeprom: add missing implicit header cmd: sys_eeprom reflect I2C dependency in Kconfig arm: mvebu: clearfog: don't set SPL misc arm: mvebu: clearfog: fix compile w/o EEPROM
board/solidrun/clearfog/clearfog.c | 26 +++++++++++++++----------- cmd/Kconfig | 1 + cmd/sys_eeprom.c | 1 + configs/clearfog_defconfig | 1 - 4 files changed, 17 insertions(+), 12 deletions(-)
Is it correct to assume, that this patchset is superseded by the Baruch's work? Can it be dropped?
Which work are you referring to?
The text quoted above specifically mentions dependency on my patch series adding auto detection based on EEPROM data. So as I understand these patches are still useful.
Joel, correct me if I am wrong.
baruch
-- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch@tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

Hi Baruch,
On 16.04.20 14:22, Baruch Siach wrote:
Hi Stefan,
On Wed, Apr 15 2020, Stefan Roese wrote:
On 19.01.20 08:10, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Joel Johnson (4): cmd: sys_eeprom: add missing implicit header cmd: sys_eeprom reflect I2C dependency in Kconfig arm: mvebu: clearfog: don't set SPL misc arm: mvebu: clearfog: fix compile w/o EEPROM
board/solidrun/clearfog/clearfog.c | 26 +++++++++++++++----------- cmd/Kconfig | 1 + cmd/sys_eeprom.c | 1 + configs/clearfog_defconfig | 1 - 4 files changed, 17 insertions(+), 12 deletions(-)
Is it correct to assume, that this patchset is superseded by the Baruch's work? Can it be dropped?
Which work are you referring to?
The text quoted above specifically mentions dependency on my patch series adding auto detection based on EEPROM data. So as I understand these patches are still useful.
Joel, correct me if I am wrong.
If these are still useful, then please rebase and resubmit. I've dropped the patches in the meantime from patchwork as they didn't apply clean any more.
Thanks, Stefan

On 2020-04-16 06:38, Stefan Roese wrote:
Hi Baruch,
On 16.04.20 14:22, Baruch Siach wrote:
Hi Stefan,
On Wed, Apr 15 2020, Stefan Roese wrote:
On 19.01.20 08:10, Joel Johnson wrote:
This set of patches applies on top of https://patchwork.ozlabs.org/cover/1200324/, based on testing using the static configuration fallback updates in a related patch series.
Joel Johnson (4): cmd: sys_eeprom: add missing implicit header cmd: sys_eeprom reflect I2C dependency in Kconfig arm: mvebu: clearfog: don't set SPL misc arm: mvebu: clearfog: fix compile w/o EEPROM
board/solidrun/clearfog/clearfog.c | 26 +++++++++++++++----------- cmd/Kconfig | 1 + cmd/sys_eeprom.c | 1 + configs/clearfog_defconfig | 1 - 4 files changed, 17 insertions(+), 12 deletions(-)
Is it correct to assume, that this patchset is superseded by the Baruch's work? Can it be dropped?
Which work are you referring to?
The text quoted above specifically mentions dependency on my patch series adding auto detection based on EEPROM data. So as I understand these patches are still useful.
Joel, correct me if I am wrong.
If these are still useful, then please rebase and resubmit. I've dropped the patches in the meantime from patchwork as they didn't apply clean any more.
Thanks, Stefan
Dropping these are fine, it was indeed superseded.
Baruch, you'd included a reworked version of these into a later version of your patchset. As I recall, there were issues at the time with disabling EEPROM support which this, and the eventual merged version of your series, resolved.
Joel
participants (3)
-
Baruch Siach
-
Joel Johnson
-
Stefan Roese