Received: by 10.192.165.156 with SMTP id m28csp872547imm; Wed, 11 Apr 2018 08:32:29 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/nLOZ4S7h/I9Cg7/CgMd1i07b/uo0UesGBF3pc9B52KKxESyUuN91ei0E55xQGtC4qRA4N X-Received: by 2002:a17:902:aa03:: with SMTP id be3-v6mr5694087plb.299.1523460749315; Wed, 11 Apr 2018 08:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523460749; cv=none; d=google.com; s=arc-20160816; b=TBdGs0GEo1WeSC67uXOQvZ7qh6vlgB+0acj898RDAWcdIQZDtg2lsGWs4P15uPYvAm jk1Lw6z1Wgp71UXLxJiLC6u67xhaIpFUZkeWQA/95KsD2PN7ULZqmPMUiEeM6ksTUVYH YTbe3iW4QtJ9jjyO6/U/AXFQZ3YKlmNpGmulwg1UKJcABN+fcqVk/NNOW1O2d76sunpm lCZfp1CIXS6xsmJ/cugbdJeu2bN7w2U4bIpZhhv2JTwJkgFbsgG6bACQexSRIVu+QKL5 LD70K/iUBj3Ld9N8UK3k26WyxEgdVw4WAoiSEQXTHYU7LmKSJEu9AnqLzcGMZZxdfe1Q /Peg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:user-agent:message-id :references:cc:in-reply-to:from:to:content-transfer-encoding :mime-version:dkim-signature:arc-authentication-results; bh=c+Xi03hJLGz0IM7J4Kk8cdG3+dY+Isg+fptQ6hDJfCM=; b=MfyQ4niC8bc7aRaOnAG7ALgxpT9qxIOU4+EG3ymDJ/2+8xHE1cFQ+8nIas4YFk2Fej AnPx+AxnCyGq3aw1K+7ZPnxSPIe4ftBAraX2nNoqpZFpsuxx2cNHNN3rECuAQmGarabt +EV2K4OcaZCh6/AIXZnm8DxnixYQ61E1GdOGxKO1HC1PGY1i+ZVYduxWQSPMCuQ8jO7P xA/k2TQOuE1yzpkD8d7uNEclsrbWocWh5YTdYw5UNaYkoF2c/VFDDe/snJqWPF88YCtn gKsw61LdFMx2MkYytTSSdvB5ZGkE/vYLd8E+MPpkcozm8ns9MloEbqBY46cNjZPwWbDN cAfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MCHFNYjn; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d22-v6si1283466plr.581.2018.04.11.08.31.52; Wed, 11 Apr 2018 08:32:29 -0700 (PDT) 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=@chromium.org header.s=google header.b=MCHFNYjn; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753425AbeDKP3J (ORCPT + 99 others); Wed, 11 Apr 2018 11:29:09 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:33549 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752879AbeDKP3G (ORCPT ); Wed, 11 Apr 2018 11:29:06 -0400 Received: by mail-pf0-f179.google.com with SMTP id f15so1114584pfn.0 for ; Wed, 11 Apr 2018 08:29:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:to:from:in-reply-to:cc :references:message-id:user-agent:subject:date; bh=c+Xi03hJLGz0IM7J4Kk8cdG3+dY+Isg+fptQ6hDJfCM=; b=MCHFNYjn9vp2+Eo+f+bh3vHnhwBnA/AWwB7p7t0BbBX+iZJnMnqY+8lxDtI/DZWcQd FH3p+l0Z9rnjlL3lXjvEMqQB9skguNNr9C0Fu2C/JXBXLaacA8cKBk1aTL1WtDeleQ3L /12Zolo8utqw1Ycgazi8P85pyHr4iTKUe1R+A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding:to:from :in-reply-to:cc:references:message-id:user-agent:subject:date; bh=c+Xi03hJLGz0IM7J4Kk8cdG3+dY+Isg+fptQ6hDJfCM=; b=gA0feHyG/LtmmsWvbgbEmuhm/FYkr1ojLQVXn09Xja8cSJNNKWmzsD5D9uhFzsgI+N 35wIlK56RbzRT3QNUYeOQc7K9wM70yuog3vcwafoDb35e0fFTVBkoOFgjzRpQUEhoyI/ 0i+YU5/+e00zTMdf0a3YzlvC3iJpw8MGs+oRkJmpwFHWW7N2xKTNMSplGqoNnemSVuaF eO/7632FI3vag8EgpSvHj/Tf2tGsPnQao1uBol1XV1Gt8lgAoJjyXqnp8WyymQglrpIn +ejLOWsuUi3OXWvO44UrY9r778pwb0FR8qZ1NJ2WjDfwlrc6cuKI2jWa/JRootZkFIhE ooGg== X-Gm-Message-State: ALQs6tD/+G6kKVeKk2yTW7RE3QeSLimbtVyJvt34O+Euj8mJMMXx+8ir ucXI9MdKQdFOuKRwW/hCzPXJvA== X-Received: by 10.99.56.8 with SMTP id f8mr3829223pga.374.1523460546351; Wed, 11 Apr 2018 08:29:06 -0700 (PDT) Received: from localhost ([2620:0:1000:1511:d30e:62c6:f82c:ff40]) by smtp.gmail.com with ESMTPSA id p8sm3380042pgf.75.2018.04.11.08.29.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Apr 2018 08:29:05 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: Lina Iyer From: Stephen Boyd In-Reply-To: <20180409160800.GC19682@codeaurora.org> Cc: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, rnayak@codeaurora.org, bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, evgreen@chromium.org, dianders@chromium.org, devicetree@vger.kernel.org References: <20180405161834.3850-1-ilina@codeaurora.org> <20180405161834.3850-3-ilina@codeaurora.org> <152306368031.94378.14957212064809086345@swboyd.mtv.corp.google.com> <20180409160800.GC19682@codeaurora.org> Message-ID: <152346054406.180276.4468371342222361883@swboyd.mtv.corp.google.com> User-Agent: alot/0.7 Subject: Re: [PATCH v5 02/10] dt-bindings: introduce RPMH RSC bindings for Qualcomm SoCs Date: Wed, 11 Apr 2018 08:29:04 -0700 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Lina Iyer (2018-04-09 09:08:00) > On Fri, Apr 06 2018 at 19:14 -0600, Stephen Boyd wrote: > >Quoting Lina Iyer (2018-04-05 09:18:26) > >> diff --git a/Documentation/devicetree/bindings/soc/qcom/rpmh-rsc.txt b= /Documentation/devicetree/bindings/soc/qcom/rpmh-rsc.txt > >> new file mode 100644 > >> index 000000000000..dcf71a5b302f > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/soc/qcom/rpmh-rsc.txt > >> @@ -0,0 +1,127 @@ > >> + > >> +Example 1: > >> + > >> +For a TCS whose RSC base address is is 0x179C0000 and is at a DRV id = of 2, the > >> +register offsets for DRV2 start at 0D00, the register calculations ar= e like > >> +this - > >> +First tuple: 0x179C0000 + 0x10000 * 2 =3D 0x179E0000 > >> +Second tuple: 0x179E0000 + 0xD00 =3D 0x179E0D00 > >> + > >> + apps_rsc: rsc@179e000 { > >> + label =3D "apps_rsc"; > >> + compatible =3D "qcom,rpmh-rsc"; > >> + reg =3D <0x179e0000 0x10000>, <0x179e0d00 0x3000>; > > > >The first reg property overlaps the second one. Does this second one > >ever move around? I would hardcode it in the driver to be 0xd00 away > >from the drv base instead of specifying it in DT if it's the same all > >the time. > > > >Also, the example shows 0x179c0000 which I guess is the actual beginning > >of the RSC block. So the binding seems to be for one DRV inside of an > >RSC. Can we get the full description of the RSC in the binding instead? > >I imagine that means there's a DRV0,1,2 and those probably have an > >interrupt per each DRV and then a different TCS config per each one too? > >If the binding can describe all of the RSC then we can use different > >DRVs by changing the qcom,drv-id property. > > > > rsc@179c0000 { > > compatible =3D "qcom,rpmh-rsc"; > > reg =3D <0x179c0000 0x10000>, > > <0x179d0000 0x10000>, > > <0x179e0000 0x10000>; > > qcom,tcs-offset =3D <0xd00>; > > qcom,drv-id =3D <0/1/2>; > > interrupts =3D , > > , > > ; > > } > > > >This is sort of what I imagine it would look like. I have no idea how > >the tcs config would work unless each DRV has the same TCS config > >though. Otherwise, if each node is for a drv, then I would expect the > >node would be called 'drv' and we wouldn't need the drv-id property and > >the compatible string would say drv instead of rsc? > > > >BTW, what are the other DRVs used for in the apps RSC? > > > The DRV is the voter for an execution environment (Linux, Hypervisor, > ATF) in the RSC. The RSC has a lot of other registers that Linux is not > privy to. They are access restricted. Alright. Well sometimes access restrictions aren't there, so this isn't a good assumption to make. > The memory organization of the RSC > mandates that we know the DRV id to access registers specific to the > DRV. I think qcom,drv-id covers that, no? > Unfortunately, not all RSC have identical DRV configuration and the > register space is also variable depending on the capability of the RSC. > There are functionalities supported by other RSCs in the SoC that are > not supported by the RSC associated with the application processor, > while not many RSCs' support multiple DRVs. Therefore it doesn't benefit > describing the whole RSC as it is not usable from Linux (because of > access restrictions). If we're not describing the whole RSC in the RSC binding then we're not going to get very far. From what I can tell, this binding describes one DRV inside of an RSC instead of the whole RSC. Yes we'll probably never use the ATF part of the RSC in Linux, but we may use the hypervisor part if we use KVM/Xen so the binding should be describing as much as it can about this device in case some software needs to use it. Put another way, even if the "apps" RSC is complicated, we should be describing it to the best of our abilities in the binding so that when it is used by non-linux OSes things still work by simply tweaking the drv-id that we use to pick the right things out of the node. Or we're describing the RSC but it's really a container node that doesn't do much besides hold DRVs? So this is described at the wrong level?