From patchwork Sat Jun 11 21:02:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 100032 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:4978:20e::2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2CF2DB7073 for ; Sun, 12 Jun 2011 07:02:55 +1000 (EST) Received: from canuck.infradead.org ([2001:4978:20e::1]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QVVKH-0007GN-Cl; Sat, 11 Jun 2011 21:02:37 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QVVKG-0000eF-V4; Sat, 11 Jun 2011 21:02:36 +0000 Received: from mail-vx0-f177.google.com ([209.85.220.177]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QVVK5-0000cU-Bp; Sat, 11 Jun 2011 21:02:26 +0000 Received: by vxd2 with SMTP id 2so3795071vxd.36 for ; Sat, 11 Jun 2011 14:02:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=cDcGXRhaK6w/ZrJrNTvNO413e2dtMTgsDWlErTQZE/0=; b=W9pYaR0brbdv8ApLeIb0F7z0a22yRqxTddLv6gPY3sINNGG6du8VHHpj3eV1R+JtBA Ck4YgPsaZBX+8fzQdH+wPNH8r68ex6VfHesF6zKm3N1XC+gNyFxVBJLh4XP4+S75EeOl 3USpK5zrkeJjtUy1JaWjbRAdVug94dVbcHcVQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=PqE2YobetaCsQagV9HLjrRBIRq91k3pRRN3ZBtF3HkceDatt6QIFqc6C4NsFHw8jgU 6urp0Eiu3gA0epZF0JD+BFzplO8Anu3k6G46HKrP+l9rKf1Mcx/6k646bzB18BMwty62 UnNYOhJnOB6Gn2CSSZ6XrIuXwoJkT4qC+vg38= MIME-Version: 1.0 Received: by 10.220.102.17 with SMTP id e17mr1239062vco.258.1307826141055; Sat, 11 Jun 2011 14:02:21 -0700 (PDT) Received: by 10.220.181.194 with HTTP; Sat, 11 Jun 2011 14:02:21 -0700 (PDT) In-Reply-To: <20110611092224.GB16318@ibawizard.net> References: <1307369056-29319-1-git-send-email-dbaryshkov@gmail.com> <1307369056-29319-3-git-send-email-dbaryshkov@gmail.com> <20110611092224.GB16318@ibawizard.net> Date: Sun, 12 Jun 2011 01:02:21 +0400 Message-ID: Subject: Re: [PATCH 2/3] ts72xx: use MTDPART_OFS_RETAIN for mtd partitioning From: Dmitry Eremin-Solenikov To: =?UTF-8?Q?Petr_=C5=A0tetiar?= X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110611_170225_781213_9B00D9E5 X-CRM114-Status: GOOD ( 22.64 ) X-Spam-Score: -0.8 (/) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-0.8 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.220.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is freemail (dbaryshkov[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RFC_ABUSE_POST Both abuse and postmaster missing on sender domain Cc: Russell King , dedekind1@gmail.com, Mika Westerberg , Hartley Sweeten , Ryan Mallon , linux-mtd@lists.infradead.org, David Woodhouse , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org Hello, colleagues, On 6/11/11, Petr Štetiar wrote: > Dmitry Eremin-Solenikov [2011-06-06 18:04:15]: >> Instead of specifying a callback for dynamic partitioning, use >> MTDPART_OFS_RETAIN for reserving a place near the end of flash for >> RedBoot. > > [...] > >> - .offset = MTDPART_OFS_APPEND, >> - .size = 0, /* filled in later */ >> + .offset = MTDPART_OFS_RETAIN, >> + .size = TS72XX_REDBOOT_PART_SIZE, >> + /* leave so much for last partition */ > > thank you for the mtd cleanup work. While testing this patch, I've noticed, > that the TS72XX_REDBOOT_PART_SIZE is by 16K bigger, then it should be: > > Redboot: > > RedBoot> fis list > Name FLASH addr Mem addr Length Entry point > (reserved) 0x60000000 0x60000000 0x01D04000 0x00000000 > RedBoot 0x61D04000 0x61D04000 0x00040000 0x00000000 > vmlinux 0x61D44000 0x00218000 0x000C0000 0x00218000 > FIS directory 0x61FFC000 0x61FFC000 0x00003000 0x00000000 > RedBoot config 0x61FFF000 0x61FFF000 0x00001000 0x00000000 > > Linux: > > 0x000000000000-0x000000004000 : "TS-BOOTROM" > 0x000000004000-0x000001d00000 : "Linux" > 0x000001d00000-0x000002000000 : "RedBoot" > > So if I simply read now first 4 bytes from /dev/mtdblock2, there's no 'CRUS' > or 'SURC' boot HeaderID/signature and it means, that there's no valid > Redboot > for ep93xx. The correct value is: > > #define TS72XX_REDBOOT_PART_SIZE (SZ_2M + SZ_1M - SZ_16K) Could you please verify/ack the attached patch? From 9a7a69043004d2f738e321c2443f81f345bf9b1e Mon Sep 17 00:00:00 2001 From: Dmitry Eremin-Solenikov Date: Sun, 12 Jun 2011 00:58:38 +0400 Subject: [PATCH] ts72xx: correct partition sizes Since afe43223d (ts72xx: use MTDPART_OFS_RETAIN for mtd partitioning), ts72xx uses incorrect size for Linux partition (difference is 16k), correct that so that users have correct access to RedBoot partition. Signed-off-by: Dmitry Eremin-Solenikov --- arch/arm/mach-ep93xx/ts72xx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index dea42e2..9510ae0 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -106,7 +106,7 @@ static int ts72xx_nand_device_ready(struct mtd_info *mtd) static const char *ts72xx_nand_part_probes[] = { "cmdlinepart", NULL }; #define TS72XX_BOOTROM_PART_SIZE (SZ_16K) -#define TS72XX_REDBOOT_PART_SIZE (SZ_2M + SZ_1M) +#define TS72XX_REDBOOT_PART_SIZE (SZ_2M + SZ_1M - SZ_16K) static struct mtd_partition ts72xx_nand_parts[] = { { -- 1.7.5.3