From patchwork Tue Nov 21 21:43:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 10068953 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 1B65C602B7 for ; Tue, 21 Nov 2017 21:45:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 099D329550 for ; Tue, 21 Nov 2017 21:45:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F274C29A1B; Tue, 21 Nov 2017 21:45:00 +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=ham 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 68BB329A43 for ; Tue, 21 Nov 2017 21:45:00 +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: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:In-Reply-To: References:List-Owner; bh=XvYIvvI12VcKwu9E+mtpZVAMX7dkhLjWjB3bCj0Z6bw=; b=aCJ WqDYTvgksbi1Cq0P59KgggTwr2sXErLXkhzg+mGT8YwJx21/FbFYFxljB2rGyqCOYHk76elEGlmRN /1I6R2rzz9vN9TekKvTZJD8MyjrLooWwAKqZJNZ+9rjSbWlw2KGLAha+UX+jabd2y7tUFtTqcfaf9 zNyh6OMjZMnH1R6PhYUCbyfFtjZF5lfR1B2ZgnMWxrVQwK+JLQ/fWSgCFJmjK3KgjEeK/Ne6PGSGA IjRfYOtBuB29ka+XhniE1N34Xzh6LTM6s3BiKwwxb9gg/exOtpw4vxf40CfsmHEJ20lafOOJtM38w eU86edmU2lLR33WCIlsMARaWSQ6P/TA==; 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 1eHGLh-0001PD-Ai; Tue, 21 Nov 2017 21:44:57 +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 1eHGL5-0000me-6G for linux-arm-kernel@lists.infradead.org; Tue, 21 Nov 2017 21:44:21 +0000 Received: by mail-wr0-x244.google.com with SMTP id w95so12684827wrc.2 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; bh=jgELxgKmwgW6Pk/fHrw7IYWSi9U9bfQYjPl3Wz31rHo=; b=MPC16KXumvjNrsmyglXRfUlibGOxokGmRSo9AlLKb9SBoILuiXSDlG+aTyfMPpxOOE GMXyYpfT/8zIBmqp+9muDhZ9KkXq+0PyfId2PEn8Qc7/NM7FdGDXvowZZDWsT+8nE22R FFEQ4RnBdmQNBPaEEp1r71MfP7STmXbh+e569C+4PPPf75CrxPG/AO3FDdD6pcuaNa9o 1+w5nx1SIs4dIOWpPCGrqNkT3aMz9iDAHkz+j1TPinry44zLiOwriuXxy83jaswOYqXO EfUnhKs1Y4WQBmeVQAdGHDpugTeljQGFNtqRTqj3ggLUSt5Jqv0G8wvx2qO+AvJP7sAE unjQ== 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; bh=jgELxgKmwgW6Pk/fHrw7IYWSi9U9bfQYjPl3Wz31rHo=; b=cRBlbiRqnBqhOBZ5ZWRzDFjbNhwfogK+D4ozo+UXIgdWTc+BkDyO6UbcNLQAvOOEZR HE6kmz4+wGzT3Flcs3N375TuGAPlXOIf8rOU4Eytg9qF/br5XNVuXvfHpSpSwOO/mhTO ZC2pF8smFHGw1tfMnrAxURc3UfJXFYP1BmsozDBSyc1TDcbJ6in6J9fGnuTcxGTSDZIo srf7xQWLDf5hQMkN2vDdSNnkRRyccn02TPlQ3ommGH8jd76CApaKPxuG46WRT2vOFHiw vnzot246fyDGMbJRW9zV/PcshsO8Kv9xJ+HM4pwUofRPGmkW2RaJui0/VdkM0cxs/jTm WsCQ== X-Gm-Message-State: AJaThX46yIV8n4fY3SFHRnC2CRo/ITy7fHqLJQk4dprkQherPs5ykGbf sNg1UK8Y9Oq3k1Z2vJmPRLlTAR3P X-Google-Smtp-Source: AGs4zMax69mYDOsOXQXRr1a4Dh7YYPU5gYE6YACnKF+iFYvA/VqpDr1hzhHom9LA8bmp2KIXJjSybQ== X-Received: by 10.223.153.162 with SMTP id y31mr15072698wrb.216.1511300633881; Tue, 21 Nov 2017 13:43:53 -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.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Nov 2017 13:43:52 -0800 (PST) From: Andrea Adami To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/4] ARM: pxa/corgi: Remove hardcoded partitioning, use sharpslpart parser Date: Tue, 21 Nov 2017 22:43:48 +0100 Message-Id: <1511300631-1343-1-git-send-email-andrea.adami@gmail.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171121_134419_519214_8B89B745 X-CRM114-Status: GOOD ( 13.50 ) 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/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();