Received: by 10.223.164.202 with SMTP id h10csp5676296wrb; Tue, 21 Nov 2017 13:46:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMahafRheoAQ3YLUM3yXBHkW9Xzs10ZOWymSLbjIHLn+dVnGVHDVwBjmE/GbSGBMU9wUa+1+ X-Received: by 10.99.120.131 with SMTP id t125mr18376495pgc.81.1511300766761; Tue, 21 Nov 2017 13:46:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511300766; cv=none; d=google.com; s=arc-20160816; b=y7ZsNZmDNetz7MMuVXs17C8NSFg/UwGaQCw5QE4aD1OawkqCHFRv5cHP05BXWHB9ea v4NHQY4NcIwwKBIz1ixbQO24ct39PIkYBe8N2FDToyxXSalq7lyviMura3Ekahpemfn7 4/5/bIkK3GFRfhQ2RR5/zNDpcXJ+F8gyWs/BNHzat2aUdNiovuolAznUb53zUd2xfz3f QUi8uN0hm4shWhk59/fR3l3r3ujCZ48c2upaeJXkIW8BQAsc0DMN9BGk1SgHX54j3vPj 8euKYSyWbfSwYiXzs2CrhWiPCCe9NRWqw1H08rsKNXyukvyW7/BsP7np9HJrOVLH+DiE ZM7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=3i7CJoLIZi24UoeLVuZsCoJxoDziiepE82yEhFjIHJY=; b=KiccqAY7VWHmLSKZF6gi74y2ujt3qVDnJuKR/6S/fmC3ilUmzvybF6sRHD/uf313AU dirC1A2GZ8Fdv+gBe5ilhQ4AdL835x82Niiy9nTXpZ+EcJA3zLFyS+XsthxnKIZjDCRf DyPIYP67iy2VNZzDJXoWmveP5yV8wBX/JjZEbldS4Z+SzkLYPdPFrWwrRpLL0f8Q52oF xjz1AgO3GBRGMKx5FxlMk2qnLakmyJAFkVc+tR3c4SI1cuxK6RRsLd2ia0SJtdT6mUt9 /RHniEQaT1zXgSUY9IWHSyIw45MsGZqx5zetmBeWs0R9Jr+s8M9dKeK1YkFUU+iwoWy9 ycrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NcjDDtAx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12si11576427pgs.784.2017.11.21.13.45.55; Tue, 21 Nov 2017 13:46:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NcjDDtAx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751471AbdKUVn7 (ORCPT + 76 others); Tue, 21 Nov 2017 16:43:59 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:43829 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751229AbdKUVn5 (ORCPT ); Tue, 21 Nov 2017 16:43:57 -0500 Received: by mail-wm0-f66.google.com with SMTP id x63so6362205wmf.2 for ; Tue, 21 Nov 2017 13:43:56 -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=pBRcUwsl+y8H1AK7W+BPpThPUt1HwKayQMdjgKikaqu3n4EJawg1Wacy2SDXmgGLIn FboWOR8BUoL1uSLvX57FUv1yfBgf2h/rS0mJAjOpaqKxgLYarRBYE3/PSKexKxuInb7B 2/UsxpoD+25Af2zh595X2inyG9LSuxY1HTNpiqKHAFK8QZtMIeFv/V8xkQqoD7Z7IZ+4 1v0Q3hyDBJbdfQ+2s5Y+z5GGJ0GuB4crU/mwy88mBQLupzwvjDZYj7Kqzu2Rwt+/70eP nxEi2VxjKeBT75vDfculSYNWBZmfFvsaYA5vM/7FNoOGZGesvAG4Qdg1qxxFyqrTVXxA GyDQ== X-Gm-Message-State: AJaThX4d9K1aO1cncJgEJ5G2ctVGrpniCyeBEXAieTS+DBX+ZeCcbY4Q OmvqjBdAgkmak6V/f1ayEjw= 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 Cc: Robert Jarzmik , Haojian Zhuang , Dmitry Eremin-Solenikov , Russell King , linux-kernel@vger.kernel.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.7.4 From 1585384267208948000@xxx Wed Nov 29 07:24:17 +0000 2017 X-GM-THRID: 1584846971213343650 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread