Received: by 10.192.165.156 with SMTP id m28csp1202670imm; Wed, 11 Apr 2018 14:29:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+UGxgWjEE9Ji/cCkflLBeRpOoFZY250DxVFyMNRTrVpnMQ8c4C9Jii2LOf0Fj+1p5hmoAP X-Received: by 2002:a17:902:1025:: with SMTP id b34-v6mr6637806pla.324.1523482176625; Wed, 11 Apr 2018 14:29:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523482176; cv=none; d=google.com; s=arc-20160816; b=esMRi+TUjV/wi1ExGa7RIgrINqTkAGgwy8DpJhxy7g7rUkQ626N9u4kI4/7y5qTiAd i6sGMImL3cW6Otmf4PN4FM1uBqHNil3tD1x/cAe052R2mUC1ktBlA3kvM+g/ZUfeXYSh wlwaOes6hVytjFK8iw8kokMdbhA66joQ5KVLyQYzyjPoo4kBKVEKJhJjkUYhY8d4iPJM eEYMIVeEaGFZ/ApX2HscH4eLML1VhR2hP+6yKxHWXqAZY4CvfBdTrKc4dIpAfG5TS6eb yAFCI5EmR1GxxcCe5yCk0gjHbarjFSs93hdEFALiTO8V4TGXJXk65vcZVYn5L5VN+GBF t7bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=N0YOLgLr/b3aL7yH+Q3OwhUMCGCy3n4t1/FUihqgphc=; b=ztzitvxdV9GcqLP/bfN0KXqqlMe4dwhVLlRSSwdPkCJWpRnV48oPled6HNJ0We6msU f9iPXFMnYx3a5Zyd6UhQYhjRNi6BGq7QEAm7KFbXgsVWx9jvZDBYgA4gxnfGEV5/otg6 xQj3FvoW38sKtkQpL50lNC4f2H/MRmkVrZTMJX0TOZpYrwS9dupfxJkj226MFhmmnn+C KxS9Eld+m4Nm8JyALi6C+Uf7YO5AfI0iBOfluaRTXPwes9TE168bZOx1F6fB8eoY8Hpj zjtAeZs1wfTCG+kaIXcht8uUXuV6mLCOIX5rWjjyPXiv5lgDn5oGbCUr/5jjk822pmG4 iMpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=bCdS+wRA; dkim=pass header.i=@codeaurora.org header.s=default header.b=FXcF3wqb; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a90-v6si1802176plc.732.2018.04.11.14.28.59; Wed, 11 Apr 2018 14:29:36 -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=@codeaurora.org header.s=default header.b=bCdS+wRA; dkim=pass header.i=@codeaurora.org header.s=default header.b=FXcF3wqb; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754506AbeDKVYi (ORCPT + 99 others); Wed, 11 Apr 2018 17:24:38 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:59534 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754182AbeDKVYe (ORCPT ); Wed, 11 Apr 2018 17:24:34 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C1D5C602BA; Wed, 11 Apr 2018 21:24:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523481873; bh=5WG4I2i1kvWAV9/iIKIDrA/GpJ9fvll1I6/d0XQb2q4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bCdS+wRA4OsJ5qD3oJ+WvtCR+axdRbETuj+i/BCzUNpphUBvDijNVt9z9saZI4mR7 111DLcjTLTrZmjDNjTmfLt72Wd8Ni9uZIURnEiYNeyrOk3BRII5guHq9ABTcqSoMbg jHWbpNmaltpLD6T5FQDm0MhDH1YcDsSfX35mGRTU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id B43C36079B; Wed, 11 Apr 2018 21:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523481872; bh=5WG4I2i1kvWAV9/iIKIDrA/GpJ9fvll1I6/d0XQb2q4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FXcF3wqbQcUVx/jWVcWko4UsrKxp1CgDxbLKFhV3r08Py0F1uBJGc0bFy6BQH4A+l YwnWIV+KxgBVBJ/S7VeIIM6tWV6nqUGuWEr4WoUTSdSvFkrGuG3MTuQ+EPBSB1PMpY DWio+wELe17RYD/DquUNxMq8sbTvB/XKvLMyG6Xw= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org B43C36079B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org Date: Wed, 11 Apr 2018 15:24:31 -0600 From: Lina Iyer To: Stephen Boyd 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 Subject: Re: [PATCH v5 02/10] dt-bindings: introduce RPMH RSC bindings for Qualcomm SoCs Message-ID: <20180411212431.GG19682@codeaurora.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> <152346054406.180276.4468371342222361883@swboyd.mtv.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <152346054406.180276.4468371342222361883@swboyd.mtv.corp.google.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 11 2018 at 09:29 -0600, Stephen Boyd wrote: >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 are like >> >> +this - >> >> +First tuple: 0x179C0000 + 0x10000 * 2 = 0x179E0000 >> >> +Second tuple: 0x179E0000 + 0xD00 = 0x179E0D00 >> >> + >> >> + apps_rsc: rsc@179e000 { >> >> + label = "apps_rsc"; >> >> + compatible = "qcom,rpmh-rsc"; >> >> + reg = <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 = "qcom,rpmh-rsc"; >> > reg = <0x179c0000 0x10000>, >> > <0x179d0000 0x10000>, >> > <0x179e0000 0x10000>; >> > qcom,tcs-offset = <0xd00>; >> > qcom,drv-id = <0/1/2>; >> > interrupts = , >> > , >> > ; >> > } >> > >> >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. > The RSC is pretty much this. A set of registers that are RSC specific at the address pointed to by the "rsc" reg and the TCS regsiters pointed to by the "tcs" reg. You do not want to clobber multiple DRVs into the same device node. It will be a lot confusing for the drivers to determine which DRV to vote. >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? What we are describing is a DRV, but a standalone DRV alone is useless without the necessary RSC registers. So its a unique RSC+DRV combination that is represented here. Hope that helps. -- Lina