xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/media/rockchip-cif.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Rockchip SoC Camera Interface
2----------------------------------------------
3
4Rockchip CIF is a camera interface for the Rockchip series of SoCs
5like px30, rk3288, rk312x, rk1808, RV1108 to receive frame data from camera or CCIR656 encoder,
6and transfer the data into system main memory by AXI bus.
7
8Required properties:
9- compatible: value should be one of the following
10	"rockchip,px30-cif";
11	"rockchip,rk1808-cif";
12	"rockchip,rk3128-cif";
13	"rockchip,rk3288-cif";
14- reg : offset and length of the register set for the device.
15- interrupts: should contain cif interrupt.
16- clocks: phandle to the required clocks.
17- clock-names: required clock name.
18
19Optional properties:
20- iommus: iommu node attached to cif if exist.
21- resets: CRU reset of cif if exist.
22
23port node
24-------------------
25
26The device node should contain one 'port' child node with child 'endpoint'
27nodes, according to the bindings defined in Documentation/devicetree/bindings/
28media/video-interfaces.txt.
29
30- endpoint(parallel):
31	- remote-endpoint: Connecting to a sensor with a parallel video bus or a mipi csi2 bus.
32	- parallel_bus properties: Refer to Documentation/devicetree/bindings/
33		media/video-interfaces.txt.
34	- mipi csi2 bus properties: Refer to Documentation/devicetree/bindings/
35		media/video-interfaces.txt.
36
37The port node must contain at least one endpoint.
38It could have multiple endpoints, but please note the hardware don't support
39two sensors work at a time, they are supposed to work asynchronously.
40
41Device node example
42-------------------
43
44	cif: cif@ff490000 {
45		compatible = "rockchip,px30-cif";
46		reg = <0x0 0xff490000 0x0 0x200>;
47		interrupts = <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
48		clocks = <&cru ACLK_CIF>, <&cru HCLK_CIF>, <&cru PCLK_CIF>, <&cru SCLK_CIF_OUT>;
49		clock-names = "aclk_cif", "hclk_cif", "pclk_cif", "cif_out";
50		resets = <&cru SRST_CIF_A>, <&cru SRST_CIF_H>, <&cru SRST_CIF_PCLKIN>;
51		reset-names = "rst_cif_a", "rst_cif_h", "rst_cif_pclkin";
52		power-domains = <&power PX30_PD_VI>;
53		iommus = <&vip_mmu>;
54		status = "okay";
55		port {
56			cif_in: endpoint {
57				remote-endpoint = <&gc2155_out>;
58				vsync-active = <0>;
59				hsync-active = <1>;
60			};
61		};
62	};
63
64	cif: cif@ffae0000 {
65		compatible = "rockchip,rk1808-cif";
66		reg = <0x0 0xffae0000 0x0 0x200>, <0x0 0xffb10000 0x0 0x100>;
67		reg-names = "cif_regs", "csihost_regs";
68		interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
69		clocks = <&cru ACLK_CIF>, <&cru DCLK_CIF>,
70			 <&cru HCLK_CIF>, <&cru SCLK_CIF_OUT>,
71			 <&cru PCLK_CSI2HOST>;
72		clock-names = "aclk_cif", "dclk_cif",
73			"hclk_cif", "sclk_cif_out",
74			"pclk_csi2host";
75		resets = <&cru SRST_CIF_A>, <&cru SRST_CIF_H>,
76			 <&cru SRST_CIF_I>, <&cru SRST_CIF_D>,
77			<&cru SRST_CIF_PCLKIN>;
78		reset-names = "rst_cif_a", "rst_cif_h",
79			"rst_cif_i", "rst_cif_d",
80			"rst_cif_pclkin";
81		power-domains = <&power RK1808_PD_VIO>;
82		iommus = <&cif_mmu>;
83		status = "okay";
84		port {
85			cif_in: endpoint@0 {
86				remote-endpoint = <&dphy_rx_out>;
87				data-lanes = <1 2 3 4>;
88			};
89		};
90	};
91
92	cif: cif@1010a000 {
93		compatible = "rockchip,rk3128-cif";
94		reg = <0x1010a000 0x200>;
95
96		clocks = <&cru ACLK_CIF>, <&cru HCLK_CIF>,
97			 <&cru SCLK_CIF_OUT>;
98		clock-names = "aclk_cif", "hclk_cif",
99			      "sclk_cif_out";
100		resets = <&cru SRST_CIF0>;
101		reset-names = "rst_cif";
102		interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
103		/* px3se has not iommu attached */
104		/* iommus = <&cif_mmu>; */
105		power-domains = <&power RK3128_PD_VIO>;
106
107		status = "okay";
108
109		port {
110			cif_in: endpoint {
111				remote-endpoint = <&adv7181_out>;
112				vsync-active = <0>;
113				hsync-active = <1>;
114			};
115		};
116	};
117