xref: /linux/Documentation/devicetree/bindings/media/brcm,bcm2835-unicam.yaml (revision 36ec807b627b4c0a0a382f0ae48eac7187d14b2b)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/media/brcm,bcm2835-unicam.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Broadcom BCM283x Camera Interface (Unicam)
8
9maintainers:
10  - Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
11
12description: |-
13  The Unicam block on BCM283x SoCs is the receiver for either
14  CSI-2 or CCP2 data from image sensors or similar devices.
15
16  The main platform using this SoC is the Raspberry Pi family of boards.  On
17  the Pi the VideoCore firmware can also control this hardware block, and
18  driving it from two different processors will cause issues.  To avoid this,
19  the firmware checks the device tree configuration during boot. If it finds
20  device tree nodes whose name starts with 'csi' then it will stop the firmware
21  accessing the block, and it can then safely be used via the device tree
22  binding.
23
24properties:
25  compatible:
26    const: brcm,bcm2835-unicam
27
28  reg:
29    items:
30      - description: Unicam block.
31      - description: Clock Manager Image (CMI) block.
32
33  reg-names:
34    items:
35      - const: unicam
36      - const: cmi
37
38  interrupts:
39    maxItems: 1
40
41  clocks:
42    items:
43      - description: Clock to drive the LP state machine of Unicam.
44      - description: Clock for the VPU (core clock).
45
46  clock-names:
47    items:
48      - const: lp
49      - const: vpu
50
51  power-domains:
52    items:
53      - description: Unicam power domain
54
55  brcm,num-data-lanes:
56    $ref: /schemas/types.yaml#/definitions/uint32
57    enum: [ 2, 4 ]
58    description: |
59      Number of CSI-2 data lanes supported by this Unicam instance. The number
60      of data lanes actively used is specified with the data-lanes endpoint
61      property.
62
63  port:
64    $ref: /schemas/graph.yaml#/$defs/port-base
65    unevaluatedProperties: false
66
67    properties:
68      endpoint:
69        $ref: /schemas/media/video-interfaces.yaml#
70        additionalProperties: false
71
72        properties:
73          bus-type:
74            enum: [ 3, 4 ]
75
76          clock-noncontinuous: true
77          data-lanes: true
78          remote-endpoint: true
79
80        required:
81          - bus-type
82          - data-lanes
83          - remote-endpoint
84
85    required:
86      - endpoint
87
88required:
89  - compatible
90  - reg
91  - reg-names
92  - interrupts
93  - clocks
94  - clock-names
95  - power-domains
96  - brcm,num-data-lanes
97  - port
98
99additionalProperties: False
100
101examples:
102  - |
103    #include <dt-bindings/clock/bcm2835.h>
104    #include <dt-bindings/interrupt-controller/arm-gic.h>
105    #include <dt-bindings/media/video-interfaces.h>
106    #include <dt-bindings/power/raspberrypi-power.h>
107
108    csi1: csi@7e801000 {
109        compatible = "brcm,bcm2835-unicam";
110        reg = <0x7e801000 0x800>,
111              <0x7e802004 0x4>;
112        reg-names = "unicam", "cmi";
113        interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
114        clocks = <&clocks BCM2835_CLOCK_CAM1>,
115                 <&firmware_clocks 4>;
116        clock-names = "lp", "vpu";
117        power-domains = <&power RPI_POWER_DOMAIN_UNICAM1>;
118        brcm,num-data-lanes = <2>;
119        port {
120                csi1_ep: endpoint {
121                        remote-endpoint = <&imx219_0>;
122                        bus-type = <MEDIA_BUS_TYPE_CSI2_DPHY>;
123                        data-lanes = <1 2>;
124                };
125        };
126    };
127...
128