From patchwork Tue Nov 21 21:43:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Adami X-Patchwork-Id: 10068949 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 5D69D602B7 for ; Tue, 21 Nov 2017 21:44:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4BE0429A40 for ; Tue, 21 Nov 2017 21:44:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F6FB29A44; 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=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 B6CA929A41 for ; Tue, 21 Nov 2017 21:44:38 +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=BgYBGmOW3d5YG1wRE4MivSaK1A9vwK3DjHpf7HX6yPI=; b=Dg2mbE9E4MpuTLFniUmwqrF/Ov dSJlMFuHiS311bcJ5iBE21+0js3RfOb7/XxwbOWqanYEYPsOhJjDqEsy9Gz6LjsFLV1SBPD5Ndhjw lHOdJsZgBGyKjrAKxOzpwARyhPMf1ArRE2aWIMiGvqeOajA04OM26eJIROFuolS8dmna9eVdJjmd4 eJ8biSVoib1o6tbyjZQ9FqsqlLYqH+6D4tHgLOgkCPFkDTODOZirp2nntapxFR8Qu43TGDAVAQek6 zUcECjhaBVFbVdAC40LraSUNrz+166Dotpw0R0Cf+Rtg8HtL0ywZSzcRz5vROR8xzaqXcy8UdC0Er Ww0N8+tQ==; 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 1eHGLK-000141-Vr; Tue, 21 Nov 2017 21:44:35 +0000 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eHGL1-0000mg-Ad for linux-arm-kernel@lists.infradead.org; Tue, 21 Nov 2017 21:44:17 +0000 Received: by mail-wr0-x241.google.com with SMTP id u40so12629718wrf.10 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=GhwkxcH585Ji59npv7VkmxfWZGr6tohCPoQ5pT9q+jE=; b=Dg3zEy55qmABOS4AmHmxY0vhtUr+9Q/rqJdI6GbF/bTbbsdOY9KD0CCph1NB7j91iK QpGAkWVrwtm7JGzejXVhA7lN2NGyidJo6U4QGf/qPxSHL/xI88k6ZVLKG14EQwQLbIUI 8bSIb6CnQleZkvTmz/uE5PZFoXsZhrEb7GxWP2mGlHH9e9d9X1F7tR5qYTwfy6aEg7/h PUJCUzzzoElZ1+6uTmRpsY57kuPMw8SPKgREoilhgH3TH3q0DU4O5aDX8lRT43/brXvh YEL4ZNvbeFAFFiUB7rZoLfJEdk983NE5Eok6NexTj5uPDrcrDuQVXfcmwOB0l5a/YSpq Tg7w== 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=GhwkxcH585Ji59npv7VkmxfWZGr6tohCPoQ5pT9q+jE=; b=UgpoEYyxuW5ofb5mHwZ1gtyo55UEabg/TjbcusmiSg+VE43j1ZZeQvb9tKbiyC2x7L QAvYm8x2uyl1AU4Y3Rkk0V5f1N+ZJMP2oIpx7W4srEesQypFIRL4wBXYwuE95eRwa6Mr w9BAaJCtv5yyrhFpldxFZWW2Yp492mVOHHxSgj6RN1JJgbseheXnlRGHbfYAXvgtvXyP +1lPjD0MdcEVXc+GMuWt5VDg2NIU5i+fnbdKH01fdSlwCWTNG+XkZ7KRap80ylQ+Q8ZO q7hWvinpPk9JIhwJKxnGXvDFxC0mzOcV9rBjzvahLTdgAsGDonpyK60iaWbVOgVwB79Y 759Q== X-Gm-Message-State: AJaThX5p0Go1CwSjuWQIxQWmaF8UJu3jxA8rNMEyx+p+OFSMF2s+KxTp 1FPznCfT2HHJ/qjBtbIZ6k/9k6XP X-Google-Smtp-Source: AGs4zMYcRyN33UqOjJi44pKx+kEi0X/CxP+XBaTEhpuJtthFsXXmsNFqTTdD7so+TmgzGjsO7FROvw== X-Received: by 10.223.164.22 with SMTP id d22mr17484015wra.232.1511300634890; Tue, 21 Nov 2017 13:43:54 -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.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Nov 2017 13:43:54 -0800 (PST) From: Andrea Adami To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/4] ARM: pxa/tosa: Remove hardcoded partitioning, use sharpslpart parser Date: Tue, 21 Nov 2017 22:43:49 +0100 Message-Id: <1511300631-1343-2-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_658863_11658571 X-CRM114-Status: GOOD ( 13.11 ) 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/tosa.c | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 13de660..b90560b 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c @@ -673,24 +673,6 @@ static int tosa_tc6393xb_suspend(struct platform_device *dev) return 0; } -static struct mtd_partition tosa_nand_partition[] = { - { - .name = "smf", - .offset = 0, - .size = 7 * 1024 * 1024, - }, - { - .name = "root", - .offset = MTDPART_OFS_APPEND, - .size = 28 * 1024 * 1024, - }, - { - .name = "home", - .offset = MTDPART_OFS_APPEND, - .size = MTDPART_SIZ_FULL, - }, -}; - static uint8_t scan_ff_pattern[] = { 0xff, 0xff }; static struct nand_bbt_descr tosa_tc6393xb_nand_bbt = { @@ -700,10 +682,16 @@ static struct nand_bbt_descr tosa_tc6393xb_nand_bbt = { .pattern = scan_ff_pattern }; +static const char * const probes[] = { + "cmdlinepart", + "ofpart", + "sharpslpart", + NULL, +}; + static struct tmio_nand_data tosa_tc6393xb_nand_config = { - .num_partitions = ARRAY_SIZE(tosa_nand_partition), - .partition = tosa_nand_partition, .badblock_pattern = &tosa_tc6393xb_nand_bbt, + .part_parsers = probes, }; static int tosa_tc6393xb_setup(struct platform_device *dev)