From patchwork Sat Mar 24 23:24:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alban X-Patchwork-Id: 890740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mHy/I7eM"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.b="lU5sjTG6"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 408YMq6JX9z9ryk for ; Mon, 26 Mar 2018 10:27:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To: References:List-Owner; bh=S49a82rd8vOFOmHcjLPx1huQJoMg7Hzdk/yDQ0iBClU=; b=mHy /I7eMvg1Mb2fmgFvYPIBZsFJD5txNSf3p1ejj0uqa45uzIVFDkaomE1g7uvwgNEOsCkwOAPQ2wXhc DNFPAwD9Khzql1V2nJoZysqojAWZwQsZcaRZQ27Lx+cWO5AQzyn+IKheBUTRXPvC0wUDjqIUi7uNn KrGEBQGkzfy92H5LXeLTikRYN2twBXjODgOSGRplAmbCXz6gCl8n2WlpMUnDWpe4c7Mdgy0YI/wKo 27h0IQjTPUcO5WAnYTWX1QDRt2cOuBnQRiD+il3fYgTytFtIcxb4DiyZ1t9sPqLZS3g5gI/p79v+c d7W2l5FBJ/sFHZIBjLYOM445PNnoReg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0F2g-0006sV-MZ; Sun, 25 Mar 2018 23:27:14 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0En4-0006ba-Df for linux-mtd@bombadil.infradead.org; Sun, 25 Mar 2018 23:11:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vS6I2mrYQ0hG3PJyftJXBRl4e/8k8AA7WCGfFRZqYBA=; b=lU5sjTG6lyZwJMdBaeU07AONZ Ye+irV1hGZ57UIlFhlGeOowyCQI5s4zeDD5EJym69fB1ERMja5SSA+oEeM17zfnIj/od1MoPQ8bk6 sPq8VvV9Btb/qyHVRqf62Vhy223CQ4an5jsBea/OsoiJi7Hfkb3HuaHiEvI7fxs86cPzYs/cNx6kU bk61M27XXXgQ1f0/eFG/pzW7Y6kggqVBP1gYxL+Tkimi8ZfmiY5W/JdLfCRvNFxDIGnAdpDXZ5ajk fk2CJhM0gJlIOM8jiJhF/LTpNnae99K3q/0UjOBcZF67ZheaTLtDjnokqM+980qhHLjyQZoXhtwyi nrdkHfVZw==; Received: from smtp4-g21.free.fr ([212.27.42.4]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ezsYb-0004iE-I3 for linux-mtd@lists.infradead.org; Sat, 24 Mar 2018 23:26:42 +0000 Received: from tock.home (unknown [IPv6:2a02:8108:4740:3978:85fa:b641:9ec1:a586]) (Authenticated sender: albeu) by smtp4-g21.free.fr (Postfix) with ESMTPA id 0728819F574; Sun, 25 Mar 2018 00:25:16 +0100 (CET) From: Alban Bedel To: linux-kernel@vger.kernel.org Subject: [PATCH v3 0/3] mtd: Add support for reading MTD devices via the nvmem API Date: Sun, 25 Mar 2018 00:24:56 +0100 Message-Id: <1521933899-362-1-git-send-email-albeu@free.fr> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180324_192641_739002_F7F2D2E1 X-CRM114-Status: GOOD ( 12.93 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.1 on merlin.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [212.27.42.4 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [212.27.42.4 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (albeu[at]free.fr) -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Boris Brezillon , devicetree@vger.kernel.org, Richard Weinberger , Marek Vasut , Rob Herring , Srinivas Kandagatla , linux-mtd@lists.infradead.org, Cyrille Pitchen , Alban Bedel , Brian Norris , David Woodhouse MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Hi all, this series add support for reading MTD devices via the nvmem API, this is mostly needed on embedded devices where things like MAC address and calibration data is often stored in a partition on the main flash device. Adding support for the nvmem API to the MTD core is trivial, however there is a clash in the OF binding used by both subsystems. The current nvmem binding expect nvmem cell to be subnode of the nvmem device, without any compatible string. But MTD devices used a similar scheme for partition in the past, so a subnode from an MTD device could be a partition using the old binding or an nvmem cell. To avoid this problem we update the nvmem cell binding to use a 'nvmem-cells' subnode with compatible string to hold the list of nvmem cells. This new binding make sure that any kind of device can be used as nvmem provider. Alban Bedel (3): nvmem: Update the OF binding to use a subnode for the cells list doc: bindings: Add bindings documentation for mtd nvmem mtd: Add support for reading MTD devices via the nvmem API .../devicetree/bindings/nvmem/mtd-nvmem.txt | 27 ++++++++++ Documentation/devicetree/bindings/nvmem/nvmem.txt | 55 +++++++++++++------- drivers/mtd/Kconfig | 1 + drivers/mtd/mtdcore.c | 59 ++++++++++++++++++++++ drivers/nvmem/core.c | 10 ++++ include/linux/mtd/mtd.h | 2 + 6 files changed, 137 insertions(+), 17 deletions(-) create mode 100644 Documentation/devicetree/bindings/nvmem/mtd-nvmem.txt