meson-axg-s400.dts 11.4 KB
Newer Older
1
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 3 4 5 6 7 8
/*
 * Copyright (c) 2017 Amlogic, Inc. All rights reserved.
 */

/dts-v1/;

#include "meson-axg.dtsi"
9
#include <dt-bindings/input/input.h>
10 11 12 13 14

/ {
	compatible = "amlogic,s400", "amlogic,a113d", "amlogic,meson-axg";
	model = "Amlogic Meson AXG S400 Development Board";

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
	adc_keys {
		compatible = "adc-keys";
		io-channels = <&saradc 0>;
		io-channel-names = "buttons";
		keyup-threshold-microvolt = <1800000>;

		button-next {
			label = "Next";
			linux,code = <KEY_NEXT>;
			press-threshold-microvolt = <1116000>; /* 62% */
		};

		button-prev {
			label = "Previous";
			linux,code = <KEY_PREVIOUS>;
			press-threshold-microvolt = <900000>; /* 50% */
		};

		button-wifi {
			label = "Wifi";
			linux,code = <KEY_WLAN>;
			press-threshold-microvolt = <684000>; /* 38% */
		};

		button-up {
			label = "Volume Up";
			linux,code = <KEY_VOLUMEUP>;
			press-threshold-microvolt = <468000>; /* 26% */
		};

		button-down {
			label = "Volume Down";
			linux,code = <KEY_VOLUMEDOWN>;
			press-threshold-microvolt = <252000>; /* 14% */
		};

		button-voice {
			label = "Voice";
			linux,code = <KEY_VOICECOMMAND>;
			press-threshold-microvolt = <0>; /* 0% */
		};
	};

58 59
	aliases {
		serial0 = &uart_AO;
60
		serial1 = &uart_A;
61
	};
62

63
	linein: audio-codec-0 {
64 65 66 67 68 69 70 71 72
		#sound-dai-cells = <0>;
		compatible = "everest,es7241";
		VDDA-supply = <&vcc_3v3>;
		VDDP-supply = <&vcc_3v3>;
		VDDD-supply = <&vcc_3v3>;
		status = "okay";
		sound-name-prefix = "Linein";
	};

73
	lineout: audio-codec-1 {
74 75 76 77 78 79 80 81
		#sound-dai-cells = <0>;
		compatible = "everest,es7154";
		VDD-supply = <&vcc_3v3>;
		PVDD-supply = <&vcc_5v>;
		status = "okay";
		sound-name-prefix = "Lineout";
	};

82
	spdif_dit: audio-codec-2 {
83 84 85 86 87 88
		#sound-dai-cells = <0>;
		compatible = "linux,spdif-dit";
		status = "okay";
		sound-name-prefix = "DIT";
	};

89
	dmics: audio-codec-3 {
90 91 92 93 94 95 96 97
		#sound-dai-cells = <0>;
		compatible = "dmic-codec";
		num-channels = <7>;
		wakeup-delay-ms = <50>;
		status = "okay";
		sound-name-prefix = "MIC";
	};

98 99 100 101 102 103 104
	spdif_dir: audio-codec-4 {
		#sound-dai-cells = <0>;
		compatible = "linux,spdif-dir";
		status = "okay";
		sound-name-prefix = "DIR";
	};

105 106 107 108 109
	emmc_pwrseq: emmc-pwrseq {
		compatible = "mmc-pwrseq-emmc";
		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
	};

110 111 112 113 114 115 116 117 118
	chosen {
		stdout-path = "serial0:115200n8";
	};

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

119 120 121 122 123
	main_12v: regulator-main_12v {
		compatible = "regulator-fixed";
		regulator-name = "12V";
		regulator-min-microvolt = <12000000>;
		regulator-max-microvolt = <12000000>;
124
		regulator-always-on;
125 126
	};

127
	vcc_3v3: regulator-vcc_3v3 {
128
		compatible = "regulator-fixed";
129 130 131
		regulator-name = "VCC_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
132 133
		vin-supply = <&vddao_3v3>;
		regulator-always-on;
134 135
	};

136 137 138 139 140 141 142 143 144 145 146
	vcc_5v: regulator-vcc_5v {
		compatible = "regulator-fixed";
		regulator-name = "VCC5V";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&main_12v>;

		gpio = <&gpio_ao GPIOAO_13 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

147 148 149 150 151
	vddao_3v3: regulator-vddao_3v3 {
		compatible = "regulator-fixed";
		regulator-name = "VDDAO_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
152 153
		vin-supply = <&main_12v>;
		regulator-always-on;
154 155 156 157 158 159 160
	};

	vddio_ao18: regulator-vddio_ao18 {
		compatible = "regulator-fixed";
		regulator-name = "VDDIO_AO18";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
161 162
		vin-supply = <&vddao_3v3>;
		regulator-always-on;
163 164
	};

165
	vddio_boot: regulator-vddio_boot {
166
		compatible = "regulator-fixed";
167 168 169
		regulator-name = "VDDIO_BOOT";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
170 171
		vin-supply = <&vddao_3v3>;
		regulator-always-on;
172 173
	};

174 175 176 177 178 179 180 181 182
	usb_pwr: regulator-usb_pwr {
		compatible = "regulator-fixed";
		regulator-name = "USB_PWR";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&vcc_5v>;

		gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
		enable-active-high;
183 184
	};

185 186 187 188 189 190 191
	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&gpio GPIOX_7 GPIO_ACTIVE_LOW>;
		clocks = <&wifi32k>;
		clock-names = "ext_clock";
	};

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
	speaker-leds {
		compatible = "gpio-leds";

		aled1 {
			label = "speaker:aled1";
			gpios = <&gpio_speaker 7 0>;
		};

		aled2 {
			label = "speaker:aled2";
			gpios = <&gpio_speaker 6 0>;
		};

		aled3 {
			label = "speaker:aled3";
			gpios = <&gpio_speaker 5 0>;
		};

		aled4 {
			label = "speaker:aled4";
			gpios = <&gpio_speaker 4 0>;
		};

		aled5 {
			label = "speaker:aled5";
			gpios = <&gpio_speaker 3 0>;
		};

		aled6 {
			label = "speaker:aled6";
			gpios = <&gpio_speaker 2 0>;
		};
	};
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
	sound {
		compatible = "amlogic,axg-sound-card";
		model = "AXG-S400";
		audio-aux-devs = <&tdmin_a>, <&tdmin_b>,  <&tdmin_c>,
				 <&tdmin_lb>, <&tdmout_c>;
		audio-widgets = "Line", "Lineout",
				"Line", "Linein",
				"Speaker", "Speaker1 Left",
				"Speaker", "Speaker1 Right";
		audio-routing = "TDMOUT_C IN 0", "FRDDR_A OUT 2",
				"SPDIFOUT IN 0", "FRDDR_A OUT 3",
				"TDMOUT_C IN 1", "FRDDR_B OUT 2",
				"SPDIFOUT IN 1", "FRDDR_B OUT 3",
				"TDMOUT_C IN 2", "FRDDR_C OUT 2",
				"SPDIFOUT IN 2", "FRDDR_C OUT 3",
				"TDM_C Playback", "TDMOUT_C OUT",
				"TDMIN_A IN 2", "TDM_C Capture",
				"TDMIN_A IN 5", "TDM_C Loopback",
				"TDMIN_B IN 2", "TDM_C Capture",
				"TDMIN_B IN 5", "TDM_C Loopback",
				"TDMIN_C IN 2", "TDM_C Capture",
				"TDMIN_C IN 5", "TDM_C Loopback",
				"TDMIN_LB IN 2", "TDM_C Loopback",
				"TDMIN_LB IN 5", "TDM_C Capture",
				"TODDR_A IN 0", "TDMIN_A OUT",
				"TODDR_B IN 0", "TDMIN_A OUT",
				"TODDR_C IN 0", "TDMIN_A OUT",
				"TODDR_A IN 1", "TDMIN_B OUT",
				"TODDR_B IN 1", "TDMIN_B OUT",
				"TODDR_C IN 1", "TDMIN_B OUT",
				"TODDR_A IN 2", "TDMIN_C OUT",
				"TODDR_B IN 2", "TDMIN_C OUT",
				"TODDR_C IN 2", "TDMIN_C OUT",
259 260 261
				"TODDR_A IN 3", "SPDIFIN Capture",
				"TODDR_B IN 3", "SPDIFIN Capture",
				"TODDR_C IN 3", "SPDIFIN Capture",
262 263 264
				"TODDR_A IN 4", "PDM Capture",
				"TODDR_B IN 4", "PDM Capture",
				"TODDR_C IN 4", "PDM Capture",
265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284
				"TODDR_A IN 6", "TDMIN_LB OUT",
				"TODDR_B IN 6", "TDMIN_LB OUT",
				"TODDR_C IN 6", "TDMIN_LB OUT",
				"Lineout", "Lineout AOUTL",
				"Lineout", "Lineout AOUTR",
				"Speaker1 Left", "SPK1 OUT_A",
				"Speaker1 Left", "SPK1 OUT_B",
				"Speaker1 Right", "SPK1 OUT_C",
				"Speaker1 Right", "SPK1 OUT_D",
				"Linein AINL", "Linein",
				"Linein AINR", "Linein";
		assigned-clocks = <&clkc CLKID_HIFI_PLL>,
				  <&clkc CLKID_MPLL0>,
				  <&clkc CLKID_MPLL1>;
		assigned-clock-parents = <0>, <0>, <0>;
		assigned-clock-rates = <589824000>,
				       <270950400>,
				       <393216000>;
		status = "okay";

285
		dai-link-0 {
286 287 288
			sound-dai = <&frddr_a>;
		};

289
		dai-link-1 {
290 291 292
			sound-dai = <&frddr_b>;
		};

293
		dai-link-2 {
294 295 296
			sound-dai = <&frddr_c>;
		};

297
		dai-link-3 {
298 299 300
			sound-dai = <&toddr_a>;
		};

301
		dai-link-4 {
302 303 304
			sound-dai = <&toddr_b>;
		};

305
		dai-link-5 {
306 307 308
			sound-dai = <&toddr_c>;
		};

309
		dai-link-6 {
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
			sound-dai = <&tdmif_c>;
			dai-format = "i2s";
			dai-tdm-slot-tx-mask-2 = <1 1>;
			dai-tdm-slot-rx-mask-1 = <1 1>;
			mclk-fs = <256>;

			codec@0 {
				sound-dai = <&lineout>;
			};

			codec@1 {
				sound-dai = <&speaker_amp1>;
			};

			codec@2 {
				sound-dai = <&linein>;
			};

		};

330
		dai-link-7 {
331 332 333 334 335 336
			sound-dai = <&spdifout>;

			codec {
				sound-dai = <&spdif_dit>;
			};
		};
337

338
		dai-link-8 {
339 340 341 342 343 344 345 346
			sound-dai = <&spdifin>;

			codec {
				sound-dai = <&spdif_dir>;
			};
		};

		dai-link-9 {
347 348 349 350 351 352
			sound-dai = <&pdm>;

			codec {
				sound-dai = <&dmics>;
			};
		};
353
	};
354 355 356 357 358 359 360

	wifi32k: wifi32k {
		compatible = "pwm-clock";
		#clock-cells = <0>;
		clock-frequency = <32768>;
		pwms = <&pwm_ab 0 30518 0>; /* PWM_A at 32.768KHz */
	};
361 362
};

