Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3648671pxf; Mon, 22 Mar 2021 11:22:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1Q95j4airJsEQOWwyLH0guxr1rK8fPndbc8r4kLfQUx2hjoNM9G4uL6xdicJwAFlQD+/9 X-Received: by 2002:a17:906:f01:: with SMTP id z1mr1118888eji.235.1616437378944; Mon, 22 Mar 2021 11:22:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616437378; cv=none; d=google.com; s=arc-20160816; b=wjQxY6bOj8MfRTLEycrf05vaosJQsny0MtUxeH5LTSfsbdYho1pHwL53GCaOwfAkdV HsuBLMjaxxOEnE0c5MLXaauAqr8tn534Xti9GqUZ9Yh7EK77TCNTH+jACxF26V4dBIYC k5bYYmC8uL9l9faHVgwiJlmwU+Ntdr73t09gscLTtaxN/ccEHB0U+qnH3YZTSgGnSmmZ YubGy4YKUAW32PuMMP2TgqNUIx7B8BHBSEYg7J1d43p//WwD9tpaSbrQ4E9vMQLhP7Yk xXTTWL3IVCm/kJN7FGbjH6OMnXNDASA2hAFX9e//Y+n0owRe2ia0FMb3MEfiDuUFYBV2 /9Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SxpId9qwMWCyRo+nBXdhG1wstwEIVslF9/SHxhhLN5s=; b=x7nyrdIv6jHxCwgbLfsKnChYPxH0FmSoxdKjP1gqIDsPy6r7y9J8KgKVnpxKQsabCG 3eyd16WV/ieaBlAqw3uGsmi5F6meeLwh+wovPkjgjZgBqkqxFj7UHuG/I+NJ0lwkkSCl BLyt/R/137Nukb/X0WAiIWy3zjvagjrb7B2aEk/dnObF9c6gGHvrrI7RWP+/ks+rGG+O MNBzO3QrsXdmPm+JZZ+oT62qRHi1xyXRfkd/t4BHjcpQsuR+CfoDjW3SF+VxJmMd5QYt xIrmfG962hWNJN0rc7E9ovg3DOLqQYilVC9/Z+n4mFe6ne9od+niC6p2x9A8YFQkIHWr PVyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=KWo0c2fi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l17si11415702eda.91.2021.03.22.11.22.35; Mon, 22 Mar 2021 11:22:58 -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=@walle.cc header.s=mail2016061301 header.b=KWo0c2fi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231617AbhCVSUR (ORCPT + 99 others); Mon, 22 Mar 2021 14:20:17 -0400 Received: from ssl.serverraum.org ([176.9.125.105]:39321 "EHLO ssl.serverraum.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231334AbhCVSUH (ORCPT ); Mon, 22 Mar 2021 14:20:07 -0400 Received: from mwalle01.fritz.box (unknown [IPv6:2a02:810c:c200:2e91:fa59:71ff:fe9b:b851]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 3347122235; Mon, 22 Mar 2021 19:19:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1616437203; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SxpId9qwMWCyRo+nBXdhG1wstwEIVslF9/SHxhhLN5s=; b=KWo0c2fipzhzAxOznyiMV3nndYf9T5pqY15N4oPf5BKWqv3AUM9i/+/bQ2PfJirbqak137 gxfK2iQ8CBKDA/w81/XJ6cDmO94ifsGuZ2Ip7eEc8AzZ7qqYTE9aRL1A3jscTjRU+4WaNV ZNot83yCr9OMiYMJcJ0LgiQg9tW9vsQ= From: Michael Walle To: linux-mtd@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Rob Herring , Srinivas Kandagatla , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= , Michael Walle Subject: [RFC PATCH 0/4] mtd: core: OTP nvmem provider support Date: Mon, 22 Mar 2021 19:19:45 +0100 Message-Id: <20210322181949.2805-1-michael@walle.cc> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam: Yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The goal is to fetch a (base) MAC address from the OTP region of a SPI NOR flash. This is the first part, where I try to add the nvmem provider support to the MTD core. I'm not sure about the device tree bindings. Consider the following two variants: (1) flash@0 { .. otp { compatible = "mtd-user-otp"; #address-cells = <1>; #size-cells = <1>; serial-number@0 { reg = <0x0 0x8>; }; }; }; (2) flash@0 { .. otp { compatible = "mtd-user-otp"; #address-cells = <1>; #size-cells = <1>; some-useful-name { compatible = "nvmem-cells"; serial-number@0 { reg = <0x0 0x8>; }; }; }; }; Both bindings use a subnode "opt[-N]". We cannot have the nvmem cells as children to the flash node because of the legacy partition binding. (1) seems to be the form which is used almost everywhere in the kernel. That is, the nvmem cells are just children of the parent node. (2) seem to be more natural, because there might also be other properties inside the otp subnode and might be more future-proof. At the moment this patch implements (1). Michael Walle (4): nvmem: core: allow specifying of_node dt-bindings: mtd: add YAML schema for the generic MTD bindings dt-bindings: mtd: add OTP bindings mtd: core: add OTP nvmem provider support .../devicetree/bindings/mtd/common.txt | 16 +- .../devicetree/bindings/mtd/mtd.yaml | 110 +++++++++++++ drivers/mtd/mtdcore.c | 149 ++++++++++++++++++ drivers/nvmem/core.c | 4 +- include/linux/mtd/mtd.h | 2 + include/linux/nvmem-provider.h | 2 + 6 files changed, 267 insertions(+), 16 deletions(-) create mode 100644 Documentation/devicetree/bindings/mtd/mtd.yaml -- 2.20.1