From patchwork Fri Sep 4 01:28:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1357132 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=MY39GIXQ; dkim-atps=neutral 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 4BjKpV165kz9sVK for ; Fri, 4 Sep 2020 11:29:22 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6746B822A4; Fri, 4 Sep 2020 03:29:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="MY39GIXQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6155C81C31; Fri, 4 Sep 2020 03:29:04 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 4E4B681C31 for ; Fri, 4 Sep 2020 03:29:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd42.google.com with SMTP id b16so5580475ioj.4 for ; Thu, 03 Sep 2020 18:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g/lbPrP9+ba7/gby9VA5gsWM4guYxD/XqgE+pYQnvlA=; b=MY39GIXQnzFj9nRa9/7aqVYiPsja2w/DHg5gR8DUEM+aUpKv/Yvgk1Ax6dS8w8ZS0i wHOVDu3kOeSBsfcqEB2r7+jsu+7F6WbmLsR4Wj7ZDrnY7mgsFef3lXIckm4GNUnWgCVM /CBa94Pxq4T9XNvQr1sXQynOiQ+WlIpPJAfH8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g/lbPrP9+ba7/gby9VA5gsWM4guYxD/XqgE+pYQnvlA=; b=B6+WRrlZceYNjC5YM0zzlzzQQ992aG1h/FImQ4vf18majmFp8WN+rvtNVqdj/kEazA pXtyW/+8/HQ1gXtue0Ey/kN9NzpWQDeoecqeOpTZde5PPulkrblrOPlBNpSamQzcPjsu c8YUth3rOUuxPK+poFPrUtzvS70L6LGWPwvKJc0Xgi2/uAjoOu2XxyFGLxSsyjvZ1VMN I2Otk5ulyinYXDXTD0NPnlwXMG6XrSqIHBPKBvBtNEyiQaGyIqtKv8uAzF6TyP3fJjlV 53qP10tX+9IqUYXYPYVfQPE1oPJqul1uJAkmE/wpv9P5kfuRs9VKcxLM9aJX9FlDKXMb sogA== X-Gm-Message-State: AOAM531eJf12zht7DDWPPq0qFE/06R5p+nc9D/0RBghzt1vHikYvRqMi ZKK5zE0L9ILPBXZiBryQalM6nou9O4YJU09W X-Google-Smtp-Source: ABdhPJwxTCVMogP8ZYYMtuDJ52zm5NHZOjUNc1DU69r7R4Bs6th5KUhuwjZUxKagyIpJlfeIM9DLTw== X-Received: by 2002:a6b:3a0b:: with SMTP id h11mr5537038ioa.109.1599182940056; Thu, 03 Sep 2020 18:29:00 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id k16sm2273740ilc.38.2020.09.03.18.28.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 18:28:59 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH 1/5] x86: Use multiple images Date: Thu, 3 Sep 2020 19:28:52 -0600 Message-Id: <20200904012856.1175506-2-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200904012856.1175506-1-sjg@chromium.org> References: <20200904012856.1175506-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean We already use binman's 'multiple-images' feature with Chrome OS and we want to use it for Edison. There is no real down-side. Adjust x86 to always use multiple-images. Signed-off-by: Simon Glass Acked-by: Andy Shevchenko --- arch/x86/dts/u-boot.dtsi | 7 ------- 1 file changed, 7 deletions(-) diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index fa8106c8b8c..90badcc15c9 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -6,7 +6,6 @@ #include -#ifdef CONFIG_CHROMEOS / { binman { multiple-images; @@ -14,12 +13,6 @@ }; }; }; -#else -/ { - rom: binman { - }; -}; -#endif #ifdef CONFIG_ROM_SIZE &rom { From patchwork Fri Sep 4 01:28:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1357133 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=gNPPmN0a; dkim-atps=neutral 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 4BjKpk1TX3z9sV8 for ; Fri, 4 Sep 2020 11:29:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 65BB6822C0; Fri, 4 Sep 2020 03:29:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gNPPmN0a"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B0EB2822A4; Fri, 4 Sep 2020 03:29:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 062638221F for ; Fri, 4 Sep 2020 03:29:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2a.google.com with SMTP id m17so5580060ioo.1 for ; Thu, 03 Sep 2020 18:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=apULJ4rHjziYicobW7+MRwW+pSmsS6gW+J6MNAQuzaQ=; b=gNPPmN0amCfnhccL3WGRWAFcW1EbgqFyD+OPk/JEP2pyzj4A4bDeDvkcJDi51SdvoN dolvQHpGsHOY0qaHP1A/U3OM8rrVH1Jod15JJAyTbN8aKRb5IXZC4nXAfAFvE+nqU3Zv ADLIu0ygoPF5GyN9JrTtOYlgf9MwM4pObI8AE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=apULJ4rHjziYicobW7+MRwW+pSmsS6gW+J6MNAQuzaQ=; b=iE3Lt34/9/AWcSDgDaWUearev0F20ejR+WeBs1wz5rYVNygQk79oB6xU+JYj0ICPpL lNGlt1iA6r6FTurkUP38FMqgOxI/QYCEcZ0G7BEQh1HQU+WLkJifzVvyFWq3fNSgRx2F suU9rjB0fuBx/Yg8Mrx2bmSjmqx5ksQ4hdbfv2Oou31aw38q3m+RFWaLbNnFrxcmU1tP Dwiu8xIi8SMIqUyimCv7lMFJk5yI9bBus69BMxwQgaXZrmDT99JfjHdjIf/bfXTajhI8 MX1V8tgnkYP9ODHOSWHM2VPDxsHyE9WAAC7//zKKAEo5GUnGe08bOTQ5eQ/x42NZC5/N RnmA== X-Gm-Message-State: AOAM531en8cvhgkFN7++Jon6Ra1gAcO9tCkkHDyfddT0eE/hvG1DKVqK Ku5KgTZVCgyyAhXUHgLnbIVINcm/V2BTYRcW X-Google-Smtp-Source: ABdhPJxBbmDX0/8+dxbVM4sRDc8dcB7a53QFFhE87kmxb7WvOw509ZeQoU0pzBAdPG8dG4yLF3p28g== X-Received: by 2002:a05:6602:2dd2:: with SMTP id l18mr5497871iow.81.1599182940785; Thu, 03 Sep 2020 18:29:00 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id k16sm2273740ilc.38.2020.09.03.18.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 18:29:00 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH 2/5] binman: Show an error when a file is missing Date: Thu, 3 Sep 2020 19:28:53 -0600 Message-Id: <20200904012856.1175506-3-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200904012856.1175506-1-sjg@chromium.org> References: <20200904012856.1175506-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The recent support for missing external binaries does not show an error message when a file is genuinely missing (i.e. it is missing but not marked as 'external'). This means that when -m is passed to binman, it will never report a missing file. Fix this and add a test. Signed-off-by: Simon Glass Acked-by: Andy Shevchenko --- tools/binman/etype/blob.py | 7 ++++--- tools/binman/ftest.py | 7 +++++++ tools/binman/test/173_missing_blob.dts | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 tools/binman/test/173_missing_blob.dts diff --git a/tools/binman/etype/blob.py b/tools/binman/etype/blob.py index c5f97c85a38..66cf243976e 100644 --- a/tools/binman/etype/blob.py +++ b/tools/binman/etype/blob.py @@ -37,13 +37,14 @@ class Entry_blob(Entry): def ObtainContents(self): self._filename = self.GetDefaultFilename() - self._pathname = tools.GetInputFilename(self._filename, - self.section.GetAllowMissing()) + self._pathname = tools.GetInputFilename( + self._filename, self.external and self.section.GetAllowMissing()) # Allow the file to be missing - if self.external and not self._pathname: + if not self._pathname: self.SetContents(b'') self.missing = True return True + self.ReadBlobContents() return True diff --git a/tools/binman/ftest.py b/tools/binman/ftest.py index 95b17d0b749..91225459162 100644 --- a/tools/binman/ftest.py +++ b/tools/binman/ftest.py @@ -3708,5 +3708,12 @@ class TestFunctional(unittest.TestCase): self.assertIn('Wibble test', err) self.assertIn('Another test', err) + def testMissingBlob(self): + """Test handling of a blob containing a missing file""" + with self.assertRaises(ValueError) as e: + self._DoTestFile('173_missing_blob.dts', allow_missing=True) + self.assertIn("Filename 'missing' not found in input path", + str(e.exception)) + if __name__ == "__main__": unittest.main() diff --git a/tools/binman/test/173_missing_blob.dts b/tools/binman/test/173_missing_blob.dts new file mode 100644 index 00000000000..ffb655a1cb4 --- /dev/null +++ b/tools/binman/test/173_missing_blob.dts @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + blob { + filename = "missing"; + }; + }; +}; From patchwork Fri Sep 4 01:28:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1357134 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IQNONqZ9; dkim-atps=neutral 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 4BjKpy6v2sz9sV8 for ; Fri, 4 Sep 2020 11:29:46 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 764BF822BF; Fri, 4 Sep 2020 03:29:09 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="IQNONqZ9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 187BD822A4; Fri, 4 Sep 2020 03:29:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DC3EF82286 for ; Fri, 4 Sep 2020 03:29:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd2e.google.com with SMTP id z13so1510098iom.8 for ; Thu, 03 Sep 2020 18:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xl02FyeniWxMynafa1iRL3FjRZJLlsKkugbWiIq0JAc=; b=IQNONqZ9xqeDwZw1nT4DXasM5A5A4d84MAdsvGWcEFFvDsPo8pwRXSx6lu2ZpCVNIh wzO4RkH38BZGxy2FwupCvbEwI5YtiOfhxU9re0NEi9PT7xHv8LX/mJjbXt4YDUaQ2gih 7h4gPAzpr0HueEM5bNW8ag2FbNpJwLM/QwVtQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xl02FyeniWxMynafa1iRL3FjRZJLlsKkugbWiIq0JAc=; b=DkEfXgZ2dkARN7IrmWyU8xa41GXQeEHB6McFTA3YdSKRBA9H1DUnwo3NGoUoQgsSOw zZ0mDjzV7oJYAcpPUjPHg1+oN0PqXOcxn06uk3wzp1MBr1XJJXtD0Me07hOkSq14mpJ9 zgbqllQkwf8zaiTrFwte/uf5PmTXLu3gg3TnQj2EzFaUMJXMxqYxHvtHj9fpkqqWzekl +CYkVooL4lVGIZs9XLIflDLYccdTMr07aohmg4QndqzB78BamnCKtUi9q3asTVGqYja+ djTET/q1scIwxOfuwW2q9GYUCfCVD9XTv/xMHouDGN5/IXnc+i3kH00Nnsflaa0lCV9s cPNA== X-Gm-Message-State: AOAM5322xtMRzU7e3j7iHGYMPoSs+wAdDQfOZItOzWu9Xjpj2W3IrWo2 C62azD1yhvL6djcZiGL0KEB8/WEqzB/7rfek X-Google-Smtp-Source: ABdhPJzU5qK93NMbhRFHQjgKGJhTo0RnQ41AqU8gAk+wgv9sc4zDsFQRPmfBhFyy6VVXmgjdyD+nZw== X-Received: by 2002:a6b:d203:: with SMTP id q3mr5661811iob.20.1599182941565; Thu, 03 Sep 2020 18:29:01 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id k16sm2273740ilc.38.2020.09.03.18.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 18:29:01 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH 3/5] binman: Support adding a U-Boot environment Date: Thu, 3 Sep 2020 19:28:54 -0600 Message-Id: <20200904012856.1175506-4-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200904012856.1175506-1-sjg@chromium.org> References: <20200904012856.1175506-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean In some cases it is useful to include a U-Boot environment region in an image. This allows the board to start up with an environment ready to go. Add a new entry type for this. The input is a text file containing the environment entries, one per line, in the format: var=value Signed-off-by: Simon Glass Acked-by: Andy Shevchenko --- tools/binman/etype/u_boot_env.py | 42 +++++++++++++++++++++++++ tools/binman/ftest.py | 31 ++++++++++++++++++ tools/binman/test/174_env.dts | 20 ++++++++++++ tools/binman/test/175_env_no_size.dts | 19 +++++++++++ tools/binman/test/176_env_too_small.dts | 20 ++++++++++++ 5 files changed, 132 insertions(+) create mode 100644 tools/binman/etype/u_boot_env.py create mode 100644 tools/binman/test/174_env.dts create mode 100644 tools/binman/test/175_env_no_size.dts create mode 100644 tools/binman/test/176_env_too_small.dts diff --git a/tools/binman/etype/u_boot_env.py b/tools/binman/etype/u_boot_env.py new file mode 100644 index 00000000000..1694c2a6eef --- /dev/null +++ b/tools/binman/etype/u_boot_env.py @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: GPL-2.0+ +# Copyright (c) 2018 Google, Inc +# Written by Simon Glass +# + +import struct +import zlib + +from binman.etype.blob import Entry_blob +from dtoc import fdt_util +from patman import tools + +class Entry_u_boot_env(Entry_blob): + """An entry which contains a U-Boot environment + + Properties / Entry arguments: + - filename: File containing the environment text, with each line in the + form var=value + """ + def __init__(self, section, etype, node): + super().__init__(section, etype, node) + + def ReadNode(self): + super().ReadNode() + if self.size is None: + self.Raise("'u-boot-env' entry must have a size property") + self.fill_value = fdt_util.GetByte(self._node, 'fill-byte', 0) + + def ReadBlobContents(self): + indata = tools.ReadFile(self._pathname) + data = b'' + for line in indata.splitlines(): + data += line + b'\0' + data += b'\0'; + pad = self.size - len(data) - 5 + if pad < 0: + self.Raise("'u-boot-env' entry too small to hold data (need %#x more bytes)" % -pad) + data += tools.GetBytes(self.fill_value, pad) + crc = zlib.crc32(data) + buf = struct.pack('; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-env { + filename = "env.txt"; + size = <0x18>; + fill-byte = [ff]; + }; + u-boot-nodtb { + }; + }; +}; diff --git a/tools/binman/test/175_env_no_size.dts b/tools/binman/test/175_env_no_size.dts new file mode 100644 index 00000000000..267acd15491 --- /dev/null +++ b/tools/binman/test/175_env_no_size.dts @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-env { + filename = "env.txt"; + fill-byte = [ff]; + }; + u-boot-nodtb { + }; + }; +}; diff --git a/tools/binman/test/176_env_too_small.dts b/tools/binman/test/176_env_too_small.dts new file mode 100644 index 00000000000..2db8d054639 --- /dev/null +++ b/tools/binman/test/176_env_too_small.dts @@ -0,0 +1,20 @@ +// SPDX-License-Identifier: GPL-2.0+ + +/dts-v1/; + +/ { + #address-cells = <1>; + #size-cells = <1>; + + binman { + u-boot { + }; + u-boot-env { + filename = "env.txt"; + size = <0x8>; + fill-byte = [ff]; + }; + u-boot-nodtb { + }; + }; +}; From patchwork Fri Sep 4 01:28:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1357135 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=ADVWRZJN; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (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 4BjKq90Rnbz9sV8 for ; Fri, 4 Sep 2020 11:29:57 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 833D5822D5; Fri, 4 Sep 2020 03:29:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="ADVWRZJN"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B3372822A7; Fri, 4 Sep 2020 03:29:07 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CC07882294 for ; Fri, 4 Sep 2020 03:29:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id b6so5552268iof.6 for ; Thu, 03 Sep 2020 18:29:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aZ+KnqWULfJ7EBz54xGy9vDC6m6FlauN/ZDDIyzwi9I=; b=ADVWRZJNRjRsBn5dgU1j1Ji1ZZywF5EQG03s1XI8TLJHB6qNxW7Ht2VhZ/WCuKUvsS ZFA8+sHQSFvv3arlnVZq732ZzF5fKb8XMBQLfsjAKTlbRQatkcwJZiygCJkJG54PYkmT 54fIwVXOJAo3nOgrbqWp1ZXlxTzWUtY15sjJY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aZ+KnqWULfJ7EBz54xGy9vDC6m6FlauN/ZDDIyzwi9I=; b=dPv2blIFW23h+TjwPS1F9BrX9OxXxvGi3JTAlKmijrxPaBC6hyuIyXAmeRewQPrTBV idfK0pnetMobpsjETAoReuMRn/7pRqP+C/NPJonEwzRBw2PJIIUdX14cEF4W7Yd+GdEZ crLDu4mRInAVL5ETjHbWqKrOemslENtkgatGibRiHUHjVZHqzvNbYg6qZEFms80peJ4R rzdEwd86TspLsy7wJ7Euc+U3ToFuXsDNcmVAWDHC3IWV4G1QmKBMKpUnvCvhk3fHVA7E zLk1G9uqPRKc5jNa61PKh3NpZ0tJHI5EAe2A3N3AjYnBB/5m7YVOYYG8qaykThLJrnJR 28Zg== X-Gm-Message-State: AOAM532sUGFhl65yKNWeIacO/BNRQKMyjOasaFh8WxYEg9bvJ/wAjf+a MtXolMvMyAslDc9PmlMhSruuyKjIDjud0iNS X-Google-Smtp-Source: ABdhPJzOarpT6IcCNdyTnABbrqjjrBV75JQ8prKYSTsR6Iu3yMGFFX4e68F0zilROEr6tBYJzKDhMw== X-Received: by 2002:a05:6638:22d0:: with SMTP id j16mr5998322jat.97.1599182942321; Thu, 03 Sep 2020 18:29:02 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id k16sm2273740ilc.38.2020.09.03.18.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 18:29:02 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH 4/5] x86: edison: Generate an image suitable for xFSTK Date: Thu, 3 Sep 2020 19:28:55 -0600 Message-Id: <20200904012856.1175506-5-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200904012856.1175506-1-sjg@chromium.org> References: <20200904012856.1175506-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean It is useful to be able to flash Edison directly without relying on the installed U-Boot being functional. Add a binman image for this. It includes a master-boot record, U-Boot binary and an environment. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- arch/x86/cpu/tangier/Kconfig | 1 + arch/x86/dts/edison.dts | 34 +++++++++++++++ board/intel/edison/edison-environment.txt | 48 ++++++++++++++++++++++ board/intel/edison/edison-mbr.dat | Bin 0 -> 512 bytes 4 files changed, 83 insertions(+) create mode 100644 board/intel/edison/edison-environment.txt create mode 100644 board/intel/edison/edison-mbr.dat GIT binary patch literal 512 zcmY%K4_0AdU}R!sv|zvqI6yK2j0^%mY{0<459IwH1p^uah`4$OWHN%d4;C{cM2TaC Gt^xr56@#Pz literal 0 HcmV?d00001 diff --git a/arch/x86/cpu/tangier/Kconfig b/arch/x86/cpu/tangier/Kconfig index d2b7edecd60..571470c74b2 100644 --- a/arch/x86/cpu/tangier/Kconfig +++ b/arch/x86/cpu/tangier/Kconfig @@ -12,6 +12,7 @@ config INTEL_TANGIER imply MMC_SDHCI_TANGIER imply USB imply USB_DWC3 + imply BINMAN if INTEL_TANGIER diff --git a/arch/x86/dts/edison.dts b/arch/x86/dts/edison.dts index df24aa0d26a..b5aac6b7349 100644 --- a/arch/x86/dts/edison.dts +++ b/arch/x86/dts/edison.dts @@ -22,6 +22,10 @@ serial2 = &serial2; }; + binman: binman { + multiple-images; + }; + chosen { stdout-path = &serial2; }; @@ -130,3 +134,33 @@ }; }; }; + +&binman { + u-boot-edison { + filename = "u-boot-edison.img"; + + /* This is Master-Boot Record */ + blob { + filename = "edison-mbr.dat"; + }; + + u-boot { + offset = <0x200>; + }; + + u-boot-env { + offset = <0x200200>; + filename = "edison-environment.txt"; + size = <0x10000>; + fill-byte = [ff]; + }; + + u-boot-env2 { + type = "u-boot-env"; + offset = <0x500200>; + filename = "edison-environment.txt"; + size = <0x10000>; + fill-byte = [ff]; + }; + }; +}; diff --git a/board/intel/edison/edison-environment.txt b/board/intel/edison/edison-environment.txt new file mode 100644 index 00000000000..afe00920461 --- /dev/null +++ b/board/intel/edison/edison-environment.txt @@ -0,0 +1,48 @@ +partitions=uuid_disk=${uuid_disk};name=u-boot0,start=1MiB,size=2MiB,uuid=${uuid_uboot0};name=u-boot-env0,size=1MiB,uuid=${uuid_uboot_env0};name=u-boot1,size=2MiB,uuid=${uuid_uboot1};name=u-boot-env1,size=1MiB,uuid=${uuid_uboot_env1};name=factory,size=1MiB,uuid=${uuid_factory};name=panic,size=24MiB,uuid=${uuid_panic};name=boot,size=32MiB,uuid=${uuid_boot};name=rootfs,size=1536MiB,uuid=${uuid_rootfs};name=update,size=768MiB,uuid=${uuid_update};name=home,size=-,uuid=${uuid_home}; +do_dfu_alt_info_mmc=setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2;u-boot0 part 0 1;u-boot-env0 part 0 2;u-boot1 part 0 3;u-boot-env1 part 0 4;boot part 0 7;rootfs part 0 8;update part 0 9;home part 0 10;vmlinuz fat 0 7;initrd fat 0 7" +dfu_alt_info_ram=kernel ram ${loadaddr} 0x800000 +do_dfu_alt_info_ifwi=setenv dfu_alt_info "ifwi${hardware_id} raw 0 8192 mmcpart 1;ifwib${hardware_id} raw 0 8192 mmcpart 2" +dfu_alt_info_reset=reset ram 0x0 0x0 +bootargs_console=console=ttyMFD2 earlyprintk=ttyMFD2,keep +bootargs_debug=loglevel=4 +do_bootargs_rootfs=setenv bootargs_rootfs rootwait root=PARTUUID=${uuid_rootfs} rootfstype=ext4 +first_install_retry=0 +first_install_max_retries=3 +ota_update_retry=0 +ota_update_max_retries=3 +audio_codec_name=audio_codec="dummy" +do_audio_support=setenv audio_support platform_mrfld_audio.${audio_codec_name} +do_compute_target=if itest.b ${first_install_retry} -gt ${first_install_max_retries} || itest.b ${ota_update_retry} -gt ${ota_update_max_retries}; then echo "Switch to Rescue target"; setenv bootargs_target rescue; saveenv; fi +mmc-bootargs=run do_bootargs_rootfs; run do_audio_support; setenv bootargs ${bootargs_rootfs} ${bootargs_console} ${bootargs_debug} g_multi.ethernet_config=${bootargs_ethconfig} systemd.unit=${bootargs_target}.target hardware_id=${hardware_id} g_multi.iSerialNumber=${serial#} g_multi.dev_addr=${usb0addr} ${audio_support} +loadaddr=0x100000 +load_kernel=fatload mmc 0:7 ${loadaddr} vmlinuz +do_partition_done=0 +do_partition=if itest.b ${do_partition_done} -eq 1; then echo "Partitioning already done..."; else run do_force_partition ; fi +do_force_partition=echo "Partitioning using GPT"; gpt write mmc 0 ${partitions} ; mmc rescan; setenv do_partition_done 1 ; saveenv +do_flash_ifwi=run do_dfu_alt_info_ifwi ; dfu 0 mmc 0 $dfu_to_sec +do_flash_os=if itest.b ${do_flash_os_done} -eq 1 ; then echo "Flashing already done..." ; else run do_force_flash_os; fi +do_force_flash_os=run do_dfu_alt_info_mmc ; sleep 1 ; setenv do_flash_os_done 1 ; saveenv ; dfu 0 mmc 0 $dfu_to_sec +do_flashall=run do_partition;run do_flash_ifwi;run do_flash_os +do_dnx=setenv dfu_alt_info ${dfu_alt_info_ram};dfu 0 ram 0 ram;run bootcmd +init_dfu=run do_dfu_alt_info_mmc ; saveenv +bootcmd=echo "Target:${target_name}"; run do_partition; run do_handle_bootargs_mode; +do_handle_bootargs_mode=run do_preprocess_bootargs_mode; if itest.s $bootargs_mode == "ota" ; then run do_ota; fi; if itest.s $bootargs_mode == "boot" ; then run do_boot; fi; if itest.s $bootargs_mode == "flash"; then run do_flash; fi; run do_fallback; exit; +do_preprocess_bootargs_mode=if env exists bootargs_mode ; then ; else setenv bootargs_mode "boot" ;fi; +do_fallback=echo "Unknown boot mode: $bootargs_mode"; env delete -f bootargs_mode; saveenv; echo "Resetting to default boot mode and reboot..."; reset; +do_boot=run boot_target_cmd; +do_flash=run do_force_flash_os; +ota_done=0 +ota_script_addr=0x100000 +do_ota_init=setenv ota_status 1 ; env delete -f bootargs_mode +do_load_ota_scr=if fatload mmc 0:9 $ota_script_addr ota_update.scr ; then setenv ota_status 0 ; else setenv ota_status 1 ; fi +do_source_ota_scr=if test $ota_status -eq 0 ; then if source $ota_script_addr ; then setenv ota_status 0 ; else setenv ota_status 2 ; fi ; fi +do_ota_clean=saveenv ; reset +do_ota=run do_ota_init ; run do_load_ota_scr ; run do_source_ota_scr ; run do_ota_clean +target_name=blank +bootdelay=1 +do_flash_os_done=1 +bootargs_target=multi-user +bootargs_ethconfig=cdc +dfu_to_sec=3 +do_probe_dfu=run do_dfu_alt_info_mmc ; dfu 0 mmc 0 $dfu_to_sec +boot_target_cmd=run do_flash_os;run do_probe_dfu;run do_compute_target;run mmc-bootargs;run load_kernel;zboot ${loadaddr} diff --git a/board/intel/edison/edison-mbr.dat b/board/intel/edison/edison-mbr.dat new file mode 100644 index 0000000000000000000000000000000000000000..c984e99f247c54253f1d950ece602d44c10cb6eb From patchwork Fri Sep 4 01:28:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1357136 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=OCb6zjkb; dkim-atps=neutral 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 4BjKqP6xbrz9sV8 for ; Fri, 4 Sep 2020 11:30:09 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8B0FF822E9; Fri, 4 Sep 2020 03:29:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="OCb6zjkb"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 98C05822BF; Fri, 4 Sep 2020 03:29:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 896CF81260 for ; Fri, 4 Sep 2020 03:29:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x141.google.com with SMTP id y2so4980820ilp.7 for ; Thu, 03 Sep 2020 18:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K6EOQs2CVJ3zoEaOdtz0DIc5KVPopnsNJShcSbcD0VQ=; b=OCb6zjkbFCSALaE9MEdKbioX+YqqxEeKVFUwnUCC1v+Ax+1nVWP1I9ALaGXbpMs5A3 detBhGtC6NkJ6MMTWlx7Qg2SrIYP0ZEm91i9cWvlZRVymbTnwumUasHuX4OXqMUQE01j 3LT/ajCbvYJMU91i3eo6e4b/ruiHP0piKwtLM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=K6EOQs2CVJ3zoEaOdtz0DIc5KVPopnsNJShcSbcD0VQ=; b=DBB2MsA5uwZKL+uNyxga2K4edyPhuDCwxrgbSf0sCmdKYUrfKbILq7rD6138kDi+OZ Kqf7zfPDjL+dZlNGQNSovmoxufbDaIJAH/NgU42r6TSxy2DJ7HrqU30a328s//m3uGiA gb/YjPlCPuhoz2yudG8TdFTVH33y4Ya2UILwQnqUXabIZTx8g2PkQ76P7gm4WqpyYrq0 qJwRMvqrYMChfI8APu3oCoaZKoKSCfqIOcYSyHkOnZbgknddSYAyq8TU0qYkM5EkrQpv 9Bm6/syamv/spiWDJsZfxHetAfDBKgzMunMMPSLTVH74sn2+edzPZ49xxCS8Egy9eYqS lazg== X-Gm-Message-State: AOAM530zFVDS0XUiruQOrh0XMr5lPTuyIc1oAeHsYwpdeStfX0Ek6N/q WzWDm6UFY8S+SXwLnvbdRMMJwUbYKJ97c0t2 X-Google-Smtp-Source: ABdhPJxdABUHzjuCV8bexswL90eY2KaDK1TWju6rebO3VrQ88ZO2HHCJfy+DFJNLy9YJjVqGXmzIAw== X-Received: by 2002:a05:6e02:673:: with SMTP id l19mr5859454ilt.225.1599182943149; Thu, 03 Sep 2020 18:29:03 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id k16sm2273740ilc.38.2020.09.03.18.29.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Sep 2020 18:29:02 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH 5/5] x86: edison: Add documentation for using am xFSTK image Date: Thu, 3 Sep 2020 19:28:56 -0600 Message-Id: <20200904012856.1175506-6-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200904012856.1175506-1-sjg@chromium.org> References: <20200904012856.1175506-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean Add a description of how to flash Edison using the XFSTK tool. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- doc/board/intel/edison.rst | 120 +++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/doc/board/intel/edison.rst b/doc/board/intel/edison.rst index 1aee2a1fc0d..40acd80a051 100644 --- a/doc/board/intel/edison.rst +++ b/doc/board/intel/edison.rst @@ -39,3 +39,123 @@ use. reset the board:: => reset + + +Updating U-Boot using xFSTK +--------------------------- + +You can also update U-Boot using the xfstk-dldr-solo tool if you can build it. +One way to do that is to follow the `xFSTK`_ instructions. You may need to use +a virtual machine running Ubuntu Trusty. Once you have built it and installed +libboost-all-dev, you can copy xfstk-dldr-solo to /usr/local/bin and +libboost_program_options.so.1.54.0 to /usr/lib/i386-linux-gnu/ and with luck +it will work. You might fine this `drive`_ helpful. + +If it does, then you can download and unpack the Edison reocovery image, +install dfu-util, reset your board and flash U-Boot like this:: + + $ xfstk-dldr-solo --gpflags 0x80000007 \ + --osimage u-boot-edison.img \ + --fwdnx recover/edison_dnx_fwr.bin \ + --fwimage recover/edison_ifwi-dbg-00.bin \ + --osdnx recover/edison_dnx_osr.bin + +This should show the following + +.. code-block:: none + + XFSTK Downloader Solo 0.0.0 + Copyright (c) 2015 Intel Corporation + Build date and time: Aug 15 2020 15:07:13 + + .Intel SoC Device Detection Found + Parsing Commandline.... + Registering Status Callback.... + .Initiating Download Process.... + .......(lots of dots)........XFSTK-STATUS--Reconnecting to device - Attempt #1 + .......(even more dots)...................... + + +You have about 10 seconds after resetting the board to type the above command. +If you want to check if the board is ready, type: + +.. code-block:: none + + lsusb |egrep "8087|8086" + Bus 001 Device 004: ID 8086:e005 Intel Corp. + +If you see a device with the same ID as above, the board is waiting for your +command. + +After about 5 seconds you should see some console output from the board: + +.. code-block:: none + + ****************************** + PSH KERNEL VERSION: b0182b2b + WR: 20104000 + ****************************** + + SCU IPC: 0x800000d0 0xfffce92c + + PSH miaHOB version: TNG.B0.VVBD.0000000c + + microkernel built 11:24:08 Feb 5 2015 + + ******* PSH loader ******* + PCM page cache size = 192 KB + Cache Constraint = 0 Pages + Arming IPC driver .. + Adding page store pool .. + PagestoreAddr(IMR Start Address) = 0x04899000 + pageStoreSize(IMR Size) = 0x00080000 + + *** Ready to receive application *** + + After another 10 seconds the xFSTK tool completes and the board resets. About + 10 seconds after that should see the above message again and then within a + few seconds U-Boot should start on your board: + +.. code-block:: none + + U-Boot 2020.10-rc3-00032-gd9f6680e925-dirty (Sep 03 2020 - 18:44:28 -0600) + + CPU: Genuine Intel(R) CPU 4000 @ 500MHz + DRAM: 980.6 MiB + WDT: Started with servicing (60s timeout) + MMC: mmc@ff3fc000: 0, mmc@ff3fa000: 1 + Loading Environment from MMC... OK + In: serial + Out: serial + Err: serial + Saving Environment to MMC... Writing to redundant MMC(0)... OK + Saving Environment to MMC... Writing to MMC(0)... OK + Net: No ethernet found. + Hit any key to stop autoboot: 0 + Target:blank + Partitioning using GPT + Writing GPT: success! + Saving Environment to MMC... Writing to redundant MMC(0)... OK + Flashing already done... + 5442816 bytes read in 238 ms (21.8 MiB/s) + Valid Boot Flag + Setup Size = 0x00003c00 + Magic signature found + Using boot protocol version 2.0c + Linux kernel version 3.10.17-poky-edison+ (ferry@kalamata) #1 SMP PREEMPT Mon Jan 11 14:54:18 CET 2016 + Building boot_params at 0x00090000 + Loading bzImage at address 100000 (5427456 bytes) + Magic signature found + Kernel command line: "rootwait root=PARTUUID=ada722ed-6410-764e-8619-abff6f66e10e rootfstype=ext4 console=ttyMFD2 earlyprintk=ttyMFD2,keep loglevel=4 g_multi.ethernet_config=cdc systemd.unit=multi-user.target hardware_id=00 g_multi.iSerialNumber=2249baf774c675598661a63098c0ad41 g_multi.dev_addr=02:00:86:c0:ad:41 platform_mrfld_audio.audio_codec=dummy" + Magic signature found + + Starting kernel ... + + ... + + Poky (Yocto Project Reference Distro) 1.7.2 edison ttyMFD2 + + edison login: + +.. _xFSTK: https://community.intel.com/t5/Intel-Makers/Building-xFSTK-on-Ubuntu-14-04-32-bit-for-flashing-Edison/td-p/538081 +.. _drive: https://drive.google.com/drive/u/0/folders/1URPHrOk9-UBsh8hjv-7WwC0W6Fy61uAJ