363 364 365 366
&ethmac {
	status = "okay";
	pinctrl-0 = <&eth_rgmii_y_pins>;
	pinctrl-names = "default";
367 368 369 370 371 372 373 374 375 376 377
	phy-handle = <&eth_phy0>;
	phy-mode = "rgmii";

	mdio {
		compatible = "snps,dwmac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;

		eth_phy0: ethernet-phy@0 {
			/* Realtek RTL8211F (0x001cc916) */
			reg = <0>;
378 379
			interrupt-parent = <&gpio_intc>;
			interrupts = <98 IRQ_TYPE_LEVEL_LOW>;
380 381 382
			eee-broken-1000t;
		};
	};
383 384
};

385 386 387 388 389 390 391 392 393 394 395 396
&frddr_a {
	status = "okay";
};

&frddr_b {
	status = "okay";
};

&frddr_c {
	status = "okay";
};

397 398 399 400 401
&ir {
	status = "okay";
	pinctrl-0 = <&remote_input_ao_pins>;
	pinctrl-names = "default";
};
402 403 404 405 406

&i2c1 {
	status = "okay";
	pinctrl-0 = <&i2c1_z_pins>;
	pinctrl-names = "default";
407 408 409 410 411 412 413 414 415 416 417 418

	speaker_amp1: audio-codec@1b {
		compatible = "ti,tas5707";
		reg = <0x1b>;
		reset-gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
		#sound-dai-cells = <0>;
		AVDD-supply = <&vcc_3v3>;
		DVDD-supply = <&vcc_3v3>;
		PVDD_A-supply = <&main_12v>;
		PVDD_B-supply = <&main_12v>;
		PVDD_C-supply = <&main_12v>;
		PVDD_D-supply = <&main_12v>;
419
		sound-name-prefix = "SPK1";
420
	};
421
};
422

423 424 425 426
&i2c_AO {
	status = "okay";
	pinctrl-0 = <&i2c_ao_sck_10_pins>, <&i2c_ao_sda_11_pins>;
	pinctrl-names = "default";
427 428 429 430 431 432 433 434

	gpio_speaker: gpio-controller@1f {
		compatible = "nxp,pca9557";
		reg = <0x1f>;
		gpio-controller;
		#gpio-cells = <2>;
		vcc-supply = <&vddao_3v3>;
	};
435 436
};

437 438 439 440 441 442 443
&pdm {
	pinctrl-0 = <&pdm_dclk_a14_pins>, <&pdm_din0_pins>,
		    <&pdm_din1_pins>, <&pdm_din2_pins>, <&pdm_din3_pins>;
	pinctrl-names = "default";
	status = "okay";
};

444 445 446 447 448 449
&pwm_ab {
	status = "okay";
	pinctrl-0 = <&pwm_a_x20_pins>;
	pinctrl-names = "default";
};

450
&saradc {
451
	status = "okay";
452
	vref-supply = <&vddio_ao18>;
453
};
454 455 456 457 458 459 460 461 462 463 464 465 466

/* wifi module */
&sd_emmc_b {
	status = "okay";
	#address-cells = <1>;
	#size-cells = <0>;

	pinctrl-0 = <&sdio_pins>;
	pinctrl-1 = <&sdio_clk_gate_pins>;
	pinctrl-names = "default", "clk-gate";

	bus-width = <4>;
	cap-sd-highspeed;
467 468
	sd-uhs-sdr104;
	max-frequency = <200000000>;
469 470 471 472 473 474 475 476 477 478 479 480 481
	non-removable;
	disable-wp;

	mmc-pwrseq = <&sdio_pwrseq>;

	vmmc-supply = <&vddao_3v3>;
	vqmmc-supply = <&vddio_boot>;

	brcmf: wifi@1 {
		reg = <1>;
		compatible = "brcm,bcm4329-fmac";
	};
};
482

