From patchwork Fri Jul 6 13:41:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Schmelzer X-Patchwork-Id: 940521 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=oevsv.at Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 41MbhP3NLGz9s4r for ; Fri, 6 Jul 2018 23:50:13 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1BC5AC2202B; Fri, 6 Jul 2018 13:45:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0F1E1C22071; Fri, 6 Jul 2018 13:42:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6F63BC2206C; Fri, 6 Jul 2018 13:42:11 +0000 (UTC) Received: from mail.schmelzer.or.at (mail.schmelzer.or.at [87.106.47.214]) by lists.denx.de (Postfix) with ESMTP id BEAD9C2202B for ; Fri, 6 Jul 2018 13:42:06 +0000 (UTC) Received: from localhost (s15287728.onlinehome-server.info [127.0.0.1]) by hamspirit.at (Postfix) with ESMTP id 9C3748F488B6; Fri, 6 Jul 2018 13:42:06 +0000 (UTC) Received: from mail.schmelzer.or.at ([127.0.0.1]) by localhost (s15287728.onlinehome-server.info [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 40lNXddwKzlA; Fri, 6 Jul 2018 13:42:01 +0000 (UTC) Received: from scm-ws12.ampr.at (unknown [213.174.225.82]) by hamspirit.at (Postfix) with ESMTP id 4E5E18F488B3; Fri, 6 Jul 2018 13:41:45 +0000 (UTC) From: Hannes Schmelzer To: u-boot@lists.denx.de Date: Fri, 6 Jul 2018 15:41:25 +0200 Message-Id: <1530884489-28089-9-git-send-email-oe5hpm@oevsv.at> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> References: <1530884489-28089-1-git-send-email-oe5hpm@oevsv.at> Cc: Hannes Schmelzer Subject: [U-Boot] [PATCH 08/12] board/BuR/common: refactor ft_board_setup(...) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" On other OS, not one provided by B&R, it is not guaranteed that there are factory-settings within a devicetree. So we must not treat the absence of them as error. Further we've the fact that on different version of the device-tree files there are different namings of the factory-settings, we consider this with searching for an alternative name. changing things as following: - don't treat as error if the bootloader version cannot written into devicetree. - since the naming of the factory-settings are different in different versions of the provided device-tree we search for the alternate name "/fset" Signed-off-by: Hannes Schmelzer --- board/BuR/common/common.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 38da36d..01e3078 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -252,15 +252,20 @@ int ft_board_setup(void *blob, bd_t *bd) nodeoffset = fdt_path_offset(blob, "/factory-settings"); if (nodeoffset < 0) { - puts("set bootloader version 'factory-settings' not in dtb!\n"); - return -1; + printf("%s: cannot find /factory-settings, trying /fset\n", + __func__); + nodeoffset = fdt_path_offset(blob, "/fset"); + if (nodeoffset < 0) { + printf("%s: cannot find /fset.\n", __func__); + return 0; + } } + if (fdt_setprop(blob, nodeoffset, "bl-version", PLAIN_VERSION, strlen(PLAIN_VERSION)) != 0) { - puts("set bootloader version 'bl-version' prop. not in dtb!\n"); - return -1; + printf("%s: no 'bl-version' prop in fdt!\n", __func__); + return 0; } - return 0; }