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_1 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 855EAC636C8 for ; Thu, 15 Jul 2021 20:50:21 +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 6DCB5610C7 for ; Thu, 15 Jul 2021 20:50:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DCB5610C7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com 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 ABE1782051; Thu, 15 Jul 2021 22:50:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com 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; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="aimCHtUx"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 89CCF828BC; Thu, 15 Jul 2021 22:50:15 +0200 (CEST) Received: from mail-qt1-x82e.google.com (mail-qt1-x82e.google.com [IPv6:2607:f8b0:4864:20::82e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2DFFE812A6 for ; Thu, 15 Jul 2021 22:50:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82e.google.com with SMTP id r17so5544593qtp.5 for ; Thu, 15 Jul 2021 13:50:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lblZa663cbGNGGe/l3iQXlWks/ULKPwNvD0VAP+ByjY=; b=aimCHtUxj9UycTel//JuMvN2qbathzW+QIJDBFEbyWnpZhjjflRsI54WVEDMPIsei9 ykqOYFOV3LV83g4mw4jLlyVmwISOZs/3u36PQ1PlewUD3v8pnwDcGGYcSG/kwixyuOTz chgEKEc3vPJLAZmggClkpO+J7a1mFn7fz9iH8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lblZa663cbGNGGe/l3iQXlWks/ULKPwNvD0VAP+ByjY=; b=Oy0cytLsQhiavmsFnk1OnQt3jvh3wX6dmVGGldRB2JoyCZi0lo0/IWQz644DFQjvo3 dLvfO5gfixhAOrYM/vEJBOxpDlXsSaQUk7VXT/D1f+fQ9vJtK/xmbXjamHiJl4zpKpDq iAd72P7UOih3eApCFTFbZfDtga7wfjm5e2I8Po050ddiYTNNXh49sf2O0hQLXdZRH7lS w5lPT6Zs70aBxcN8yesnnOxHq5H1sq+rgycgyz5Ojqb2jMiAJkZfQrZjCuTFQbJrB/To x5xTI6fzRiG3mfZFVTFuA+VEWmGizbC1DcEGjcQEgPKaKMrD8Q41SQQsQJYhgAiFhVmN GXgg== X-Gm-Message-State: AOAM530BFNON42+1Y9ZAsqjRq3GdSWUCZg4/X/RqSyVYBsqKlqkzf8tO Ngvs8doZCiRKH6Vp2qmYgn7g7Q== X-Google-Smtp-Source: ABdhPJzdCkvEhuZPHpvBHi5eVZrans5g9QFFSJs+EW+OPpqW4AJLuTHlHHa8nR4rq5gPqTOKI6pXTw== X-Received: by 2002:ac8:7ee6:: with SMTP id r6mr5802510qtc.199.1626382210996; Thu, 15 Jul 2021 13:50:10 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-a8ce-b25c-3933-5c80.res6.spectrum.com. [2603:6081:7b01:cbda:a8ce:b25c:3933:5c80]) by smtp.gmail.com with ESMTPSA id o186sm3091847qke.44.2021.07.15.13.50.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Jul 2021 13:50:10 -0700 (PDT) Date: Thu, 15 Jul 2021 16:50:08 -0400 From: Tom Rini To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: u-boot@lists.denx.de, Masami Hiramatsu , Jagan Teki , Patrice CHOTARD , Miquel Raynal , Pali =?iso-8859-1?Q?Roh=E1r?= , Simon Glass Subject: Re: u-boot and mtdparts Message-ID: <20210715205008.GD9379@bill-the-cat> References: <20210715201355.5f571f27@dellmb> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qGV0fN9tzfkG3CxV" Content-Disposition: inline In-Reply-To: <20210715201355.5f571f27@dellmb> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) 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 --qGV0fN9tzfkG3CxV Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 15, 2021 at 08:13:55PM +0200, Marek Beh=FAn wrote: > Hello Tom and others, >=20 > many boards still use the obsolete mtdparts command. > What is the plan with this command? Do we still want to support it? >=20 > 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. >=20 > 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. >=20 > 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? >=20 > 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). >=20 > 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. >=20 > What do you think? I think there's a few parts to this. Checking the help for CMD_MTDPARTS, it's been saying it's deprecated since: commit 938db6fe5da3581ed2c17d64c7e016a7a8df5237 Author: Miquel Raynal Date: Sat Sep 29 12:58:30 2018 +0200 cmd: mtdparts: describe as legacy So yes, lets kill off cmd/mtdparts.c. Linux has taken the partition layout from the device tree itself, one way or another, for seemingly forever. I don't think we need to have logic to construct the cmdline option for the kernel at this point. If platforms need it still, for legacy kernels, they can still of course construct and pass it in manually. Now, what to do about parsing of CONFIG_MTDPARTS_DEFAULT / CONFIG_MTDIDS_DEFAULT? Well, I think at this point we what we care about in terms of "U-Boot wants to know how MTD is partitioned" everything should come in from the device tree. Or, we can parse CONFIG_MTD{PARTS,IDS}_DEFAULT and assume it describes what we need perhaps? --=20 Tom --qGV0fN9tzfkG3CxV Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDwn30ACgkQFHw5/5Y0 tyyaZgv8CbI1Qz2BC0kCula6sJHwHqprKPQmgcgthJrQ56JsgZOQSUplQVKWd1PN eEFnRXAzhUUjkATfOX6DJl8EASr29cVybnUq254YoiwPuErFXu6lgjH93X3MS5vh /xC2RTinBHLffqAp7HZOHKEyjG1r1fBL9yQC1cjD+kUeArhThU0HfsNuT0Mm9zp7 9CEDeEOlHi4Hqofj4XgMLqhvFHymE/o580E5hqAk+Fl/lx2xNzOM0VQGpwvyAxfJ ZpOpCs+w4NWSOI37ZcBxaWaslERw78YzF60u5S688aAhbv24cojYulaCqh0ErLVz Nc8RY/jWTttqxOsXLyEWvPFo0B9iw/PKijC6h7Kv/OXF/gaTJCxqlbngAHFWsgez Fu0NNIgXQTNRn3GKnmZ2UKx2ZrtPbIxer7Lm44TYAzKl03/g/b2YGiXBswiVB6Sr 7D4JeOl84S7Pzs0o4mhIGrTj8qDfD+vsDl1KMF9PbocZByQztCMiq9UDIhDeFUPX rVQ9XqM4 =knZy -----END PGP SIGNATURE----- --qGV0fN9tzfkG3CxV--