summaryrefslogtreecommitdiff
path: root/bindings/msm-cam-cpas.txt
blob: c18b74391c18d1532d0f744edf388cf93456f038 (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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
* Qualcomm Technologies, Inc. MSM Camera CPAS

The MSM camera CPAS device provides dependency definitions for
enabling Camera CPAS HW and provides the Client definitions
for all HW blocks that use CPAS driver for BW voting. These
definitions consist of various properties that define the list
of clients supported, AHB, AXI master-slave IDs used for BW
voting.

=======================
Required Node Structure
=======================
The camera CPAS device must be described in five levels. The first level has
general description of cpas including compatibility, interrupts, power info
etc.
The second level deals with information related to CPAS clients and how
the BW should be calculated. For simplicity in BW vote consolidation, the
grouping of granular votes pertaining to CPAS clients is represented as nodes
at four CAMNOC levels. The nodes at a particular level have some common
properties such as traffic merge type which indicates whether the votes at a
node have to be summed up, sum divided by two or taken max of all. CAMNOC Level
zero node usually represents granular vote info for clients. CAMNOC Level one
represents nodes which are clubbed together by arbiter in CAMNOC diagram. CAMNOC
Level two represents consolidated read and write nodes for RT and NRT paths.
CAMNOC Level three provides axi port information and these have nodes where all
paths from clients eventually converge according to their properties. This
includes master-slave IDs, ab, ib values for mnoc, camnoc bus interface

==================================
First Level Node - CAM CPAS device
==================================
- cell-index
  Usage: required
  Value type: <u32>
  Definition: Node instance number.

- compatible
  Usage: required
  Value type: <string>
  Definition: Should be "qcom,cam-cpas".

- label
  Usage: required
  Value type: <string>
  Definition: Should be "cpas".

- arch-compat
  Usage: required
  Value type: <string>
  Definition: Should be "cpas_top" or "camss_top".

- reg-names
  Usage: required
  Value type: <string>
  Definition: Name of the register resources.

- reg
  Usage: required
  Value type: <u32>
  Definition: Register values.

- reg-cam-base
  Usage: required
  Value type: <u32>
  Definition: Offset of the register space compared to
	to Camera base register space.

- cam_hw_fuse
  Usage: optional
  Value type: <u32>
  Definition: List of fuse based features and respective
	fuse info.

- interrupt-names
  Usage: optional
  Value type: <string>
  Definition: Name of the interrupt.

- interrupts
  Usage: optional
  Value type: <u32>
  Definition: Interrupt associated with CAMNOC HW.

- qcom,cpas-hw-ver
  Usage: required
  Value type: <u32>
  Definition: CAM HW Version information.

- camnoc-axi-min-ib-bw
  Usage: optional
  Value type: <u64>
  Definition: Min camnoc axi bw for the given target.

- regulator-names
  Usage: required
  Value type: <string>
  Definition: Name of the regulator resources for CPAS HW.

- camss-vdd-supply
  Usage: required
  Value type: <phandle>
  Definition: Regulator reference corresponding to the names listed
	in "regulator-names".

- clock-names
  Usage: required
  Value type: <string>
  Definition: List of clock names required for CPAS HW.

- clocks
  Usage: required
  Value type: <phandle>
  Definition: List of clocks used for CPAS HW.

- src-clock-name
  Usage: required
  Value type: <string>
  Definition: Source clock name.

- clock-rates
  Usage: required
  Value type: <u32>
  Definition: List of clocks rates.

- clock-cntl-level
  Usage: required
  Value type: <string>
  Definition: List of strings corresponds clock-rates levels.
  Supported strings: minsvs, lowsvs, svs, svs_l1, nominal, turbo.

- control-camnoc-axi-clk
  Usage: optional
  Value type: <empty>
  Definition: Bool property specifying whether to control camnoc axi
              clock from cpas driver.

- camnoc-bus-width
  Usage: required if control-camnoc-axi-clk is enabled
  Value type: <u32>
  Definition: camnoc bus width.

- camnoc-axi-clk-bw-margin-perc
  Usage: optional
  Value type: <u32>
  Definition: Percentage value to be added to camnoc bw while calculating
              camnoc axi clock frequency.

- qcom,msm-bus,name
- qcom,msm-bus,num-cases
- qcom,msm-bus,num-paths
- qcom,msm-bus,vectors-KBps
  Please refer Documentation/devicetree/bindings/arm/msm/msm_bus.txt
  for the properties above.

- vdd-corners
  Usage: required
  Value type: <u32>
  Definition: List of vdd corners to map for ahb level.

- vdd-corner-ahb-mapping
  Usage: required
  Value type: <string>
  Definition: List of ahb level strings corresponds to vdd-corners.
  Supported strings: suspend, svs, nominal, turbo

- client-id-based
  Usage: required
  Value type: <empty>
  Definition: Bool property specifying whether CPAS clients are ID based.

- client-names
  Usage: required
  Value type: <string>
  Definition: List of Clients supported by CPAS.

- client-bus-camnoc-based
  Usage: optional
  Value type: <empty>
  Definition: Bool property specifying whether Clients are connected
	through CAMNOC for AXI access.

===================================================================
Third Level Node - CAMNOC Level nodes
===================================================================
- level-index
  Usage: required
  Value type: <u32>
  Definition: Number representing level index for ndoes at current CAMNOC level

- camnoc-max-needed
  Usage: optional
  Value type: <empty>
  Definition: Bool property for all votes at current level to be taken maximum
              for CAMNOC BW calculation.

===================================================================
Fourth Level Node - Generic CAMNOC node properties
===================================================================
- cell-index
  Usage: required
  Value type: <u32>
  Definition: Unique index of node to be used by CPAS driver.

- node-name
  Usage: required
  Value type: <string>
  Definition: Unique name representing this node.

- path-data-type
  Usage: required if a CAMNOC Level 0 Node
  Value type: <u32>
  Definition: Type of path data for a specific client.
  Supported : CAM_CPAS_PATH_DATA_IFE_LINEAR, CAM_CPAS_PATH_DATA_ALL, etc.
              Please refer dt-bindings/msm/msm-camera.h for all supported
              definitions.

- path-transaction-type
  Usage: required if a CAMNOC Level 0 Node
  Value type: <u32>
  Definition: Type of path transaction for a specific client.
  Supported : CAM_CPAS_TRANSACTION_READ, CAM_CPAS_TRANSACTION_WRITE

- client-name
  Usage: required if a CAMNOC Level 0 Node
  Value type: <string>
  Definition: Name of the client with above properties.
  Supported : From "client-names" property in CPAS node

- constituent-paths
  Usage: optional, applicable only to CAMNOC Level 0 Nodes
  Value type: <u32>
  Definition: List of constituents of path data type of current node.
  Supported : CAM_CPAS_PATH_DATA_IFE_VID, CAM_CPAS_PATH_DATA_IFE_DISP, etc.
              Please refer dt-bindings/msm/msm-camera.h for all supported
              definitions.

- traffic-merge-type
  Usage: required if NOT a CAMNOC Level 0 Node
  Value type: <u32>
  Definition: Type of traffic merge for that node.
  Supported : CAM_CPAS_TRAFFIC_MERGE_SUM, CAM_CPAS_TRAFFIC_MERGE_SUM_INTERLEAVE.

- parent-node
  Usage: required for all except CAMNOC Level 3 Nodes
  Value type: <phandle>
  Definition: Parent node of this node. Parent node must be at least
              one level above the current level.

- bus-width-factor
  Usage: optional
  Value type: <u32>
  Definition: For bus width factor consideration in CAMNOC BW calculation

- qcom,axi-port-name
  Usage: required at CAMNOC Level 3
  Value type: <string>
  Definition: Name of the AXI Port.

- ib-bw-voting-needed
  Usage: optional
  Value type: <empty>
  Definition: Bool property indicating axi port requires instantaneous bandwidth

===================================================================
Fifth Level Node - CAM AXI Bus Properties
===================================================================
- qcom,msm-bus,name
- qcom,msm-bus,num-cases
- qcom,msm-bus,num-paths
- qcom,msm-bus,vectors-KBps
  Please refer Documentation/devicetree/bindings/arm/msm/msm_bus.txt
  for the properties above.

- qcom,msm-bus-vector-dyn-vote
  Usage: optional
  Value type: <empty>
  Definition: Bool property specifying whether this bus client
              is dynamic vote based.

Example:

	qcom,cam-cpas@ac40000 {
		cell-index = <0>;
		compatible = "qcom,cam-cpas";
		label = "cpas";
		arch-compat = "cpas_top";
		status = "ok";
		reg-names = "cam_cpas_top", "cam_camnoc";
		reg = <0xac40000 0x1000>,
			<0xac42000 0x5000>;
		reg-cam-base = <0x40000 0x42000>;
		cam_hw_fuse = <CAM_CPAS_QCFA_BINNING_ENABLE 0x00780210 29>,
			<CAM_CPAS_SECURE_CAMERA_ENABLE 0x00780210 18>;
		interrupt-names = "cpas_camnoc";
		interrupts = <0 459 0>;
		qcom,cpas-hw-ver = <0x170100>; /* Titan v170 v1.0.0 */
		regulator-names = "camss-vdd";
		camss-vdd-supply = <&titan_top_gdsc>;
		clock-names = "gcc_ahb_clk",
			"gcc_axi_clk",
			"soc_ahb_clk",
			"cpas_ahb_clk",
			"slow_ahb_clk_src",
			"camnoc_axi_clk";
		clocks = <&clock_gcc GCC_CAMERA_AHB_CLK>,
			<&clock_gcc GCC_CAMERA_AXI_CLK>,
			<&clock_camcc CAM_CC_SOC_AHB_CLK>,
			<&clock_camcc CAM_CC_CPAS_AHB_CLK>,
			<&clock_camcc CAM_CC_SLOW_AHB_CLK_SRC>,
			<&clock_camcc CAM_CC_CAMNOC_AXI_CLK>;
		src-clock-name = "slow_ahb_clk_src";
		clock-rates = <0 0 0 0 80000000 0>;
		clock-cntl-level = "turbo";
		control-camnoc-axi-clk;
		camnoc-bus-width = <32>;
		camnoc-axi-clk-bw-margin-perc = <10>;
		qcom,msm-bus,name = "cam_ahb";
		qcom,msm-bus,num-cases = <4>;
		qcom,msm-bus,num-paths = <1>;
		qcom,msm-bus,vectors-KBps =
			<MSM_BUS_MASTER_AMPSS_M0
			MSM_BUS_SLAVE_CAMERA_CFG 0 0>,
			<MSM_BUS_MASTER_AMPSS_M0
			MSM_BUS_SLAVE_CAMERA_CFG 0 300000>,
			<MSM_BUS_MASTER_AMPSS_M0
			MSM_BUS_SLAVE_CAMERA_CFG 0 640000>,
			<MSM_BUS_MASTER_AMPSS_M0
			MSM_BUS_SLAVE_CAMERA_CFG 0 640000>;
		client-id-based;
		client-names =
			"csiphy0", "csiphy1", "csiphy2", "csiphy3",
			"csiphy4", "csiphy5", "cci0", "cci1",
			"csid0", "csid1", "csid2", "csid3",
			"csid4", "csid5", "csid6",
			"ife0", "ife1", "ife2", "ife3", "custom0",
			"ipe0", "cam-cdm-intf0", "cpas-cdm0", "cpas-cdm1",
			"cpas-cdm2",
			"bps0", "icp0", "jpeg-dma0", "jpeg-enc0",
			"fd0";

		camera-bus-nodes {
			level3-nodes {
				level-index = <3>;
				level3_rt0_rd_wr_sum: level3-rt0-rd-wr-sum {
					cell-index = <0>;
					node-name = "level3-rt0-rd-wr-sum";
					traffic-merge-type =
					<CAM_CPAS_TRAFFIC_MERGE_SUM>;
					qcom,axi-port-name = "cam_hf_0";
					ib-bw-voting-needed;
					qcom,axi-port-mnoc {
						qcom,msm-bus,name =
						"cam_hf_0_mnoc";
						qcom,msm-bus-vector-dyn-vote;
						qcom,msm-bus,num-cases = <2>;
						qcom,msm-bus,num-paths = <1>;
						qcom,msm-bus,vectors-KBps =
						<MSM_BUS_MASTER_CAMNOC_HF
						MSM_BUS_SLAVE_EBI_CH0 0 0>,
						<MSM_BUS_MASTER_CAMNOC_HF
						MSM_BUS_SLAVE_EBI_CH0 0 0>;
					};
				};
			};
			level2-nodes {
				level-index = <2>;
				camnoc-max-needed;
				level2_rt0_wr: level2-rt0-wr {
					cell-index = <3>;
					node-name = "level2-rt0-wr";
					parent-node = <&level3_rt0_rd_wr_sum>;
					traffic-merge-type =
					<CAM_CPAS_TRAFFIC_MERGE_SUM_INTERLEAVE>;
				};
			};
			level1-nodes {
				level-index = <1>;
				camnoc-max-needed;
				level1_rt0_wr0: level1-rt0-wr0 {
					cell-index = <8>;
					node-name = "level1-rt0-wr0";
					parent-node = <&level2_rt0_wr>;
					traffic-merge-type =
					<CAM_CPAS_TRAFFIC_MERGE_SUM>;
				};
			};
			level0-nodes {
				level-index = <0>;
				ife0_ubwc_stats_wr: ife0-ubwc-stats-wr {
					cell-index = <16>;
					node-name = "ife0-ubwc-stats-wr";
					client-name = "ife0";
					traffic-data =
					<CAM_CPAS_PATH_DATA_IFE_UBWC_STATS>;
					traffic-transaction-type =
					<CAM_CPAS_TRANSACTION_WRITE>;
					constituent-paths =
					<CAM_CPAS_PATH_DATA_IFE_VID
					CAM_CPAS_PATH_DATA_IFE_DISP
					CAM_CPAS_PATH_DATA_IFE_STATS>;
					parent-node = <&level1_rt0_wr0>;
				};
			};
		};
	};