Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1361548pxb; Mon, 11 Oct 2021 04:30:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4EaLsCEf/yTMIIZ+uRTNl3CQJ5gW4a7fVnjY8H7bIL2/AEo1thGSGJQR8hJ1DBirCzkmu X-Received: by 2002:a63:4606:: with SMTP id t6mr17422059pga.388.1633951815851; Mon, 11 Oct 2021 04:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633951815; cv=none; d=google.com; s=arc-20160816; b=VFkgQYpJPJuiXIbXd/I8y0YKH6kom3jUdQA8+P4ywMY5DdYCniRr4k4dBf4PHpBKGd QzwdeJu2z+hWsx6oDXUKt1YIRSs6zfY/5Mz1VGd0TW+ObgPBt2CMcK+ACEzUiBdO+qeU n5Xkt38Q1YliNVPH9/gilGPTEtsYj1vWVl4r55LfG5R8/vKrJ7jqe7u9MupfKpRb6/xI CkwJEvIM2mL4dKJ6KSVPoqvlkJ2/ifrVXuJHquO0S6W5MFEHUy9ajsBbgx46sLaLnn8q LALNTE/mMJsfjPrEh/ULkdKuXIez3btC3Em2lDYd4sinOERVSuRt4TT4mSDcyM8qob+E 0o4A== 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=4A5IbiON99sAmaO5rSffIZ7vgzdOWfa8UnMZX6no8SI=; b=gU+fHwqlLmipFweo6Cp1wQZ+G6RdhcDl+6VXD5H0F4iAYVCfx35ic5xazGm5FIQFkW 5A1FRxbarcsmGk/W1x05WMdttwl255ifEeTIzor8fytC5zMxfiu4yK76Be4xMNOWz7ct 27InAwGzkaXn7b+fcgW6vLwBnzmZVe1F0QLarYEgi3KTbq73zb2zrSTiAiFOj2UB9y2/ s0y8fVfGfoyuqYTAyo+EgFuGs1zsd0hinWl6vMcjTD83cREXk+IyYoaezFyuyhKC2Q0P 3i3mBt+xQk0MvvUbpbPOICvwAedHyar1zo6jXOyx7tsD0/sRDjRJaXfOc+gWChmN2R63 gXzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@narfation.org header.s=20121 header.b=XZSyyuZJ; 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 q5si9574807pls.138.2021.10.11.04.30.03; Mon, 11 Oct 2021 04:30:15 -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=XZSyyuZJ; 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 S232473AbhJKHJE (ORCPT + 99 others); Mon, 11 Oct 2021 03:09:04 -0400 Received: from dvalin.narfation.org ([213.160.73.56]:40566 "EHLO dvalin.narfation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230102AbhJKHJE (ORCPT ); Mon, 11 Oct 2021 03:09:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org; s=20121; t=1633936023; 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=4A5IbiON99sAmaO5rSffIZ7vgzdOWfa8UnMZX6no8SI=; b=XZSyyuZJbarDtRPi2do9RZJzBnzxlFdszrY04nDqWis73okxBzpJoCfh+RA8SLDvuciTLZ 9hsVmEICvl3JjYKdA4KeElflamaETDHsW00Be2UMnIKCK70wPJeseVi5tjogKlBOy4AFgd +KVsAJZtmvzYHOzpzms4Kioebl+/rpw= From: Sven Eckelmann To: openwrt-devel@lists.openwrt.org Cc: 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: Mon, 11 Oct 2021 09:06:56 +0200 Message-ID: <14722734.oMan5NXi5u@sven-desktop> In-Reply-To: <18728084.NGlc0Rocea@sven-desktop> References: <18728084.NGlc0Rocea@sven-desktop> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart27234856.iIAV7Kigx3"; micalg="pgp-sha512"; protocol="application/pgp-signature" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nextPart27234856.iIAV7Kigx3 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii"; protected-headers="v1" From: Sven Eckelmann To: openwrt-devel@lists.openwrt.org Cc: 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: Mon, 11 Oct 2021 09:06:56 +0200 Message-ID: <14722734.oMan5NXi5u@sven-desktop> In-Reply-To: <18728084.NGlc0Rocea@sven-desktop> References: <18728084.NGlc0Rocea@sven-desktop> On Sunday, 10 October 2021 14:53:13 CEST Sven Eckelmann wrote: [...] > Since there are most likely more devices out there which use mtdparts, I would > guess that there might already be a strategy out there which can be used to > define the nvmem-provider for mtdparts defined partitions. At least I saw that > Bartosz Golaszewski added all the mtd devices automatically as nvmem provider > in c4dfa25ab307 ("mtd: add support for reading MTD devices via the nvmem > API"). So there might also be something for nvmem-cells to find the correct > mtd instead of relying on the fixed-partitions registration + of_node (which > doesn't exist because it comes from mtdparts and not devicetree). 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. Kind regards, Sven [1] https://github.com/openwrt/openwrt/pull/4664#issuecomment-939567963 --nextPart27234856.iIAV7Kigx3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF10rh2Elc9zjMuACXYcKB8Eme0YFAmFj4pAACgkQXYcKB8Em e0b9eBAArC/EsvvrKk2y7/99MES/Eds+2b37/9dxuvOPOxULMobk3Gu1VC1qhKv4 Z2zYdWP1rGz14r+DqYD9YhSvw1wM8WMN6hT3A2QWErF36fPngvahOLXZjoagaDVN PQQ+G8KKV/5WtNGjiah8zMWBcXC0zzLVRkxLsZ2BwuSVXsFo0qJereWknxw7F/Qf dw86a5Yf7JbcPaL4oJg/522oC+6O8CLwakwmyjp5ZLDDqo/z+p4DgqDM8OVphX5v 0MsYCT0YfvEJyVOZfkiUKljqIwyEgJbAtJDxIYAX6Riauz+cEmy6diArVOnNro8/ EEQuoyJq6Vu9By2E/pnsDahrk1DIkd5pi1hnR8qTMf/VTD2YC85DWg1y7qKdpf8g pQ8HsH/5ZCgPcQJFXU50RNaxlHQq8BJVbGcO8SHKUSZY29lo17pafWwMfRKLO1fh Qhyk8l19iwmmQ09Uho1xbNE5CBzSP1RH76/4HTEFDXPYSOCu1zDuf5FSlSQZjTop KClni0PvXPqeDRRtkoMLO2/LIjE3S8cCsRF37zqJdN6Ko9drwk/Vsp1BEIkzBzB9 hNihrk6JeaKhQ6Ogmtcw7pIMwrI8TXgvWlYqvaEt7KPHU0HKXOXdkS+4jO1nyaZD k4dLtPx5LW4kgHcY0JqaFLOZfTMwPiPL05cPTEp+WkyR7rJCktk= =iCmG -----END PGP SIGNATURE----- --nextPart27234856.iIAV7Kigx3--