summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/media/samsung-fimc.txt
blob: 48c599dacbdf7baafbc2cc3a64c170a44ba95313 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
Samsung S5P/EXYNOS SoC Camera Subsystem (FIMC)
----------------------------------------------

The S5P/Exynos SoC Camera subsystem comprises of multiple sub-devices
represented by separate device tree nodes. Currently this includes: FIMC (in
the S5P SoCs series known as CAMIF), MIPI CSIS, FIMC-LITE and FIMC-IS (ISP).

The sub-subdevices are defined as child nodes of the common 'camera' node which
also includes common properties of the whole subsystem not really specific to
any single sub-device, like common camera port pins or the CAMCLK clock outputs
for external image sensors attached to an SoC.

Common 'camera' node
--------------------

Required properties:

- compatible: must be "samsung,fimc", "simple-bus"
- clocks: list of clock specifiers, corresponding to entries in
  the clock-names property;
- clock-names : must contain "sclk_cam0", "sclk_cam1", "pxl_async0",
  "pxl_async1" entries, matching entries in the clocks property.

- #clock-cells: from the common clock bindings (../clock/clock-bindings.txt),
  must be 1. A clock provider is associated with the 'camera' node and it should
  be referenced by external sensors that use clocks provided by the SoC on
  CAM_*_CLKOUT pins. The clock specifier cell stores an index of a clock.
  The indices are 0, 1 for CAM_A_CLKOUT, CAM_B_CLKOUT clocks respectively.

- clock-output-names: from the common clock bindings, should contain names of
  clocks registered by the camera subsystem corresponding to CAM_A_CLKOUT,
  CAM_B_CLKOUT output clocks respectively.

The pinctrl bindings defined in ../pinctrl/pinctrl-bindings.txt must be used
to define a required pinctrl state named "default" and optional pinctrl states:
"idle", "active-a", active-b". These optional states can be used to switch the
camera port pinmux at runtime. The "idle" state should configure both the camera
ports A and B into high impedance state, especially the CAMCLK clock output
should be inactive. For the "active-a" state the camera port A must be activated
and the port B deactivated and for the state "active-b" it should be the other
way around.

The 'camera' node must include at least one 'fimc' child node.


'fimc' device nodes
-------------------

Required properties:

- compatible: "samsung,s5pv210-fimc" for S5PV210, "samsung,exynos4210-fimc"
  for Exynos4210 and "samsung,exynos4212-fimc" for Exynos4x12 SoCs;
- reg: physical base address and length of the registers set for the device;
- interrupts: should contain FIMC interrupt;
- clocks: list of clock specifiers, must contain an entry for each required
  entry in clock-names;
- clock-names: must contain "fimc", "sclk_fimc" entries.
- samsung,pix-limits: an array of maximum supported image sizes in pixels, for
  details refer to Table 2-1 in the S5PV210 SoC User Manual; The meaning of
  each cell is as follows:
  0 - scaler input horizontal size,
  1 - input horizontal size for the scaler bypassed,
  2 - REAL_WIDTH without input rotation,
  3 - REAL_HEIGHT with input rotation,
- samsung,sysreg: a phandle to the SYSREG node.

Each FIMC device should have an alias in the aliases node, in the form of
fimc<n>, where <n> is an integer specifying the IP block instance.

Optional properties:

- clock-frequency: maximum FIMC local clock (LCLK) frequency;
- samsung,min-pix-sizes: an array specyfing minimum image size in pixels at
  the FIMC input and output DMA, in the first and second cell respectively.
  Default value when this property is not present is <16 16>;
- samsung,min-pix-alignment: minimum supported image height alignment (first
  cell) and the horizontal image offset (second cell). The values are in pixels
  and default to <2 1> when this property is not present;
- samsung,mainscaler-ext: a boolean property indicating whether the FIMC IP
  supports extended image size and has CIEXTEN register;
