Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF879C636C9 for ; Thu, 15 Jul 2021 18:14:05 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 47B5661360 for ; Thu, 15 Jul 2021 18:14:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 47B5661360 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nic.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7318482B30; Thu, 15 Jul 2021 20:14:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=nic.cz header.i=@nic.cz header.b="D0+3cH2Y"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BAD6082B30; Thu, 15 Jul 2021 20:13:59 +0200 (CEST) Received: from mail.nic.cz (mail.nic.cz [IPv6:2001:1488:800:400::400]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E3CDB82A13 for ; Thu, 15 Jul 2021 20:13:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=nic.cz Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.behun@nic.cz Received: from dellmb (unknown [IPv6:2001:1488:fffe:6:8747:7254:5571:3010]) by mail.nic.cz (Postfix) with ESMTPSA id 85D62141605; Thu, 15 Jul 2021 20:13:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1626372836; bh=vq9ZepUUGFbROhZzPS13GHvxdDnVQ7FIGm1y0GhykwE=; h=Date:From:To; b=D0+3cH2YtFIc3414yjh6RFf84G63xsO9RoYFGAPmUXqcSE0+0RRUWfxdiGQak14hG tZtu3UpmXUlIL6dMJbnXbwhLSKoyJAF8i3i+nIyOCllpBoL/JqHVH6I8oVSOC06WWN BGRmVVxrjR7MNFnwxG/bqciY6GCYDU0drKjJM4QE= Date: Thu, 15 Jul 2021 20:13:55 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Tom Rini Cc: u-boot@lists.denx.de, Masami Hiramatsu , Jagan Teki , Patrice CHOTARD , Miquel Raynal , Pali =?UTF-8?B?Um9ow6Fy?= , Simon Glass Subject: u-boot and mtdparts Message-ID: <20210715201355.5f571f27@dellmb> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hello Tom and others, many boards still use the obsolete mtdparts command. What is the plan with this command? Do we still want to support it? Recently as discovered by Masami, my patch mtd: spi-nor: allow registering multiple MTDs when DM is enabled caused that mtds may have different name than that defined in CONFIG_MTDPARTS_DEFAULT. Masami fixed his board by putting the partition definitions into devicetree, but there are still many boards that may be broken. The easy fix here is to make mtd_device_matches_name() in drivers/mtd/mtdcore.c to support the old names. Most of them are in format "type.id", for example "nor.1", "nand.1", but some are different. The problem is that I do not know how exactly to match these names with the devices. Does the number represent the bus, or chip select or something else? There are also multiple parsers of the mtdparts string (at least two, one in cmd/mtdparts.c and the other in drivers/mtd/mtd_uboot.c). IMO the proper solution would be to get rid of the mtdparts entirely, move it to devicetree, and add code that generates the mtdparts string for Linux' command line from devicetree. What do you think? Marek