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: 1225361 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lixil.net Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 480mF16wYVz9sRK for ; Sun, 19 Jan 2020 18:11:33 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B8CD68182E; Sun, 19 Jan 2020 08:11:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=lixil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 604C7817FC; Sun, 19 Jan 2020 08:11:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from crane.lixil.net (crane.lixil.net [IPv6:2605:2700:1:1045:0:6c:6978:696c]) by phobos.denx.de (Postfix) with ESMTP id C77B581826 for ; Sun, 19 Jan 2020 08:10:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=lixil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mrjoel@lixil.net Received: from dark.lixil.net (unknown [IPv6:2601:8c3:4100:b411:34d1:f09e:1618:a814]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mrjoel@lixil.net) by crane.lixil.net (Postfix) with ESMTPSA id E020931DC4F; Sun, 19 Jan 2020 00:10:55 -0700 (MST) From: Joel Johnson To: Baruch Siach Subject: [PATCH 1/4] cmd: sys_eeprom: add missing implicit header Date: Sun, 19 Jan 2020 00:10:47 -0700 Message-Id: <20200119071050.16240-2-mrjoel@lixil.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200119071050.16240-1-mrjoel@lixil.net> References: <20200119071050.16240-1-mrjoel@lixil.net> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: u-boot@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean 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: 1225362 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lixil.net Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 480mFD5t0Nz9sRK for ; Sun, 19 Jan 2020 18:11:44 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4362681835; Sun, 19 Jan 2020 08:11:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=lixil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 43FB481829; Sun, 19 Jan 2020 08:11:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from crane.lixil.net (crane.lixil.net [71.19.154.81]) by phobos.denx.de (Postfix) with ESMTP id EFB52817D9 for ; Sun, 19 Jan 2020 08:10:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=lixil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mrjoel@lixil.net Received: from dark.lixil.net (unknown [IPv6:2601:8c3:4100:b411:34d1:f09e:1618:a814]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mrjoel@lixil.net) by crane.lixil.net (Postfix) with ESMTPSA id 46FDD31DC52; Sun, 19 Jan 2020 00:10:56 -0700 (MST) From: Joel Johnson To: Baruch Siach Subject: [PATCH 2/4] cmd: sys_eeprom reflect I2C dependency in Kconfig Date: Sun, 19 Jan 2020 00:10:48 -0700 Message-Id: <20200119071050.16240-3-mrjoel@lixil.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200119071050.16240-1-mrjoel@lixil.net> References: <20200119071050.16240-1-mrjoel@lixil.net> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eugeniu Rosca , u-boot@lists.denx.de, Heinrich Schuchardt , Miquel Raynal Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean 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: 1225360 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lixil.net Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 480mDp6vdzz9sRR for ; Sun, 19 Jan 2020 18:11:22 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 83891817E1; Sun, 19 Jan 2020 08:11:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=lixil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 6F48E817E1; Sun, 19 Jan 2020 08:11:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from crane.lixil.net (crane.lixil.net [IPv6:2605:2700:1:1045:0:6c:6978:696c]) by phobos.denx.de (Postfix) with ESMTP id C3732817E0 for ; Sun, 19 Jan 2020 08:10:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=lixil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mrjoel@lixil.net Received: from dark.lixil.net (unknown [IPv6:2601:8c3:4100:b411:34d1:f09e:1618:a814]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mrjoel@lixil.net) by crane.lixil.net (Postfix) with ESMTPSA id F0FF631DC57; Sun, 19 Jan 2020 00:10:56 -0700 (MST) From: Joel Johnson To: Baruch Siach Subject: [PATCH 3/4] arm: mvebu: clearfog: don't set SPL misc Date: Sun, 19 Jan 2020 00:10:49 -0700 Message-Id: <20200119071050.16240-4-mrjoel@lixil.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200119071050.16240-1-mrjoel@lixil.net> References: <20200119071050.16240-1-mrjoel@lixil.net> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Rini , Stefan Roese , u-boot@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean 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: 1225363 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=lixil.net Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 480mFQ6r7Zz9sRK for ; Sun, 19 Jan 2020 18:11:54 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ED95B8182B; Sun, 19 Jan 2020 08:11:13 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=lixil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 828AB817E1; Sun, 19 Jan 2020 08:11:05 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from crane.lixil.net (crane.lixil.net [IPv6:2605:2700:1:1045:0:6c:6978:696c]) by phobos.denx.de (Postfix) with ESMTP id A0529817DC for ; Sun, 19 Jan 2020 08:10:58 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=lixil.net Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mrjoel@lixil.net Received: from dark.lixil.net (unknown [IPv6:2601:8c3:4100:b411:34d1:f09e:1618:a814]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mrjoel@lixil.net) by crane.lixil.net (Postfix) with ESMTPSA id 736C931DC5A; Sun, 19 Jan 2020 00:10:57 -0700 (MST) From: Joel Johnson To: Baruch Siach Subject: [PATCH 4/4] arm: mvebu: clearfog: fix compile w/o EEPROM Date: Sun, 19 Jan 2020 00:10:50 -0700 Message-Id: <20200119071050.16240-5-mrjoel@lixil.net> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200119071050.16240-1-mrjoel@lixil.net> References: <20200119071050.16240-1-mrjoel@lixil.net> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.26 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Rini , Stefan Roese , u-boot@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.101.4 at phobos.denx.de X-Virus-Status: Clean 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)