From patchwork Mon Apr 16 20:32:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 133496 Delivered-To: patch@linaro.org Received: by 10.46.84.18 with SMTP id i18csp3974395ljb; Mon, 16 Apr 2018 13:36:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx49CWNCLeopk0YmV1iY4LxOJcJWTtCKDSyAYYEMdcbsSR/vCQUJGVVsrmDbQVjLqvIboEWGy X-Received: by 10.80.180.216 with SMTP id x24mr34030972edd.126.1523910971757; Mon, 16 Apr 2018 13:36:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523910971; cv=none; d=google.com; s=arc-20160816; b=mPH2XjLbzTuwVy+so8CN6oqPobDPeF0RH5pKZBtYBN9roq7xWiiY2Bntg9/IhRveUF GinzJydQp9kafKXusOguZv/CJMN0/574Os56stvD9LA7OQsuJVH77WiiJxf6qMNoQqxG 7I0NMoawrXLwt6LlhTHukvhqSUaFpjz0NuIMzwyodB2FIhFnWb270OR2iSPZsVCDdGXc yupc/lYmcjUL0UaefvUzBjqQRaN6RMhugKpdWOJxek1ghP8UFEuMlpfQi/anJFIh2dz0 4kKuu6P8cjYm2WlfzeLUGrCoVQOkD9Xp1GXF90A3UgLhwUJhPQzw0CogFxRBI2oS8Dx3 aR0Q== 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:dkim-signature:arc-authentication-results; bh=mh4a+gJCTuPhCTtRAYthH3Tyv8rhGK0cJWJ24k4JaOg=; b=0MFwMQHcRqxHDkZAxfXosEFEDkvz6CGTFK//ngEFt4bSyCbduR0JMqH4b9+xGZcKfF 0Cln9k1q6fdgPeeo5HYIxeDHeKWTgu1QSguidaRp4kL9ILuk3ZjD5Cu7l2FlYSDy9LG6 XV589Q1EdqUrupfJwfsmMhO0KSxmjdAGn0KE1rqh7lON1ObM6wDOO2eEaWiylFdXhg1e jy9MPKx0RTU+RKg60BJzsZs+8veLTJ4tagYGgaIzdXQyr0cEL6zNe1zHdUfEv7/QXVBJ u9lwTVoiIIVm4FDJH60APjANddGFQpMXQh2kwQNND3VUeRq2N7DOxblBEFQGiaIho4+l 2xYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VmWGE2gj; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id r25si9333edm.165.2018.04.16.13.36.11; Mon, 16 Apr 2018 13:36:11 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=VmWGE2gj; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: by lists.denx.de (Postfix, from userid 105) id 5991BC21E38; Mon, 16 Apr 2018 20:34:27 +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=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID 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 3239DC21E3A; Mon, 16 Apr 2018 20:33:49 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 0165EC21DFD; Mon, 16 Apr 2018 20:32:44 +0000 (UTC) Received: from mail-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by lists.denx.de (Postfix) with ESMTPS id 14275C21E08 for ; Mon, 16 Apr 2018 20:32:40 +0000 (UTC) Received: by mail-lf0-f65.google.com with SMTP id q9-v6so24042661lfk.9 for ; Mon, 16 Apr 2018 13:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EHzR+01SC0GMoKEPXdB2/7bKlZehnxMIkUIefkES8Yk=; b=VmWGE2gjUUhJdl8zDnJVf9AUONGCx33jpB3HJVoOn3d0itMj0lA8e9QSO5DNO4aDcS Kl1B387C954yQXEojCSbafqX8dY1rItTCl4KA7jUCUqxldvYzVbuVQdK7fCJgKbtYptI XYlzsoa3YdN7ZTErL53vIqCp8o4GOrL0DlcrE= 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; bh=EHzR+01SC0GMoKEPXdB2/7bKlZehnxMIkUIefkES8Yk=; b=CihlG+PVjTUw8VlxxtoqXXuP7XMhjUJDJcdTHJE4m315ImzgW5KRzasUjs0xBZElFh 44pNXJk3MqIIKAN92hfGfMvOYSKpV2QYmqgxHP7vjoycVLUa+7T9hjhWFfsZBliBo0E/ f2OA6iweaXjz0TrdKga+obhSqbp87Uoyy5kSJkS6lqJ8QIB6s9DYsokL0/MNFUDcwphD 6FD8ALvEOnWS8eUOZawmCXNFAHvH0GNONYCAnoSL/YX1l7S0d5G24yfW95g+0IxlvPio Et9U/1rSI1HLrYnCN1xp1OGpVKyzdZv98SXTgIFifNt3EF9Kxa1yhZikfL2z37+pQ4tK vlrg== X-Gm-Message-State: ALQs6tDuzQHCxVnbcFAKX0PZecVfiaEp8FrKE9BNXNZx2j3eVvyhisJz t0PAKHb626KCay3RnyygFuKfOfAzCcA= X-Received: by 2002:a19:519a:: with SMTP id g26-v6mr14989243lfl.50.1523910759097; Mon, 16 Apr 2018 13:32:39 -0700 (PDT) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id s3sm391116ljd.75.2018.04.16.13.32.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 16 Apr 2018 13:32:38 -0700 (PDT) From: Sam Protsenko To: u-boot@lists.denx.de Date: Mon, 16 Apr 2018 23:32:26 +0300 Message-Id: <20180416203227.26523-5-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180416203227.26523-1-semen.protsenko@linaro.org> References: <20180416203227.26523-1-semen.protsenko@linaro.org> Cc: Amit Pundir , Tom Rini , Praneeth Bajjuri , John Stultz , Sumit Semwal Subject: [U-Boot] [PATCH 4/5] arm: ti: boot: Add dtbo partition for Android boot 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" New Android boot scheme looks like this [1], and it involves adding new partition for storing Device Tree Overlays. This patch adds dtbo partition. While at it, let's revise Android partition table a bit. List of changes: - rename "misc" to "hole" (not used for anything, just a guard hole) - rename "reserved" to "uenv" (because it hold U-Boot environment) - rename "environment" to "dtb" (because it actually holds .dtb file) - move "dtb" after "uenv" (so that changes of dtb size won't affect "uenv" offset) - make "hole" size twice as bigger (to keep "uenv" offset the same, because "dtb" was moved after "uenv") - add "dtbo" partition (after "dtb", to not affect "uenv" offset) - while at it, increase "boot" partition size up to 20 MiB; that's needed because while playing with some additional drivers built-in and different compression techniques, and also for HS signing, we have seen the boot partition size reach close to border and sometimes reach over the limit of 10 MiB Now eMMC layout looks like this: offset content size partition (KiB) (KiB) =============================================================== 0 +------------------------+ | MBR/GPT header | 128 - 128 +------------------------+ | MLO | 256 xloader 384 +------------------------+ | u-boot.img | 1792 bootloader 2176 +------------------------+ | //////// hole //////// | 256 hole 2432 +------------------------+ | U-Boot environment | 256 uenv | (+ redundant) | 2688 +------------------------+ | dtb files | 1024 dtb 3712 +------------------------+ | dtbo files | 1024 dtbo 4736 +------------------------+ Android partitions remaining * =============================================================== "hole" partition is needed just to keep U-Boot environment at 2432 KiB offset, because: - this offset is used in DFU_ALT_INFO_EMMC: "u-env.raw raw 0x1300 0x200;" 0x1300 = 4864 sectors = 2432 KiB - which in turn relies on CONFIG_ENV_OFFSET: CONFIG_ENV_OFFSET = 0x260000 = 2432 KiB We are using "hole" partition instead of specifying "start" property to "uenv" partition, because this way it's easier to maintain change of preceding partitions. Also fix Android boot commands appropriately. [1] https://source.android.com/devices/architecture/dto/partitions Signed-off-by: Sam Protsenko --- include/environment/ti/boot.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/environment/ti/boot.h b/include/environment/ti/boot.h index 4f3d748b5c..f2d91f5298 100644 --- a/include/environment/ti/boot.h +++ b/include/environment/ti/boot.h @@ -26,13 +26,14 @@ "uuid_disk=${uuid_gpt_disk};" \ "name=xloader,start=128K,size=256K,uuid=${uuid_gpt_xloader};" \ "name=bootloader,size=1792K,uuid=${uuid_gpt_bootloader};" \ - "name=environment,size=128K,uuid=${uuid_gpt_environment};" \ - "name=misc,size=128K,uuid=${uuid_gpt_misc};" \ - "name=reserved,size=256K,uuid=${uuid_gpt_reserved};" \ + "name=hole,size=256K,uuid=${uuid_gpt_hole};" \ + "name=uenv,size=256K,uuid=${uuid_gpt_uenv};" \ + "name=dtb,size=1M,uuid=${uuid_gpt_dtb};" \ + "name=dtbo,size=1M,uuid=${uuid_gpt_dtbo};" \ "name=efs,size=16M,uuid=${uuid_gpt_efs};" \ "name=crypto,size=16K,uuid=${uuid_gpt_crypto};" \ "name=recovery,size=40M,uuid=${uuid_gpt_recovery};" \ - "name=boot,size=10M,uuid=${uuid_gpt_boot};" \ + "name=boot,size=20M,uuid=${uuid_gpt_boot};" \ "name=system,size=768M,uuid=${uuid_gpt_system};" \ "name=vendor,size=256M,uuid=${uuid_gpt_vendor};" \ "name=cache,size=256M,uuid=${uuid_gpt_cache};" \ @@ -66,8 +67,8 @@ "setenv machid fe6; " \ "mmc dev $mmcdev; " \ "mmc rescan; " \ - "part start mmc ${mmcdev} environment fdt_start; " \ - "part size mmc ${mmcdev} environment fdt_size; " \ + "part start mmc ${mmcdev} dtb fdt_start; " \ + "part size mmc ${mmcdev} dtb fdt_size; " \ "part start mmc ${mmcdev} boot boot_start; " \ "part size mmc ${mmcdev} boot boot_size; " \ "mmc read ${fdtaddr} ${fdt_start} ${fdt_size}; " \