From patchwork Fri Jul 10 09:45:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 6764321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C32F8C05AC for ; Fri, 10 Jul 2015 09:47:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7D7F20619 for ; Fri, 10 Jul 2015 09:47:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CEE86206DD for ; Fri, 10 Jul 2015 09:47:37 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZDUsN-0007i9-5b; Fri, 10 Jul 2015 09:45:47 +0000 Received: from mail-wg0-f47.google.com ([74.125.82.47]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZDUsF-0007JX-6N for linux-arm-kernel@lists.infradead.org; Fri, 10 Jul 2015 09:45:40 +0000 Received: by wgjx7 with SMTP id x7so244480061wgj.2 for ; Fri, 10 Jul 2015 02:45:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Ec3+03spCBu3umOnDbu48JUBuglg/hvjeRVy56kIT2g=; b=Mqbo1YKSFfs92Ro2MVGO9+5gGzzIQ3lZV9r1bEyxk2uoHJC51hQtHoeCX54PLbaqPf EvrK/sqc0AWiomAxgRZBKUvv0j6gi2EXCO++Bks2AEMXcrNbXbZ7AsP4pc31I/6A4jGE PzxQUt4cQlW9PLEViujuT3EiHINq9JESBx64f91k05GRb5c7l31+rdr6vp+RL2GbtzQa j8PQyxyFgMeTJJPIAgGUiP51rdL7F1CfoGspCN2+B4vw29/MIQBTjtZN5yQ9Z+VQB3Wm vIDG09suMN9hRBNz0+G0j/Ojep1Cb8KWIWFuQJyQaZ5qEAqczT9JprJU8aE/BshnPwlr T/1Q== X-Gm-Message-State: ALoCoQmfjfOd96vbAuUsTq0bTAlnrcrF3tNjNrWSYaHCJAw35fjkEB0F+5Z5Od9N1awA8hTI2kdP X-Received: by 10.194.109.36 with SMTP id hp4mr40939258wjb.4.1436521517603; Fri, 10 Jul 2015 02:45:17 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-89-242-231-79.as13285.net. [89.242.231.79]) by smtp.gmail.com with ESMTPSA id jz4sm12779109wjb.16.2015.07.10.02.45.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Jul 2015 02:45:16 -0700 (PDT) From: Srinivas Kandagatla To: linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman Subject: [PATCH v7 4/9] nvmem: Add bindings for simple nvmem framework Date: Fri, 10 Jul 2015 10:45:13 +0100 Message-Id: <1436521513-10838-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1436521427-10568-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1436521427-10568-1-git-send-email-srinivas.kandagatla@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150710_024539_393192_4D678DD9 X-CRM114-Status: GOOD ( 16.72 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: stefan.wahren@i2se.com, devicetree@vger.kernel.org, arnd@arndb.de, linux-api@vger.kernel.org, s.hauer@pengutronix.de, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, Rob Herring , pantelis.antoniou@konsulko.com, Mark Brown , Srinivas Kandagatla , Kumar Gala , mporter@konsulko.com, Maxime Ripard , linux-arm-msm@vger.kernel.org, wxt@rock-chips.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds bindings for simple nvmem framework which allows nvmem consumers to talk to nvmem providers to get access to nvmem cell data. Signed-off-by: Maxime Ripard [Maxime Ripard: intial version of eeprom framework] Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/nvmem/nvmem.txt | 85 +++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Documentation/devicetree/bindings/nvmem/nvmem.txt diff --git a/Documentation/devicetree/bindings/nvmem/nvmem.txt b/Documentation/devicetree/bindings/nvmem/nvmem.txt new file mode 100644 index 0000000..849f1e1 --- /dev/null +++ b/Documentation/devicetree/bindings/nvmem/nvmem.txt @@ -0,0 +1,85 @@ += NVMEM(Non Volatile Memory) Data Device Tree Bindings = + +This binding is intended to represent the location of hardware +configuration data stored in NVMEMs like eeprom, efuses and so on. + +On a significant proportion of boards, the manufacturer has stored +some data on NVMEM, for the OS to be able to retrieve these information +and act upon it. Obviously, the OS has to know about where to retrieve +these data from, and where they are stored on the storage device. + +This document is here to document this. + += Data providers = +Contains bindings specific to provider drivers and data cells as children +of this node. + +Optional properties: + read-only: Mark the provider as read only. + += Data cells = +These are the child nodes of the provider which contain data cell +information like offset and size in nvmem provider. + +Required properties: +reg: specifies the offset in byte within that storage device, start bit + in the byte and the length in bytes of the data we care about. + There could be more than one offset-length pairs in this property. + +Optional properties: + +bit-offset: specifies the offset in bit within the address range specified + by reg property. Can take values from 0-7. +nbits: specifies number of bits this cell occupies starting from bit-offset. + +For example: + + /* Provider */ + qfprom: qfprom@00700000 { + ... + + /* Data cells */ + tsens_calibration: calib@404 { + reg = <0x404 0x10>; + }; + + tsens_calibration_bckp: calib_bckp@504 { + reg = <0x504 0x11>; + bit-offset = 6; + nbits = 128; + }; + + pvs_version: pvs-version@6 { + reg = <0x6 0x2> + bit-offset = 7; + nbits = 2; + }; + + speed_bin: speed-bin@c{ + reg = <0xc 0x1>; + bit-offset = 2; + nbits = 3; + + }; + ... + }; + += Data consumers = +Are device nodes which consume nvmem data cells/providers. + +Required-properties: +nvmem-cells: list of phandle to the nvmem data cells. +nvmem-cell-names: names for the each nvmem-cells specified. Required if + nvmem-cells is used. + +Optional-properties: +nvmem : list of phandles to nvmem providers. +nvmem-names: names for the each nvmem provider. required if nvmem is used. + +For example: + + tsens { + ... + nvmem-cells = <&tsens_calibration>; + nvmem-cell-names = "calibration"; + };