From mboxrd@z Thu Jan 1 00:00:00 1970 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=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham 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 2900CC433F5 for ; Wed, 22 Sep 2021 19:08:56 +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 6876660F48 for ; Wed, 22 Sep 2021 19:08:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6876660F48 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nic.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 030A3832FE; Wed, 22 Sep 2021 21:08:53 +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="K5lSsgCc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A6A128331D; Wed, 22 Sep 2021 21:08:50 +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 DF611832FE for ; Wed, 22 Sep 2021 21:08:46 +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 thinkpad (unknown [172.20.6.87]) by mail.nic.cz (Postfix) with ESMTPSA id 60F6E146375; Wed, 22 Sep 2021 21:08:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1632337726; bh=fDif3x+cdPgPf+EQ/PcTP8hxBPmrkknaJGoLEIxg9uw=; h=Date:From:To; b=K5lSsgCc32JtIVWxQdsQFXbXWj815Glbp9v6KADtrPGEMGDiMa3SCAZcZGCvIJLkS bY4hokKwdl6gF0Bwc60XWigP0YocvqpohghPSyTLIx9E3pcma+dXlcrbRl+tgVxaI3 PnLwIC2eYNfqRHt5KSOBA/i7qO6ndk2xZMUDFOWg= Date: Wed, 22 Sep 2021 21:08:45 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Tom Rini Cc: Marek Vasut , Patrick Delaunay , u-boot@lists.denx.de, Pali =?UTF-8?B?Um9o?= =?UTF-8?B?w6Fy?= , Jagan Teki , Christophe KERELLO , Miquel Raynal , Priyanka Jain , Patrice Chotard , Heiko Schocher , Simon Glass , Vignesh R , U-Boot STM32 Subject: Re: [PATCH v4 0/2] mtd: spi: nor: force mtd name to "nor%d" Message-ID: <20210922210845.25e65944@thinkpad> In-Reply-To: <20210922184230.GN8579@bill-the-cat> References: <20210922162909.1857566-1-patrick.delaunay@foss.st.com> <20210922192925.723abcba@thinkpad> <20210922184230.GN8579@bill-the-cat> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 On Wed, 22 Sep 2021 14:42:30 -0400 Tom Rini wrote: > On Wed, Sep 22, 2021 at 08:24:18PM +0200, Marek Vasut wrote: > > On 9/22/21 7:29 PM, Marek Beh=C3=BAn wrote: =20 > > > (Adding also Tom.) > > >=20 > > > Hi Patrick, Marek, > > >=20 > > > I find this either not complete or not needed: > > >=20 > > > - either you need mtd names to be of this format so that old MTDPARTS > > > config definitions do not need to be changed, i.e. something like > > > CONFIG_MTDPARTS_DEFAULT=3D"nor0:1M(u-boot),0x1000@0xfff000(env)" > > > does not work currently, and you want to make it work. > > >=20 > > > I find your solution here incomplete because MTDPARTS can also be > > > used to be passed to Linux as mtdparts parameter, but there is no > > > guarantee that the "norN" numbering you are creating in U-Boot will > > > be the same as the one in kernel. > > >=20 > > > - or it is not needed, because you can remove MTDPARTS definition from > > > the board config entirely and move the information into device tre= e. > > > In fact this was the main idea behind making the series > > > Support SPI NORs and OF partitions in `mtd list` > > > The SPI-NOR MTDs after this series can have conflicting names, > > > because you can still choose between them via OF path with the `mt= d` > > > command. > > >=20 > > > Tom and I were of the opinion that MTDPARTS should be deprecated a= nd > > > removed in favor of OF. Marek Vasut says that this is not possible > > > for every board, and so needs to stay. > > >=20 > > > BTW, I find it a little weird for Marek to defend old API which should > > > be converted to DT, when in discussion about DM USB / Nokia N900 > > > USB TTY console [1] he was defending the opinion that we should be > > > heading to DT in U-Boot. > > >=20 > > > [1] > > > https://patchwork.ozlabs.org/project/uboot/patch/20210618145724.2558-= 1-pali@kernel.org/ =20 > >=20 > > That USB discussion is completely unrelated to the problem here, the USB > > discussion is about internal (i.e. not user facing) conversion to DM/DT= . The > > user-facing ABI does not change there. Also, that discussion was about > > patching USB stack to permit new non-DM/DT operation, not fixing existi= ng > > one. > >=20 > > This problem here is user facing ABI, the mtdparts/mtdids. That user fa= cing > > ABI got broken. Boards which do depend on it, even those currently in t= ree, > > are broken. Not all boards can update their environment, so some backwa= rd > > compatibility of the user facing ABI should be in place, even though it > > might not be to the degree Linux kernel does so. So far, it seems most = of > > the U-Boot command line interface has managed to retain backward > > compatibility, I don't see why this here should be handled any differen= tly. > >=20 > > Note that there are not just a few boards that are broken, but hundreds= . I > > believe that itself justifies a fix, instead of just throwing all those > > hundreds of boards overboard. > >=20 > > u-boot$ git grep -l CONFIG_MTDIDS configs | wc -l > > 203 > >=20 > > Hopefully that clarifies the difference. =20 >=20 > It doesn't quite, sorry. If you have "mtdparts=3D... mtdids=3D..." in yo= ur > cmdline that you pass to Linux, U-Boot doesn't care. That's one of the > main users of CONFIG_MTDIDS/MTDPARTS today, which could in some good > number of cases be removed (take am335x_evm_defconfig for example, the > table has been defined in the upstream DT for forever). Taking a look > at: > commit 938db6fe5da3581ed2c17d64c7e016a7a8df5237 > Author: Miquel Raynal > Date: Sat Sep 29 12:58:30 2018 +0200 >=20 > cmd: mtdparts: describe as legacy > =20 > The 'mtdparts' command is not needed anymore. While the environment > variable is still valid (and useful, along with the 'mtdids' one), the > command has been replaced by 'mtd' which is much more close to the MTD > stack and do not add its own specific glue. > =20 > Signed-off-by: Miquel Raynal > Reviewed-by: Stefan Roese > Reviewed-by: Boris Brezillon >=20 > Is when "mtdparts" in U-Boot was noted as legacy. So what exactly are > we fixing with this series? Nothing changed about hard-coded values > being passed along. What may have broken was some progmatic way to set > those, but I think that's both fragile and deprecated in favor of the > table being in the DT. >=20 We may be fixing user scripts hardcoded with something like mtd read nor0 The question is how many users use something like this, and how many just need the norN names for mtdparts. Marek