From patchwork Tue Feb 16 21:26:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1441122 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=01MnkMDF; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=H7N31piU; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DgDZy0dytz9sBJ for ; Wed, 17 Feb 2021 08:27:38 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6q96H9HheIyIkNgZ6pk5OJHXsKCL/3Zx3sHAWlBELhM=; b=01MnkMDFzEBJgeJMOWtFs2qqI qjC+L61pQ0Ja+MJcy+K1kz/ZBLUQWezY9WxjZf3u0BKnysnbsqK8W3ys48KgDN6cmzE8TMHXljBif 0z3v0bfIK+nZTfdBa6gSRd1TYbBTNvFMEy9B1rZPSx2QbSj9S8s8r2BDmWKgBU0Y81f28d8mqjLpq s+bhjIQvhUJDGW7WS62ASatZ/QoW7UckHH9elcAqYxr7rrVDZjq7LF+Q7f231TukqiRY99Z5/5XEX +Kj325sH/zbQOTp3+PB1lsGYLPEsKPEiELz46jETTAqsh0PUq20Q3O9x/5dgRyNEq7vHZQ8DXZH+w VNtggju/w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC7s6-0004Y7-6P; Tue, 16 Feb 2021 21:27:02 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC7s4-0004XV-8m for linux-mtd@lists.infradead.org; Tue, 16 Feb 2021 21:27:01 +0000 Received: by mail-wr1-x431.google.com with SMTP id v14so15051455wro.7 for ; Tue, 16 Feb 2021 13:26:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gTKUWEdr7X7gHT2/c0rh/4HOUp41ym8Za7G+Wwf9Lwk=; b=H7N31piULCOG4p3kVh8VEIuac2d288j8dXkSoYRRVRXCpfTrJ8LSuVH+sv+wqjaRgm JKmEI0x7hme53FbBwsJ52shL93m6Ne341jtSUlUD78GDni7Yt8ZGmjJjdGzQIhSewRw/ bG23eubM2pktJY/ePOXFOTat5SoALpSnW8rCvhfYtPUyYPZRvxDUrKl3gEoUy7bnQQWK GQKctLHu31M9ygX5YwaNu4I4tOnAYTdpbLFZo67bPV3HseTrTo5Lx8Afc8DsbSYqojAv MBHc1aWsiiXz6Uwty36AEG9Xi6AYFEJWoVeHOymKpN6LvFG6UWD1pdfH5Kk2cwOYFoV6 Ft2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gTKUWEdr7X7gHT2/c0rh/4HOUp41ym8Za7G+Wwf9Lwk=; b=dUjc3b0J1K/4BmTzOOJagwRRXQWFHhYqrEGvHTB/oCwz269twIKIqcjkcOCfe+SRIZ v5KN8M6SnwIw5o9g5ABD8aF16mV3WXHYJ2x6bIpVFyYlWXfxrxhArBarJA+uqnfy/LqT lFgYwinkRXlrALySCeeiMCY7nxmhINR273lECkKDeJ+8XSXptTwZz/m4k4NcvgfaTWJy IahHhbgzM8cJqR612RRky4JilvMNl0U4qYZS5JX86FGJ1YS2NP2/Cd0dyAtIHLfi+2jD kjtKfzPKWMY974h10ryrK34w57m5sOqpmMTO9siWOyFKLGz1ubDgMKGq2ofR5VjAC7le 1bmA== X-Gm-Message-State: AOAM530TYGzMlmCtvwO5qF8qA+q0sgQ0EDpKKhiPtSZ/Sng1mmmfB0SO jfMXuSebxdVIUK5MSbYhwcc= X-Google-Smtp-Source: ABdhPJywo7VmsW32KITYWmVvyUWc2zBCwLyTACvX3mOy6RmpF6iQNI6DbIv8VsnZrxqhev97rJHmBw== X-Received: by 2002:adf:edc8:: with SMTP id v8mr25548852wro.330.1613510817997; Tue, 16 Feb 2021 13:26:57 -0800 (PST) Received: from Ansuel-xps.localdomain (host-87-6-252-11.retail.telecomitalia.it. [87.6.252.11]) by smtp.googlemail.com with ESMTPSA id s14sm7132182wmj.23.2021.02.16.13.26.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 13:26:57 -0800 (PST) From: Ansuel Smith To: Richard Weinberger Subject: [PATCH v2 1/3] mtd: partitions: ofpart: skip subnodes parse with compatible Date: Tue, 16 Feb 2021 22:26:26 +0100 Message-Id: <20210216212638.28382-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210216212638.28382-1-ansuelsmth@gmail.com> References: <20210216212638.28382-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210216_162700_331945_FD76F791 X-CRM114-Status: GOOD ( 14.75 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:431 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Vignesh Raghavendra , Boris Brezillon , linux-kernel@vger.kernel.org, Rob Herring , linux-mtd@lists.infradead.org, Miquel Raynal , Ansuel Smith Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org If a partitions structure is not used, parse direct subnodes as fixed-partitions only if a compatible is not found or is of type fixed-partition. A parser can be used directly on the subnode and subnodes should not be parsed as fixed-partitions by default. Signed-off-by: Ansuel Smith --- drivers/mtd/parsers/ofpart.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mtd/parsers/ofpart.c b/drivers/mtd/parsers/ofpart.c index daf507c123e6..4b363dd0311c 100644 --- a/drivers/mtd/parsers/ofpart.c +++ b/drivers/mtd/parsers/ofpart.c @@ -50,6 +50,11 @@ static int parse_fixed_partitions(struct mtd_info *master, master->name, mtd_node); ofpart_node = mtd_node; dedicated = false; + + /* Skip parsing direct subnodes if a compatible is found and is not fixed-partitions */ + if (node_has_compatible(ofpart_node) && + !of_device_is_compatible(ofpart_node, "fixed-partitions")) + return 0; } else if (!of_device_is_compatible(ofpart_node, "fixed-partitions")) { /* The 'partitions' subnode might be used by another parser */ return 0; From patchwork Tue Feb 16 21:26:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1441125 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=Rgd6s5A+; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=EaxJ5CEL; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DgDbN6NH5z9sBJ for ; Wed, 17 Feb 2021 08:28:00 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8ndSUEJOokxGBOuwVyQKM05ymxvllZA7nCbpIowK3h8=; b=Rgd6s5A+vegInqukeYpPOaDle wpTb2p4GSaOgZ98yokY0mOeUwDUYMfVP5YWqy6izTYWlEff8SHgdw3azGIb7VhfK5g43y4R8Avw71 /EKsjugFaw+1lJOKdfIbtUHC0QJqQmuEXXKGNxNOTKOndlHvtdhYS5f0ihW3LPFX0Alk/x95ih6/4 VbPWf5sAQyVJ65SXtfMid5/7sJQDfiBbgIXj7B3EaWHHUgz1q0virT1+is8yQjfBL1EEL6pUph0HE bdC+gGpPVKq61g41a0CPtXm3NlOU/ebQ5xvr6ITr3vk3g2YZ6sORH+zfLg1/DEfwfjaZI5kJRSrnW DOtzin6zw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC7sF-0004Zj-Je; Tue, 16 Feb 2021 21:27:11 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC7sC-0004Yq-Or for linux-mtd@lists.infradead.org; Tue, 16 Feb 2021 21:27:10 +0000 Received: by mail-wr1-x42a.google.com with SMTP id b3so15056559wrj.5 for ; Tue, 16 Feb 2021 13:27:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GDofa5l7P6G0aPshCRUpeDnHopahisIJ3Z8CdpNi7O8=; b=EaxJ5CEL06ZrL7LAe9TlR5b7kiHOmU47EzQvPcKa8nlwaykJh4kgBLOjTIto8Tew0W pagLkvyl6VZhgjag9+87+Y8R6iT4r8gRzCuBW3o6Vzpft9KaiXAucNkkuZGy+JDZbLSu kUn99XJUjerF7D+DzNPnHRjbIizQXwettsJ+CAySvhup+TiQEQhj8AlXHL+ikuDN8ZAC JGLKxMpc0UlK1j8yVLDBnaa5CmPqHtDJBgnbQoqM54N2LyMtS5B8dW/4niQWyO6BDKW3 1i/r6ShckSkNS+FC9WMI6ab3O0jK2tpVfpDfj6tG+L1eIrOovjWjo1LqBhzJmdgl3J0Y KSkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GDofa5l7P6G0aPshCRUpeDnHopahisIJ3Z8CdpNi7O8=; b=pWZE/ZA+CvVS/OTNstb152x5FO4X9GiU1DPz2qpZFGrmRl0daVyxoX2mLZpzkvdkbq Js5Q5TKyyZn0pm+rOk+gRYdbN0vQ2Vbv/UlEsF/YLv1OtQNs+lPmNLCtxS5Cnn/NMXvI VlL7DhSf+P67b2gWeceg53yFK8hslycNxHvtmexhrGJi9AXVFBV4Pv7h7nP8GpSE1Sbf /lkIjoeRAwLUHADJ5K9A6goZ2arHHQkE+W786YPw3ufo3Lqf/oDxfD2tuWwvp/ovR/bA 2diPQbK2SZZTY+/pU9Jm8/F8xRTcpp7YlGBWet/k+j4WnJYMv3Icc25Ov4k7Y5Fa2aD/ 91ww== X-Gm-Message-State: AOAM531aLF8EXNO1nYoe4AmmH4pJwp2OrrahUEVrFDgRrO7Ox35zg2DQ 4yigmadFRih5Wya+JOhmTj4= X-Google-Smtp-Source: ABdhPJxGN5rFGltSfdK4JsTkjNuZGmY97moou1E5YYGCHexloAkgXNVPxE6lGC8yljZHXMBTwjXI8g== X-Received: by 2002:adf:bbca:: with SMTP id z10mr25753146wrg.168.1613510827298; Tue, 16 Feb 2021 13:27:07 -0800 (PST) Received: from Ansuel-xps.localdomain (host-87-6-252-11.retail.telecomitalia.it. [87.6.252.11]) by smtp.googlemail.com with ESMTPSA id s14sm7132182wmj.23.2021.02.16.13.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 13:27:07 -0800 (PST) From: Ansuel Smith To: Richard Weinberger Subject: [PATCH v2 2/3] mtd: core: add nvmem-partitions compatible to parse mtd as nvmem cells Date: Tue, 16 Feb 2021 22:26:27 +0100 Message-Id: <20210216212638.28382-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210216212638.28382-1-ansuelsmth@gmail.com> References: <20210216212638.28382-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210216_162709_254318_3E2EFD0E X-CRM114-Status: GOOD ( 14.50 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:42a listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Vignesh Raghavendra , Boris Brezillon , linux-kernel@vger.kernel.org, Rob Herring , linux-mtd@lists.infradead.org, Miquel Raynal , Ansuel Smith Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Partitions that contains the nvmem-partitions compatible will register their direct subonodes as nvmem cells and the node will be treated as a nvmem provider. Signed-off-by: Ansuel Smith Tested-by: Rafał Miłecki --- drivers/mtd/mtdcore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 2d6423d89a17..29d257678a86 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -531,6 +531,7 @@ static int mtd_nvmem_reg_read(void *priv, unsigned int offset, static int mtd_nvmem_add(struct mtd_info *mtd) { + struct device_node *node = mtd_get_of_node(mtd); struct nvmem_config config = {}; config.id = -1; @@ -543,7 +544,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd) config.stride = 1; config.read_only = true; config.root_only = true; - config.no_of_node = true; + config.no_of_node = !of_device_is_compatible(node, "nvmem-partitions"); config.priv = mtd; mtd->nvmem = nvmem_register(&config); From patchwork Tue Feb 16 21:26:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1441124 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=opoPUPgs; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=caRYm4JR; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DgDbB4hWdz9sBy for ; Wed, 17 Feb 2021 08:27:50 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4qd/bueucKxX6b3NIcV8SvKfWRKIByPFiztH/uLa5gg=; b=opoPUPgsVHmMG1y4FWTuHjI1H XEE3F4oCDJ3cJ5thP1yFV7ipkV7+J3hNvcRFbKyb1dOM5Ni9v92E2gaYSux6Lspl3Iq84dJU8RcVQ bmAdwg6miyQiGxv5qpwDjuux/TLOs+Rop7+TTHFGqg25loP70DIn5Dxmp/m8x3Rf+A3xbems6pEZt sP2iY+NhLywWlRc/wI+ZwMIkPphCmTN/le/6BrBHGEaZ6v9ulRq28kFdGlTZKuqK54s3tP/SqblZv hLHsLZC4OudHHQSS3+Jrd4L628YkGtjTyTrqIp8NZg6YSw0jX+xRU/D9ctWTahFdHPep5xA4etAw/ 5V2kkaP4A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC7sN-0004cR-Rz; Tue, 16 Feb 2021 21:27:19 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC7sK-0004bJ-OZ for linux-mtd@lists.infradead.org; Tue, 16 Feb 2021 21:27:17 +0000 Received: by mail-wr1-x431.google.com with SMTP id v14so15052045wro.7 for ; Tue, 16 Feb 2021 13:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B+rzS0sRv0J3BMSreb/SAsip/5NpGgjcUC0WZfb9UMo=; b=caRYm4JRhNEpJJ5ON0GqN4amrinIZlbOoymCBoNa2y3NhBJxpxqy9oH9+MLXDdT6mQ fM0an6mHcEWV9uTmEBs3SJjnQWUn0u2ydFzLfd74I+rt3aTG8mgS44IfTRkMOKSpLNKo tpvQmkyMOIEQvMzU4Uy0Wi5cR5mrtUHrSGgh40oUi3v9wH9pAtweVQVLzuEG4TuSn0nX ew0xBYMn9ZLqbGnLbB3AxGlmgUfEDGYna0nT0rq12RstesvqkxiDk6auQnHZFlDbIbKG yFOu7g1dwn7eclpPNbKp7+9RTZqNv1D3odJFy3AcOuvzxwwn7BMAdUIzJICErS3oDAn7 bNcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B+rzS0sRv0J3BMSreb/SAsip/5NpGgjcUC0WZfb9UMo=; b=p4mVHfFpV1FcstyGKKti9mmG4XNTjaEHZmcx05NS1BVJxatiiAZtbfXZuoLG2dPdc9 eWXxae7FZxgWQpy3Xu2TA8vOxGg7K5wAUlflbtMKJqX9oAt1TFqublQZRafKdn7qwWHI SuMnVn8cAZtD7GOwZKq9Xs8gm2DCa/nDoIx+WaM7kd+yhHOl7g+vg839fP1EbJNZOvOB C2ius+rNwuZUnNDREF52fB6JWNDeb04UVysWdWIeZ4vKkj3NUzBo8UJraB2+g5MjnWWi WXfN2hEnfLg4chx/elj5TPyychyFkFVNLhBz3DP7q7L/XmUAkptUb7/iz8aOnPQRAaIB LNKQ== X-Gm-Message-State: AOAM5304cj2MVrYnc1pFzUV7K1KKeMaBtjsOi67+nblVIBitbaYY5Mb2 qHOHBTGljBr3wHoucogDhY8= X-Google-Smtp-Source: ABdhPJzpGa895LxR+1I55koS/MCG0yUrUf4FciTfVyz+UK47hf3qpzinn/2+isQbyz2+D8Y0rgXnkQ== X-Received: by 2002:a5d:6951:: with SMTP id r17mr13973220wrw.279.1613510835780; Tue, 16 Feb 2021 13:27:15 -0800 (PST) Received: from Ansuel-xps.localdomain (host-87-6-252-11.retail.telecomitalia.it. [87.6.252.11]) by smtp.googlemail.com with ESMTPSA id s14sm7132182wmj.23.2021.02.16.13.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 13:27:15 -0800 (PST) From: Ansuel Smith To: Richard Weinberger Subject: [PATCH v2 3/3] dt-bindings: mtd: Document use of nvmem-partitions compatible Date: Tue, 16 Feb 2021 22:26:28 +0100 Message-Id: <20210216212638.28382-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210216212638.28382-1-ansuelsmth@gmail.com> References: <20210216212638.28382-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210216_162716_826229_3C4D0309 X-CRM114-Status: GOOD ( 15.15 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:431 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Vignesh Raghavendra , Boris Brezillon , linux-kernel@vger.kernel.org, Rob Herring , linux-mtd@lists.infradead.org, Miquel Raynal , Ansuel Smith Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Document nvmem-partitions compatible used to treat mtd partitions as a nvmem provider. Signed-off-by: Ansuel Smith --- .../mtd/partitions/nvmem-partitions.yaml | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/nvmem-partitions.yaml diff --git a/Documentation/devicetree/bindings/mtd/partitions/nvmem-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/nvmem-partitions.yaml new file mode 100644 index 000000000000..1ff283febcaa --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/nvmem-partitions.yaml @@ -0,0 +1,105 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/partitions/nvmem-partitions.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Nvmem partitions + +description: | + This binding can be used to treat the specific partition as a nvmem provider. + Each direct subnodes represents the nvmem cells and won't be parsed as fixed-partitions. + Fixed-partitions bindings described in fixed-partitions.yaml apply to the nvmem provider node. + +maintainers: + - Ansuel Smith + +properties: + compatible: + const: nvmem-partitions + + "#address-cells": true + + "#size-cells": true + + reg: + description: partition's offset and size within the flash + maxItems: 1 + +required: + - compatible + - "#address-cells" + - "#size-cells" + - reg + +additionalProperties: true + +examples: + - | + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* ... */ + + }; + art: art@1200000 { + compatible = "nvmem-partitions"; + reg = <0x1200000 0x0140000>; + label = "art"; + read-only; + #address-cells = <1>; + #size-cells = <1>; + + macaddr_gmac1: macaddr_gmac1@0 { + reg = <0x0 0x6>; + }; + + macaddr_gmac2: macaddr_gmac2@6 { + reg = <0x6 0x6>; + }; + + pre_cal_24g: pre_cal_24g@1000 { + reg = <0x1000 0x2f20>; + }; + + pre_cal_5g: pre_cal_5g@5000{ + reg = <0x5000 0x2f20>; + }; + }; + - | + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "bootloader"; + reg = <0x000000 0x100000>; + read-only; + }; + + firmware@100000 { + compatible = "brcm,trx"; + label = "firmware"; + reg = <0x100000 0xe00000>; + }; + + calibration@f00000 { + compatible = "nvmem-partitions"; + label = "calibration"; + reg = <0xf00000 0x100000>; + ranges = <0 0xf00000 0x100000>; + #address-cells = <1>; + #size-cells = <1>; + + wifi0@0 { + reg = <0x000000 0x080000>; + }; + + wifi1@80000 { + reg = <0x080000 0x080000>; + }; + }; + };