Chrome platform driver development
 help / color / mirror / Atom feed
From: Tinghan Shen <tinghan.shen@mediatek.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Mathieu Poirier <mathieu.poirier@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Lee Jones <lee.jones@linaro.org>,
	Benson Leung <bleung@chromium.org>,
	Guenter Roeck <groeck@chromium.org>,
	Daisuke Nojiri <dnojiri@chromium.org>,
	Sebastian Reichel <sebastian.reichel@collabora.com>,
	"Dustin L. Howett" <dustin@howett.net>,
	Tzung-Bi Shih <tzungbi@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Prashant Malani <pmalani@chromium.org>,
	"Enric Balletbo i Serra" <enric.balletbo@collabora.com>,
	Brian Norris <briannorris@chromium.org>
Cc: <linux-remoteproc@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <chrome-platform@lists.linux.dev>,
	<Project_Global_Chrome_Upstream_Group@mediatek.com>,
	<weishunc@google.com>
Subject: Re: [PATCH v1 01/15] dt-binding: remoteproc: mediatek: Support dual-core SCP
Date: Thu, 2 Jun 2022 19:29:56 +0800	[thread overview]
Message-ID: <5c614dc0947aba6ce2eb0cdc3055a390da723d08.camel@mediatek.com> (raw)
In-Reply-To: <45c8050e-16d3-80d6-0799-8b067a38d956@linaro.org>

Hi Krzysztof,

