Linux Audio

Check our new training course

Embedded Linux Audio

Check our new training course
with Creative Commons CC-BY-SA
lecture materials

Bootlin logo

Elixir Cross Referencer

Loading...
  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
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)

/dts-v1/;

#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
#include "rk3128.dtsi"

/ {
	model = "Geniatech XPI-3128";
	compatible = "geniatech,xpi-3128", "rockchip,rk3128";

	aliases {
		ethernet0 = &gmac;
		mmc0 = &emmc;
		mmc1 = &sdmmc;
	};

	memory@60000000 {
		device_type = "memory";
		reg = <0x60000000 0x40000000>;
	};

	chosen {
		stdout-path = &uart1;
	};

	adc-keys {
		compatible = "adc-keys";
		io-channels = <&saradc 1>;
		io-channel-names = "buttons";
		keyup-threshold-microvolt = <3300000>;

		button-recovery {
			label = "Recovery";
			linux,code = <KEY_VENDOR>;
			press-threshold-microvolt = <0>;
		};
	};

	dc_5v: dc-5v-regulator {
		compatible = "regulator-fixed";
		regulator-name = "DC_5V";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
		regulator-boot-on;
	};

	hdmi-connnector {
		compatible = "hdmi-connector";
		type = "a";

		port {
			hdmi_connector_in: endpoint {
				remote-endpoint = <&hdmi_connector_out>;
			};
		};
	};

	/*
	 * This is a vbus-supply, which also supplies the GL852G usb hub,
	 * thus has to be always-on
	 */
	host_pwr_5v: host-pwr-5v-regulator {
		compatible = "regulator-fixed";
		gpio = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
		startup-delay-us = <1500>;
		regulator-name = "HOST_PWR_5V";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&dc_5v>;
		pinctrl-names = "default";
		pinctrl-0 = <&host_drv>;
		enable-active-high;
		regulator-always-on;
	};

	ir-receiver {
		compatible = "gpio-ir-receiver";
		gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&ir_int>;
	};

	leds {
		compatible = "gpio-leds";

		led-power {
			gpios = <&gpio0 RK_PD2 GPIO_ACTIVE_HIGH>;
			function = LED_FUNCTION_POWER;
			color = <LED_COLOR_ID_BLUE>;
			default-state = "on";
			pinctrl-names = "default";
			pinctrl-0 = <&power_led>;
		};

		led-spd {
			gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>;
			function = LED_FUNCTION_LAN;
			color = <LED_COLOR_ID_GREEN>;
			/*
			 * currently not allowed to be set as per
			 * https://www.kernel.org/doc/Documentation/devicetree/bindings/leds/common.yaml
			 * and needs to set in userspace:
			 *
			 * linux,default-trigger = "netdev";
			 */
			pinctrl-names = "default";
			pinctrl-0 = <&spd_led>;
		};
	};

	mcu3v3: mcu3v3-regulator {
		compatible = "regulator-fixed";
		regulator-name = "MCU3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vcc_io>;
		regulator-always-on;
		regulator-boot-on;
	};

	vcc_ddr: vcc-ddr-regulator {
		compatible = "regulator-fixed";
		regulator-name = "VCC_DDR";
		regulator-min-microvolt = <1500000>;
		regulator-max-microvolt = <1500000>;
		vin-supply = <&vcc_sys>;
		regulator-always-on;
		regulator-boot-on;
	};

	vcc_io: vcc-io-regulator {
		compatible = "regulator-fixed";
		regulator-name = "VCC_IO";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vcc_sys>;
		regulator-always-on;
		regulator-boot-on;
	};

	vcc_lan: vcc-lan-regulator {
		compatible = "regulator-fixed";
		regulator-name = "VCC_LAN";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vcc_io>;
		regulator-always-on;
		regulator-boot-on;
	};

	vcc_sd: vcc-sd-regulator {
		compatible = "regulator-fixed";
		gpio = <&gpio1 RK_PB6 GPIO_ACTIVE_LOW>;
		startup-delay-us = <500>;
		regulator-name = "VCC_SD";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vcc_io>;
		pinctrl-names = "default";
		pinctrl-0 = <&sdmmc_pwren>;
	};

	vcc_sys: vcc-sys-regulator {
		compatible = "regulator-fixed";
		regulator-name = "VCC_SYS";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&dc_5v>;
		regulator-always-on;
		regulator-boot-on;
	};

	vcc33_hdmi: vcc33-hdmi-regulator {
		compatible = "regulator-fixed";
		regulator-name = "VCC33_HDMI";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vcca_33>;
		regulator-always-on;
		regulator-boot-on;
	};

	vcca_33: vcca-33-regulator {
		compatible = "regulator-fixed";
		regulator-name = "VCCA_33";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vcc_sys>;
		regulator-always-on;
		regulator-boot-on;
	};

	vdd_11: vdd-11-regulator {
		compatible = "regulator-fixed";
		regulator-name = "VDD_11";
		regulator-min-microvolt = <1100000>;
		regulator-max-microvolt = <1100000>;
		vin-supply = <&vcc_sys>;
		regulator-always-on;
		regulator-boot-on;
	};

	vdd11_hdmi: vdd11-hdmi-regulator {
		compatible = "regulator-fixed";
		regulator-name = "VDD11_HDMI";
		regulator-min-microvolt = <1100000>;
		regulator-max-microvolt = <1100000>;
		vin-supply = <&vdd_11>;
		regulator-always-on;
		regulator-boot-on;
	};

	vdd_arm: vdd-arm-regulator {
		compatible = "pwm-regulator";
		regulator-name = "VDD_ARM";
		pwms = <&pwm1 0 25000 1>;
		pwm-supply = <&vcc_sys>;
		regulator-min-microvolt = <900000>;
		regulator-max-microvolt = <1400000>;
		regulator-always-on;
		regulator-boot-on;
	};

	/*
	 * As per schematics vdd_log is minimum 900 mV, maximum 1400 mV.
	 * Since there are HW blocks in PD_LOGIC (which are all driven by
	 * this supply), that either do not have a driver at all or the
	 * driver does not implement regulator support we have to make
	 * sure here that the voltage never drops below 1050 mV.
	 */
	vdd_log: vdd-log-regulator {
		compatible = "pwm-regulator";
		regulator-name = "VDD_LOG";
		pwms = <&pwm2 0 25000 1>;
		pwm-dutycycle-range = <30 100>;
		pwm-supply = <&vcc_sys>;
		regulator-min-microvolt = <1050000>;
		regulator-max-microvolt = <1400000>;
		regulator-ramp-delay = <4000>;
		regulator-always-on;
		regulator-boot-on;
	};

};

