1Samsung S5P/EXYNOS SoC Camera Subsystem (FIMC)
2----------------------------------------------
3
4The S5P/Exynos SoC Camera subsystem comprises of multiple sub-devices
5represented by separate device tree nodes. Currently this includes: FIMC (in
6the S5P SoCs series known as CAMIF), MIPI CSIS, FIMC-LITE and FIMC-IS (ISP).
7
8The sub-subdevices are defined as child nodes of the common 'camera' node which
9also includes common properties of the whole subsystem not really specific to
10any single sub-device, like common camera port pins or the CAMCLK clock outputs
11for external image sensors attached to an SoC.
12
13Common 'camera' node
14--------------------
15
16Required properties:
17
18- compatible: must be "samsung,fimc", "simple-bus"
19- clocks: list of clock specifiers, corresponding to entries in
20  the clock-names property;
21- clock-names : must contain "sclk_cam0", "sclk_cam1", "pxl_async0",
22  "pxl_async1" entries, matching entries in the clocks property.
23
24- #clock-cells: from the common clock bindings (../clock/clock-bindings.txt),
25  must be 1. A clock provider is associated with the 'camera' node and it should
26  be referenced by external sensors that use clocks provided by the SoC on
27  CAM_*_CLKOUT pins. The clock specifier cell stores an index of a clock.
28  The indices are 0, 1 for CAM_A_CLKOUT, CAM_B_CLKOUT clocks respectively.
29
30- clock-output-names: from the common clock bindings, should contain names of
31  clocks registered by the camera subsystem corresponding to CAM_A_CLKOUT,
32  CAM_B_CLKOUT output clocks respectively.
33
34The pinctrl bindings defined in ../pinctrl/pinctrl-bindings.txt must be used
35to define a required pinctrl state named "default" and optional pinctrl states:
36"idle", "active-a", active-b". These optional states can be used to switch the
37camera port pinmux at runtime. The "idle" state should configure both the camera
38ports A and B into high impedance state, especially the CAMCLK clock output
39should be inactive. For the "active-a" state the camera port A must be activated
40and the port B deactivated and for the state "active-b" it should be the other
41way around.
42
43The 'camera' node must include at least one 'fimc' child node.
44
45
46'fimc' device nodes
47-------------------
48
49Required properties:
50
51- compatible: "samsung,s5pv210-fimc" for S5PV210, "samsung,exynos4210-fimc"
52  for Exynos4210 and "samsung,exynos4212-fimc" for Exynos4x12 SoCs;
53- reg: physical base address and length of the registers set for the device;
54- interrupts: should contain FIMC interrupt;
55- clocks: list of clock specifiers, must contain an entry for each required
56  entry in clock-names;
57- clock-names: must contain "fimc", "sclk_fimc" entries.
58- samsung,pix-limits: an array of maximum supported image sizes in pixels, for
59  details refer to Table 2-1 in the S5PV210 SoC User Manual; The meaning of
60  each cell is as follows:
61  0 - scaler input horizontal size,
62  1 - input horizontal size for the scaler bypassed,
63  2 - REAL_WIDTH without input rotation,
64  3 - REAL_HEIGHT with input rotation,
65- samsung,sysreg: a phandle to the SYSREG node.
66
67Each FIMC device should have an alias in the aliases node, in the form of
68fimc<n>, where <n> is an integer specifying the IP block instance.
69
70Optional properties:
71
72- clock-frequency: maximum FIMC local clock (LCLK) frequency;
73- samsung,min-pix-sizes: an array specyfing minimum image size in pixels at
74  the FIMC input and output DMA, in the first and second cell respectively.
75  Default value when this property is not present is <16 16>;
76- samsung,min-pix-alignment: minimum supported image height alignment (first
77  cell) and the horizontal image offset (second cell). The values are in pixels
78  and default to <2 1> when this property is not present;
79- samsung,mainscaler-ext: a boolean property indicating whether the FIMC IP
80  supports extended image size and has CIEXTEN register;
81- samsung,rotators: a bitmask specifying whether this IP has the input and
82  the output rotator. Bits 4 and 0 correspond to input and output rotator
83  respectively. If a rotator is present its corresponding bit should be set.
84  Default value when this property is not specified is 0x11.
85- samsung,cam-if: a bolean property indicating whether the IP block includes
86  the camera input interface.
87- samsung,isp-wb: this property must be present if the IP block has the ISP
88  writeback input.
89- samsung,lcd-wb: this property must be present if the IP block has the LCD
90  writeback input.
91
92
93'parallel-ports' node
94---------------------
95
96This node should contain child 'port' nodes specifying active parallel video
97input ports. It includes camera A and camera B inputs. 'reg' property in the
98port nodes specifies data input - 0, 1 indicates input A, B respectively.
99
100Optional properties
101
102- samsung,camclk-out (deprecated) : specifies clock output for remote sensor,
103  0 - CAM_A_CLKOUT, 1 - CAM_B_CLKOUT;
104
105Image sensor nodes
106------------------
107
108The sensor device nodes should be added to their control bus controller (e.g.
109I2C0) nodes and linked to a port node in the csis or the parallel-ports node,
110using the common video interfaces bindings, defined in video-interfaces.txt.
111
112Example:
113
114	aliases {
115		fimc0 = &fimc_0;
116	};
117
118	/* Parallel bus IF sensor */
119	i2c_0: i2c@13860000 {
120		s5k6aa: sensor@3c {
121			compatible = "samsung,s5k6aafx";
122			reg = <0x3c>;
123			vddio-supply = <...>;
124
125			clock-frequency = <24000000>;
126			clocks = <&camera 1>;
127			clock-names = "mclk";
128
129			port {
130				s5k6aa_ep: endpoint {
131					remote-endpoint = <&fimc0_ep>;
132					bus-width = <8>;
133					hsync-active = <0>;
134					vsync-active = <1>;
135					pclk-sample = <1>;
136				};
137			};
138		};
139
140		/* MIPI CSI-2 bus IF sensor */
141		s5c73m3: sensor@0x1a {
142			compatible = "samsung,s5c73m3";
143			reg = <0x1a>;
144			vddio-supply = <...>;
145
146			clock-frequency = <24000000>;
147			clocks = <&camera 0>;
148			clock-names = "mclk";
149
150			port {
151				s5c73m3_1: endpoint {
152					data-lanes = <1 2 3 4>;
153					remote-endpoint = <&csis0_ep>;
154				};
155			};
156		};
157	};
158
159	camera {
160		compatible = "samsung,fimc", "simple-bus";
161		clocks = <&clock 132>, <&clock 133>, <&clock 351>,
162			 <&clock 352>;
163		clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0",
164			      "pxl_async1";
165		#clock-cells = <1>;
166		clock-output-names = "cam_a_clkout", "cam_b_clkout";
167		pinctrl-names = "default";
168		pinctrl-0 = <&cam_port_a_clk_active>;
169		status = "okay";
170		#address-cells = <1>;
171		#size-cells = <1>;
172
173		/* parallel camera ports */
174		parallel-ports {
175			/* camera A input */
176			port@0 {
177				reg = <0>;
178				fimc0_ep: endpoint {
179					remote-endpoint = <&s5k6aa_ep>;
180					bus-width = <8>;
181					hsync-active = <0>;
182					vsync-active = <1>;
183					pclk-sample = <1>;
184				};
185			};
186		};
187
188		fimc_0: fimc@11800000 {
189			compatible = "samsung,exynos4210-fimc";
190			reg = <0x11800000 0x1000>;
191			interrupts = <0 85 0>;
192			status = "okay";
193		};
194
195		csis_0: csis@11880000 {
196			compatible = "samsung,exynos4210-csis";
197			reg = <0x11880000 0x1000>;
198			interrupts = <0 78 0>;
199			/* camera C input */
200			port@3 {
201				reg = <3>;
202				csis0_ep: endpoint {
203					remote-endpoint = <&s5c73m3_ep>;
204					data-lanes = <1 2 3 4>;
205					samsung,csis-hs-settle = <12>;
206				};
207			};
208		};
209	};
210
211The MIPI-CSIS device binding is defined in samsung-mipi-csis.txt.
212