Re: [PATCH v4 2/3] dt-bindings: arm: mediatek: mmsys: Add OF graph support for board path

From: AngeloGioacchino Del Regno
Date: Mon May 20 2024 - 06:53:42 EST


Il 19/05/24 19:18, Alexandre Mergnat ha scritto:
Hi Angelo,

On 16/05/2024 10:11, AngeloGioacchino Del Regno wrote:
+    oneOf:
+      - required:
+          - endpoint@0
+      - required:
+          - endpoint@1
+      - required:
+          - endpoint@2

I'm not sure this is what you expect because I must remove this part to pass the dt-validate.

I have 2 possible display at the same time (DSI and DPI), then I add this in my DTSI:

        mmsys: syscon@14000000 {
            compatible = "mediatek,mt8365-mmsys", "syscon";
            reg = <0 0x14000000 0 0x1000>;
            #clock-cells = <1>;
            port {
                #address-cells = <1>;
                #size-cells = <0>;

                mmsys_main: endpoint@0 {
                    reg = <0>;
                    remote-endpoint = <&ovl0_in>;
                };
                mmsys_ext: endpoint@1 {
                    reg = <1>;
                    remote-endpoint = <&rdma1_in>;
                };
            };
        };

But the DTS check returns me an error:

dt-validate -s Documentation/devicetree/bindings arch/arm64/boot/dts/mediatek/mt8365-evk.dtb
/home/*******/linux-upstream/arch/arm64/boot/dts/mediatek/mt8365-evk.dtb: syscon@14000000: port: More than one condition true in oneOf schema:
        {'$ref': '/schemas/graph.yaml#/properties/port',
         'oneOf': [{'required': ['endpoint@0']},
                   {'required': ['endpoint@1']},
                   {'required': ['endpoint@2']}],
         'properties': {'endpoint@0': {'$ref': '/schemas/graph.yaml#/properties/endpoint'},
                        'endpoint@1': {'$ref': '/schemas/graph.yaml#/properties/endpoint'},
                        'endpoint@2': {'$ref': '/schemas/graph.yaml#/properties/endpoint'}}}
        from schema $id: http://devicetree.org/schemas/arm/mediatek/mediatek,mmsys.yaml#


In other hand, if I use "ports" to keep only one endpoint for each port:

        mmsys: syscon@14000000 {
            compatible = "mediatek,mt8365-mmsys", "syscon";
            reg = <0 0x14000000 0 0x1000>;
            #clock-cells = <1>;
            ports {
                #address-cells = <1>;
                #size-cells = <0>;

                port@0 {
                    #address-cells = <1>;
                    #size-cells = <0>;
                    reg = <0>;
                    mmsys_main: endpoint@0 {
                        reg = <0>;
                        remote-endpoint = <&ovl0_in>;
                    };
                };

                port@1 {
                    #address-cells = <1>;
                    #size-cells = <0>;
                    reg = <1>;
                    mmsys_ext: endpoint@1 {
                        reg = <1>;
                        remote-endpoint = <&rdma1_in>;
                    };
                };
            };
        };

The DTS check returns another error:

dt-validate -s Documentation/devicetree/bindings arch/arm64/boot/dts/mediatek/mt8365-evk.dtb
/home/*******/linux-upstream/arch/arm64/boot/dts/mediatek/mt8365-evk.dtb: syscon@14000000: 'ports' does not match any of the regexes: 'pinctrl-[0-9]+'
        from schema $id: http://devicetree.org/schemas/arm/mediatek/mediatek,mmsys.yaml#

Additionally, with the last DTS example, displays aren't working, probably because "ports" isn't well parsed.

So, I don't know how you want to manage multiple display, but IMHO there are 2 ways:
- removing the current "oneOf".

..eh I think this should be anyOf instead :-)

I'll check later and send a v5.

Cheers,
Angelo

- adding the "ports" support in the documentation and driver (to be parsed).

Still possible I missed something and I doing shit :)