From patchwork Wed May 31 22:40:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 9758409 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 C44BE602BF for ; Wed, 31 May 2017 22:44:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B52DE28453 for ; Wed, 31 May 2017 22:44:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A8879284D2; Wed, 31 May 2017 22:44:46 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM 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 4768128453 for ; Wed, 31 May 2017 22:44:46 +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=xNu1YupsR7P+YwdjMxy95U4gQ3FkLTKis/IkAmYvMTQ=; b=cNrmVhTQkdm2LoO+43rMGhBxiC XLE4ff4FqFxiNKqNOsPnw8oRapg6vxrQ9AgUY+sniv2Udl0mCJ3mhTnXOm2MZ7Cw4p0NDMYg78VCw MYWuO9FLqW1lAWWnULSGZqJzSgewrl+L6rj0c+ge7RIyHbvnbGoHF0Z3ZqjOwxOS7dVh50fSsiuks YV5NiTF7aVrluD2U5apJnivBgBf+ptIwfUMFBcoftrFpNitfpF+62ovi4ga4qbRIKHCu2y4JysNEz 30KfWrHSjdbQie1gZi0jNjZD2ZYYtBQf4YAtaX+Noz+ar3yP+VcRlPIKZa5fFCtUPSfcJS2PQF2bZ 8LQaOhyw==; 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 1dGCM8-0000XY-D0; Wed, 31 May 2017 22:44:44 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dGCJ3-0004gc-Dh; Wed, 31 May 2017 22:41:35 +0000 Received: by mail-wm0-x244.google.com with SMTP id b84so6962115wmh.0; Wed, 31 May 2017 15:41:14 -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=X4jQsVrDFmWqN1dlsUkA2cktO+pSHcf6dhzDsUb6vYA=; b=CYerCD9F7Blhz+qPqxb7HZrkoK1zVfmHPopfDlrpjhrQe7wV7o/9t/eHBHhhbVs4pw IyyEazht38H12my61b7BKhQ84c2jJtdg++FUxXO0V0ikWr6qWmf9T4hiq4+xqMkEREn7 df7g8Da2SeVJ4bCaFc6kp3ekwkGjVlN7ikqv00AcAgVPdNgWufz6qQ5hK9cW+fdr62Ww cTmNbxH7VO8E3VNGz09qL41XGjXdkFMobPO1A1EUtkjU2O4GbRxo1jPuJoBFTj8uLpYE nRg/U9x8s/LUkVE2DanAHa2C4G0v40VV99cCims0Q+YN9Hm1dhD8+0PUh7SiymNe5lzv upMg== 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=X4jQsVrDFmWqN1dlsUkA2cktO+pSHcf6dhzDsUb6vYA=; b=kcHO8ULfgulHydYiUiTwrqKfna9vwjHufhdHnk8TcURT+aXKkhxsvmwgdTYLrbl/cJ FH6WAbiTWVLbIFncwKoNRVEQZXmC76FqlwChnhe6eaZ9paIme/CZURqWHG/QL5dtSsOE gO0VYMUhJQ63E/LZtzFBTUNzM+5nWOzWZG0U9VrvNVKZQnj3F/xXY4sfc248vSMGwVy3 226VAIShyuTE+AQLJv7UVBSPMfk3QfIs8NipDnJYXJkpxyOxwXqTHId68XiIH76mCAiW AW8b9bz77nG+jQjSog5nQm/5gbhH+U9ufO5ZIXOgP0zFGPxNd+wF5bgkFdzhE1YLuMB0 oiYQ== X-Gm-Message-State: AODbwcBuomZDMk8HKglMza7VKH573tWv9AJ0DnF87cQpKBIZf9DcNRxe AqGM7kSjMrQ1HhHBC6I= X-Received: by 10.223.173.74 with SMTP id p68mr19536966wrc.163.1496270473662; Wed, 31 May 2017 15:41:13 -0700 (PDT) Received: from andrea-ThinkPad-T520.homenet.telecomitalia.it (host134-11-dynamic.32-79-r.retail.telecomitalia.it. [79.32.11.134]) by smtp.gmail.com with ESMTPSA id j1sm41840356wmf.6.2017.05.31.15.41.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 15:41:13 -0700 (PDT) From: Andrea Adami To: linux-mtd@lists.infradead.org Subject: [PATCH v3 8/9] arm: pxa: spitz.c: remove hardcoded partitioning, use sharpslpart parser Date: Thu, 1 Jun 2017 00:40:57 +0200 Message-Id: <1496270458-6479-9-git-send-email-andrea.adami@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1496270458-6479-1-git-send-email-andrea.adami@gmail.com> References: <1496270458-6479-1-git-send-email-andrea.adami@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170531_154133_658834_543A213B X-CRM114-Status: GOOD ( 14.34 ) 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 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..21a2e42 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), + .types = 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; }