&cpu0 {
	cpu-supply = <&vdd_arm>;
};

&display_subsystem {
	status = "okay";
};

&emmc {
	bus-width = <8>;
	vmmc-supply = <&vcc_io>;
	pinctrl-names = "default";
	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
	cap-mmc-highspeed;
	mmc-ddr-3_3v;
	no-sd;
	no-sdio;
	status = "okay";
};

&gmac {
	clock_in_out = "output";
	phy-supply = <&vcc_lan>;
	phy-mode = "rmii";
	phy-handle = <&phy0>;
	assigned-clocks = <&cru SCLK_MAC_SRC>;
	assigned-clock-rates= <50000000>;
	pinctrl-names = "default";
	pinctrl-0 = <&rmii_pins>;
	status = "okay";
};

&gpio0 {
	gpio-line-names = /* GPIO0 A0-A7 */
			  "", "", "HEADER_5", "HEADER_3",
			  "", "", "", "",
			  /* GPIO0 B0-B7 */
			  "HEADER_22", "HEADER_23", "", "HEADER_19",
			  "HEADER_26", "HEADER_21", "HEADER_24", "",
			  /* GPIO0 C0-C7 */
			  "", "HEADER_18", "", "",
			  "", "", "", "",
			  /* GPIO0 D0-D7 */
			  "HEADER_36", "", "", "",
			  "", "", "HEADER_13", "";
};

