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

Alexandre Mergnat amergnat at baylibre.com
Sun May 19 10:18:03 PDT 2024


Hi Angelo,

On 16/05/2024 10:11, AngeloGioacchino Del Regno wrote:
> +    oneOf:
> +      - required:
> +          - endpoint at 0
> +      - required:
> +          - endpoint at 1
> +      - required:
> +          - endpoint at 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 at 14000000 {
			compatible = "mediatek,mt8365-mmsys", "syscon";
			reg = <0 0x14000000 0 0x1000>;
			#clock-cells = <1>;
			port {
				#address-cells = <1>;
				#size-cells = <0>;

				mmsys_main: endpoint at 0 {
					reg = <0>;
					remote-endpoint = <&ovl0_in>;
				};
				mmsys_ext: endpoint at 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 at 14000000: port: 
More than one condition true in oneOf schema:
         {'$ref': '/schemas/graph.yaml#/properties/port', 

          'oneOf': [{'required': ['endpoint at 0']}, 

                    {'required': ['endpoint at 1']}, 

                    {'required': ['endpoint at 2']}], 

          'properties': {'endpoint at 0': {'$ref': '/schemas/graph.yaml#/properties/endpoint'}, 

                         'endpoint at 1': {'$ref': '/schemas/graph.yaml#/properties/endpoint'},
                         'endpoint at 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 at 14000000 {
			compatible = "mediatek,mt8365-mmsys", "syscon";
			reg = <0 0x14000000 0 0x1000>;
			#clock-cells = <1>;
			ports {
				#address-cells = <1>;
				#size-cells = <0>;

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

				port at 1 {
					#address-cells = <1>;
					#size-cells = <0>;
					reg = <1>;
					mmsys_ext: endpoint at 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 at 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".
- adding the "ports" support in the documentation and driver (to be parsed).

Still possible I missed something and I doing shit :)

-- 
Regards,
Alexandre



More information about the linux-arm-kernel mailing list