On Thu, 2022-06-02 at 12:37 +0200, Krzysztof Kozlowski wrote:
> On 02/06/2022 10:58, Tinghan Shen wrote:
> > Hi Krzysztof,
> > 
> > On Thu, 2022-06-02 at 08:55 +0200, Krzysztof Kozlowski wrote:
> > > On 02/06/2022 07:21, Tinghan Shen wrote:
> > > > Hi Krzysztof,
> > > > 
> > > > On Wed, 2022-06-01 at 13:50 +0200, Krzysztof Kozlowski wrote:
> > > > > On 01/06/2022 13:21, Tinghan Shen wrote:
> > > > > > The SCP co-processor is a dual-core RISC-V MCU on MT8195.
> > > > > > 
> > > > > > Add a new property to identify each core and helps to find drivers
> > > > > > through device tree API to cooperate with each other, e.g. boot flow and
> > > > > > watchdog timeout flow.
> > > > > > 
> > > > > > Add a new compatile for the driver of SCP 2nd core.
> > > > > > 
> > > > > > Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
> > > > > > ---
> > > > > >  .../devicetree/bindings/remoteproc/mtk,scp.yaml      | 12 ++++++++++++
> > > > > >  1 file changed, 12 insertions(+)
> > > > > > 
> > > > > > diff --git a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
> > > > > > b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
> > > > > > index eec3b9c4c713..b181786d9575 100644
> > > > > > --- a/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
> > > > > > +++ b/Documentation/devicetree/bindings/remoteproc/mtk,scp.yaml
> > > > > > @@ -20,6 +20,7 @@ properties:
> > > > > >        - mediatek,mt8186-scp
> > > > > >        - mediatek,mt8192-scp
> > > > > >        - mediatek,mt8195-scp
> > > > > > +      - mediatek,mt8195-scp-dual
> > > > > >  
> > > > > >    reg:
> > > > > >      description:
> > > > > > @@ -57,6 +58,16 @@ properties:
> > > > > >    memory-region:
> > > > > >      maxItems: 1
> > > > > >  
> > > > > > +  mediatek,scp-core:
> > > > > > +    $ref: /schemas/types.yaml#/definitions/uint32-array
> > > > > > +    description:
> > > > > > +      The property value is a list with 2 items, a core id and a phandle
> > > > > 
> > > > > uint32, not phandle.
> > > > > 
> > > > > > +      to the sibling SCP node. 
> > > > > 
> > > > > Skip this. First part is obvious from the schema, second part should be
> > > > > described via items.
> > > > > 
> > > > > The core id represents the id of the dts node contains
> > > > > > +      this property. The valid values of core id are 0 and 1 for dual-core SCP.
> > > > > > +      The phandle of sibling SCP node is used to find the register settings,
> > > > > > +      trigger core dependent callback, and invoke rproc API.
> > > > > 
> > > > > Entire description did not help me to understand what's this. So far it
> > > > > looks like it is not a hardware property but some programming help, so
> > > > > it does not look like properly described in bindings.
> > > > > 
> > > > > > +    maxItems: 1
> > > > > 
> > > > > In description you said - two items.
> > > > > 
> > > > > You need allOf:if:then disallowing this property for other variants.
> > > > > 
> > > > > > +
> > > > > >  required:
> > > > > >    - compatible
> > > > > >    - reg
> > > > > > @@ -115,6 +126,7 @@ examples:
> > > > > >          reg-names = "sram", "cfg", "l1tcm";
> > > > > >          clocks = <&infracfg CLK_INFRA_SCPSYS>;
> > > > > >          clock-names = "main";
> > > > > > +        mediatek,scp-core = <0 &scp_dual>;
> > > > > 
> > > > > This looks like phandle, so wrong type.
> > > > > >  
> > > > > >          cros_ec {
> > > > > >              mediatek,rpmsg-name = "cros-ec-rpmsg";
> > > > 
> > > > Thanks for your feedback.
> > > > After looking for a comparable uses case, I find out a different approach.
> > > > 
> > > >   mediatek,scp-core:
> > > >     $ref: "/schemas/types.yaml#/definitions/phandle-array"
> > > >     description:
> > > >       Enable the dual-core support in scp driver.
> > > 
> > > You describe desired functional behavior, not the hardware. What is the
> > > property about? If you just want to indicate this is two-core processor,
> > > then it could be:
> > > 	mediatek,cores = <2>; /* number of cores */
> > > 
> > > 
> > > However it seems you want to achieve here something different and as I
> > > raised last time - it does not look like DT property.
> > > 
> > > Or maybe this is for first core and you want to indicate the sibling?
> > > Something like that was mentioned in previous description.
> > 
> > This property is mainly added for scp 1st core driver 
> > and scp 2nd core driver to find each other via DT API.
> > 
> > After reconsidering the use of core id in the scp driver, it 
> > is not necessary in the control flow. I'll remove the core id 
> > at next version.
> > 
> > How about change the description as following,
> > 
> >   This property enables the dual-core support in scp driver.
> >   By providing the phandle of SCP 2nd core node, the 1st SCP node
> >   can control the SCP 2nd core as the subdevice of remoteproc framework.
> 
> Please, read it again:
> 
> > > You describe desired functional behavior, not the hardware.
> 
> Again, you describe Linux implementation (scp driver, remoteproc
> framework). You need to describe the hardware, not Linux drivers.
> 
> Maybe the hardware property is that one core has its sibling and you
> provide here that sibling?

Yes, exactly. I'm sorry for misreading your argument.

How about this one,
   
  Reference to the sibling SCP core. This is required when 
  dual-core SCP support is enabled.

Thanks,
TingHan






  reply	other threads:[~2022-06-02 11:30 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-01 11:21 [PATCH v1 00/15] Add support for MT8195 SCP 2nd core Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 01/15] dt-binding: remoteproc: mediatek: Support dual-core SCP Tinghan Shen
2022-06-01 11:50   ` Krzysztof Kozlowski
2022-06-02  5:21     ` Tinghan Shen
2022-06-02  6:55       ` Krzysztof Kozlowski
2022-06-02  8:58         ` Tinghan Shen
2022-06-02 10:37           ` Krzysztof Kozlowski
2022-06-02 11:29             ` Tinghan Shen [this message]
2022-06-02 12:02               ` Krzysztof Kozlowski
2022-06-01 11:21 ` [PATCH v1 02/15] remoteproc: Kconfig: Add mt8195 SCP dual core configuration Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 03/15] remoteproc: mediatek: Support hanlding scp core 1 wdt timeout Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 04/15] remoteproc: mediatek: Add SCP core 1 register definitions Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 05/15] remoteproc: mediatek: Add SCP core 1 driver for dual-core scp Tinghan Shen
2022-06-06  9:15   ` AngeloGioacchino Del Regno
2022-06-06  9:52     ` Tinghan Shen
2022-06-06 10:08       ` AngeloGioacchino Del Regno
2022-06-06 10:41         ` Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 06/15] remoteproc: mediatek: Add SCP core 1 rproc operations Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 07/15] remoteproc: mediatek: Add SCP core 1 reserved memory support Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 08/15] remoteproc: mediatek: Add SCP core 1 interrupt support Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 09/15] remoteproc: mediatek: Register SCP core 1 initialization ipi Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 10/15] remoteproc: mediatek: Add chip dependent operations for SCP core 1 Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 11/15] remoteproc: mediatek: Add SCP core 1 SRAM offset Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 12/15] remoteproc: mediatek: Add SCP core 1 as a rproc subdevice Tinghan Shen
2022-06-01 11:21 ` [PATCH v1 13/15] remoteproc: mediatek: Wait SCP core 1 probe done Tinghan Shen
2022-06-01 11:22 ` [PATCH v1 14/15] remoteproc: mediatek: Support rpmsg for SCP core 1 Tinghan Shen
2022-06-01 11:22 ` [PATCH v1 15/15] mfd: cros_ec: Add SCP core 1 as a new CrOS EC MCU Tinghan Shen
2022-06-15 22:28   ` Lee Jones
2022-06-01 11:46 ` [PATCH v1 00/15] Add support for MT8195 SCP 2nd core Krzysztof Kozlowski
2022-06-02  3:52   ` Tinghan Shen
2022-06-02  6:56     ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c614dc0947aba6ce2eb0cdc3055a390da723d08.camel@mediatek.com \
    --to=tinghan.shen@mediatek.com \
    --cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=bleung@chromium.org \
    --cc=briannorris@chromium.org \
    --cc=chrome-platform@lists.linux.dev \
    --cc=devicetree@vger.kernel.org \
    --cc=dnojiri@chromium.org \
    --cc=dustin@howett.net \
    --cc=enric.balletbo@collabora.com \
    --cc=groeck@chromium.org \
    --cc=gustavoars@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=matthias.bgg@gmail.com \
    --cc=pmalani@chromium.org \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=tzungbi@kernel.org \
    --cc=weishunc@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox