From patchwork Tue Nov 21 21:43:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 10068955 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 EEFF5602B7 for ; Tue, 21 Nov 2017 21:45:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD02329A32 for ; Tue, 21 Nov 2017 21:45:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1FB529A44; Tue, 21 Nov 2017 21:45:19 +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 3E4AA29A32 for ; Tue, 21 Nov 2017 21:45:19 +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=IFRbLi+yeg6CHhOuwDC30oTbkTn44g7V5CrjzcnzJPo=; b=XB6pGeahsx9gtjDuURrv/3w4j/ /pau+Du3k7FI9D+23+bxiYwZYNPZOID2lxJmsohgNCTTsbcDu4qNIsI/ytmdbXPLovavMOhnKrdoU HEE5wa900ezxscovBmuVpG9dT/uF2PUv5YHwwPgakL0Uxjn/tmUbhKpfrcj364obNu66tNZJ6pn+g ZBxurp7NDUHVFhxUhP7VAWOfdtcxFogDruKcKRzhD/aJO9p2kpNsf+47sJFzzElUIyyTu0JiU2LiD jRLzFfzphAK2jNI/v1AMuTXf26iHHEr7jo/euujl+Q1oAjZ1MoPhqEcmk7i633lRt0wcPCMkdUgWg M3PAF7Yw==; 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 1eHGM1-0002OY-CH; Tue, 21 Nov 2017 21:45:17 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eHGL6-0000mj-Ep for linux-arm-kernel@lists.infradead.org; Tue, 21 Nov 2017 21:44:23 +0000 Received: by mail-wm0-x241.google.com with SMTP id l188so4591510wma.1 for ; Tue, 21 Nov 2017 13:43:59 -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=+vEUOvELafIboIuIbd+xZsJ5KrO6+TWsWTVdqJj6f7k=; b=SFASUHcZZW5GcG+LnCYSW+1ef354WMPZxDqS5ea3Ge+8gPIas2dtszN89tfFkff6oL sa0es2voJGBpN9WO349yvvkcD04LdHNizJhsV/aIriM6sCGgJ8oPgB3dyM1MZLyW2mp0 FuaN3eGlRMdbHeNa2NKTkNxAuTZS/J904oKeR+cI7eztK8ozKsrVgeav0seZ3/Xe/9S+ 8y/J/pfV+okcPrz4/IiFzDOn4q//tx9cxd7lTcX64OW4nRZkPs67XThUEqyGEwXaISHV aIcGy8Txf4Tz7nk11of1yy98hZbB6RdVYq5rZzb8r6/3JduFNg0M73CFdd3Xy0KrBvR2 ZIwQ== 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=+vEUOvELafIboIuIbd+xZsJ5KrO6+TWsWTVdqJj6f7k=; b=mJ/cyPzUCi5LEu32IEkM67i3hzIO644cqIyVZF3A8PFz7q0Dec7hCX3gKb62tGnOCI 3W6Cp8r75Ih/LDGxZ++LR+szXRiaM3dOY2uTd0ruRiJng6+lb6XEw0TZE5EpAJ4b/Q+r rbdMT6z2Jmweq5qTlMBXYj028zngUFzqz5DhMiFn+nfiRS+hqw+NniNW4L30vZaT9DNz sJlRNbInje+hsg30kQk02xzQB3v8huwDovVHH57SxV9uiSgFG7P/W8CqtDoWAq6CArRZ y7SGfuFaeceXd9LpFhYsg7TSFRCEZqGNmPGVsAwysx8D7R5m7saSIvmExMHn6RnxcfAU sfyg== X-Gm-Message-State: AJaThX5qkOw10kwPUUxa1Zt/yRFHopTPvb5w9ZgE6v6UHhJDNuHLr7+v JagYoMAh+J5lhKVtMteXn5/5axLt X-Google-Smtp-Source: AGs4zMaQ95Z8WThlhG9LoDf/QhPkFhUpJBbKbyKBAyVaYKmUfTYiVzVma3CGS1GUoIRGf0tfhP2SxA== X-Received: by 10.28.112.22 with SMTP id l22mr2339154wmc.35.1511300637140; Tue, 21 Nov 2017 13:43:57 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Nov 2017 13:43:56 -0800 (PST) From: Andrea Adami To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 4/4] ARM: pxa/poodle: Remove hardcoded partitioning, use sharpslpart parser Date: Tue, 21 Nov 2017 22:43:51 +0100 Message-Id: <1511300631-1343-4-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_134420_806887_BF73C930 X-CRM114-Status: GOOD ( 12.65 ) 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/poodle.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 62a1191..fd01d6b 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c @@ -333,24 +333,6 @@ static struct pxafb_mach_info poodle_fb_info = { .lcd_conn = LCD_COLOR_TFT_16BPP, }; -static struct mtd_partition sharpsl_nand_partitions[] = { - { - .name = "System Area", - .offset = 0, - .size = 7 * 1024 * 1024, - }, - { - .name = "Root Filesystem", - .offset = 7 * 1024 * 1024, - .size = 22 * 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 = { @@ -360,10 +342,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[] = {