From patchwork Thu Mar 11 05:12:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 399033 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=-14.2 required=3.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 CDE5DC433DB for ; Thu, 11 Mar 2021 12:20:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8801B64FE8 for ; Thu, 11 Mar 2021 12:20:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233046AbhCKMTx (ORCPT ); Thu, 11 Mar 2021 07:19:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232954AbhCKMTr (ORCPT ); Thu, 11 Mar 2021 07:19:47 -0500 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B10AC061574; Thu, 11 Mar 2021 04:19:47 -0800 (PST) Received: by mail-ed1-x535.google.com with SMTP id o19so2438572edc.3; Thu, 11 Mar 2021 04:19: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:mime-version :content-transfer-encoding; bh=AIJvF8THgvNIIJY7o0rd8q2CMHcgDSy7Mtu5dW42sFA=; b=A19s8+jcTYLYpRsTm88vI1YTqVcVLHEihep/7ZY6UKdqCHWbLvtkAlSJH+ioQtAGT3 kMC0ktX5vY5B9g/NbCbtFtostd/bOd9CNm2niBhWsLdZVVchgJsCRjjQVIz/Ns7t9lOA 1EwZCUL6g9JBywi5pfxET3aZRozHxgndsfPi5RPH1oENyXJNo8F3RNooDluSJdYbq/L/ XnsIiFPDIBmP/Vd3CaZgpaBALxGBNcbU/xlvhG13bJaLC895HqtDVGgm3LkJoEKNZ1GP BMrMERCqSiEvoR0+gtEVhhPkT7KwU2Eg3Dr7YIS8NoLmZfu+u45bKCgKpOgXOHJo0BLz E19Q== 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:mime-version :content-transfer-encoding; bh=AIJvF8THgvNIIJY7o0rd8q2CMHcgDSy7Mtu5dW42sFA=; b=A1yd58UDVMqSRMQvDCEzpMJE5e0Pau1Ac4tqqxNC8LRCiOLLju3xCVZyKIHg3Pa1Un KwSJqcFfPGWMk0PvpfY+xcz44j5uIcS2Bf6YxMwZ755+KIpGwOXpv0IlfRLD+Xfv9Qe4 20PTs0o1TJJ86Xlsv5KBrAJHVMeQwxySSW1a2jTEmmyq7cKnCqAvRGhZs+Vq19tndduc GrTdwfi6rRfDHQ6y/ebvaqhSl6SrZPTR7fNlHm2l2P3E+oMIILrbnLfpBcSSwIReeX+q YuRWuWWs+Y43/jXg7c+x4SsjxfjJePREUHVVK5sYBbzum13ry0QsjUjMUL7Pzn8GvC8K OAmQ== X-Gm-Message-State: AOAM5326BHR9l/CQYtMgKGeq2n218NhOZaYNK/fRqO3FLmZHPCqfMMy6 lvvo1DaxlEWoBJj/n8zlCa8= X-Google-Smtp-Source: ABdhPJwhxUYujpvYF+ZFXc/c5AA8Ze9yPl1neq05v/Fn2/yyq/4oZ00TbhKSx6vBEzMJaZG9V9Jg0g== X-Received: by 2002:aa7:c9c8:: with SMTP id i8mr8096195edt.193.1615465185761; Thu, 11 Mar 2021 04:19:45 -0800 (PST) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id c7sm1273748edk.50.2021.03.11.04.19.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 04:19:45 -0800 (PST) From: Ansuel Smith To: Rob Herring Cc: Ansuel Smith , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Srinivas Kandagatla , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 1/3] mtd: core: add nvmem-cells compatible to parse mtd as nvmem cells Date: Thu, 11 Mar 2021 06:12:47 +0100 Message-Id: <20210311051309.16789-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Partitions that contains the nvmem-cells compatible will register their direct subonodes as nvmem cells and the node will be treated as a nvmem provider. Signed-off-by: Ansuel Smith --- 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..ac1b4f176a17 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-cells"); config.priv = mtd; mtd->nvmem = nvmem_register(&config); From patchwork Thu Mar 11 05:12:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 399032 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=-14.2 required=3.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 0160DC433E6 for ; Thu, 11 Mar 2021 12:20:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B672F64FF2 for ; Thu, 11 Mar 2021 12:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233033AbhCKMUZ (ORCPT ); Thu, 11 Mar 2021 07:20:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233054AbhCKMTy (ORCPT ); Thu, 11 Mar 2021 07:19:54 -0500 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 937C6C061574; Thu, 11 Mar 2021 04:19:53 -0800 (PST) Received: by mail-ej1-x62b.google.com with SMTP id mj10so45777477ejb.5; Thu, 11 Mar 2021 04:19:53 -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=n5Nl3CoPrKUbvXcQoRdyX4Oe5Nctcc661QmqCsoFZxk=; b=W9/2O2W2Nzf/YibnD9+XfwhqgdaREhr9zRG72Y3zAUhUEh6lP1D9U+PYb8DNmuS0G3 MYopY8QagwqMioK+oK3KXWjQnkY1q88kifVpq8RiM3t2gMI4JpeP/tAnybHUrrl8sspq Q5kUNkJhzMl4ZNPXwBTm42CRxUnhQGG+gEGeInvNNgw1Ic4zF+YGM4IY2OwlPyzYPmhi I+SIEQ84HvuaPJgcIHq1Dt9d6WIam0X3OG0HjRVMLb0JXbVFgwOn6TNYf2RwnoOWYwHZ +/tgI9g/BIU2JT4bBzrsvzbf3FSOwEF/dY2MN32hwPRW1pZK/WBYYYg5rCRkjN6ix0uu rfnw== 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=n5Nl3CoPrKUbvXcQoRdyX4Oe5Nctcc661QmqCsoFZxk=; b=b1pVc5WKQdMuA6uXE8/p0uawCx0zE8MFRpYxgqjCplbu75RjwOiV0nP3SAQuPG1Awc 9snGHoKZZKMcGM1BAfa096MoiRNVCQ7e8Dgna9CEssS1Q5gTL57ahTAITPIAQeLfZgRm exmWL7Oy7ylMru/+KipEMFUc7jS5jI4Z/J59K2ZywqC7H0sa8nVc82++MRaUYY/lpW1K 5x9NIe50FkQFx9Y0Sad2/lIQ/R/Z/nADyi17wLgQwxbR0zFBuCR2r+10/lIyZa1Uh837 pLscMB4cVEjKpTGGLWVIPFpTSuqfop1wtqkDyz1Kt6UAIu27fVSnAAjI4mPlozSVMqT5 yvrA== X-Gm-Message-State: AOAM533lcFxhxPBjZPf4uyoLoAyrgbBDEHWg2gB003n9UeLmrv0QF0Pd Q8cgWn9eYzbak0wANRzRxBU= X-Google-Smtp-Source: ABdhPJyNq7Hxm7thpemDAQbUMAcjYcqqmdPmwbm22NHsax+E614rEyqGn+G9L+erfG40fdN/jF21tQ== X-Received: by 2002:a17:907:7684:: with SMTP id jv4mr2876710ejc.231.1615465192231; Thu, 11 Mar 2021 04:19:52 -0800 (PST) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id c7sm1273748edk.50.2021.03.11.04.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 04:19:51 -0800 (PST) From: Ansuel Smith To: Rob Herring Cc: Ansuel Smith , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Srinivas Kandagatla , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 2/3] dt-bindings: mtd: Document use of nvmem-cells compatible Date: Thu, 11 Mar 2021 06:12:48 +0100 Message-Id: <20210311051309.16789-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210311051309.16789-1-ansuelsmth@gmail.com> References: <20210311051309.16789-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Document nvmem-cells compatible used to treat mtd partitions as a nvmem provider. Signed-off-by: Ansuel Smith --- .../bindings/mtd/partitions/nvmem-cells.yaml | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Documentation/devicetree/bindings/mtd/partitions/nvmem-cells.yaml diff --git a/Documentation/devicetree/bindings/mtd/partitions/nvmem-cells.yaml b/Documentation/devicetree/bindings/mtd/partitions/nvmem-cells.yaml new file mode 100644 index 000000000000..b53faf87d4e4 --- /dev/null +++ b/Documentation/devicetree/bindings/mtd/partitions/nvmem-cells.yaml @@ -0,0 +1,99 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mtd/partitions/nvmem-cells.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Nvmem cells + +description: | + Any partition containing the compatible "nvmem-cells" will register as a + nvmem provider. + Each direct subnodes represents a nvmem cell following the nvmem binding. + Nvmem binding to declare nvmem-cells can be found in: + Documentation/devicetree/bindings/nvmem/nvmem.yaml + +maintainers: + - Ansuel Smith + +allOf: + - $ref: "../../nvmem/nvmem.yaml#" + +properties: + compatible: + const: nvmem-cells + +required: + - compatible + +additionalProperties: true + +examples: + - | + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + /* ... */ + + }; + art: art@1200000 { + compatible = "nvmem-cells"; + 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-cells"; + 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>; + }; + }; + }; From patchwork Thu Mar 11 05:12:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 397783 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=-14.2 required=3.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT 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 CD840C433DB for ; Thu, 11 Mar 2021 12:20:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8DD7964FEC for ; Thu, 11 Mar 2021 12:20:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232714AbhCKMUZ (ORCPT ); Thu, 11 Mar 2021 07:20:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233114AbhCKMT7 (ORCPT ); Thu, 11 Mar 2021 07:19:59 -0500 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E917C061574; Thu, 11 Mar 2021 04:19:59 -0800 (PST) Received: by mail-ed1-x52a.google.com with SMTP id w18so2430519edc.0; Thu, 11 Mar 2021 04:19:59 -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=0SX53bYeJpoRn/Rj8EJYnn/yWlrMIeX4TZ6gWcrZofc=; b=fgeawZzrBbCGdcAcelur+0SABygA5M29pxOKik9PqPGuRJeYG3++RrM99cKN5ZnBCY 8DUtgcoZKtjVyhYq51WBmsH2MM6T88TtXF7uE/eLQtQZ8zZoBw4dhlbRcFN6BtbufYD2 YOXx7v+TJ3oHBCfX3rlbT6cboH9c6o+zbPztZPAOx6mXp1sd9lcIckkncy7PN23JlPnh QCkca64+f1dHVVeVDhFK7asr7p00Oqz7EZjcl6HF9N9tznb6zLLajtcdwtXICybDYvoR Bq/X6AvxvApOldH7ABXtX1EjPHdgkozhlDYqBWQM9gVxSDj5FSHIlLQgWOuqS6QcqsgX E4KA== 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=0SX53bYeJpoRn/Rj8EJYnn/yWlrMIeX4TZ6gWcrZofc=; b=IOAdaiz8+fLcn5lkF2ecetk9/N7z+CHxgU4VnM4jUsR/hGQIp9uQyvtPkY0sJL1JAO 396SqKkRSlgPgtLVnft8EtXmcEDro9NEqzVdHuRyVCEEw1hwq93evg7GgqF28mkRQ4pR fuWNgfY11PN0IYCcR1ZJICEzdZx0u/kwmChV6bEvxRacRLHtjzHDvWGbCc2l1NYH6oMQ Bh1lCy+jnnWanjX5sPUh4ohTxgvE5vsjQFObvNduFfETfjH4kqZHCylN+9zxwn+xiI73 RkMqeWS+JXFVEZpKT85Dmk9XAWbUtRHvb10mDYn3n1crWNKmfu3FPEa5GTz+1eCr4f1B ZnCg== X-Gm-Message-State: AOAM5333LNbpArYFquMW7dBV2XXuI+0BIHvHAYdWWRHTvtoyxugIQcjb k8vSLWKEtzbWR2psT2lYeTk= X-Google-Smtp-Source: ABdhPJy/LAguhBAHOubln+kVzUm2XTYYb3+YQBi4JS/9M4gqAYnf0B1QXYHEUFxzxcAIn5nHuVYfrA== X-Received: by 2002:a50:f113:: with SMTP id w19mr8114112edl.226.1615465198235; Thu, 11 Mar 2021 04:19:58 -0800 (PST) Received: from Ansuel-xps.localdomain (93-35-189-2.ip56.fastwebnet.it. [93.35.189.2]) by smtp.googlemail.com with ESMTPSA id c7sm1273748edk.50.2021.03.11.04.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 04:19:57 -0800 (PST) From: Ansuel Smith To: Rob Herring Cc: Ansuel Smith , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Srinivas Kandagatla , linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v5 3/3] devicetree: nvmem: nvmem: drop $nodename restriction Date: Thu, 11 Mar 2021 06:12:49 +0100 Message-Id: <20210311051309.16789-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210311051309.16789-1-ansuelsmth@gmail.com> References: <20210311051309.16789-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Drop $nodename restriction as now mtd partition can also be used as nvmem provider. Signed-off-by: Ansuel Smith --- Documentation/devicetree/bindings/nvmem/nvmem.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.yaml b/Documentation/devicetree/bindings/nvmem/nvmem.yaml index 7481a9e48f19..b8dc3d2b6e92 100644 --- a/Documentation/devicetree/bindings/nvmem/nvmem.yaml +++ b/Documentation/devicetree/bindings/nvmem/nvmem.yaml @@ -20,9 +20,6 @@ description: | storage device. properties: - $nodename: - pattern: "^(eeprom|efuse|nvram)(@.*|-[0-9a-f])*$" - "#address-cells": const: 1