- samsung,rotators: a bitmask specifying whether this IP has the input and
  the output rotator. Bits 4 and 0 correspond to input and output rotator
  respectively. If a rotator is present its corresponding bit should be set.
  Default value when this property is not specified is 0x11.
- samsung,cam-if: a bolean property indicating whether the IP block includes
  the camera input interface.
- samsung,isp-wb: this property must be present if the IP block has the ISP
  writeback input.
- samsung,lcd-wb: this property must be present if the IP block has the LCD
  writeback input.


'parallel-ports' node
---------------------

This node should contain child 'port' nodes specifying active parallel video
input ports. It includes camera A and camera B inputs. 'reg' property in the
port nodes specifies data input - 0, 1 indicates input A, B respectively.

Optional properties

- samsung,camclk-out (deprecated) : specifies clock output for remote sensor,
  0 - CAM_A_CLKOUT, 1 - CAM_B_CLKOUT;

Image sensor nodes
------------------

The sensor device nodes should be added to their control bus controller (e.g.
I2C0) nodes and linked to a port node in the csis or the parallel-ports node,
using the common video interfaces bindings, defined in video-interfaces.txt.

Example:

	aliases {
		fimc0 = &fimc_0;
	};

	/* Parallel bus IF sensor */
	i2c_0: i2c@13860000 {
		s5k6aa: sensor@3c {
			compatible = "samsung,s5k6aafx";
			reg = <0x3c>;
			vddio-supply = <...>;

			clock-frequency = <24000000>;
			clocks = <&camera 1>;
			clock-names = "mclk";

			port {
				s5k6aa_ep: endpoint {
					remote-endpoint = <&fimc0_ep>;
					bus-width = <8>;
					hsync-active = <0>;
					vsync-active = <1>;
					pclk-sample = <1>;
				};
			};
		};

		/* MIPI CSI-2 bus IF sensor */
		s5c73m3: sensor@1a {
			compatible = "samsung,s5c73m3";
			reg = <0x1a>;
			vddio-supply = <...>;

			clock-frequency = <24000000>;
			clocks = <&camera 0>;
			clock-names = "mclk";

			port {
				s5c73m3_1: endpoint {
					data-lanes = <1 2 3 4>;
					remote-endpoint = <&csis0_ep>;
				};
			};
		};
	};

	camera {
		compatible = "samsung,fimc", "simple-bus";
		clocks = <&clock 132>, <&clock 133>, <&clock 351>,
			 <&clock 352>;
		clock-names = "sclk_cam0", "sclk_cam1", "pxl_async0",
			      "pxl_async1";
		#clock-cells = <1>;
		clock-output-names = "cam_a_clkout", "cam_b_clkout";
		pinctrl-names = "default";
		pinctrl-0 = <&cam_port_a_clk_active>;
		#address-cells = <1>;
		#size-cells = <1>;

		/* parallel camera ports */
		parallel-ports {
			/* camera A input */
			port@0 {
				reg = <0>;
				fimc0_ep: endpoint {
					remote-endpoint = <&s5k6aa_ep>;
					bus-width = <8>;
					hsync-active = <0>;
					vsync-active = <1>;
					pclk-sample = <1>;
				};
			};
		};

		fimc_0: fimc@11800000 {
			compatible = "samsung,exynos4210-fimc";
			reg = <0x11800000 0x1000>;
			interrupts = <0 85 0>;
		};

		csis_0: csis@11880000 {
			compatible = "samsung,exynos4210-csis";
			reg = <0x11880000 0x1000>;
			interrupts = <0 78 0>;
			/* camera C input */
			port@3 {
				reg = <3>;
				csis0_ep: endpoint {
					remote-endpoint = <&s5c73m3_ep>;
					data-lanes = <1 2 3 4>;
					samsung,csis-hs-settle = <12>;
				};
			};
		};
	};

The MIPI-CSIS device binding is defined in samsung-mipi-csis.txt.