From patchwork Mon Aug 14 20:48:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 9900153 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 5C356602D9 for ; Mon, 14 Aug 2017 20:55:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EBD12866F for ; Mon, 14 Aug 2017 20:55:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41CCE28737; Mon, 14 Aug 2017 20:55:44 +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 BF7762866F for ; Mon, 14 Aug 2017 20:55:43 +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=WnkdB2OlyXUBAFIVnTtVkmWL0ypMqZmxlvkCpp6ZG1I=; b=LJA9D5npuR7d+ZJ8vIUiEHKyic 1o2yK+J/zUxebSg3V5qsziyEur6Q6Wlz3TRhYCBenywn1UQWR6FT6GLNXNaxoowYbpDW81PMj54JO ncCVF5XM0RBsCW4d4mBPjPhwnHgehWo7hmDB2uP4frvx6oJEcehghFrpFPpUMRi/r9VkJBUy17eJ9 rJ22THn2iIZjNSkP05pPGz+AtcIZCSUrbJGXhp00nYSLwlmXt/mS0rFClp1cvpTlZ+LYDUmnd5QlB 4ITTvzGxhAcsQGTzeB+yyA91eVACmTsx5u3TUG0BnoZ8NwTjij7CbaGhu99voOqTQN3C5hbQLoc6C ZAt0jPbQ==; 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 1dhMOh-0000Fu-JZ; Mon, 14 Aug 2017 20:55:39 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dhMIX-0000F3-T0; Mon, 14 Aug 2017 20:49:27 +0000 Received: by mail-wm0-x242.google.com with SMTP id r77so15741722wmd.2; Mon, 14 Aug 2017 13:48:55 -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=5ansDtksmhx5iUiNttlbaYCceS0q7gmoGiPlKQFnAp4=; b=ej0xLxBCnCeUUqkEqnEvqgZ76FWltIlY541tapFPKM8XN844UwW+gFiY8hiZ69trDJ 2HMI+XGc4E0okBWNgTnKGFk/12FhvNWk3MoLnTrGJhjavHNd+EtqLQmWoIzGZWTvjrlX yH9T4U1uZ5mj2V3p/V91L7K6ghMOUosjhSIhINn7+ATA36wI03PnBJ7Xbri8xzYtwhXL EbSha/UPHUChOaIlC4HquBLxpBHdxU7rAk7oCqfrKodjm819nHHPwQ0tNaKyHzpx9lDz zHWuPV5kty9+sHs2SURkGoe81Kw53ZrifX9yGE3Vhol+HAnWK4aVXw8ao7cHQlCzO+TH UFOg== 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=5ansDtksmhx5iUiNttlbaYCceS0q7gmoGiPlKQFnAp4=; b=i2fHULmK8BXku2u2rYS+8OkzNpfJ2OJpAfsP92VYkRBy7yndeVn4IH7bb+KtjdtG8u ULTGSOGwwg6keYhEVwO/k6gqQqB9+uGv1Tc7e17Xu3Ns6rPlX+g5LmAWUIHf9PO4CS/y 1jXABuH0UlI+9wKeh+zL2FvN7PXMjoXwlJplJNf0FVFfVTSxdf6nwIpeZ7QK0oP7MY5b SEiFIjj36vG8vHJwHTuKgFitWqtgiTQHgBsvVGSoJX1AsuUl/ZxNX103+FbYi1ljb+Nf MNQpntWt9hwtNjQJX0XP7zD1kF2JhbfNGHmkMDF4Rgyj4RPQU9V/6a3KKft2JZg7Ste6 j/tw== X-Gm-Message-State: AHYfb5iTYmXvpL8AhBPTPG7MLezus+0w6CPSvcW4/DuxIM1frPV14Jm6 2WTZI+fTOU+CqbnJn0I= X-Received: by 10.28.133.149 with SMTP id h143mr115159wmd.129.1502743733974; Mon, 14 Aug 2017 13:48:53 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 14 Aug 2017 13:48:53 -0700 (PDT) From: Andrea Adami To: linux-mtd@lists.infradead.org Subject: [PATCH v5 6/9] ARM: pxa/corgi: Remove hardcoded partitioning, use sharpslpart parser Date: Mon, 14 Aug 2017 22:48:37 +0200 Message-Id: <1502743720-28672-7-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_134918_901739_3AAD1211 X-CRM114-Status: GOOD ( 13.05 ) 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/corgi.c | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 7270f0d..9546452 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c @@ -606,24 +606,6 @@ static void __init corgi_init_spi(void) static inline void corgi_init_spi(void) {} #endif -static struct mtd_partition sharpsl_nand_partitions[] = { - { - .name = "System Area", - .offset = 0, - .size = 7 * 1024 * 1024, - }, - { - .name = "Root Filesystem", - .offset = 7 * 1024 * 1024, - .size = 25 * 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 sharpsl_bbt = { @@ -633,10 +615,16 @@ static struct nand_bbt_descr sharpsl_bbt = { .pattern = scan_ff_pattern }; +static const char * const probes[] = { + "cmdlinepart", + "ofpart", + "sharpslpart", + NULL, +}; + static struct sharpsl_nand_platform_data sharpsl_nand_platform_data = { .badblock_pattern = &sharpsl_bbt, - .partitions = sharpsl_nand_partitions, - .nr_partitions = ARRAY_SIZE(sharpsl_nand_partitions), + .part_parsers = probes, }; static struct resource sharpsl_nand_resources[] = { @@ -750,9 +738,6 @@ static void __init corgi_init(void) platform_scoop_config = &corgi_pcmcia_config; - if (machine_is_husky()) - sharpsl_nand_partitions[1].size = 53 * 1024 * 1024; - platform_add_devices(devices, ARRAY_SIZE(devices)); regulator_has_full_constraints();