Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4092242ybl; Mon, 13 Jan 2020 07:43:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxKXhZ4D3jA6c911+n2U1Eiw9u6bkyhz4IkW5xHizpfLK0AinmiZh5FYAtIfDzbTRYb38vh X-Received: by 2002:a9d:da2:: with SMTP id 31mr12898093ots.319.1578930222058; Mon, 13 Jan 2020 07:43:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578930222; cv=none; d=google.com; s=arc-20160816; b=vgk0m6jpbp3ScPc9XVVUB5PnKrqjcdzgDlP7B+K8f8ayamX6WL7NMZ8L1LJb8fDZaX fYLG2ABkCqwHsFmG5nA6M0RufTG6sEXGWXJd2i0hpZnVD8y3UR0h1VvBux+b0z0SZkgj mwgQO41nehknZFvTJyBWDzPm9dchGFzOY10jsaFeZiJqQQB4SeIwZJVQXb75jjQflXhm le0r2BxvTiOm6AEHLDMuY5LXSLVYJH6LtGpZxpuJNQMSv3FgVRHx7vB1bOHlOfPu2hqr 125sudLK7mqyOqHEHHLGWJI2a8qx7TTpfYCidjb1/nY0tU9xjL11MD8ncxceqfvYSSht dXDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=lR8ahDtEwHSVyU/JhReJIGC5fn6ozxOJ+Ql/GfE7ig8=; b=ro9N++71gmzh0RFSV6Rwg6M+hBIdkeMwALnxXiytnWt2y27XT7NdlnioBCE+VRU/pH ImlQlZ2o5by/2+6adeia/qKTA9BsPmm1jZzz2XQ0cU6qJ0/1F4CGsRGEJqoLKwEq//wk XYHrjBw1klB0Z0zRxJJTQtM4grnRGRRxEXxG+HHVUTM52dENcCRZp0YcHHQBa0ObCRqR aB89tNUj30iiC7mkWonxFInje44GBBxKlh4rkgOHJrWj+A8CMdjvuLmfsVbCrk/omad3 awJP/lSp493ymeuIcPbdP6YczoxzFMbkJTp7Rn96dX2yuEWmwzkm12DERdv+Y7g/qQgP ckXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zsMXx19K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i11si6999488otc.105.2020.01.13.07.43.29; Mon, 13 Jan 2020 07:43:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zsMXx19K; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728741AbgAMPmh (ORCPT + 99 others); Mon, 13 Jan 2020 10:42:37 -0500 Received: from mail.kernel.org ([198.145.29.99]:52398 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727286AbgAMPmg (ORCPT ); Mon, 13 Jan 2020 10:42:36 -0500 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4E45A21739; Mon, 13 Jan 2020 15:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578930155; bh=RVsyyyEak92HbEk5ozmzJ7WvLdzHYvkt6miQWJICS50=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=zsMXx19K/zG854+NtB/NSsH0j0812u2mBkgKLZHL36fLhfQBHrThEZkuTyd99dmPY rmgmR7O0wWFyxqDN1663OT1yr9EMHeTgq0S8YqbPQjjnWSnUyQpgjxAHP5MF8E+Qsy PgeAOpFuIKlp0GsxxajNArfw9mrxd+/ArZxe+g1Y= Received: by mail-qk1-f176.google.com with SMTP id x129so8842308qke.8; Mon, 13 Jan 2020 07:42:35 -0800 (PST) X-Gm-Message-State: APjAAAUB75kPCkO9P+Z3R9Fm5hpA5I5Sk5KA8v1vdX/Bp4CVVGcYF5Wg BzTH8SPrj5xZ3omss6RCArmJ09jTkAfj7jg2Kg== X-Received: by 2002:a05:620a:135b:: with SMTP id c27mr15396199qkl.119.1578930154331; Mon, 13 Jan 2020 07:42:34 -0800 (PST) MIME-Version: 1.0 References: <1577165532-28772-1-git-send-email-sthella@codeaurora.org> <20200108163943.GA26863@bogus> <8aeb91730552357db340f8bfb21e6d15@codeaurora.org> In-Reply-To: From: Rob Herring Date: Mon, 13 Jan 2020 09:42:22 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: nvmem: add binding for QTI SPMI SDAM To: Shyam Kumar Thella Cc: Andy Gross , Srinivas Kandagatla , Mark Rutland , linux-arm-msm , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 10, 2020 at 2:54 AM wrote: > > On 2020-01-09 21:01, Rob Herring wrote: > > On Thu, Jan 9, 2020 at 4:57 AM wrote: > >> > >> On 2020-01-08 22:09, Rob Herring wrote: > >> > On Tue, Dec 24, 2019 at 11:02:12AM +0530, Shyam Kumar Thella wrote: > >> >> QTI SDAM allows PMIC peripherals to access the shared memory that is > >> >> available on QTI PMICs. Add documentation for it. > >> >> > >> >> Signed-off-by: Shyam Kumar Thella > >> >> --- > >> >> .../devicetree/bindings/nvmem/qcom,spmi-sdam.yaml | 79 > >> >> ++++++++++++++++++++++ > >> >> 1 file changed, 79 insertions(+) > >> >> create mode 100644 > >> >> Documentation/devicetree/bindings/nvmem/qcom,spmi-sdam.yaml > >> >> > >> >> diff --git > >> >> a/Documentation/devicetree/bindings/nvmem/qcom,spmi-sdam.yaml > >> >> b/Documentation/devicetree/bindings/nvmem/qcom,spmi-sdam.yaml > >> >> new file mode 100644 > >> >> index 0000000..8961a99 > >> >> --- /dev/null > >> >> +++ b/Documentation/devicetree/bindings/nvmem/qcom,spmi-sdam.yaml > >> >> @@ -0,0 +1,79 @@ > >> >> +# SPDX-License-Identifier: GPL-2.0 > >> > > >> > Dual license new bindings: > >> > > >> > (GPL-2.0-only OR BSD-2-Clause) > >> > > >> > Please spread the word in QCom. > >> Sure. I will add Dual license in next patchset. > >> > > >> >> +%YAML 1.2 > >> >> +--- > >> >> +$id: http://devicetree.org/schemas/nvmem/qcom,spmi-sdam.yaml# > >> >> +$schema: http://devicetree.org/meta-schemas/core.yaml# > >> >> + > >> >> +title: Qualcomm Technologies, Inc. SPMI SDAM DT bindings > >> >> + > >> >> +maintainers: > >> >> + - Shyam Kumar Thella > >> >> + > >> >> +description: | > >> >> + The SDAM provides scratch register space for the PMIC clients. This > >> >> + memory can be used by software to store information or communicate > >> >> + to/from the PBUS. > >> >> + > >> >> +allOf: > >> >> + - $ref: "nvmem.yaml#" > >> >> + > >> >> +properties: > >> >> + compatible: > >> >> + enum: > >> >> + - qcom,spmi-sdam > >> >> + > >> >> + reg: > >> >> + maxItems: 1 > >> >> + > >> >> + "#address-cells": > >> >> + const: 1 > >> >> + > >> >> + "#size-cells": > >> >> + const: 1 > >> > > >> > ranges? The child addresses should be translateable I assume. > >> The addresses are not memory mapped on the CPU's address domain. They > >> are the SPMI addresses which can be accessed over SPMI controller. > > > > Doesn't have to be a CPU address. Are the child offsets within the > > range defined in the parent 'reg'? If so, then it should have > > 'ranges'. > Yes the child offsets fall within parent reg's address space. > I will add ranges in the next patch set. > > > >> > > >> >> + > >> >> +required: > >> >> + - compatible > >> >> + - reg > >> >> + > >> >> +patternProperties: > >> >> + "^.*@[0-9a-f]+$": > >> >> + type: object > >> >> + > >> >> + properties: > >> >> + reg: > >> >> + maxItems: 1 > >> >> + description: > >> >> + Offset and size in bytes within the storage device. > >> >> + > >> >> + bits: > >> > > >> > Needs a type reference. > >> Yes. I will add a reference in the next patch set. > >> > > >> >> + maxItems: 1 > >> >> + items: > >> >> + items: > >> >> + - minimum: 0 > >> >> + maximum: 7 > >> >> + description: > >> >> + Offset in bit within the address range specified by > >> >> reg. > >> >> + - minimum: 1 > >> > > >> > max is 7? > >> I don't think it is limited to 7 as it is the size within the address > >> range specified by reg. If the address range is more than a byte size > >> can be more. > > > > Then why is the maximum offset 7? > I see. Offset can be more than 7 within the address range specified in > case > of data cells with more than a byte. I will remove maximum in the next > patch set. That's the wrong thing to do though. If the offset is more than 7, you should just increase 'reg' value. IOW, 'bits' should only be used to express bit position up to the minimum alignment of 'reg'. I guess you could have an unaligned multi-byte field, so I guess this is fine as-is. Rob