meson-sm1-sei610.dts 11.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2019 BayLibre SAS. All rights reserved.
 */

/dts-v1/;

#include "meson-sm1.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/gpio/meson-g12a-gpio.h>
12
#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
13 14 15 16 17 18 19 20 21 22

/ {
	compatible = "seirobotics,sei610", "amlogic,sm1";
	model = "SEI Robotics SEI610";

	aliases {
		serial0 = &uart_AO;
		ethernet0 = &ethmac;
	};

23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
	mono_dac: audio-codec-0 {
		compatible = "maxim,max98357a";
		#sound-dai-cells = <0>;
		sound-name-prefix = "U16";
		sdmode-gpios = <&gpio GPIOX_8 GPIO_ACTIVE_HIGH>;
	};

	dmics: audio-codec-1 {
		#sound-dai-cells = <0>;
		compatible = "dmic-codec";
		num-channels = <2>;
		wakeup-delay-ms = <50>;
		status = "okay";
		sound-name-prefix = "MIC";
	};

39 40 41 42 43 44 45 46 47 48
	chosen {
		stdout-path = "serial0:115200n8";
	};

	emmc_pwrseq: emmc-pwrseq {
		compatible = "mmc-pwrseq-emmc";
		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
	};

	gpio-keys {
49
		compatible = "gpio-keys";
50 51 52 53 54

		key1 {
			label = "A";
			linux,code = <BTN_0>;
			gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;
55 56
			interrupt-parent = <&gpio_intc>;
			interrupts = <34 IRQ_TYPE_EDGE_BOTH>;
57 58 59 60 61 62
		};

		key2 {
			label = "B";
			linux,code = <BTN_1>;
			gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
63 64
			interrupt-parent = <&gpio_intc>;
			interrupts = <35 IRQ_TYPE_EDGE_BOTH>;
65 66 67 68 69 70
		};

		key3 {
			label = "C";
			linux,code = <BTN_2>;
			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
			interrupt-parent = <&gpio_intc>;
			interrupts = <2 IRQ_TYPE_EDGE_BOTH>;
		};

		mic_mute {
			label = "MicMute";
			linux,code = <SW_MUTE_DEVICE>;
			linux,input-type = <EV_SW>;
			gpios = <&gpio_ao GPIOE_2 GPIO_ACTIVE_LOW>;
			interrupt-parent = <&gpio_intc>;
			interrupts = <99 IRQ_TYPE_EDGE_BOTH>;
		};

		power_key {
			label = "PowerKey";
			linux,code = <KEY_POWER>;
			gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
			interrupt-parent = <&gpio_intc>;
			interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
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
		};
	};

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

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

	leds {
		compatible = "gpio-leds";

		bluetooth {
			label = "sei610:blue:bt";
			gpios = <&gpio GPIOC_7 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
			default-state = "off";
		};
	};

	pwmleds {
		compatible = "pwm-leds";

		power {
			label = "sei610:red:power";
			pwms = <&pwm_AO_ab 0 30518 0>;
			max-brightness = <255>;
			linux,default-trigger = "default-on";
			active-low;
		};
	};

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

	ao_5v: regulator-ao_5v {
		compatible = "regulator-fixed";
		regulator-name = "AO_5V";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&dc_in>;
		regulator-always-on;
	};

	dc_in: regulator-dc_in {
		compatible = "regulator-fixed";
		regulator-name = "DC_IN";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};

	emmc_1v8: regulator-emmc_1v8 {
		compatible = "regulator-fixed";
		regulator-name = "EMMC_1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&vddao_3v3>;
		regulator-always-on;
	};

	vddao_3v3: regulator-vddao_3v3 {
		compatible = "regulator-fixed";
		regulator-name = "VDDAO_3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&dc_in>;
		regulator-always-on;
	};

	/* Used by Tuner, RGB Led & IR Emitter LED array */
	vddao_3v3_t: regulator-vddao_3v3_t {
		compatible = "regulator-fixed";
		regulator-name = "VDDAO_3V3_T";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		vin-supply = <&vddao_3v3>;
		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
		enable-active-low;
		regulator-always-on;
	};

	vddcpu: regulator-vddcpu {
		/*
		 * SY8120B1ABC DC/DC Regulator.
		 */
		compatible = "pwm-regulator";

		regulator-name = "VDDCPU";
		regulator-min-microvolt = <690000>;
		regulator-max-microvolt = <1050000>;

		vin-supply = <&dc_in>;

		pwms = <&pwm_AO_cd 1 1500 0>;
		pwm-dutycycle-range = <100 0>;

		regulator-boot-on;
		regulator-always-on;
	};

	vddio_ao1v8: regulator-vddio_ao1v8 {
		compatible = "regulator-fixed";
		regulator-name = "VDDIO_AO1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
		vin-supply = <&vddao_3v3>;
		regulator-always-on;
	};

	reserved-memory {
		/* TEE Reserved Memory */
		bl32_reserved: bl32@5000000 {
			reg = <0x0 0x05300000 0x0 0x2000000>;
			no-map;
		};
	};

	sdio_pwrseq: sdio-pwrseq {
		compatible = "mmc-pwrseq-simple";
		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
		clocks = <&wifi32k>;
		clock-names = "ext_clock";
	};

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
	sound {
		compatible = "amlogic,axg-sound-card";
		model = "SM1-SEI610";
		audio-aux-devs = <&tdmout_a>, <&tdmout_b>,
				 <&tdmin_a>, <&tdmin_b>;
		audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
				"TDMOUT_A IN 1", "FRDDR_B OUT 0",
				"TDMOUT_A IN 2", "FRDDR_C OUT 0",
				"TDM_A Playback", "TDMOUT_A OUT",
				"TDMOUT_B IN 0", "FRDDR_A OUT 1",
				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
				"TDM_B Playback", "TDMOUT_B OUT",
				"TODDR_A IN 4", "PDM Capture",
				"TODDR_B IN 4", "PDM Capture",
				"TODDR_C IN 4", "PDM Capture",
				"TDMIN_A IN 0", "TDM_A Capture",
				"TDMIN_A IN 3", "TDM_A Loopback",
				"TDMIN_B IN 0", "TDM_A Capture",
				"TDMIN_B IN 3", "TDM_A Loopback",
				"TDMIN_A IN 1", "TDM_B Capture",
				"TDMIN_A IN 4", "TDM_B Loopback",
				"TDMIN_B IN 1", "TDM_B Capture",
				"TDMIN_B IN 4", "TDM_B Loopback",
				"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";

		assigned-clocks = <&clkc CLKID_MPLL2>,
				  <&clkc CLKID_MPLL0>,
				  <&clkc CLKID_MPLL1>;
		assigned-clock-parents = <0>, <0>, <0>;
		assigned-clock-rates = <294912000>,
				       <270950400>,
				       <393216000>;
		status = "okay";

		dai-link-0 {
			sound-dai = <&frddr_a>;
		};

		dai-link-1 {
			sound-dai = <&frddr_b>;
		};

		dai-link-2 {
			sound-dai = <&frddr_c>;
		};

		dai-link-3 {
			sound-dai = <&toddr_a>;
		};

		dai-link-4 {
			sound-dai = <&toddr_b>;
		};

		dai-link-5 {
			sound-dai = <&toddr_c>;
		};

		/* internal speaker interface */
		dai-link-6 {
			sound-dai = <&tdmif_a>;
			dai-format = "i2s";
			dai-tdm-slot-tx-mask-0 = <1 1>;
			mclk-fs = <256>;

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

			codec-1 {
				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
			};
		};

		/* 8ch hdmi interface */
		dai-link-7 {
			sound-dai = <&tdmif_b>;
			dai-format = "i2s";
			dai-tdm-slot-tx-mask-0 = <1 1>;
			dai-tdm-slot-tx-mask-1 = <1 1>;
			dai-tdm-slot-tx-mask-2 = <1 1>;
			dai-tdm-slot-tx-mask-3 = <1 1>;
			mclk-fs = <256>;

			codec {
				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
			};
		};

		/* internal digital mics */
		dai-link-8 {
			sound-dai = <&pdm>;

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

		/* hdmi glue */
		dai-link-9 {
			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;

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

335 336 337 338 339 340 341 342
	wifi32k: wifi32k {
		compatible = "pwm-clock";
		#clock-cells = <0>;
		clock-frequency = <32768>;
		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
	};
};

343 344 345 346
&arb {
	status = "okay";
};

347 348 349 350 351 352 353 354 355 356 357 358 359 360
&cec_AO {
	pinctrl-0 = <&cec_ao_a_h_pins>;
	pinctrl-names = "default";
	status = "disabled";
	hdmi-phandle = <&hdmi_tx>;
};

&cecb_AO {
	pinctrl-0 = <&cec_ao_b_h_pins>;
	pinctrl-names = "default";
	status = "okay";
	hdmi-phandle = <&hdmi_tx>;
};

361 362 363 364
&clkc_audio {
	status = "okay";
};

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
&cpu0 {
	cpu-supply = <&vddcpu>;
	operating-points-v2 = <&cpu_opp_table>;
	clocks = <&clkc CLKID_CPU_CLK>;
	clock-latency = <50000>;
};

&cpu1 {
	cpu-supply = <&vddcpu>;
	operating-points-v2 = <&cpu_opp_table>;
	clocks = <&clkc CLKID_CPU1_CLK>;
	clock-latency = <50000>;
};

&cpu2 {
	cpu-supply = <&vddcpu>;
	operating-points-v2 = <&cpu_opp_table>;
	clocks = <&clkc CLKID_CPU2_CLK>;
	clock-latency = <50000>;
};

&cpu3 {
	cpu-supply = <&vddcpu>;
	operating-points-v2 = <&cpu_opp_table>;
	clocks = <&clkc CLKID_CPU3_CLK>;
	clock-latency = <50000>;
};

&ethmac {
	status = "okay";
	phy-handle = <&internal_ephy>;
	phy-mode = "rmii";
};

399 400 401 402 403 404 405 406 407 408 409 410
&frddr_a {
	status = "okay";
};

&frddr_b {
	status = "okay";
};

&frddr_c {
	status = "okay";
};

411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434
&hdmi_tx {
	status = "okay";
	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
	pinctrl-names = "default";
};

&hdmi_tx_tmds_port {
	hdmi_tx_tmds_out: endpoint {
		remote-endpoint = <&hdmi_connector_in>;
	};
};

&i2c3 {
	status = "okay";
	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
	pinctrl-names = "default";
};

&ir {
	status = "okay";
	pinctrl-0 = <&remote_input_ao_pins>;
	pinctrl-names = "default";
};

435 436 437 438 439 440
&pdm {
	pinctrl-0 = <&pdm_din0_z_pins>, <&pdm_dclk_z_pins>;
	pinctrl-names = "default";
	status = "okay";
};

441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486
&pwm_AO_ab {
	status = "okay";
	pinctrl-0 = <&pwm_ao_a_pins>;
	pinctrl-names = "default";
	clocks = <&xtal>;
	clock-names = "clkin0";
};

&pwm_AO_cd {
	pinctrl-0 = <&pwm_ao_d_e_pins>;
	pinctrl-names = "default";
	clocks = <&xtal>;
	clock-names = "clkin1";
	status = "okay";
};

&pwm_ef {
	status = "okay";
	pinctrl-0 = <&pwm_e_pins>;
	pinctrl-names = "default";
	clocks = <&xtal>;
	clock-names = "clkin0";
};

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

/* SDIO */
&sd_emmc_a {
	status = "okay";
	pinctrl-0 = <&sdio_pins>;
	pinctrl-1 = <&sdio_clk_gate_pins>;
	pinctrl-names = "default", "clk-gate";
	#address-cells = <1>;
	#size-cells = <0>;

	bus-width = <4>;
	cap-sd-highspeed;
	sd-uhs-sdr50;
	max-frequency = <100000000>;

	non-removable;
	disable-wp;

487 488 489
	/* WiFi firmware requires power to be kept while in suspend */
	keep-power-in-suspend;

490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520
	mmc-pwrseq = <&sdio_pwrseq>;

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

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

/* SD card */
&sd_emmc_b {
	status = "okay";
	pinctrl-0 = <&sdcard_c_pins>;
	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
	pinctrl-names = "default", "clk-gate";

	bus-width = <4>;
	cap-sd-highspeed;
	max-frequency = <50000000>;
	disable-wp;

	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
	vmmc-supply = <&vddao_3v3>;
	vqmmc-supply = <&vddao_3v3>;
};

/* eMMC */
&sd_emmc_c {
	status = "okay";
521
	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537
	pinctrl-1 = <&emmc_clk_gate_pins>;
	pinctrl-names = "default", "clk-gate";

	bus-width = <8>;
	cap-mmc-highspeed;
	mmc-ddr-1_8v;
	mmc-hs200-1_8v;
	max-frequency = <200000000>;
	non-removable;
	disable-wp;

	mmc-pwrseq = <&emmc_pwrseq>;
	vmmc-supply = <&vddao_3v3>;
	vqmmc-supply = <&emmc_1v8>;
};

538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585
&tdmif_a {
	pinctrl-0 = <&tdm_a_dout0_pins>, <&tdm_a_fs_pins>, <&tdm_a_sclk_pins>;
	pinctrl-names = "default";
	status = "okay";

	assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD0>,
			  <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD0>;
	assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_A_SCLK>,
				 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
	assigned-clock-rates = <0>, <0>;
};

&tdmif_b {
	status = "okay";
};

&tdmin_a {
	status = "okay";
};

&tdmin_b {
	status = "okay";
};

&tdmout_a {
	status = "okay";
};

&tdmout_b {
	status = "okay";
};

&toddr_a {
	status = "okay";
};

&toddr_b {
	status = "okay";
};

&toddr_c {
	status = "okay";
};

&tohdmitx {
	status = "okay";
};

586 587 588 589 590 591 592 593
&uart_A {
	status = "okay";
	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
	pinctrl-names = "default";
	uart-has-rtscts;

	bluetooth {
		compatible = "brcm,bcm43438-bt";
594 595
		interrupt-parent = <&gpio_intc>;
		interrupts = <95 IRQ_TYPE_LEVEL_HIGH>;
596
		interrupt-names = "host-wakeup";
597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616
		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
		max-speed = <2000000>;
		clocks = <&wifi32k>;
		clock-names = "lpo";
		vbat-supply = <&vddao_3v3>;
		vddio-supply = <&vddio_ao1v8>;
	};
};

/* Exposed via the on-board USB to Serial FT232RL IC */
&uart_AO {
	status = "okay";
	pinctrl-0 = <&uart_ao_a_pins>;
	pinctrl-names = "default";
};

&usb {
	status = "okay";
	dr_mode = "otg";
};