From patchwork Fri Oct 20 12:16:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 116489 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1621867qgn; Fri, 20 Oct 2017 05:17:51 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SOg9Xa1ADeGeWf9/bJN8iX9f9y7hsLw1tP5PrMQjAaUydp2ONRAdHppeHAlZwKwJroUvfu X-Received: by 10.80.243.12 with SMTP id p12mr6177553edm.38.1508501871892; Fri, 20 Oct 2017 05:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508501871; cv=none; d=google.com; s=arc-20160816; b=w7cGefQx9YEnpUzqjXBoX8pTr+ClzbJ5YLELML84yLKJuGz95waBu+cG8FeUBeOUhC 0TboApSNeHFY1l38ISQOA22SB9aBcG/AnGiLsjuDCogoJetuAJsDVTDRZVkzEegHBeWg YGGG2WWSHPse3nbqmVyM0/KD5X4tQ5vnuB1dHS2cOkv2g8oviPrkVpwVjWV3i4Iw3VSF KEpTTLM3jPzfdUo0LEFSIuJ7/JP62FS4bqaEF3MTyuz1H7JHflZRqLUbM/cvyPbq6qhC 9ns1LlrvUDfiXdO5Sx4H5eiIDkhrc/u17QcCAIsi/Y2k/JsM0+bb8zJVnSIhJ8OZRrYu Uc1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=5N1dYWMxgKOcQS3iZKa4s6pRK7YSpL3DTGnA5j10GPg=; b=aB/3N9hezwcMs2TKyASR4z+iMJokI/5ZGB6bAizq2qegdcW7YOgB9KqeM1eNFLn1ZL Icr/eLCIm12s/rFCQBwfrr/lAdwGsfirZC2czHtqBxUfZ/AhodJWa8it8mlbPigQP1UZ mT+BLIYxb+lO61VYJI5bDYduqgM9o57Fhdzgqn3k4ydGCMlEeFm/wj2m4hOcTJmrV9H6 03UunmBThbf0S6UApXndVJ7/EvA2+9oCwEEG8O1Fo7XqqJ00Znu5IrJFYfBzRBjWAKAo NaUXNOIAGMxdkQ2vpG4XPkqELtfWdVxOCNhO1w+1Qj8IW6fAlgT0AwmMqSyIli7rJdQ7 2CLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id l9si734079edf.545.2017.10.20.05.17.51; Fri, 20 Oct 2017 05:17:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 7055AC21FDE; Fri, 20 Oct 2017 12:16:54 +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 36221C22008; Fri, 20 Oct 2017 12:16:30 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id D1513C21FC8; Fri, 20 Oct 2017 12:16:24 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 0DE12C21FE0 for ; Fri, 20 Oct 2017 12:16:21 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 85D6E206A6; Fri, 20 Oct 2017 14:16:19 +0200 (CEST) Received: from localhost (unknown [185.94.189.190]) by mail.free-electrons.com (Postfix) with ESMTPSA id 1AA542038C; Fri, 20 Oct 2017 14:16:19 +0200 (CEST) From: Maxime Ripard To: Tom Rini Date: Fri, 20 Oct 2017 14:16:13 +0200 Message-Id: <20171020121614.9863-2-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171020121614.9863-1-maxime.ripard@free-electrons.com> References: <20171020121614.9863-1-maxime.ripard@free-electrons.com> Cc: Andre Przywara , agraf@suse.de, u-boot@lists.denx.de, Maxime Ripard , Jagan Teki Subject: [U-Boot] [PATCH v3 1/2] sunxi: Enable THUMB build for the U-Boot binary 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" We start to get to the limit of our main U-Boot binary size (with some boards even crossing it). Enable its build using thumb2 to get some extra room. Suggested-by: Siarhei Siamashka Signed-off-by: Maxime Ripard Reviewed-by: Andre Przywara Tested-by: Andre Przywara --- arch/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 64e0ee43f112..83b7aa51dc2c 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -698,6 +698,7 @@ config ARCH_SUNXI select SPL_SYS_MALLOC_SIMPLE if SPL select SYS_NS16550 select SPL_SYS_THUMB_BUILD if !ARM64 + select SYS_THUMB_BUILD if !ARM64 select USB if DISTRO_DEFAULTS select USB_STORAGE if DISTRO_DEFAULTS select USB_KEYBOARD if DISTRO_DEFAULTS From patchwork Fri Oct 20 12:16:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 116487 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1620835qgn; Fri, 20 Oct 2017 05:16:50 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RzWkd538U3HHQFpSBXSMYelCQ16FIcutJEmh0+JZw25lVWWSxUcs5D6+KD4wvfdwbYszgS X-Received: by 10.80.140.36 with SMTP id p33mr5954897edp.130.1508501809943; Fri, 20 Oct 2017 05:16:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508501809; cv=none; d=google.com; s=arc-20160816; b=bWHjMcxhy94VSTmzJjLXw1R5JutCg3m1nJxwEmwvr4kwj9ZYNjTonuXANtfp3JhIcR naxRIKXyBn2u19cNvVSSRDZ2IyzuNQk5darhbt1PFHBtET6tzkoGPFV/ga1z89bx8GKx CvvPzLlIW0oWrewE8MwFhX2mHvSvSLQdV2EGM5BRp3N4gwCHzsdoUlrzZ5akPrsGiInl 66igV9iNGYixeaKEvsctbhil2WrNOjVVo3Sov2uBloOTamlVWbVsd6nQcR/3IZCZ+Q75 Aro9u+aZ+nBsj79b2PDPHBBkiWKKHicMqxvU1oo0D08ItvER9stzsiGHC7GLCNnzktAg 7gXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:message-id :date:to:from:arc-authentication-results; bh=HAqMh+hC8SYSPqdpOxdo3Vmm3AmcXhjWSLdKlTyzzDU=; b=oRQe5BtUAuccGSC96YoVH6LOFT2m2e3Q4gv3SFopz0fBzHA/vRjM8L3X7NUST++2op 9NvIIIDXRRspXc3+PdavOF/V9mLt7IfnqBreaUtzzBCcGPqk1umiGjyCd6lXHNSLgApq JgIUTEtfO4Jtpn3XL8kRflauL9umu86JN4YK/DwO/Kej16O3DpwrR3sHvub8bKZIHdCG ahCjO+UPvkfbmKmuFu8rNWQCySw8TDXgys5KwTVJAwuGVqiLOuUCYXkSldSFSM+WBAPZ tiziF36fz0RdCm43tNP1Ut+cVh+GoHpDq8R0giK5cefGL91CmhpGI1wm4UmJCMjfOO0O zvGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id y21si487084edi.263.2017.10.20.05.16.49; Fri, 20 Oct 2017 05:16:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 7F5D9C21FD1; Fri, 20 Oct 2017 12:16:38 +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 38209C21FDC; Fri, 20 Oct 2017 12:16:28 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5E067C21FCC; Fri, 20 Oct 2017 12:16:23 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 27F7AC21FC0 for ; Fri, 20 Oct 2017 12:16:19 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 9C5ED2068F; Fri, 20 Oct 2017 14:16:17 +0200 (CEST) Received: from localhost (unknown [185.94.189.190]) by mail.free-electrons.com (Postfix) with ESMTPSA id 2EF122038C; Fri, 20 Oct 2017 14:16:17 +0200 (CEST) From: Maxime Ripard To: Tom Rini Date: Fri, 20 Oct 2017 14:16:14 +0200 Message-Id: <20171020121614.9863-3-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171020121614.9863-1-maxime.ripard@free-electrons.com> References: <20171020121614.9863-1-maxime.ripard@free-electrons.com> Cc: Andre Przywara , agraf@suse.de, u-boot@lists.denx.de, Maxime Ripard , Jagan Teki Subject: [U-Boot] [PATCH v3 2/2] sunxi: binman: Add U-Boot binary size check 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" The U-Boot binary may trip over its actual allocated size in the storage. In such a case, the environment will not be readable anymore (because corrupted when the new image was flashed), and any attempt at using saveenv to reconstruct the environment will result in a corrupted U-Boot binary. Reviewed-by: Andre Przywara Signed-off-by: Maxime Ripard --- arch/arm/dts/sunxi-u-boot.dtsi | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/arm/dts/sunxi-u-boot.dtsi b/arch/arm/dts/sunxi-u-boot.dtsi index 5adfd9bca2ec..72e95afd780e 100644 --- a/arch/arm/dts/sunxi-u-boot.dtsi +++ b/arch/arm/dts/sunxi-u-boot.dtsi @@ -1,5 +1,14 @@ #include +/* + * This is the maximum size the U-Boot binary can be, which is basically + * the start of the environment, minus the start of the U-Boot binary in + * the MMC. This makes the assumption that the MMC is using 512-bytes + * blocks, but devices using something other than that remains to be + * seen. + */ +#define UBOOT_MMC_MAX_SIZE (CONFIG_ENV_OFFSET - (CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR * 512)) + / { binman { filename = "u-boot-sunxi-with-spl.bin"; @@ -8,6 +17,9 @@ filename = "spl/sunxi-spl.bin"; }; u-boot-img { +#ifdef CONFIG_MMC + size = ; +#endif pos = ; }; };