From patchwork Mon Aug 14 20:48:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 9900155 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 A7C59602D9 for ; Mon, 14 Aug 2017 20:57:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92CE528743 for ; Mon, 14 Aug 2017 20:57:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90F9B28748; Mon, 14 Aug 2017 20:57:25 +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=unavailable 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 BCA5428743 for ; Mon, 14 Aug 2017 20:57:24 +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=xxeix9dsOVTGGKfZ90MqxO7B/BHRalSmNd1rb/VTLQU=; b=TOgtKO51iRgN/QGCClFtvGAPur UXhpYmLEtEvJxUXGbAjQS9kx1nzAEsA+GAaIf5LpDOayiMLATWo+XArgi87mA1TdKyd+cq2ijN8ri hwzqJzMtcjtFWhyMrpDAdXDTCraWTbrB/Wo4IfvF842HEep8mHXJXT2McjE/7REiRC6jpgCTrNIwA s7MuvHz1i9EAR12aDI9Z/jH/0Qk7AEu7qCkxA9pORT4m/YIYctWzIqo0Z1qjZJbb90v4Kq+OFXk5R 4EA/D+H71VstdfrAGNWwdyJlgqE1m16pHYsZkDdA4TbnPUg/m1ArFf05CfniVoIxqU1qnF1hHeisf qGwiKp7w==; 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 1dhMPN-0000qS-QZ; Mon, 14 Aug 2017 20:56:21 +0000 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dhMIZ-0000Gb-Bh; Mon, 14 Aug 2017 20:49:35 +0000 Received: by mail-wr0-x244.google.com with SMTP id x43so1472208wrb.1; Mon, 14 Aug 2017 13:48:58 -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=dUWhiOgL9W7XT4qrKfW6hPLZ1TMsJHWY1qWgqTIdTPU=; b=DeuCQMZKVYyafz1j1LmUg3MJLaR+D0bqtvRlbO8a3Fe9u41YlCqSj8ihQhrZANynsq P/nilwajG6qvLwMh/mpfG8hGZsDi8oDZixvGfdOwPZM0esIlSC5q6GIcLirPNPWhYVjn wP6MjTJ3h9nOqso1mXzrhr2opymVLc1LiepwluFm1jqKDMVj9XhNBQK2/rnyN/Vycy0d 5yXYj5D1L/uoRtN1YMznEMXKD6ad5qUcxWPnIzXMYsxjmETDweHTbxAGdzuE9J11fh1B EqcAMw8GEj1Wn0S9ur4zF+IznWGjyyB/gZvNidnSKiPj6/cDXjy5arNNkcyLDPLFIGCL IcaA== 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=dUWhiOgL9W7XT4qrKfW6hPLZ1TMsJHWY1qWgqTIdTPU=; b=B4D8ZDgQu6Rc7hFeCWUjAQFsQrc31FeZfWC92+ppbJfkhMFpux0vEqX8QGg2Eoy1vI ouX+PoqQ/2jAwPKMWsEa5GlFe8AFwMZxNlL0g0ra3nUAjW2Qgy7pk2UIKy8DhkvSsLHB 5bK5g7stdbD9HjUhEKHCQ86vozFdnEjzXYfyZuAgFlKFeMkAtw66DNWqbDsYIu4r8qIE YiAThnXqhzUD4PfHLEG7xbItR8RB9JXDLtQ0fX/IBivkhp2VIhAhW01uADId4boTtNWG g39Jf3kM5tkuFE9ukxx5/8UBOn6dtHYKLXILWVMevm1hcTk1RakGH4xPOQFEPY7npQYE iDIA== X-Gm-Message-State: AHYfb5hqrtJOrEzwFcZEHVtYbiZiLWxF8G13SOuy77SJ0KlcLI/FkyJJ aW8jsVduTlHV27lNITg= X-Received: by 10.223.154.203 with SMTP id a69mr17015567wrc.139.1502743736615; Mon, 14 Aug 2017 13:48:56 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Aug 2017 13:48:56 -0700 (PDT) From: Andrea Adami To: linux-mtd@lists.infradead.org Subject: [PATCH v5 8/9] ARM: pxa/spitz: Remove hardcoded partitioning, use sharpslpart parser Date: Mon, 14 Aug 2017 22:48:39 +0200 Message-Id: <1502743720-28672-9-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_134920_403975_47DDA9D6 X-CRM114-Status: GOOD ( 14.29 ) 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/spitz.c | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index 67d66c7..defefa3 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -739,21 +739,6 @@ static inline void spitz_lcd_init(void) {} * NAND Flash ******************************************************************************/ #if defined(CONFIG_MTD_NAND_SHARPSL) || defined(CONFIG_MTD_NAND_SHARPSL_MODULE) -static struct mtd_partition spitz_nand_partitions[] = { - { - .name = "System Area", - .offset = 0, - .size = 7 * 1024 * 1024, - }, { - .name = "Root Filesystem", - .offset = 7 * 1024 * 1024, - }, { - .name = "Home Filesystem", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL, - }, -}; - static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; static struct nand_bbt_descr spitz_nand_bbt = { @@ -808,10 +793,16 @@ static const struct mtd_ooblayout_ops akita_ooblayout_ops = { .free = akita_ooblayout_free, }; +static const char * const probes[] = { + "cmdlinepart", + "ofpart", + "sharpslpart", + NULL, +}; + static struct sharpsl_nand_platform_data spitz_nand_pdata = { .badblock_pattern = &spitz_nand_bbt, - .partitions = spitz_nand_partitions, - .nr_partitions = ARRAY_SIZE(spitz_nand_partitions), + .part_parsers = probes, }; static struct resource spitz_nand_resources[] = { @@ -834,14 +825,7 @@ static struct platform_device spitz_nand_device = { static void __init spitz_nand_init(void) { - if (machine_is_spitz()) { - spitz_nand_partitions[1].size = 5 * 1024 * 1024; - } else if (machine_is_akita()) { - spitz_nand_partitions[1].size = 58 * 1024 * 1024; - spitz_nand_bbt.len = 1; - spitz_nand_pdata.ecc_layout = &akita_ooblayout_ops; - } else if (machine_is_borzoi()) { - spitz_nand_partitions[1].size = 32 * 1024 * 1024; + if (machine_is_akita() || machine_is_borzoi()) { spitz_nand_bbt.len = 1; spitz_nand_pdata.ecc_layout = &akita_ooblayout_ops; }