Linux-mediatek Archive mirror
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Rob Herring <robh@kernel.org>
Cc: djakov@kernel.org, krzysztof.kozlowski+dt@linaro.org,
	conor+dt@kernel.org, matthias.bgg@gmail.com, lgirdwood@gmail.com,
	broonie@kernel.org, keescook@chromium.org, gustavoars@kernel.org,
	henryc.chen@mediatek.com, linux-pm@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, kernel@collabora.com,
	wenst@chromium.org, amergnat@baylibre.com
Subject: Re: [PATCH v2 2/7] dt-bindings: interconnect: Add MediaTek EMI Interconnect bindings
Date: Thu, 18 Apr 2024 09:43:02 +0200	[thread overview]
Message-ID: <1d1bbc68-b484-4dc5-92f2-9454e8e2d6fb@collabora.com> (raw)
In-Reply-To: <20240417191445.GB3101736-robh@kernel.org>

Il 17/04/24 21:14, Rob Herring ha scritto:
> On Wed, Apr 17, 2024 at 05:32:54PM +0200, AngeloGioacchino Del Regno wrote:
>> Il 17/04/24 16:54, Rob Herring ha scritto:
>>> On Wed, Apr 17, 2024 at 11:14:37AM +0200, AngeloGioacchino Del Regno wrote:
>>>> Add bindings for the MediaTek External Memory Interface Interconnect,
>>>> which providers support system bandwidth requirements through Dynamic
>>>> Voltage Frequency Scaling Resource Collector (DVFSRC) hardware.
>>>>
>>>> This adds bindings for MediaTek MT8183 and MT8195 SoCs.
>>>>
>>>> Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>>> ---
>>>>    .../interconnect/mediatek,mt8183-emi.yaml     | 76 +++++++++++++++++++
>>>>    .../interconnect/mediatek,mt8183.h            | 23 ++++++
>>>>    .../interconnect/mediatek,mt8195.h            | 44 +++++++++++
>>>>    3 files changed, 143 insertions(+)
>>>>    create mode 100644 Documentation/devicetree/bindings/interconnect/mediatek,mt8183-emi.yaml
>>>>    create mode 100644 include/dt-bindings/interconnect/mediatek,mt8183.h
>>>>    create mode 100644 include/dt-bindings/interconnect/mediatek,mt8195.h
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/interconnect/mediatek,mt8183-emi.yaml b/Documentation/devicetree/bindings/interconnect/mediatek,mt8183-emi.yaml
>>>> new file mode 100644
>>>> index 000000000000..3ad60fd21f83
>>>> --- /dev/null
>>>> +++ b/Documentation/devicetree/bindings/interconnect/mediatek,mt8183-emi.yaml
>>>> @@ -0,0 +1,76 @@
>>>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>>>> +%YAML 1.2
>>>> +---
>>>> +$id: http://devicetree.org/schemas/interconnect/mediatek,mt8183-emi.yaml#
>>>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>>>> +
>>>> +title: MediaTek External Memory Interface (EMI) Interconnect
>>>> +
>>>> +maintainers:
>>>> +  - AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
>>>> +
>>>> +description: |
>>>> +  EMI interconnect providers support system bandwidth requirements through
>>>> +  Dynamic Voltage Frequency Scaling Resource Collector (DVFSRC) hardware.
>>>> +  The provider is able to communicate with the DVFSRC through Secure Monitor
>>>> +  Call (SMC).
>>>> +
>>>> +             ICC provider         ICC Nodes
>>>> +                              ----          ----
>>>> +             _________       |CPU |   |--- |VPU |
>>>> +    _____   |         |-----  ----    |     ----
>>>> +   |     |->|  DRAM   |       ----    |     ----
>>>> +   |DRAM |->|scheduler|----- |GPU |   |--- |DISP|
>>>> +   |     |->|  (EMI)  |       ----    |     ----
>>>> +   |_____|->|_________|---.   -----   |     ----
>>>> +               /|\         `-|MMSYS|--|--- |VDEC|
>>>> +                |             -----   |     ----
>>>> +                |                     |     ----
>>>> +                | change DRAM freq    |--- |VENC|
>>>> +             --------                 |     ----
>>>> +    SMC --> | DVFSRC |                |     ----
>>>> +             --------                 |--- |IMG |
>>>> +                                      |     ----
>>>> +                                      |     ----
>>>> +                                      |--- |CAM |
>>>> +                                            ----
>>>> +
>>>> +properties:
>>>> +  compatible:
>>>> +    enum:
>>>> +      - mediatek,mt8183-emi
>>>> +      - mediatek,mt8195-emi
>>>> +
>>>> +  reg:
>>>> +    maxItems: 1
>>>> +
>>>> +  '#interconnect-cells':
>>>> +    const: 1
>>>> +
>>>> +required:
>>>> +  - compatible
>>>> +  - '#interconnect-cells'
>>>> +
>>>> +unevaluatedProperties: false
>>>> +
>>>> +examples:
>>>> +  - |
>>>> +    #include <dt-bindings/interconnect/mediatek,mt8195.h>
>>>> +
>>>> +    soc {
>>>> +        #address-cells = <2>;
>>>> +        #size-cells = <2>;
>>>> +
>>>> +        system-controller@10012000 {
>>>> +            compatible = "mediatek,mt8195-dvfsrc";
>>>> +            reg = <0 0x10012000 0 0x1000>;
>>>> +            #address-cells = <1>;
>>>> +            #size-cells = <0>;
>>>> +
>>>> +            emi_icc: interconnect@1 {
>>>> +                compatible = "mediatek,mt8195-emi";
>>>> +                reg = <1>;
>>>> +                #interconnect-cells = <1>;
>>>
>>>
>>> There's not really any need for this node. Just put #interconnect-cells
>>> in the parent.
>>>
>>
>> Actually, I modeled it to be a subnode of the DVFSRC for multiple reasons:
>>
>> 1. Some SoCs have more than one interconnect on the DVFSRC (two different kinds
>>     of EMI interconnect, and then also a SMI interconnect); and
>>
>> 2. Some boards will want to not enable the interconnect driver because some of
>>     those are not battery powered (so they just keep the knobs at full thrust
>>     from the bootloader and never care scaling busses); and
>>
>> 3. Some DVFSRC interconnect features may depend on firmware (but I'm not
>>     sure which ones and which SoCs, as there are lots of SMI/EMI ICC things that
>>     are not implemented yet with this series).
>>
>> The alternative would've been to add a property to enable, or disable, the SMI ICC
>> (not present in this series), and/or one, or the other kind of EMI ICC (this series
>> implements only the simpler EMI ICC, and I keep saying "the other" because I
>> currently don't remember the name).... which is really ugly.
>>
>> Ideas? :-)
> 
> Just provide that reasoning in the commit msg.
> 

Okay, that's sensible - should've done that in v1 even. My bad.

Cheers
Angelo

> Rob




  reply	other threads:[~2024-04-18  7:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-17  9:14 [PATCH v2 0/7] MediaTek DVFSRC Bus Bandwidth and Regulator knobs AngeloGioacchino Del Regno
2024-04-17  9:14 ` [PATCH v2 1/7] dt-bindings: regulator: Add bindings for MediaTek DVFSRC Regulators AngeloGioacchino Del Regno
2024-04-17 14:46   ` Rob Herring
2024-04-17 15:32     ` AngeloGioacchino Del Regno
2024-04-17 14:52   ` Rob Herring
2024-04-17 15:39     ` AngeloGioacchino Del Regno
2024-04-17 19:12       ` Rob Herring
2024-04-18  7:42         ` AngeloGioacchino Del Regno
2024-04-17  9:14 ` [PATCH v2 2/7] dt-bindings: interconnect: Add MediaTek EMI Interconnect bindings AngeloGioacchino Del Regno
2024-04-17 14:46   ` Rob Herring
2024-04-17 14:54   ` Rob Herring
2024-04-17 15:32     ` AngeloGioacchino Del Regno
2024-04-17 19:14       ` Rob Herring
2024-04-18  7:43         ` AngeloGioacchino Del Regno [this message]
2024-04-17  9:14 ` [PATCH v2 3/7] dt-bindings: soc: mediatek: Add DVFSRC bindings for MT8183 and MT8195 AngeloGioacchino Del Regno
2024-04-17  9:14 ` [PATCH v2 4/7] soc: mediatek: Add MediaTek DVFS Resource Collector (DVFSRC) driver AngeloGioacchino Del Regno
2024-04-17  9:14 ` [PATCH v2 5/7] regulator: Remove mtk-dvfsrc-regulator.c AngeloGioacchino Del Regno
2024-04-17  9:14 ` [PATCH v2 6/7] regulator: Add refactored mtk-dvfsrc-regulator driver AngeloGioacchino Del Regno
2024-04-17  9:14 ` [PATCH v2 7/7] interconnect: mediatek: Add MediaTek MT8183/8195 EMI Interconnect driver AngeloGioacchino Del Regno

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=1d1bbc68-b484-4dc5-92f2-9454e8e2d6fb@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=amergnat@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=djakov@kernel.org \
    --cc=gustavoars@kernel.org \
    --cc=henryc.chen@mediatek.com \
    --cc=keescook@chromium.org \
    --cc=kernel@collabora.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=robh@kernel.org \
    --cc=wenst@chromium.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).