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_PATCH, 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 77A9DC433EF for ; Wed, 22 Sep 2021 17:29:38 +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 98C4960F6E for ; Wed, 22 Sep 2021 17:29:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 98C4960F6E 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 A35D2832DB; Wed, 22 Sep 2021 19:29:34 +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="RCXgIJ5+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B00E48326F; Wed, 22 Sep 2021 19:29:32 +0200 (CEST) Received: from mail.nic.cz (lists.nic.cz [217.31.204.67]) (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 335D7832FB for ; Wed, 22 Sep 2021 19:29:27 +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 803D1147F36; Wed, 22 Sep 2021 19:29:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1632331766; bh=7+PvqvcOA6zdOkNIWQZVm/a2v3FCy5ndFhL6nrzK6F4=; h=Date:From:To; b=RCXgIJ5+TniOB2dEJI6yey2tYLISs1iwSZYOeiG3IAi4KASDkwS+YYOm91NpBgwzw zSFvebG4pmOY9eCfUpl0ZfWTQGRtl0DqjJPpREbapf1wgcd593N78269i42GCHrO3e 8rco3EUXTP1O3l1RCI5Mzg1iPUXDv7R0P3sU1yFE= Date: Wed, 22 Sep 2021 19:29:25 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Patrick Delaunay , Marek Vasut , Tom Rini Cc: , Pali =?UTF-8?B?Um9ow6Fy?= , 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: <20210922192925.723abcba@thinkpad> In-Reply-To: <20210922162909.1857566-1-patrick.delaunay@foss.st.com> References: <20210922162909.1857566-1-patrick.delaunay@foss.st.com> 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=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 (Adding also Tom.) Hi Patrick, Marek, I find this either not complete or not needed: - 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="nor0:1M(u-boot),0x1000@0xfff000(env)" does not work currently, and you want to make it work. 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. - or it is not needed, because you can remove MTDPARTS definition from the board config entirely and move the information into device tree. 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 `mtd` command. Tom and I were of the opinion that MTDPARTS should be deprecated and removed in favor of OF. Marek Vasut says that this is not possible for every board, and so needs to stay. 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. [1] https://patchwork.ozlabs.org/project/uboot/patch/20210618145724.2558-1-pali@kernel.org/ On Wed, 22 Sep 2021 18:29:06 +0200 Patrick Delaunay wrote: > This serie is a V4 for [1]. > > Now the SPI nor are named "norN" with N after the CFI nor device: > "nor0" to "norM" => N= M+1. > > See also an other proposal from Marek (not working after test) > "mtd: spi-nor: Fix SF MTDIDS when registering multiple MTDs with > DM enabled" > > http://patchwork.ozlabs.org/project/uboot/list/?series=262362 > > The first patch of the serie fixed the compilation issues around > 'cfi_flash_num_flash_banks' found in CI: > > https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/9138 > > [1] Series: mtd: spi: nor: force mtd name to "nor%d" > http://patchwork.ozlabs.org/project/uboot/list/?series=262632&state=* > http://patchwork.ozlabs.org/project/uboot/list/?series=262017&state=* > http://patchwork.ozlabs.org/project/uboot/list/?series=262013&state=* > > Patrick > > > Changes in v4: > - introduce macro MTD_NAME_SIZE for mtd_name size and use MTD_DEV_TYPE > to retrieved the "nor" string. > > Changes in v3: > - NEW: solve compilation issue when CONFIG_SYS_MAX_FLASH_BANKS is used > - start index after the last CFI device, use CONFIG_SYS_MAX_FLASH_BANKS > > Changes in v2: > - correct commit message > > Patrick Delaunay (2): > mtd: cfi_flash: use cfi_flash_num_flash_banks only when supported > mtd: spi: nor: force mtd name to "nor%d" > > drivers/mtd/spi/spi-nor-core.c | 17 ++++++++++++++--- > include/dm/device.h | 3 ++- > include/linux/mtd/spi-nor.h | 2 ++ > include/mtd.h | 4 ++++ > include/mtd/cfi_flash.h | 8 +++++++- > 5 files changed, 29 insertions(+), 5 deletions(-) >