483 484
/* emmc storage */
&sd_emmc_c {
485 486
	status = "okay";
	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
487 488 489 490 491
	pinctrl-1 = <&emmc_clk_gate_pins>;
	pinctrl-names = "default", "clk-gate";

	bus-width = <8>;
	cap-mmc-highspeed;
492
	max-frequency = <200000000>;
493 494 495 496 497
	non-removable;
	disable-wp;
	mmc-ddr-1_8v;
	mmc-hs200-1_8v;

498 499
	mmc-pwrseq = <&emmc_pwrseq>;

500 501
	vmmc-supply = <&vcc_3v3>;
	vqmmc-supply = <&vddio_boot>;
502
};
503

504 505 506 507 508 509
&spdifin {
	pinctrl-0 = <&spdif_in_a19_pins>;
	pinctrl-names = "default";
	status = "okay";
};

510 511 512 513 514 515
&spdifout {
	pinctrl-0 = <&spdif_out_a20_pins>;
	pinctrl-names = "default";
	status = "okay";
};

516 517 518 519
&tdmif_a {
	pinctrl-0 = <&tdma_sclk_pins>, <&tdma_fs_pins>,
		    <&tdma_din0_pins>, <&tdma_dout0_x15_pins>;
	pinctrl-names = "default";
520 521 522
	status = "okay";
};

523 524 525 526
&tdmif_b {
	pinctrl-0 = <&tdmb_sclk_pins>, <&tdmb_fs_pins>,
		    <&tdmb_din3_pins>, <&mclk_b_pins>;
	pinctrl-names = "default";
527 528 529
	status = "okay";
};

530 531 532 533 534
&tdmif_c {
	pinctrl-0 = <&tdmc_sclk_pins>, <&tdmc_fs_pins>,
		    <&tdmc_din1_pins>, <&tdmc_dout2_pins>,
		    <&mclk_c_pins>;
	pinctrl-names = "default";
535 536 537
	status = "okay";
};

538
&tdmin_a {
539 540 541
	status = "okay";
};

542
&tdmin_b {
543 544 545
	status = "okay";
};

546
&tdmin_c {
547 548 549
	status = "okay";
};

550
&tdmin_lb {
551 552 553
	status = "okay";
};

554
&tdmout_c {
555 556 557 558 559 560 561 562 563 564 565 566 567 568
	status = "okay";
};

&toddr_a {
	status = "okay";
};

&toddr_b {
	status = "okay";
};

&toddr_c {
	status = "okay";
};
569 570 571

&uart_A {
	status = "okay";
572
	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
573
	pinctrl-names = "default";
574
	uart-has-rtscts;
575 576 577 578 579

	bluetooth {
		compatible = "brcm,bcm43438-bt";
		shutdown-gpios = <&gpio GPIOX_21 GPIO_ACTIVE_HIGH>;
	};
580 581 582 583 584 585 586
};

&uart_AO {
	status = "okay";
	pinctrl-0 = <&uart_ao_a_pins>;
	pinctrl-names = "default";
};