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