Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2717663pxb; Tue, 12 Oct 2021 12:01:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUHmAD/kPdF2tU3j1xYKlLfiVfNcZZygtaXNB7EKjbEsVZKm5zYcChwhNdpWotKnre2C1r X-Received: by 2002:a17:90a:1a0a:: with SMTP id 10mr7994785pjk.85.1634065309202; Tue, 12 Oct 2021 12:01:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634065309; cv=none; d=google.com; s=arc-20160816; b=RXuQdq5oYSHT/4nawYoq5AssoNPQZG43XY0I5DVCe3y0s1SGzDtrU0ePYagmSqHU69 Cd8R4kQXtL8deJVCkBcrTomdahXAnwFapc39NN9gWm/5M9b4eRggCuAXWFgvFq1BtiwC jJBzLYZ6w86trJQXgEh6f4TSLAJ/l8hU35ViKkmqDHfTe5KVsq2VtBVWynsgYJarn4t1 sMgE9V9nCGVnEPQ2SBzEBpvqsXanUsJzMf5YYT/nKR2DRV8EtIqXceQrmlDDh0538oEy I1h56pZ2fQ0nuYaJmBC8KPHRmCL6SNcmDswOdG4OqcI4Ct/eV26Ab0wrbjNxlT0CAkHN XXSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=auzct+JBnaE77SphBzk5VRKwxJ9bO7VVvpIpQ0hJFP0=; b=Aiy4opr++8JocPehZchbLAdcFOJPs+OyBh/hnSimOMP6CuZ3hUa0pniODZPijEApiG dhJM3dNqp7tDVREZ3wyngNuUxS5meEGV1w++p8Sou+oxcIdEvsMEsUhMuO/1Ir+eryAk LzzmkFMeaNCHoiII8zSHFv/tivdtgJG5KCiaPkxHWV5ps3Nc2kF6c51BSQ5lPuxi2B0G YI+DWCIQKjw0QY/pF/SvNw8RM+Jl3ch3/DCPyosp611U4RDh0hSV99jzZdUF4pMEi7Fe nxUozUB4gJ/u11OSXjhO2W7zs8z84+qJd0vuYc5CNVzs1bEG5ztBLO8axLCysEPddAA8 fIXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=BmJhgjsy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k9si20026224pfc.213.2021.10.12.12.01.34; Tue, 12 Oct 2021 12:01:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=BmJhgjsy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=narfation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234204AbhJLTBr (ORCPT + 99 others); Tue, 12 Oct 2021 15:01:47 -0400 Received: from dvalin.narfation.org ([213.160.73.56]:56816 "EHLO dvalin.narfation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233869AbhJLTBq (ORCPT ); Tue, 12 Oct 2021 15:01:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1634065180; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=auzct+JBnaE77SphBzk5VRKwxJ9bO7VVvpIpQ0hJFP0=; b=BmJhgjsy5qFOjJrDKOV46STVvCU5J6aPoxBh1f92e0SPnC0r2dCCvTbkbgtMwFTLhPerWr fM4sksq1R55NWV9VNfdb4UVvNf4Td51zWyJS0H8iul6GHfpGgtKT8xypdFYRMIIEwcA+yf +J/yrBgxukmX00kHU863/1VONkxjhnc= From: Sven Eckelmann To: Pratyush Yadav Cc: openwrt-devel@lists.openwrt.org, Ansuel Smith , Michael Walle , Adrian Schmutzler , Srinivas Kandagatla , linux-mtd@lists.infradead.org, Bartosz Golaszewski , linux-kernel@vger.kernel.org Subject: Re: nvmem: Defining cells on mtd created by mtdparts Date: Tue, 12 Oct 2021 20:59:29 +0200 Message-ID: <51067395.yQmhhqxHrA@sven-l14> X-PRIORITY: 2 (High) In-Reply-To: <20211012182444.qrn3lzp7vukklwlx@ti.com> References: <18728084.NGlc0Rocea@sven-desktop> <14722734.oMan5NXi5u@sven-desktop> <20211012182444.qrn3lzp7vukklwlx@ti.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1661808.Y5TqsuFBtk"; micalg="pgp-sha512"; protocol="application/pgp-signature" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart1661808.Y5TqsuFBtk Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Sven Eckelmann To: Pratyush Yadav Cc: openwrt-devel@lists.openwrt.org, Ansuel Smith , Michael Walle , Adrian Schmutzler , Srinivas Kandagatla , linux-mtd@lists.infradead.org, Bartosz Golaszewski , linux-kernel@vger.kernel.org Subject: Re: nvmem: Defining cells on mtd created by mtdparts Date: Tue, 12 Oct 2021 20:59:29 +0200 Message-ID: <51067395.yQmhhqxHrA@sven-l14> X-PRIORITY: 2 (High) Priority: urgent In-Reply-To: <20211012182444.qrn3lzp7vukklwlx@ti.com> References: <18728084.NGlc0Rocea@sven-desktop> <14722734.oMan5NXi5u@sven-desktop> <20211012182444.qrn3lzp7vukklwlx@ti.com> On Tuesday, 12 October 2021 20:24:46 CEST Pratyush Yadav wrote: [...] > I have been wanting to fix this problem for a while but just never got > around to it. I was thinking about either extending the mtdparts syntax > to maybe add nvmem cell information in there or adding a separate > cmdline argument that complements mtdparts with nvmem cell info. Dunno > if either of these would work well though... At least for the devices I have in mind, this doesn't seem to be a good solution. The devices are shipped since years and the bootloader isn't updated with firmware updates. So changing to a different mtdparts might sometimes not be easily possible. But this might help in situations which don't have this limitation. > > Ansuel Smith just proposed in OpenWrt [1] a workaround. It basically adds a > > minimal fixed-partitions parser to the mtd cmdlinepart parser (responsible for > > the mtdparts=) that tries to find the matching (size + offset) fixed-partition > > from the devicetree. The code in mtd_device_parse_register > > (add_mtd_partitions -> add_mtd_device -> mtd_nvmem_add) will then > > automatically take care of the rest. > > I don't quite see how this helps. You say that some devices don't have a > device tree at all so how would you even match the fixed partition? And > this of course doesn't solve the problem where you might want nvmem > cells with a partition layout that is different from the one in device > tree. I personally had a different thing in mind. The situation for OpenWrt's ath79 target (and Linux's ath79) is that they use DTs and some of these devices are still using some information which are not part of the device tree. But the DT partitions for the nvmem-cells MUST match the ones in mtdparts But you are right, this will definitely not solve situations when there is no DT used. And didn't say that I needed a solution for this - I was (hopefully) always referring to devices which use mtdparts (which can also be used with devices which are using DTs) Kind regards, Sven --nextPart1661808.Y5TqsuFBtk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF10rh2Elc9zjMuACXYcKB8Eme0YFAmFl2xEACgkQXYcKB8Em e0aeQhAAlidibVtr6PhWaQR7ik0lCLwH1o8L08cAvsDHZX80hZZ83nuoyRyMda3g 0QA0f+bdhayXa48v5yb7dVT08Mpv81nsZ5oMWsyx6S5UrcYAgPHilDFBGldqyY7J 7pN3hy2dFChNSaK/X7OIhQ0VbMwErcM0ImyBPa/M8PAdaSDtpXNO/DH4QxgMw2DY 9qzmnOk8y8VjnlInBB92gIVET3tqCTCKLUECkLsAR0wwMEdhXG9AyfCplQw4Ci8y NPbwjW4kE1WJwu7pz8adoe8B3we0XkRU4+HFvcoIuQCFAxIrjOT+5yZpWTVgg2cH UtnmSoA7U6NIk7AtAPjVt8Dt++dHlI670bvQlqrphnZ+k4U26vb4TSFnWepGomBv wMuQEztMrEtjr3wPRYjXPVCUSsT4cXOTzb/QFILYpSLETus5WX4HnATGneCXsFnw pRkUnGXGsIL9b3bgQdhhWwYmKt2BFMPrX3Kb53chN4mI+rvvi5GNnX0vQAGXhRkk lVpBNFUr2ele0IfxKYnr8UTU6igwMKFYeLM/mNQm8bh7T02lz2LjbSZsum8EOIqG doFAcZj6eyF7HqfYi9ZS7u1c5IM/WuRVmzNmUMqQzX0fcBXXNI2BZwNFQm1MNj1S R6MIy0zAnJJB2KegY9DVqOB/6+SSCQszBGvLFQMoap6HHbZPCIo= =K/DJ -----END PGP SIGNATURE----- --nextPart1661808.Y5TqsuFBtk--