From patchwork Tue Feb 16 19:56:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1441100 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=QDD7gCp/; 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=jzGuKPTM; 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 4DgBbD6Gh0z9sCD for ; Wed, 17 Feb 2021 06:57:44 +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=QDD7gCp/bXw238y5WwJwFRC+W pwi/vGpLDrAkrDWedmI4HdKnuBoiixW1eICIg5hL7IyzRjmfRPa+fbmDyO80QF3QwV4pkxlF1xGMt +26A1Y30Eb8/HhREwe62eQ9CWWyeLm6wbY2TDM/Q4CWyCNgefMNPjeV6KfSum/UKpr5FsCoXr+Ez7 TjVWVSNSy/wAAj8A4T52bGbIGOZwsMfVqKEF7mjnRWszLoGDomg1s6HmAI+oSxd/UkPQbgW/9MwA3 hNRZ6qC3vZBVSU0frRfTipF3P7RcJa3gJC/BJ/3aUAdiLacg5C41Scf2eXqrJuY0k9wUc0wR8nl+v SUVfVbYQA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC6SZ-0006Vn-77; Tue, 16 Feb 2021 19:56:35 +0000 Received: from mail-ej1-x629.google.com ([2a00:1450:4864:20::629]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC6SX-0006VP-5J for linux-mtd@lists.infradead.org; Tue, 16 Feb 2021 19:56:33 +0000 Received: by mail-ej1-x629.google.com with SMTP id i23so12305683ejg.10 for ; Tue, 16 Feb 2021 11:56:32 -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=jzGuKPTMZQWNehBBdJksfFwA4UOge6d9q760lIxNyncm7nBdfugSgxT1Keg1HPzAGd JLTkJogzs3pxn3/srZQRlM9pKm51nUl1kC4rxUo5QDMbTY5n3zVLepdEOytL2FUre2Oq ojgUAT6EOzqAFDUj3t+wJcw536Kuqg0NisJaSSSsLq+H/LMKkUpR3X5NmJ79Gh5VCXx2 000XzNjAt7yUQ+q/cwGySF6KRhgbUZyPDQ7tGfPHLfnWkpnVsWwlossT9gjdsMktQD3H SCL5QVA+TqcmyT8SzfQ+cd8c1ANJv/41oqptoBynUPMcsX1gzKIyiRrs0LS0IbH24o2P uUNw== 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=AiPZnZnFkErtKXLXgc0AfvCuRbErMF/ypTIh52tj+MQqFouPhOilNqtLf/ZKqrP0Fe IqmDWYfTK3HXGpi79Mw/Sxffy4lT9GRiqF3HenTFNXQS2RZkB1RidPWHlyNrNijPo50E aV8sFicQNFhb3miJbezKfVfcgu7vAoVL4H4+54AONu6gN+GBVBt1AKPO1XbcJmBeUYkL Nke+v8VvfVuBLismAaer7wPrnPq6AsrqXXDn4m/B5E8WO1fKbgrOCcewL1gfaLeBquG4 Iidan1pRTonocagX8gGg4PzUzgtiDyXnvdb6I1aAAQAU961hAy3f5QjiCyciwKGbhUky q31w== X-Gm-Message-State: AOAM531qT03GjxOc2eEfTox8rQ8qTHsVaqQl9IPwsxB0+IaET3ee+Tqq 3xYgoNW03HgmGVkUGMstxxs= X-Google-Smtp-Source: ABdhPJzK70XRIZgLLT7o/B2o/FVR+4gONsXyljCh7z9pr7UcUcn/7nBvSDLpE9BN9tCvYHYZsl0Ihg== X-Received: by 2002:a17:906:c1c1:: with SMTP id bw1mr22551444ejb.86.1613505391883; Tue, 16 Feb 2021 11:56:31 -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 rh22sm963332ejb.105.2021.02.16.11.56.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 11:56:31 -0800 (PST) From: Ansuel Smith To: Richard Weinberger Subject: [PATCH 1/3] mtd: partitions: ofpart: skip subnodes parse with compatible Date: Tue, 16 Feb 2021 20:56:09 +0100 Message-Id: <20210216195618.27959-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210216195618.27959-1-ansuelsmth@gmail.com> References: <20210216195618.27959-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_145633_243274_79333B72 X-CRM114-Status: GOOD ( 14.25 ) 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:629 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 19:56:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1441098 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=) 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 4DgBb51Q4wz9sBy for ; Wed, 17 Feb 2021 06:57:36 +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=xUM4ZKrXxpLOPBarbcmfWfhMFG6R8dBy8EBo1zJS17U=; b=KeB8OPvDIzKbMD2aQU1EZi9bL iqfsYo8ycRWQP0Wo+56zoguNVZHgRXaMKqlXnqNuy7O8aBmj97Z0eLv0oPt+8YpZWoiWoNfoWcge2 K6oXYOf3lYXcIHdQYOquLjHOe+43ZGTAy3qJcXFRfbMkaHstEM+IMrw6awm0it4aT8TFlk+SRu3Hz FMheh4cAWAiEtGN98gMHr8EBxA6UFjHEc5HpQCnrzi04npbrm32YEwAh1SVe3CXusw+i8x5kuokRJ 2QbgC5eHjxgEWrtjd7BNkc/zRDtNhV9oQ+L/oSaQQ6C88hTZH9Jg9GxejRGxTGn3xvFQTiHutIQWF 0rturhaHA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC6Sg-0006Xa-GA; Tue, 16 Feb 2021 19:56:42 +0000 Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC6Se-0006Wc-HG for linux-mtd@lists.infradead.org; Tue, 16 Feb 2021 19:56:41 +0000 Received: by mail-ed1-x529.google.com with SMTP id h10so9082028edl.6 for ; Tue, 16 Feb 2021 11:56:40 -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=Mw6ldDIPHpBoRiawt77fVDG0nsr8XAXcGyvERLsKDMI=; b=WNV44HZOqaFZg53RT5bumXB0KIrzTa2Ev0n48Gmus92+TJdTVGCELuURUgNnK9O2vR QMaFPp7wxhHiQHg+5LpwhwultmDctvh9kluFmwKchw/bkYkiIfuPigkCkfmFLL/ATxe0 K8PkhahyiBJwdpTuJqEvD+bLLGEI+bzeTkmGh24Zotd222GcExLUYgxd9zRTl+UBelej clMLDJLBGi2YworI/1V5ECosVo5/2CoHumuYV4KMbSru2Zfs3KciFFLw1U8P6qIb+700 HAvAzN3y2tM1uuD7qK+/mTZ6bf9IToQpWr+sirILq8fqTy8yGt6GNdSe8QNChaGlExCx 32vA== 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=Mw6ldDIPHpBoRiawt77fVDG0nsr8XAXcGyvERLsKDMI=; b=C9E3DBrHuz8H0aobb/JGDZPwB16kF6lzbZbE+ZsTZRmaLIC0rvt/kL/Gsz79F03/3F J0fCQsQAn79V6cTh5kzH0M5eF4jHSl/vI0D+e1WzFDUqc79hTiN8xCQPFDBw7N3xnACx tXC/XPttUTVx94UZyLbR2Ll1gzTlDrVpAKFj7SGhPOHxmqO5xoDVOvwgizsdYH07pz1z 89ylS8h5ywt9QayMf6U9UEtrYOS/WZIPWKb/Ln3Sr6G0QuPUZcjHwhFOfGmJ2HYhKkS0 KNJzd1ayQWcsIVb5xFf++hIOftZL+DOOBSuLf0wQ52FDV7i21deyzaFT3Kr2DC/f8I+R Egkg== X-Gm-Message-State: AOAM530tTDmH2gWRnsgl93i+WReJ6391B/ljQBcKvzHEru53ftk6LF1d XBMufYyQBb+UrvzDv0NLq8I= X-Google-Smtp-Source: ABdhPJyIx+qTiJArsI17Ha4K46SPsv9hT71NBkwO40EDIk2uD2lO4V5LCEvO156XrnhIQSawajuD8Q== X-Received: by 2002:a05:6402:d:: with SMTP id d13mr22982687edu.274.1613505399220; Tue, 16 Feb 2021 11:56:39 -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 rh22sm963332ejb.105.2021.02.16.11.56.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 11:56:38 -0800 (PST) From: Ansuel Smith To: Richard Weinberger Subject: [PATCH 2/3] mtd: core: add nvmem-partitions compatible to parse mtd as nvmem cells Date: Tue, 16 Feb 2021 20:56:10 +0100 Message-Id: <20210216195618.27959-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210216195618.27959-1-ansuelsmth@gmail.com> References: <20210216195618.27959-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_145640_587560_E279D03C X-CRM114-Status: GOOD ( 14.32 ) 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:529 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 Reported-by: kernel test robot --- drivers/mtd/mtdcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 2d6423d89a17..2a40b00ec3d0 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -543,7 +543,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 19:56:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1441101 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=g4D9A7yl; 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=P829sFMk; 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 4DgBbH04nXz9sCD for ; Wed, 17 Feb 2021 06:57:47 +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=g4D9A7ylBW0GTnrXEla86F1ap pD3QySQW9ZoqBzLYrTRsuv4HB1nsAhLFOpK72yJXzXor0/syqjUQDgSb3HmVMklnn6SKH2drVc2Ij KudxoIo5d2KxfSn0QmTSfsz+mfTFfFyd4vJuSQ58qDJmQBVJCQ8hvlONnfNQtJPzkPrGmakziQCp+ K5Lxo06qm/4JQv75Bfo4jHwa+b+6L0zeJ5G9M2J7+aWLHZHeO9nBJvxIoKydxjKL3s6Rw2V+rthaw BJEWcOtodhprNqEFWvsgcV31ggKMzoHJikTqDojdRPWTBnRdCFfF+ettJVph0vaL7knj/7+PNrk2j fT3Ct39dA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC6Sq-0006Ym-A9; Tue, 16 Feb 2021 19:56:52 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1lC6Sl-0006Y0-Tw for linux-mtd@lists.infradead.org; Tue, 16 Feb 2021 19:56:49 +0000 Received: by mail-ed1-x52f.google.com with SMTP id v9so9408507edw.8 for ; Tue, 16 Feb 2021 11:56:47 -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=P829sFMk/HWVFCWbkQIJU/89lQDZeC45HCHpcn9LsGhhvULh0Rc8y5ABYl2SNV1+c+ v1DyM6QoHi4WKWeTdxZDhcipCVlUrUt5PLqwc9Iq/ZsWOTNLL3GuAdXw4Yxe/fiQIKZ5 MpRAQpj66M2vXLc5FrNEYppq+8Pgdr+JtQsID7fVfQqTRDkAfOifeU5gH7ViTt5FRk3o PINFRppuVBcSVy6xTiTgfTESUakptpbgK4x+Fq/ggWFawDmpqkMQDohBfuGuPXtDhtxI t+g+HQwu0/F5odB0Mkj7T1abe8Go2xl+84IIRqtrOUzZ15YzlbB5kGvs9csejtNAx17r es9A== 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=tXCT1uorCl3scLRSq49T0n7en2GJQpfXGYr3Q2XEiHL6eACKOOKY4qz049OccoxutE MXwyYE2q87yOjpyI5bBF8FY6p0/Jhwhki8lcL5ynrJ17mkiadSB7fC8X3OaDcIAsKDVK TOby8o07Gtxevjf8GWV+8/u2hLWO6cMRWACoff3obDtT1MeHzxZmGkWRu80z0kGLFjD2 DkX2Ye0fvgN2D5xlkqaW2pTxb/0ehjWOfQOnRUhagRxP6cl4YzrDnmumxTY/MWdBl6Oj 8C3V8i7MWROapZsflupCyDpKH67pyxuebUcsxcaL/q4xySK9ZvAadD4jEZHitofzj+OZ HGbw== X-Gm-Message-State: AOAM532cGTTwLvjAqPtZ7gu9bVljQ5crcP1UB/12Ml0SqML5aabfg+RS xT/ryoOPuAsYIAOt+caz6jM= X-Google-Smtp-Source: ABdhPJxSU1ROjWCus6NqmtJLmIujUXHamSni+RhVcPcKr6gQPFjIzIAsjejgqQwMC97UpYq4eB/bwg== X-Received: by 2002:a05:6402:3494:: with SMTP id v20mr23442045edc.146.1613505406562; Tue, 16 Feb 2021 11:56:46 -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 rh22sm963332ejb.105.2021.02.16.11.56.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Feb 2021 11:56:46 -0800 (PST) From: Ansuel Smith To: Richard Weinberger Subject: [PATCH 3/3] dt-bindings: mtd: Document use of nvmem-partitions compatible Date: Tue, 16 Feb 2021 20:56:11 +0100 Message-Id: <20210216195618.27959-4-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210216195618.27959-1-ansuelsmth@gmail.com> References: <20210216195618.27959-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_145647_999455_A0F025EA X-CRM114-Status: GOOD ( 15.35 ) 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:52f 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>; + }; + }; + };