From patchwork Sun Sep 6 16:35:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1358329 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=DnEmYD6C; 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 4Bkxqk6p1qz9sT6 for ; Mon, 7 Sep 2020 02:36:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0680F8234A; Sun, 6 Sep 2020 18:35:48 +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="DnEmYD6C"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0F58582371; Sun, 6 Sep 2020 18:35:45 +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-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (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 02FF782342 for ; Sun, 6 Sep 2020 18:35:41 +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-x142.google.com with SMTP id q6so10471826ild.12 for ; Sun, 06 Sep 2020 09:35:40 -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=M27qhdX9VeJ/NgiaTMkkqgBqlyXcoKo/nFOykWmv8+E=; b=DnEmYD6Chcwjb7VBxyq909U4SLTXk4HgitZNAw52aAniBqgb3Xeoh76ijhxb64Ypww 2m6M9zk6Bzd/VtObIlGldwsU+Nql+vrg6Y85KmOs/H5UuuPlU6FdLvq6hyswxxb7WnnK 82EKqAauXUU19BVv7DgE6DMXQtg1sHtOfuep4= 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=M27qhdX9VeJ/NgiaTMkkqgBqlyXcoKo/nFOykWmv8+E=; b=Oatp+i4SSTevbEbC7fwwaw+NbXSQezzL6Ui0VkjljHG0zUiqNCfDs5rMeg71KYjaSv fE4bg0Wy/cwK6qVSnQmZgO/AqZKBa9c0Y0UKQqqCJ4pUc56kx0zi+IxvtUo8s27+LEr/ BoM+cyW+oVGTFI6xmHgIXTDDsA3QkiD5/1g41PDsPX+e70mBPfMpeXL1DvJFJRYoqbRH cfZIvEBx64VDEeoSTcmzb61n4F8AxEltJvKLftsjuBAwVwPQ6mrjx6rtlRmiKYWsy3wq ZnhfKG71DIPkGpbljH0TQT7eCHMPyF5EeivK582FZvDWk3iKK9aQITZ2+rnSxvX0pCBa MOXw== X-Gm-Message-State: AOAM531LjiCb1WIYK5Cbeh3q0Lif5I9irlNdbeR259WqeQSIkpvNl7oQ +t2zuwh9NTZSCtkkIDSXUFTEmjr+VKL5squo X-Google-Smtp-Source: ABdhPJyBJgyBC7p57M+FT0Vq0SPd+2XaBweUCMOuPBKZNbL4zSNMnOKMPVob7EhaIFy72ECKLUCSeA== X-Received: by 2002:a92:ae06:: with SMTP id s6mr14913303ilh.64.1599410139821; Sun, 06 Sep 2020 09:35:39 -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 2sm6689955ilj.24.2020.09.06.09.35.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 09:35:39 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH v2 1/5] x86: Use multiple images Date: Sun, 6 Sep 2020 10:35:31 -0600 Message-Id: <20200906163536.16162-2-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200906163536.16162-1-sjg@chromium.org> References: <20200906163536.16162-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 --- (no changes since v1) 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 Sun Sep 6 16:35:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1358330 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=oChA4r04; 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 4Bkxqz2X8Vz9sSn for ; Mon, 7 Sep 2020 02:36:15 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4631682395; Sun, 6 Sep 2020 18:35:49 +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="oChA4r04"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9212A8234A; Sun, 6 Sep 2020 18:35:47 +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 C06498234A for ; Sun, 6 Sep 2020 18:35:41 +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 w5so2582523ilo.5 for ; Sun, 06 Sep 2020 09:35:41 -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=uPLDz8h5bhsZtxmwxccXzP0OHyXVrWI4mVL2+Hh/PpM=; b=oChA4r04/59v1W0i+aPE+lCfU0VGhe+fAXOyCbtZNsVuGWWtQk78kIOKeaZuJDRB3E MTDa/TUqzzB1ZDtAjxral0f5N+0osihZ7He/UIcCjuvUKvcDFPa5KCvX0VNDlEuRxgFe 34eZYRcxAWobhg5jK7e+lBP9RfdxW+SCQnnFk= 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=uPLDz8h5bhsZtxmwxccXzP0OHyXVrWI4mVL2+Hh/PpM=; b=lI8JURu31h760FhLE56DzgwYbQ5EpSeFNQ3+4r/tL/qkXPbHJedtpKjlbsBQfEDmKP Oq2bY17FSbKIac2yOU4GSKYWnhxAGNzWXwTaqiv/jCHd0fqW42RuNtpdn2QM/E7LBEXH mbC7qkd3a1zwfdMV1N1hg/IpCWhr2TYGISse364hcVU0xa6u3hcsbrVjd42TPf2HwYx/ CcfDDxo1Mt28TYyBLaAVJ5XvDOdzrLnjuNzZBqX/ZgTehbzbe3PWFb9AKpWvdULFB3lk qRO7hO9GIHKlByJCF7Y2BWG9ODYCnHPPBfOAWD3AGs+6vtl8FJhw/VuYu88/gUZvGaNH cMXw== X-Gm-Message-State: AOAM530mp/B5JWyPiilsaL5d4heM4iIX+MkdI+VzLpkRIfNOD7C8Grxa YRDyaiKJn7aY8sVrlfujqBdk/LxQlbR/IgG2 X-Google-Smtp-Source: ABdhPJypKfJx0YQv1HYj2iFgSOXQaYKUgzqoTlhkWx8ddIJdCznxiPeZkwOxt0o4EcDuKyRs5JU+Jw== X-Received: by 2002:a92:d902:: with SMTP id s2mr14840700iln.21.1599410140546; Sun, 06 Sep 2020 09:35:40 -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 2sm6689955ilj.24.2020.09.06.09.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 09:35:40 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH v2 2/5] binman: Show an error when a file is missing Date: Sun, 6 Sep 2020 10:35:32 -0600 Message-Id: <20200906163536.16162-3-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200906163536.16162-1-sjg@chromium.org> References: <20200906163536.16162-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 --- Changes in v2: - Minor indenting change in ObtainContents() tools/binman/etype/blob.py | 5 +++-- tools/binman/ftest.py | 7 +++++++ tools/binman/test/173_missing_blob.dts | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 2 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..ecfb1e476e8 100644 --- a/tools/binman/etype/blob.py +++ b/tools/binman/etype/blob.py @@ -38,12 +38,13 @@ class Entry_blob(Entry): def ObtainContents(self): self._filename = self.GetDefaultFilename() self._pathname = tools.GetInputFilename(self._filename, - self.section.GetAllowMissing()) + 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 Sun Sep 6 16:35:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1358331 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=dbFT59nE; 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 4BkxrC1Jg0z9sSn for ; Mon, 7 Sep 2020 02:36:27 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3EE1E823A3; Sun, 6 Sep 2020 18:35:50 +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="dbFT59nE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F346482396; Sun, 6 Sep 2020 18:35:47 +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 C3BB382362 for ; Sun, 6 Sep 2020 18:35:42 +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 b16so11779462ioj.4 for ; Sun, 06 Sep 2020 09:35:42 -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=ubcB/eKqhWqTij67Pa2k5Z8WaD6QB+Krl6nTDK47R3w=; b=dbFT59nEs3Lh1+SAKSFGzuQGdEg6plismAC1ZIzMH3vpWo10QZy8mKdsOXPcUCgPgB oNt4xw4AzHBnJ4gg55ZkC2M74poUrceg2/c1eMTGHiAeqK59HaIriu3ozkpQCLe6zq5F WhR+UXR5HAQU5ILe1kXFZuyFfm3Wf4bRSstsQ= 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=ubcB/eKqhWqTij67Pa2k5Z8WaD6QB+Krl6nTDK47R3w=; b=iVML2XpYkNZLnPkUAgvMwqoNXSb+igQp0tT1cLKHPfq9qxjo4zW/x91871PG3/Wxhd AP8xJK1yqm27ZQfVqDZvnYI968jkzMu77OP+kP21y0xEjsCmPVNS9k117aCDpl1h+KJq Fq1j6cT59ARo5z/XWc9UvO78qNIdAkWSWHKJaz9zvo2ctST9MgSbNlyL+4z7+VGhTDEt hu06v/8p6XWhtc286trT33DV7OErnlejp+SFKbCtHPi5NW4TbxUIobPMThdKralpDlc3 S+nkoV871bV19r3nHMBnExA6SAotXKFQ2stwAXeGsuNAF/o8czEmzxQbZ+hV+sr6thyB j9Kw== X-Gm-Message-State: AOAM53398n2OilgUHGQiH/NqR2IoFvFXLjciHZHYJez4i/jQnRiDUM8c SUGTk4itEL+exO1JWaIu5sSyRtF8oHnfaqRf X-Google-Smtp-Source: ABdhPJz3+f8yXWJdEb0LU+4K4Fr1GVsVYtAFYAJI9ryaWXgdIBmHaOUCVY+JImMU/JcLBpzbi+erng== X-Received: by 2002:a05:6638:13d2:: with SMTP id i18mr2923573jaj.42.1599410141293; Sun, 06 Sep 2020 09:35:41 -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 2sm6689955ilj.24.2020.09.06.09.35.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 09:35:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH v2 3/5] binman: Support adding a U-Boot environment Date: Sun, 6 Sep 2020 10:35:33 -0600 Message-Id: <20200906163536.16162-4-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200906163536.16162-1-sjg@chromium.org> References: <20200906163536.16162-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 --- (no changes since v1) 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 Sun Sep 6 16:35:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1358332 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=lBMx7eBB; 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 4BkxrP5HnDz9sSn for ; Mon, 7 Sep 2020 02:36:37 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4E4D8823B8; Sun, 6 Sep 2020 18:35:51 +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="lBMx7eBB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 36A9A8239C; Sun, 6 Sep 2020 18:35:48 +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-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (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 58B5682378 for ; Sun, 6 Sep 2020 18:35:43 +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-x142.google.com with SMTP id l4so10536536ilq.2 for ; Sun, 06 Sep 2020 09:35:43 -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=vuwr4+EJcGT/gl9QZ/8+bcCMHv5LDyxgO4OGT1szCvM=; b=lBMx7eBBxJU9tNpH81YcaD0+PkV4KgkjlTVSFA1sqkuHGZiVkVILr+LOc7a7QjtjUT 9FzUfCYXjn/apVpJW9HQCcCiz3WHoZWu6drxzgml9elWtJlnKpybqSoHUYQiZ1oxzbKL vx8PGmyQ2CpVUbkoHfPC5w1F5EDZwy/CE4WMY= 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=vuwr4+EJcGT/gl9QZ/8+bcCMHv5LDyxgO4OGT1szCvM=; b=AESHhobwe679G5Nvk78T6AhAP/buLfjIJfBSj2WAKB8jAdwqyhE9Vwlt6CeW7GS7cX S3b8uTxEvfKT4kuB109+wFaUYC3fOn1ZVsPuHHVk7KRjc3S/9UvV68sOs63euOj1uIV6 9rNnXrgAql+aVSoQnnVBwnJ0J6EYB4mzNjJo6RPiy6STxqFjWn74Jf7LkZ/0zEKVU4Dd Dn7GLJXxJXj23jxOqNRddZcn8cq+Y558EytNJUAjoEnB/3kPUphW7O2Maan48RdD0ESE DjgrPjJOtzl+GdNRh8h7bg43yqyAsNYRJQl60kLBVxs0I1stJ+KwudynRmfPuhhzGgaH Jk7A== X-Gm-Message-State: AOAM531PUKp+1w1nMZvVB7lc6wQpkYSzIEJpaY7wJrbPryQFaFns7VmG AbZAofs/zU+DrRWaMeJtfealBjMUm8nXEvo+ X-Google-Smtp-Source: ABdhPJyPwmw91T1IGvtNpkY0YDUxRAmfUsUc2mVU0MizBqjv74DBv4hn4SaVMJzVb76pAs0aACBdgA== X-Received: by 2002:a92:ce43:: with SMTP id a3mr2494698ilr.163.1599410142042; Sun, 06 Sep 2020 09:35:42 -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 2sm6689955ilj.24.2020.09.06.09.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 09:35:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH v2 4/5] x86: edison: Generate an image suitable for xFSTK Date: Sun, 6 Sep 2020 10:35:34 -0600 Message-Id: <20200906163536.16162-5-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200906163536.16162-1-sjg@chromium.org> References: <20200906163536.16162-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 'OSIP' header (which happens to look like an MBR / (Master-Boot Record), U-Boot binary and an environment. I am not able to find a specification for OSIP. Signed-off-by: Simon Glass Reviewed-by: Andy Shevchenko --- Changes in v2: - Rename MBR to OSIP arch/x86/cpu/tangier/Kconfig | 1 + arch/x86/dts/edison.dts | 34 +++++++++++++++ board/intel/edison/edison-environment.txt | 48 ++++++++++++++++++++++ board/intel/edison/edison-osip.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-osip.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..e2f9469de32 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 the OSIP */ + blob { + filename = "edison-osip.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-osip.dat b/board/intel/edison/edison-osip.dat new file mode 100644 index 0000000000000000000000000000000000000000..c984e99f247c54253f1d950ece602d44c10cb6eb From patchwork Sun Sep 6 16:35:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1358333 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=Tn6/52j+; 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 4Bkxrb2m8mz9sSn for ; Mon, 7 Sep 2020 02:36:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3EC99823C7; Sun, 6 Sep 2020 18:35:52 +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="Tn6/52j+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DE41982396; Sun, 6 Sep 2020 18:35:48 +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-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 30A2C8237E for ; Sun, 6 Sep 2020 18:35:44 +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-xd43.google.com with SMTP id b16so11779497ioj.4 for ; Sun, 06 Sep 2020 09:35:44 -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=lcTKwPY2pWu4ilPj4qdYzzZYy/41Dxmmn0xY5pufWO8=; b=Tn6/52j+9/vqMsVO0+VnY/VvENZX/+cdvobhkNagPPLDrSDpZhy7IXbUbtV5+SM3ol 4lPN/vP5eMGtvSAkKJ5KW04rQlfd2sONxE47OB2KyHE0OypPm/9/SiM8LBcfTT1lhdxR 7zhUPCiWH4LQUEIRqN0n4czRqRwiKsaHf11lc= 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=lcTKwPY2pWu4ilPj4qdYzzZYy/41Dxmmn0xY5pufWO8=; b=pXm+1aJfydpl6YkCbcE5EJIpPB1BTrWG0GoLRkK12Ux6o98VNJvYBtFrXH8JFtYohJ sq/AYIvp+1oVxIp139uzUb61Gbd07DL1UCroaNohJi/5A4MU0XXwv5fVIZzkfcqLUJZ2 Y/OaPkU7V2Ol/hAmSWa6FfX4MIhgsjQOKbdcm/1PUzHgH6kcoJwKRXLgXbFXFmjD4/Pa M9w9aBYx3Owgvtz56f83TMkOS7u9Re8lnd3lGfUuviQY++LXIeHJQWa1sBeTth29qVGp EewOe3yLnQ7kOIHMm4CC3KUmSffRtCFK+G8MZikTgm9NUmbmKG5/1cOq0xSg/1OFy04R SbGg== X-Gm-Message-State: AOAM531JJAv7NWP0EJU2F3wzg0DonBhS3jzdH4jVwAiFOEWjWD8ML3gz 05WanjHQcd1Bvr9EK2rjw89VVLXgtMwCk5oA X-Google-Smtp-Source: ABdhPJx0ABTmxsIitcD9FWJeRX4w7WGyiyFhphudwnx0D3tESGpxHT/B+P0A4SFYZgpX9EM3b49Xww== X-Received: by 2002:a02:820b:: with SMTP id o11mr16398131jag.136.1599410142839; Sun, 06 Sep 2020 09:35:42 -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 2sm6689955ilj.24.2020.09.06.09.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Sep 2020 09:35:42 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Bin Meng , Simon Glass Subject: [PATCH v2 5/5] x86: edison: Add documentation for using am xFSTK image Date: Sun, 6 Sep 2020 10:35:35 -0600 Message-Id: <20200906163536.16162-6-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.526.ge36021eeef-goog In-Reply-To: <20200906163536.16162-1-sjg@chromium.org> References: <20200906163536.16162-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 --- Changes in v2: - Drop git hash from U-Boot version string 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..d658fac02c8 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 (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