Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp2063087pxy; Sat, 24 Apr 2021 04:09:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAcY8JDX6VkpYm9qU1NbXqiW1mBGLxyk688rAdflad1NoaheWaOpml3vRWNdzp8yGKmU/I X-Received: by 2002:a62:3486:0:b029:24c:34c0:3c7a with SMTP id b128-20020a6234860000b029024c34c03c7amr8035043pfa.36.1619262560327; Sat, 24 Apr 2021 04:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619262560; cv=none; d=google.com; s=arc-20160816; b=Ks7c/zKeUq6CxDQ97GTTeyGNtFczRQee4ImUVHbF+XMhQ5tyL0Ck/JwRyEWwA1AY4h oOataFHzfDlqtv75yGDJUGcAfvaBQQIwbOezeGnryQCn7f9PHYkW3N4X8gyBoOdiKmym +1DnBMyOmfB2EySv2T+q0hyBGNsj4FO4dBM09ukGZHj1CUH1luRw8F4Wtempxn0i2W7A cEVkEkdLxMgIEYw/mH43LJDGoOY55oZ/Zz7S4WMChgwQMKDfKKSs4t5yHtqWKZ2RQ5KP BwFKfKHzQ3+IHIilirXSBI7G9hSMmGc5e+I+7wcEBMrtL/pUd1ZWHcdTefcRv8Re/Pt2 DP0g== 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=rZ+I/irwn/OCLHsOVLfWBRlbXKmaiZIgFDgdHK7w49o=; b=m/DKkOCmoBcDagrJ9G+rJdEFWE+DgMiWgAUGV7ME31F95tZMRPD+Doqr37qTFxB11I LE6l8t7CTKHiLE1QGoKMaW2DAHLq+A0B0Sk9+KMxvH0g+xi7bqeEHbfIJXy41Sr66NF7 +kF3Ut+5mS7xBE6TwZQDLP/TpbhbFF/Ua2nGSBCBv/TmgDL6oMUQgwI39zQHVUGLwAxN 0i5Ua1kdq0HvV2jh56pL3xZeWIMnUCYNobU9G5eFBhlq/29xpAAg161ysFl0++fOSXPH A2OTvm5PMXSREQyaownfuqEmAUQqOHa6Pd1qLEE7J46kRAiUETuXLLJ/6J6bHOaF/La6 SM3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=L5cygG4p; 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 v11si11643835pfu.140.2021.04.24.04.09.07; Sat, 24 Apr 2021 04:09:20 -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=L5cygG4p; 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 S233846AbhDXLHT (ORCPT + 99 others); Sat, 24 Apr 2021 07:07:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231490AbhDXLHA (ORCPT ); Sat, 24 Apr 2021 07:07:00 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [IPv6:2a01:4f8:151:8464::1:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9657CC061574; Sat, 24 Apr 2021 04:06:18 -0700 (PDT) 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 0643E22178; Sat, 24 Apr 2021 13:06:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1619262374; 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=rZ+I/irwn/OCLHsOVLfWBRlbXKmaiZIgFDgdHK7w49o=; b=L5cygG4pEtkeFYLpTrmrNvYR3aHBmh1s1LeMsNhWANf6DBnBI4oR2YjGXrIJbWGWoXEjS+ sZsKhOulWcjWS0gjxcnaBJCxqB5qiHQ6p3efyTkiYzdT1phHLqTPaDCchGkqjWZx3xpyIO xjC7LgylUEOK/dzyZHg0Jgu8kYLGZWc= 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 , Michael Walle Subject: [PATCH v2 0/5] mtd: core: OTP nvmem provider support Date: Sat, 24 Apr 2021 13:06:03 +0200 Message-Id: <20210424110608.15748-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 Some flashes provide one (or more) OTP regions which can be used to store MAC addresses or serial numbers. Implement a NVMEM provider for this storage which then can be used by a network card to fetch the MAC adress for example. This is an example DT node: flash@0 { otp { compatible = "user-otp"; #address-cells = <1>; #size-cells = <1>; serial-number@0 { reg = <0x0 0x8>; }; }; }; Michael Walle (5): nvmem: core: allow specifying of_node dt-bindings: mtd: add YAML schema for the generic MTD bindings dt-bindings: mtd: add OTP bindings dt-bindings: mtd: spi-nor: add otp property mtd: core: add OTP nvmem provider support .../devicetree/bindings/mtd/common.txt | 16 +- .../bindings/mtd/jedec,spi-nor.yaml | 6 + .../devicetree/bindings/mtd/mtd.yaml | 89 +++++++++++ drivers/mtd/mtdcore.c | 148 ++++++++++++++++++ drivers/nvmem/core.c | 4 +- include/linux/mtd/mtd.h | 2 + include/linux/nvmem-provider.h | 2 + 7 files changed, 251 insertions(+), 16 deletions(-) create mode 100644 Documentation/devicetree/bindings/mtd/mtd.yaml -- 2.20.1