From patchwork Mon Aug 14 20:48:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 9900149 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89153602D9 for ; Mon, 14 Aug 2017 20:54:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79AD42866F for ; Mon, 14 Aug 2017 20:54:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C36228737; Mon, 14 Aug 2017 20:54:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E25012866F for ; Mon, 14 Aug 2017 20:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=pgrwyz0cIJTDhfJ7460LIwDE2OVyqqLOe7/QDgpaDyU=; b=CpmBXC6ab9d6+o90gqKXCrzIBD 4l6+VhJcNEdLJPa/B5yT9zu6dh8ZJ7inzHh8szxyJhMAaATND332RrdISXAdLDrg4yPDb+3X7KNSw uyRjT79SUPYHpbHXmVsYYbY9im5elsU4ZnCdVv2peQ+gZyAaXiqf7op/uhKw8javT23BBn7X3NkoI 904wjBxF/d9ry423/+m8mqYmI8wnFdZyFt/pYjTpRNIzLl9me8UMjJfICnTjxjCtO1qhWNS6x183u iANl8Tg5GAXFG/37WEOo0t+5d/OAgDyJTkMYUg47vf+3tyA9wPSFWT+gwCvMlAKXnh5tF+xqEXtZu uskKB0Eg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dhMNw-0006rA-R6; Mon, 14 Aug 2017 20:54:52 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dhMIW-0000Fa-P1; Mon, 14 Aug 2017 20:49:27 +0000 Received: by mail-wr0-x243.google.com with SMTP id f38so7705524wrf.4; Mon, 14 Aug 2017 13:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dUNruwAhNqQR9ZLb1Go4UkVGedejaDOlUf1X10rbpKo=; b=lLeXYsD3yEl1q+1hkN0ENh7GZxxXLczKy1qYy5AvblrVaVuydOmtiZ1jU8dkrfDqXu vNnahINYFCpv9pGqtJL5FKoe+9PwDTMjl2DYRHbpMIjZWfzIvaNJccdSMkszLOgNgY9s 9Z+pQ/Y+abbSyqsGW+6ZwNEi3j6tT9Kt0G14pyjm2gzcw7Fs4mcjp+ldEQN+uwhjGWZF DEBIFd0NpiD+KTLgKpJfmwOdJ/ZyBT1q9Xj0IVKfxm2S92T2Kz8ormSR/UkYOyQiTklu 2J6WJOGT+1w7Xt1pzH3BW03t7rC3VQN7HUdscpT+aBxcozGt57FxUA2/oRYcxeiTWn1V d9ZA== 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=dUNruwAhNqQR9ZLb1Go4UkVGedejaDOlUf1X10rbpKo=; b=BUMLI1fv9ao742U9hNmS1+ChzrOCnTS5Edfia3fZnO3QwvxRZkf8++Md/60iuZNyaM zK/GMC0fYVUX47kxqGFWxh6u/TTuDFPbON4IiBxTOUlBjTO8cc2g1mDoUK4AY5r/QwAA E64gDZz0qMJjJwwiKIHDUh7CYILnEqB5zIZT0qHek0pJad5V5uE18Gxm3wk3d6A4B9J/ gqXjAu7kca2c6qxz04ZQIbdlx5zoQlkxeugCEx1NJ8NvaTaFA6ACKZSmoUdjH+irGQ5d rRqgeKe7R1Vmkzlz0s/xMZWYQSMhgQNjgGKA4vVncf7btjEkLXJ5kuTDvJEb3LkUZAOv LTyA== X-Gm-Message-State: AHYfb5itdWDQaX1+S6uG1WCY7vuezpjnFQi8ck6DnWOrmo4qdrVd1EpD nHDV5VwJQrAbwo3cAj0= X-Received: by 10.223.163.207 with SMTP id m15mr17223725wrb.197.1502743735298; Mon, 14 Aug 2017 13:48:55 -0700 (PDT) Received: from andrea-ThinkPad-T520.homenet.telecomitalia.it (host228-232-dynamic.45-213-r.retail.telecomitalia.it. [213.45.232.228]) by smtp.gmail.com with ESMTPSA id 12sm172933wmy.44.2017.08.14.13.48.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Aug 2017 13:48:54 -0700 (PDT) From: Andrea Adami To: linux-mtd@lists.infradead.org Subject: [PATCH v5 7/9] ARM: pxa/tosa: Remove hardcoded partitioning, use sharpslpart parser Date: Mon, 14 Aug 2017 22:48:38 +0200 Message-Id: <1502743720-28672-8-git-send-email-andrea.adami@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502743720-28672-1-git-send-email-andrea.adami@gmail.com> References: <1502743720-28672-1-git-send-email-andrea.adami@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170814_134917_523149_0C820BEC X-CRM114-Status: GOOD ( 12.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Wolfram Sang , Dmitry Eremin-Solenikov , Richard Weinberger , Robert Jarzmik , linux-mmc@vger.kernel.org, Russell King , Haojian Zhuang , linux-kernel@vger.kernel.org, Marek Vasut , linux-arm-kernel@lists.infradead.org, Cyrille Pitchen , Lee Jones , Brian Norris , David Woodhouse , Linus Walleij , Daniel Mack MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP With the introduction of sharpslpart partition parser we can now read the offsets from NAND: we specify the list of the parsers as platform data, with cmdlinepart and ofpart parsers first allowing to override the part. table written in NAND. This is done here in the board file. Signed-off-by: Andrea Adami --- arch/arm/mach-pxa/tosa.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 13de660..b90560b 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c @@ -673,24 +673,6 @@ static int tosa_tc6393xb_suspend(struct platform_device *dev) return 0; } -static struct mtd_partition tosa_nand_partition[] = { - { - .name = "smf", - .offset = 0, - .size = 7 * 1024 * 1024, - }, - { - .name = "root", - .offset = MTDPART_OFS_APPEND, - .size = 28 * 1024 * 1024, - }, - { - .name = "home", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL, - }, -}; - static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; static struct nand_bbt_descr tosa_tc6393xb_nand_bbt = { @@ -700,10 +682,16 @@ static struct nand_bbt_descr tosa_tc6393xb_nand_bbt = { .pattern = scan_ff_pattern }; +static const char * const probes[] = { + "cmdlinepart", + "ofpart", + "sharpslpart", + NULL, +}; + static struct tmio_nand_data tosa_tc6393xb_nand_config = { - .num_partitions = ARRAY_SIZE(tosa_nand_partition), - .partition = tosa_nand_partition, .badblock_pattern = &tosa_tc6393xb_nand_bbt, + .part_parsers = probes, }; static int tosa_tc6393xb_setup(struct platform_device *dev)