From patchwork Tue Nov 21 21:43:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 10068951 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 176B6602B7 for ; Tue, 21 Nov 2017 21:44:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0604629A41 for ; Tue, 21 Nov 2017 21:44:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF20029A44; Tue, 21 Nov 2017 21:44:40 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED 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 3F31729A43 for ; Tue, 21 Nov 2017 21:44:40 +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=ykt0Jfk7kdMky34Np+tNd3giRmq4CDn5rpFQ1o0UI24=; b=ARZqi+bahzOYl74gzCwD8DnMnd RMUfRkRJ7fSsGJ6I7lhyWVdaOg3BNelptgn0kJH8+YPK63kBqFhUnnD+oO1R+0+7yLuOgE57T+aFl C3XUzB6cauEHfpVgIL48L78UXcyQYampSooebWdaH4IAjiz3kXXY8eohNROAQnh5rCvRCszqfbU65 vF+NPDN+uzvljFE8Ir3/IrX7iaXUWo4FlhdAx0Ebgufk3TcdC0IVXVi+kZYpQFcNU3hj/V7fiH8pH NS16POB4Lbo/SWoEQkx5krXKIJ3pjdEAwzNho4cwFNGE/YG5e2vCUBetU7ooypUoTfy4Umby43y4p ySWI3I5w==; 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 1eHGL5-0000ow-L2; Tue, 21 Nov 2017 21:44:19 +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 1eHGL1-0000mf-C7 for linux-arm-kernel@lists.infradead.org; Tue, 21 Nov 2017 21:44:17 +0000 Received: by mail-wm0-x242.google.com with SMTP id u83so6395660wmb.5 for ; Tue, 21 Nov 2017 13:43:58 -0800 (PST) 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=3i7CJoLIZi24UoeLVuZsCoJxoDziiepE82yEhFjIHJY=; b=NcjDDtAxrMgWRUDZfOVhju34u6Vlxt4d6Jxd+04Lbc9eFv7RWTvvHlq2zM+W92hd4Z gL+Qc+YpEwYrhBT5EAUXqRw+XWQwbfFTO90ZC4c9fryUwNJ9fdSSLIV/PDIqDW+2ogBf Ia4HXPpeqIUeojIxjQgmMAIZ95Pq1BreDS9FTwdfje12ZQKgdnQbcKlQfsbe+UH5A0eC KlSUKZc/GrSfkCVKYh4tMRE+JTAwZplJac4N/v/9twdNCYHQ45VOkA+UMyWF3yyrHBZ9 GK+LnmtKmlDieWlKgq/2l9h6iwz9ews3YSDW+vZLWFbdmN+BuVBJ0qrw6E3jeVaoTY/s mVOw== 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=3i7CJoLIZi24UoeLVuZsCoJxoDziiepE82yEhFjIHJY=; b=SQhHE4ERSMAjlNx2zIHiw3KZ+nBgWobWlYGRKqLQmuxZvqQzeilId581RNXLkbST/8 rRJZWlYlaggLRhEeL9vU6akOD0MxGxNf2h49Or+SpZKABJKdj1BXrxVtUYMfJXLNUCtY AUiQuYArWQBaNfLlgG0FXS+CxSILYteuTTuVHZcuQ+r3S4hKLq2iYml642IJMlAKYWEc 5X2tInCnpgIn9zNq9VoxaxbdKGRkdZoFy8SRYul2yrDk+eTH9DiIPz//yJJTviSq9vcm lCf9OXHk6MV6GERXyDX7S0DV+slTqVdZGXCLGotHB74NTBkgj6fXpPTLG20ofJsfwIDV ZTYA== X-Gm-Message-State: AJaThX7yhkxkvdKpys85RdNiDCnWBcdQLxauvxDR7yVGQnlVvZD3Rr7H CnVpnwxt7q9hjlHlFV/L2YD/Hsph X-Google-Smtp-Source: AGs4zMbsF2zJI3l0wGC5/cpY3K8UeKIhfx9fbOKKa84Si7wXZJu3RKvH4Htfwgl6gQcl+jUIMjJDmA== X-Received: by 10.28.108.11 with SMTP id h11mr2272253wmc.28.1511300635941; Tue, 21 Nov 2017 13:43:55 -0800 (PST) Received: from andrea-ThinkPad-T520.homenet.telecomitalia.it (host196-120-dynamic.180-80-r.retail.telecomitalia.it. [80.180.120.196]) by smtp.gmail.com with ESMTPSA id g7sm16804999wra.38.2017.11.21.13.43.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Nov 2017 13:43:55 -0800 (PST) From: Andrea Adami To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/4] ARM: pxa/spitz: Remove hardcoded partitioning, use sharpslpart parser Date: Tue, 21 Nov 2017 22:43:50 +0100 Message-Id: <1511300631-1343-3-git-send-email-andrea.adami@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1511300631-1343-1-git-send-email-andrea.adami@gmail.com> References: <1511300631-1343-1-git-send-email-andrea.adami@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171121_134415_658637_190D28D0 X-CRM114-Status: GOOD ( 14.45 ) 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: Dmitry Eremin-Solenikov , Robert Jarzmik , Russell King , Haojian Zhuang , linux-kernel@vger.kernel.org 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. Emulators like qemu will need to pass the mtdparts in the cmdline. 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; }