From patchwork Thu Nov 16 09:22:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 119026 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp5356623qgn; Thu, 16 Nov 2017 01:22:58 -0800 (PST) X-Google-Smtp-Source: AGs4zMaijZxWa+xi5SJeRbm+XzzKdU8QWt2i1nmz+0fkFE5a/ilZ33G+8prM1zxW2gHhc42APCVJ X-Received: by 10.80.170.87 with SMTP id p23mr1839440edc.289.1510824178036; Thu, 16 Nov 2017 01:22:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510824178; cv=none; d=google.com; s=arc-20160816; b=MwblqkksXeOCF79qxTBQECuC0A3aa2MTBbw2o65kCd1qC/E+rTmwwsj7Hr73rRlA1k 8k1qm/bqjWR2BhhV3ZztidS1kRvEllhl80BAYAiRX6xU+ozC90XgXLExpwfwAjUPy6NK RFrA8G8tsewbq8skiC7Hl4ljBpSXFPMMRzRfViQv71CqesLA7PSQJbgsP38q0JUYBarf CJRk8Qqbn0SsMQmK5cMB7et4YpCwxyGRbxmuxv1BbxaA4sDvWn/xR6GjvwPuohcjT6sK J0DxYIVrFNrx6TsisfDQDWXrAvsT3JoxQyN3m65Bi8hHi90aQuDWMzBocDRsllGyRDtR 4bHA== 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:message-id:date:to:from :arc-authentication-results; bh=rd2Ai0bj2WZANPqZRWBJ0+O8jTpAvU6PTwuJ5C50Xqk=; b=eOz3VGKLH3aul9Km5s1/3cxmCZk+TMaTPqYc8COhYwYaq57tzShCWRnkOiDSdzCeu2 aKmn2rAe9a6JUMiH9RUFbpywKg4M+nTaMErH92uHv7N8shSx/5bDeN9eD1lCPbmpHN/Y 4+nKUrQOgjqd6DQ3Ig36/EtGFyeRXCSjDaUfP2DZZlz1bz+/GxWsuw6O4ALQ03LCKsZ6 8cK3any9wVDmUZUKtztqVwaI6I0tgt1Ew725sDYT+/yUcmU9LA5xCPyfhB4zcst1gRoX sd2MlM/prH+g02ig0FoiEx3LEtCgwy8mTk5p7g5xCP8XMZYoYWhKy/HMAuMSOwmJAKzy sJ9g== 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 e41si790050edb.90.2017.11.16.01.22.57; Thu, 16 Nov 2017 01:22:58 -0800 (PST) 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 1FF4DC21D90; Thu, 16 Nov 2017 09:22:49 +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 0A8CCC21D6A; Thu, 16 Nov 2017 09:22:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 923CFC21D7C; Thu, 16 Nov 2017 09:22:46 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 93DF7C21D6A for ; Thu, 16 Nov 2017 09:22:45 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 6BB92213E2; Thu, 16 Nov 2017 10:22:44 +0100 (CET) Received: from localhost (unknown [185.94.189.187]) by mail.free-electrons.com (Postfix) with ESMTPSA id 24839203A6; Thu, 16 Nov 2017 10:22:34 +0100 (CET) From: Maxime Ripard To: Tom Rini Date: Thu, 16 Nov 2017 10:22:21 +0100 Message-Id: <20171116092231.27740-1-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 2.14.3 Cc: Andre Przywara , agraf@suse.de, u-boot@lists.denx.de, Maxime Ripard , Jagan Teki Subject: [U-Boot] [RFC PATCH 00/10] env: Multiple env support and env transition for sunxi 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" Hi, Here is a second attempt at transitioning away from the MMC raw environment to a FAT-based one. You'll find the first one here for reference: https://lists.denx.de/pipermail/u-boot/2017-October/310111.html The fundamental issue I'm trying to adress is that we've had for a very long time the assumption that the main U-Boot binary wouldn't exceed around 500 bytes. However, we're starting to get real close to that limit, and are running out of silver bullets to deal with the consequences of having a bigger U-Boot binary, the main consequence being that we would have some overlap between the environment and U-Boot. One way to address this that has been suggested by Tom is to move away from the raw MMC environment to a FAT-based one. This would allow us to slowly migrate away, and eventually remove the MMC-raw option entirely to reclaim that space for the binary. That cannot be done in a single release however, since we might have environments in the wild already that people rely on. And since we always encouraged people to use the raw MMC environment, noone would expect that. This is even worse since some platforms are using the U-Boot environment to deal with implement their upgrade mechanism, such as mender.io, and force moving the environment would break any further upgrade. The suggested implementation is to allow U-Boot to compile multiple environments backend at once, based on the work done by Simon. The default behaviour shouldn't change obviously. We can then piggy-back on this to tweak on a per-board basis the environment lookup algorithm to always favour the FAT-based environment and then fallback to the MMC. It will allow us to migrate a raw-MMC user to a FAT based solution as soon as they update their environment (assuming that there is a bootable FAT partition in the system). This has just been compile tested on sunxi so far, and I'd like general comments on the approach taken. Obviously, this will need to work properly before being merged. Let me know what you think, Maxime Maxime Ripard (10): cmd: nvedit: Get rid of the env lookup env: Make env_driver_lookup_default private env: Rename env_driver_lookup_default and env_get_default_location env: Pass additional parameters to the env lookup function env: Make the env save message a bit more explicit env: Support multiple environments env: Allow to build multiple environments in Kconfig env: Mark env_get_location as weak sunxi: Transition from the MMC to a FAT-based environment env: sunxi: Enable FAT-based environment support by default board/sunxi/board.c | 16 +++++ cmd/nvedit.c | 4 -- env/Kconfig | 69 +++++++++--------- env/env.c | 194 ++++++++++++++++++++++++++++++++------------------ include/environment.h | 14 ++-- 5 files changed, 182 insertions(+), 115 deletions(-)