18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
28c2ecf20Sopenharmony_ci# Copyright (C) 2019 Renesas Electronics Corp.
38c2ecf20Sopenharmony_ci%YAML 1.2
48c2ecf20Sopenharmony_ci---
58c2ecf20Sopenharmony_ci$id: http://devicetree.org/schemas/media/i2c/imi,rdacm2x-gmsl.yaml#
68c2ecf20Sopenharmony_ci$schema: http://devicetree.org/meta-schemas/core.yaml#
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_cititle: IMI D&D RDACM20 and RDACM21 Automotive Camera Platforms
98c2ecf20Sopenharmony_ci
108c2ecf20Sopenharmony_cimaintainers:
118c2ecf20Sopenharmony_ci  - Jacopo Mondi <jacopo+renesas@jmondi.org>
128c2ecf20Sopenharmony_ci  - Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
138c2ecf20Sopenharmony_ci  - Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
148c2ecf20Sopenharmony_ci  - Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cidescription: -|
178c2ecf20Sopenharmony_ci  The IMI D&D RDACM20 and RDACM21 are GMSL-compatible camera designed for
188c2ecf20Sopenharmony_ci  automotive applications.
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci  The RDACM20 camera module encloses a Maxim Integrated MAX9271 GMSL serializer,
218c2ecf20Sopenharmony_ci  coupled with an OV10635 image sensor and an embedded MCU. Both the MCU and
228c2ecf20Sopenharmony_ci  the image sensor are connected to the serializer local I2C bus and are
238c2ecf20Sopenharmony_ci  accessible by the host SoC by direct addressing.
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci  The RDACM21 camera module encloses the same serializer, coupled with an
268c2ecf20Sopenharmony_ci  OV10640 image sensor and an OV490 ISP. Only the OV490 ISP is interfaced to
278c2ecf20Sopenharmony_ci  the serializer local I2C bus while the image sensor is not accessible from
288c2ecf20Sopenharmony_ci  the host SoC.
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci  They both connect to a remote GMSL endpoint through a coaxial cable.
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci                                                   IMI RDACM20
338c2ecf20Sopenharmony_ci  +---------------+                        +--------------------------------+
348c2ecf20Sopenharmony_ci  |      GMSL     |   <- Video Stream      |       <- Video--------\        |
358c2ecf20Sopenharmony_ci  |               |< === GMSL Link ====== >|MAX9271<- I2C bus-> <-->OV10635 |
368c2ecf20Sopenharmony_ci  | de-serializer |   <- I2C messages ->   |                   \<-->MCU     |
378c2ecf20Sopenharmony_ci  +---------------+                        +--------------------------------+
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_ci                                                   IMI RDACM21
408c2ecf20Sopenharmony_ci  +---------------+                        +--------------------------------+
418c2ecf20Sopenharmony_ci  |      GMSL     |   <- Video Stream      |       <- Video--------\        |
428c2ecf20Sopenharmony_ci  |               |< === GMSL Link ====== >|MAX9271<- I2C bus-> <-->OV490   |
438c2ecf20Sopenharmony_ci  |               |   <- I2C messages ->   |                          |     |
448c2ecf20Sopenharmony_ci  | de-serializer |                        |          OV10640 <-------|     |
458c2ecf20Sopenharmony_ci  +---------------+                        +--------------------------------+
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci  Both camera modules serialize video data generated by the embedded camera
488c2ecf20Sopenharmony_ci  sensor on the GMSL serial channel to a remote GMSL de-serializer. They also
498c2ecf20Sopenharmony_ci  receive and transmit I2C messages encapsulated and transmitted on the GMSL
508c2ecf20Sopenharmony_ci  bidirectional control channel.
518c2ecf20Sopenharmony_ci
528c2ecf20Sopenharmony_ci  All I2C traffic received on the GMSL link not directed to the serializer is
538c2ecf20Sopenharmony_ci  propagated on the local I2C bus to the remote device there connected. All the
548c2ecf20Sopenharmony_ci  I2C traffic generated on the local I2C bus not directed to the serializer is
558c2ecf20Sopenharmony_ci  propagated to the remote de-serializer encapsulated in the GMSL control
568c2ecf20Sopenharmony_ci  channel.
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci  The RDACM20 and RDACM21 DT node should be a direct child of the GMSL
598c2ecf20Sopenharmony_ci  deserializer's I2C bus corresponding to the GMSL link that the camera is
608c2ecf20Sopenharmony_ci  attached to.
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ciproperties:
638c2ecf20Sopenharmony_ci  '#address-cells':
648c2ecf20Sopenharmony_ci    const: 1
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci  '#size-cells':
678c2ecf20Sopenharmony_ci    const: 0
688c2ecf20Sopenharmony_ci
698c2ecf20Sopenharmony_ci  compatible:
708c2ecf20Sopenharmony_ci    enum:
718c2ecf20Sopenharmony_ci      - imi,rdacm20
728c2ecf20Sopenharmony_ci      - imi,rdacm21
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci  reg:
758c2ecf20Sopenharmony_ci    description: -|
768c2ecf20Sopenharmony_ci      I2C device addresses, the first to be assigned to the serializer, the
778c2ecf20Sopenharmony_ci      following ones to be assigned to the remote devices.
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci      For RDACM20 the second entry of the property is assigned to the
808c2ecf20Sopenharmony_ci      OV10635 image sensor and the optional third one to the embedded MCU.
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci      For RDACM21 the second entry is assigned to the OV490 ISP and the optional
838c2ecf20Sopenharmony_ci      third one ignored.
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci    minItems: 2
868c2ecf20Sopenharmony_ci    maxItems: 3
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci  port:
898c2ecf20Sopenharmony_ci    type: object
908c2ecf20Sopenharmony_ci    additionalProperties: false
918c2ecf20Sopenharmony_ci    description: -|
928c2ecf20Sopenharmony_ci      Connection to the remote GMSL endpoint are modelled using the OF graph
938c2ecf20Sopenharmony_ci      bindings in accordance with the video interface bindings defined in
948c2ecf20Sopenharmony_ci      Documentation/devicetree/bindings/media/video-interfaces.txt.
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci      The device node contains a single "port" child node with a single
978c2ecf20Sopenharmony_ci      "endpoint" sub-device.
988c2ecf20Sopenharmony_ci
998c2ecf20Sopenharmony_ci    properties:
1008c2ecf20Sopenharmony_ci      endpoint:
1018c2ecf20Sopenharmony_ci        type: object
1028c2ecf20Sopenharmony_ci        additionalProperties: false
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci        properties:
1058c2ecf20Sopenharmony_ci          remote-endpoint:
1068c2ecf20Sopenharmony_ci            description: -|
1078c2ecf20Sopenharmony_ci              phandle to the remote GMSL endpoint sub-node in the remote node
1088c2ecf20Sopenharmony_ci              port.
1098c2ecf20Sopenharmony_ci            maxItems: 1
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci        required:
1128c2ecf20Sopenharmony_ci          - remote-endpoint
1138c2ecf20Sopenharmony_ci
1148c2ecf20Sopenharmony_ci    required:
1158c2ecf20Sopenharmony_ci      - endpoint
1168c2ecf20Sopenharmony_ci
1178c2ecf20Sopenharmony_cirequired:
1188c2ecf20Sopenharmony_ci  - compatible
1198c2ecf20Sopenharmony_ci  - reg
1208c2ecf20Sopenharmony_ci  - port
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ciadditionalProperties: false
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ciexamples:
1258c2ecf20Sopenharmony_ci  - |
1268c2ecf20Sopenharmony_ci    i2c@e66d8000 {
1278c2ecf20Sopenharmony_ci      #address-cells = <1>;
1288c2ecf20Sopenharmony_ci      #size-cells = <0>;
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci      reg = <0 0xe66d8000>;
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci      camera@31 {
1338c2ecf20Sopenharmony_ci        compatible = "imi,rdacm20";
1348c2ecf20Sopenharmony_ci        reg = <0x31>, <0x41>, <0x51>;
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ci        port {
1378c2ecf20Sopenharmony_ci          rdacm20_out0: endpoint {
1388c2ecf20Sopenharmony_ci            remote-endpoint = <&max9286_in0>;
1398c2ecf20Sopenharmony_ci          };
1408c2ecf20Sopenharmony_ci        };
1418c2ecf20Sopenharmony_ci      };
1428c2ecf20Sopenharmony_ci    };
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci  - |
1458c2ecf20Sopenharmony_ci    i2c@e66d8000 {
1468c2ecf20Sopenharmony_ci      #address-cells = <1>;
1478c2ecf20Sopenharmony_ci      #size-cells = <0>;
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci      reg = <0 0xe66d8000>;
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci      camera@31 {
1528c2ecf20Sopenharmony_ci        compatible = "imi,rdacm21";
1538c2ecf20Sopenharmony_ci        reg = <0x31>, <0x41>;
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci        port {
1568c2ecf20Sopenharmony_ci          rdacm21_out0: endpoint {
1578c2ecf20Sopenharmony_ci            remote-endpoint = <&max9286_in0>;
1588c2ecf20Sopenharmony_ci          };
1598c2ecf20Sopenharmony_ci        };
1608c2ecf20Sopenharmony_ci      };
1618c2ecf20Sopenharmony_ci    };
162