bcm27xx: update patches from RPi foundation
[oweals/openwrt.git] / target / linux / bcm27xx / patches-5.4 / 950-0160-dt-bindings-Document-BCM283x-CSI2-CCP2-receiver.patch
1 From a9fd19f2fc9c3f067ea32e53f84c9e83b8f910c5 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Wed, 31 Oct 2018 14:59:06 +0000
4 Subject: [PATCH] dt-bindings: Document BCM283x CSI2/CCP2 receiver
5
6 Document the DT bindings for the CSI2/CCP2 receiver peripheral
7 (known as Unicam) on BCM283x SoCs.
8
9 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
10 Acked-by: Rob Herring <robh@kernel.org>
11 ---
12  .../bindings/media/bcm2835-unicam.txt         | 85 +++++++++++++++++++
13  1 file changed, 85 insertions(+)
14  create mode 100644 Documentation/devicetree/bindings/media/bcm2835-unicam.txt
15
16 --- /dev/null
17 +++ b/Documentation/devicetree/bindings/media/bcm2835-unicam.txt
18 @@ -0,0 +1,85 @@
19 +Broadcom BCM283x Camera Interface (Unicam)
20 +------------------------------------------
21 +
22 +The Unicam block on BCM283x SoCs is the receiver for either
23 +CSI-2 or CCP2 data from image sensors or similar devices.
24 +
25 +The main platform using this SoC is the Raspberry Pi family of boards.
26 +On the Pi the VideoCore firmware can also control this hardware block,
27 +and driving it from two different processors will cause issues.
28 +To avoid this, the firmware checks the device tree configuration
29 +during boot. If it finds device tree nodes called csi0 or csi1 then
30 +it will stop the firmware accessing the block, and it can then
31 +safely be used via the device tree binding.
32 +
33 +Required properties:
34 +===================
35 +- compatible   : must be "brcm,bcm2835-unicam".
36 +- reg          : physical base address and length of the register sets for the
37 +                 device.
38 +- interrupts   : should contain the IRQ line for this Unicam instance.
39 +- clocks       : list of clock specifiers, corresponding to entries in
40 +                 clock-names property.
41 +- clock-names  : must contain an "lp" entry, matching entries in the
42 +                 clocks property.
43 +
44 +Unicam supports a single port node. It should contain one 'port' child node
45 +with child 'endpoint' node. Please refer to the bindings defined in
46 +Documentation/devicetree/bindings/media/video-interfaces.txt.
47 +
48 +Within the endpoint node the "remote-endpoint" and "data-lanes" properties
49 +are mandatory.
50 +Data lane reordering is not supported so the data lanes must be in order,
51 +starting at 1. The number of data lanes should represent the number of
52 +usable lanes for the hardware block. That may be limited by either the SoC or
53 +how the platform presents the interface, and the lower value must be used.
54 +
55 +Lane reordering is not supported on the clock lane either, so the optional
56 +property "clock-lane" will implicitly be <0>.
57 +Similarly lane inversion is not supported, therefore "lane-polarities" will
58 +implicitly be <0 0 0 0 0>.
59 +Neither of these values will be checked.
60 +
61 +Example:
62 +       csi1: csi1@7e801000 {
63 +               compatible = "brcm,bcm2835-unicam";
64 +               reg = <0x7e801000 0x800>,
65 +                     <0x7e802004 0x4>;
66 +               interrupts = <2 7>;
67 +               clocks = <&clocks BCM2835_CLOCK_CAM1>;
68 +               clock-names = "lp";
69 +
70 +               port {
71 +                       csi1_ep: endpoint {
72 +                               remote-endpoint = <&tc358743_0>;
73 +                               data-lanes = <1 2>;
74 +                       };
75 +               };
76 +       };
77 +
78 +       i2c0: i2c@7e205000 {
79 +               tc358743: csi-hdmi-bridge@0f {
80 +                       compatible = "toshiba,tc358743";
81 +                       reg = <0x0f>;
82 +
83 +                       clocks = <&tc358743_clk>;
84 +                       clock-names = "refclk";
85 +
86 +                       tc358743_clk: bridge-clk {
87 +                               compatible = "fixed-clock";
88 +                               #clock-cells = <0>;
89 +                               clock-frequency = <27000000>;
90 +                       };
91 +
92 +                       port {
93 +                               tc358743_0: endpoint {
94 +                                       remote-endpoint = <&csi1_ep>;
95 +                                       clock-lanes = <0>;
96 +                                       data-lanes = <1 2>;
97 +                                       clock-noncontinuous;
98 +                                       link-frequencies =
99 +                                               /bits/ 64 <297000000>;
100 +                               };
101 +                       };
102 +               };
103 +       };