From patchwork Wed Feb 7 18:41:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Protsenko X-Patchwork-Id: 127209 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp744631ljc; Wed, 7 Feb 2018 10:41:41 -0800 (PST) X-Google-Smtp-Source: AH8x2246Gu5DpFnPxbKpRHSLw/6DWn5RBWO8btbx0+YXZh/RBZoCFlV0vi4y1dwI23fPp0YBDlhc X-Received: by 10.80.182.203 with SMTP id f11mr9244845ede.157.1518028901466; Wed, 07 Feb 2018 10:41:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518028901; cv=none; d=google.com; s=arc-20160816; b=txS59iK8IdxeW6R19USLBuk73ZbeFTxPt9bdPC1F7H60eaSBvsYtjlJghEmcni6aio IQ3fpqcy7fiOz3fIqIqfWX4YngQtHnSuTcmqsocjW6CYymimGZyYFzRntLjUgUM0qD/V LrIjCZzz8zaFuM88RLn0Kt9AGUXDRPJIzGMN674LVrT7xqe+7UhuciT2XZQi1qeMROw2 U8lTSfNSQL9ZpfWBF9JwXfkMtMctIfxWCN73VnTUk0UeEyUgZbAq1e+SSjq0NYsQ8iBg igy0kSvLvKwsRBF1grlorib4netShW+ArQ4+S0BvkedOL7rVWQwBbHxMUCCA+zhc6rJu jjMw== 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 :dkim-signature:arc-authentication-results; bh=rH8KkZJVKWzYB8ZDu7oJZn1ZAJJqNxuz7steA7gQGyc=; b=DVtgNdVVhISzpRZ+uDOLrrHpz9y3s4VP2Y8JcOM+SP4V98CnZn/S6ih3JYfs0bG91F cE+seTqSg9j0VThYE8mBuTTroOy2oHv3QdGAf9w9hITHIN0a35xkNGt4SXq+vziRoBaw YjYA1YWXd56UwwmRJSIM7pqqNgA9bTHGomlafMsWDyIvxqZRSyYpECDSplvQlItTQML0 05AaK/EqoY/CMkfK4gIhz4DNPe+z4l9ndbuihdpJjMorEe1tyXRP7CNAoYO+N/t95me9 6fhPUEa8XGD7PR2JQjN6/H+cqXPokmKE0cTWoFzcrpPXQS7CWojQn/JhxCrFVQgRCHOG a9GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KA4ma9aH; 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 c92si1877294edd.246.2018.02.07.10.41.41; Wed, 07 Feb 2018 10:41:41 -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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=KA4ma9aH; 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 D23EBC21E08; Wed, 7 Feb 2018 18:41:39 +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_MSPIKE_H2, 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 8D787C21D9F; Wed, 7 Feb 2018 18:41:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id A5F63C21D9F; Wed, 7 Feb 2018 18:41:35 +0000 (UTC) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by lists.denx.de (Postfix) with ESMTPS id 0A922C21C57 for ; Wed, 7 Feb 2018 18:41:35 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id h9so2138181wre.12 for ; Wed, 07 Feb 2018 10:41:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=8cv6y3vgNN3NITB1RcTm78scrB7JbF6ebUcli50W3lg=; b=KA4ma9aHNJh1pYlCZ31RzFjWdjpeVFgw8/mm5wl9Vs9RCl9sXhFMcSGt4X8vvYli2x ys8+WiKlAQhWJZ5I5JfQG5RYdkJXPyZojEOVWnzcFAb2mT2L+XIuREe9XYznHIVK2IRx /wf1S+6QrLJxH649eDccYMwQz3y6Vr6T0Emwo= 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; bh=8cv6y3vgNN3NITB1RcTm78scrB7JbF6ebUcli50W3lg=; b=USXw0PNakBhKVGC+wCHKPZGq0hASqEPcXGHz4AC7XR/Z1NxLjGh3Xpb/8FQKhKs1T7 Tz7cbNj5YVTQ8P2BTo8nbYT8SYNWZnbjMMFSMm9dCgs2W33rTzdXd31Hb+zzVaf19eqV yj38GZcty9bZk/PRcSGpbR13WvmZ2bIHVPW8EBbdSF1SQddZDGMq0Gpv/npmIlUYcTpA q1rH/Y3vElLK1XnZ6eFnzgBDyOpKw+knZU0uNn+XOyO/aH5Y80qbeSuQeM9w4ztIxLri No/oOA0Ug/l1c0jt6L76p1dPUHJCxq5mRDg5w6IlncLGiz4dp095ekij5og4dLra7fFm PInw== X-Gm-Message-State: APf1xPB/HqbOcC+KykyMwOIZK9gjqacYw0A/sbFmIH78IwIBQ5KwOJg7 /RF5tA2tUOY9u7V0857UNjA+bjuXuPA= X-Received: by 10.223.128.169 with SMTP id 38mr6403709wrl.104.1518028894178; Wed, 07 Feb 2018 10:41:34 -0800 (PST) Received: from localhost ([195.238.92.132]) by smtp.gmail.com with ESMTPSA id r189sm3478860wmd.39.2018.02.07.10.41.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 07 Feb 2018 10:41:33 -0800 (PST) From: Sam Protsenko To: u-boot@lists.denx.de Date: Wed, 7 Feb 2018 20:41:32 +0200 Message-Id: <20180207184132.19831-1-semen.protsenko@linaro.org> X-Mailer: git-send-email 2.15.1 Cc: Tom Rini Subject: [U-Boot] [PATCH] am335x_evm: Consolidate eMMC partitions with DFU info 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" >From DFU_ALT_INFO_EMMC (include/environment/ti/dfu.h) we can see that rootfs will be flashed to second partition on eMMC. But at the moment we have only one partition in $partitions environment variable. Let's add "bootloader" partition prior to "rootfs", so that DFU works correctly. This also fixes eMMC boot, which looks for rootfs on second partition. "bootloader" partition start corresponds to "u-boot.img.raw" in DFU eMMC info, which is 0x300 sector (384 KiB offset from eMMC start). rootfs start address can be also found from DFU eMMC info. bootloader-related area is finished at 0x1500 sector (2688 KiB offset from eMMC start). This should be the start address for rootfs in $partitions environment variable. While at it, fix U-Boot environment address to be the same as for AM57x EVM, so that it doesn't clash with other partitions. So now eMMC layout looks like this: =============================================================== 0 +------------------------+ | MBR/GPT header | 128 - 128 +------------------------+ | MLO | 256 - 384 +------------------------+ | u-boot.img | 1792 bootloader 2176 +------------------------+ | //////// hole //////// | 256 - 2432 +------------------------+ | U-Boot environment | 128 - 2560 +------------------------+ | U-Boot environment | 128 - | (redundant) | 2688 +------------------------+ | rootfs | remaining rootfs end +------------------------+ =============================================================== "hole" area can be used further for storing U-Boot environment (like it's done in AM57x EVM config file) or for increasing u-boot.img area (in case u-boot.img size increased, e.g. if new dtbs were added). This commit conforms with Linux partition table from f6d245b8c56c ("arm: am57xx: Fix Linux boot from eMMC") commit, making things in uniform way. Signed-off-by: Sam Protsenko Reviewed-by: Lokesh Vutla Reviewed-by: Tom Rini --- include/configs/am335x_evm.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h index 31ab503dca..8c2dd2aac8 100644 --- a/include/configs/am335x_evm.h +++ b/include/configs/am335x_evm.h @@ -17,12 +17,13 @@ #define __CONFIG_AM335X_EVM_H #include +#include #ifndef CONFIG_SPL_BUILD # define CONFIG_TIMESTAMP #endif -#define CONFIG_SYS_BOOTM_LEN (16 << 20) +#define CONFIG_SYS_BOOTM_LEN SZ_16M #define CONFIG_MACH_TYPE MACH_TYPE_AM335XEVM @@ -34,7 +35,7 @@ #define CONFIG_SYS_LDSCRIPT "board/ti/am335x/u-boot.lds" /* Always 128 KiB env size */ -#define CONFIG_ENV_SIZE (128 << 10) +#define CONFIG_ENV_SIZE SZ_128K #ifdef CONFIG_NAND #define NANDARGS \ @@ -99,7 +100,9 @@ "console=ttyO0,115200n8\0" \ "partitions=" \ "uuid_disk=${uuid_gpt_disk};" \ - "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \ + "name=bootloader,start=384K,size=1792K," \ + "uuid=${uuid_gpt_bootloader};" \ + "name=rootfs,start=2688K,size=-,uuid=${uuid_gpt_rootfs}\0" \ "optargs=\0" \ "ramroot=/dev/ram0 rw\0" \ "ramrootfstype=ext2\0" \ @@ -280,8 +283,8 @@ #define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */ #elif defined(CONFIG_EMMC_BOOT) #define CONFIG_SYS_MMC_ENV_DEV 1 -#define CONFIG_SYS_MMC_ENV_PART 2 -#define CONFIG_ENV_OFFSET 0x0 +#define CONFIG_SYS_MMC_ENV_PART 0 +#define CONFIG_ENV_OFFSET 0x260000 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE) #define CONFIG_SYS_REDUNDAND_ENVIRONMENT #define CONFIG_SYS_MMC_MAX_DEVICE 2