&gpio1 {
	gpio-line-names = /* GPIO1 A0-A7 */
			  "HEADER_7", "HEADER_35", "HEADER_33", "HEADER_37",
			  "HEADER_40", "HEADER_38", "", "",
			  /* GPIO1 B0-B7 */
			  "HEADER_11", "", "", "HEADER_29",
			  "HEADER_31", "", "", "",
			  /* GPIO1 C0-C7 */
			  "", "", "", "",
			  "", "", "", "",
			  /* GPIO1 D0-D7 */
			  "", "", "", "",
			  "", "", "", "";
};

&gpio2 {
	gpio-line-names = /* GPIO2 A0-A7 */
			  "", "", "", "",
			  "", "", "", "",
			  /* GPIO2 B0-B7 */
			  "", "", "", "",
			  "", "", "", "",
			  /* GPIO2 C0-C7 */
			  "", "", "", "",
			  "HEADER_27", "", "", "",
			  /* GPIO2 D0-D7 */
			  "", "", "HEADER_8", "HEADER_10",
			  "", "", "", "";
};

&gpio3 {
	gpio-line-names = /* GPIO3 A0-A7 */
			  "", "", "", "",
			  "", "", "", "",
			  /* GPIO3 B0-B7 */
			  "", "", "", "",
			  "", "", "", "",
			  /* GPIO3 C0-C7 */
			  "", "HEADER_32", "", "",
			  "", "", "", "HEADER_12",
			  /* GPIO3 D0-D7 */
			  "", "", "", "HEADER_15",
			  "", "", "", "";
};

&gpu {
	mali-supply = <&vdd_log>;
	status = "okay";
};

&hdmi {
	status = "okay";
};

&hdmi_out {
	hdmi_connector_out: endpoint {
		remote-endpoint = <&hdmi_connector_in>;
	};
};

&mdio {
	phy0: ethernet-phy@1 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <1>;
		max-speed = <100>;
		/* T2.2.4 min. 1 us */
		reset-assert-us = <10>;
		/* T2.2.1 + T2.2.2 + T2.2.3 min. 6.05 us */
		reset-deassert-us = <20>;
		reset-gpios = <&gpio2 RK_PD0 GPIO_ACTIVE_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&dp83848c_rst>;
	};
};

&pinctrl {
	dp83848c {
		dp83848c_rst: dp83848c-rst {
			rockchip,pins = <2 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	ir-receiver {
		ir_int: ir-int {
			rockchip,pins = <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	leds {
		power_led: power-led {
			rockchip,pins = <0 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
		};

		spd_led: spd-led {
			rockchip,pins = <3 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};

	usb2 {
		host_drv: host-drv {
			rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
		};
	};
};

&pwm1 {
	status = "okay";
};

&pwm2 {
	status = "okay";
};

&saradc {
	vref-supply = <&vcc_io>;
	status = "okay";
};

&sdmmc {
	bus-width = <4>;
	vmmc-supply = <&vcc_sd>;
	pinctrl-names = "default";
	pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc_det>;
	disable-wp;
	cap-sd-highspeed;
	no-mmc;
	no-sdio;
	status = "okay";
};

&uart1 {
	status = "okay";
};

&usb_host_ehci {
	status = "okay";
};

&usb_otg {
	vusb_a-supply = <&vcc_io>;
	vusb_d-supply = <&vdd_11>;
	status = "okay";
};

&usb2phy {
	status = "okay";
};

&usb2phy_host {
	status = "okay";
};

&usb2phy_otg {
	status = "okay";
};

&vop {
	status = "okay";
};