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