r8a7790-lager.dts 13.3 KB
Newer Older
1 2 3
/*
 * Device Tree Source for the Lager board
 *
4 5
 * Copyright (C) 2013-2014 Renesas Solutions Corp.
 * Copyright (C) 2014 Cogent Embedded, Inc.
6
 * Copyright (C) 2015-2016 Renesas Electronics Corporation
7 8 9 10 11 12
 *
 * This file is licensed under the terms of the GNU General Public License
 * version 2.  This program is licensed "as is" without any warranty of any
 * kind, whether express or implied.
 */

13 14 15 16 17 18 19 20 21 22
/*
 * SSI-AK4643
 *
 * SW1: 1: AK4643
 *      2: CN22
 *      3: ADV7511
 *
 * This command is required when Playback/Capture
 *
 *	amixer set "LINEOUT Mixer DACL" on
23 24 25 26 27 28 29
 *	amixer set "DVC Out" 100%
 *	amixer set "DVC In" 100%
 *
 * You can use Mute
 *
 *	amixer set "DVC Out Mute" on
 *	amixer set "DVC In Mute" on
30 31 32 33 34 35 36 37 38
 *
 * You can use Volume Ramp
 *
 *	amixer set "DVC Out Ramp Up Rate"   "0.125 dB/64 steps"
 *	amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps"
 *	amixer set "DVC Out Ramp" on
 *	aplay xxx.wav &
 *	amixer set "DVC Out"  80%  // Volume Down
 *	amixer set "DVC Out" 100%  // Volume Up
39 40
 */

41
/dts-v1/;
42
#include "r8a7790.dtsi"
43
#include <dt-bindings/gpio/gpio.h>
44
#include <dt-bindings/input/input.h>
45 46 47 48 49

/ {
	model = "Lager";
	compatible = "renesas,lager", "renesas,r8a7790";

50
	aliases {
51
		serial0 = &scif0;
52
		serial1 = &scifa1;
53
		i2c8 = "i2cexio";
54 55
	};

56
	chosen {
57
		bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
58
		stdout-path = "serial0:115200n8";
59 60 61 62
	};

	memory@40000000 {
		device_type = "memory";
63
		reg = <0 0x40000000 0 0x40000000>;
64 65
	};

66
	memory@140000000 {
67
		device_type = "memory";
68
		reg = <1 0x40000000 0 0xc0000000>;
69 70
	};

71 72 73 74
	lbsc {
		#address-cells = <1>;
		#size-cells = <1>;
	};
75

76
	keyboard {
77 78
		compatible = "gpio-keys";

79
		one {
80 81
			linux,code = <KEY_1>;
			label = "SW2-1";
82
			wakeup-source;
83 84 85
			debounce-interval = <20>;
			gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
		};
86
		two {
87 88
			linux,code = <KEY_2>;
			label = "SW2-2";
89
			wakeup-source;
90 91 92
			debounce-interval = <20>;
			gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
		};
93
		three {
94 95
			linux,code = <KEY_3>;
			label = "SW2-3";
96
			wakeup-source;
97 98 99
			debounce-interval = <20>;
			gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
		};
100
		four {
101 102
			linux,code = <KEY_4>;
			label = "SW2-4";
103
			wakeup-source;
104 105 106 107 108
			debounce-interval = <20>;
			gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
		};
	};

109 110 111 112 113 114 115 116 117 118 119 120 121
	leds {
		compatible = "gpio-leds";
		led6 {
			gpios = <&gpio4 22 GPIO_ACTIVE_HIGH>;
		};
		led7 {
			gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
		};
		led8 {
			gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
		};
	};

122
	fixedregulator3v3: regulator-3v3 {
123 124 125 126 127 128 129
		compatible = "regulator-fixed";
		regulator-name = "fixed-3.3V";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
		regulator-boot-on;
		regulator-always-on;
	};
130

131
	vcc_sdhi0: regulator-vcc-sdhi0 {
132 133 134 135 136 137 138 139 140 141
		compatible = "regulator-fixed";

		regulator-name = "SDHI0 Vcc";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&gpio5 24 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

142
	vccq_sdhi0: regulator-vccq-sdhi0 {
143 144 145 146 147 148 149 150 151 152 153 154
		compatible = "regulator-gpio";

		regulator-name = "SDHI0 VccQ";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;

		gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
		gpios-states = <1>;
		states = <3300000 1
			  1800000 0>;
	};

155
	vcc_sdhi2: regulator-vcc-sdhi2 {
156 157 158 159 160 161 162 163 164 165
		compatible = "regulator-fixed";

		regulator-name = "SDHI2 Vcc";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&gpio5 25 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

166
	vccq_sdhi2: regulator-vccq-sdhi2 {
167 168 169 170 171 172 173 174 175 176 177
		compatible = "regulator-gpio";

		regulator-name = "SDHI2 VccQ";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <3300000>;

		gpios = <&gpio5 30 GPIO_ACTIVE_HIGH>;
		gpios-states = <1>;
		states = <3300000 1
			  1800000 0>;
	};
178

179
	audio_clock: audio_clock {
180 181 182 183 184
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <11289600>;
	};

185
	rsnd_ak4643: sound {
186 187 188 189 190 191 192 193 194 195 196 197
		compatible = "simple-audio-card";

		simple-audio-card,format = "left_j";
		simple-audio-card,bitclock-master = <&sndcodec>;
		simple-audio-card,frame-master = <&sndcodec>;

		sndcpu: simple-audio-card,cpu {
			sound-dai = <&rcar_sound>;
		};

		sndcodec: simple-audio-card,codec {
			sound-dai = <&ak4643>;
198
			clocks = <&audio_clock>;
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
	vga-encoder {
		compatible = "adi,adv7123";

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;
				adv7123_in: endpoint {
					remote-endpoint = <&du_out_rgb>;
				};
			};
			port@1 {
				reg = <1>;
				adv7123_out: endpoint {
					remote-endpoint = <&vga_in>;
				};
			};
		};
	};

	vga {
		compatible = "vga-connector";

		port {
			vga_in: endpoint {
				remote-endpoint = <&adv7123_out>;
			};
		};
	};
233 234 235 236 237 238 239 240 241 242 243

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

		port {
			hdmi_con: endpoint {
				remote-endpoint = <&adv7511_out>;
			};
		};
	};
244 245 246 247 248 249 250 251 252 253 254 255

	x2_clk: x2-clock {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <148500000>;
	};

	x13_clk: x13-clock {
		compatible = "fixed-clock";
		#clock-cells = <0>;
		clock-frequency = <148500000>;
	};
256 257 258 259 260 261 262 263 264 265

	/*
	 * IIC0/I2C0 is routed to EXIO connector A, pins 114 (SCL) + 116 (SDA) only.
	 * We use the I2C demuxer, so the desired IP core can be selected at runtime
	 * depending on the use case (e.g. DMA with IIC0 or slave support with I2C0).
	 * Note: For testing the I2C slave feature, it is convenient to connect this
	 * bus with IIC3 on pins 110 (SCL) + 112 (SDA), select I2C0 at runtime, and
	 * instantiate the slave device at runtime according to the documentation.
	 * You can then communicate with the slave via IIC3.
	 */
266
	i2cexio: i2c-8 {
267 268 269 270 271 272
		compatible = "i2c-demux-pinctrl";
		i2c-parent = <&iic0>, <&i2c0>;
		i2c-bus-name = "i2c-exio";
		#address-cells = <1>;
		#size-cells = <0>;
	};
273 274 275 276 277 278 279
};

&du {
	pinctrl-0 = <&du_pins>;
	pinctrl-names = "default";
	status = "okay";

280 281 282 283 284 285 286 287 288
	clocks = <&mstp7_clks R8A7790_CLK_DU0>,
		 <&mstp7_clks R8A7790_CLK_DU1>,
		 <&mstp7_clks R8A7790_CLK_DU2>,
		 <&mstp7_clks R8A7790_CLK_LVDS0>,
		 <&mstp7_clks R8A7790_CLK_LVDS1>,
		 <&x13_clk>, <&x2_clk>;
	clock-names = "du.0", "du.1", "du.2", "lvds.0", "lvds.1",
		      "dclkin.0", "dclkin.1";

289 290 291 292 293 294
	ports {
		port@0 {
			endpoint {
				remote-endpoint = <&adv7123_in>;
			};
		};
295 296 297 298 299
		port@1 {
			endpoint {
				remote-endpoint = <&adv7511_in>;
			};
		};
300 301 302 303 304
		port@2 {
			lvds_connector: endpoint {
			};
		};
	};
305 306
};

307 308 309 310
&extal_clk {
	clock-frequency = <20000000>;
};

311
&pfc {
312 313 314
	pinctrl-0 = <&scif_clk_pins>;
	pinctrl-names = "default";

315
	du_pins: du {
316 317
		groups = "du_rgb666", "du_sync_1", "du_clk_out_0";
		function = "du";
318 319
	};

320
	scif0_pins: scif0 {
321 322
		groups = "scif0_data";
		function = "scif0";
323 324
	};

325
	scif_clk_pins: scif_clk {
326 327
		groups = "scif_clk";
		function = "scif_clk";
328 329
	};

330
	ether_pins: ether {
331 332
		groups = "eth_link", "eth_mdio", "eth_rmii";
		function = "eth";
333 334 335
	};

	phy1_pins: phy1 {
336 337
		groups = "intc_irq0";
		function = "intc";
338 339
	};

340
	scifa1_pins: scifa1 {
341 342
		groups = "scifa1_data";
		function = "scifa1";
343 344
	};

345
	sdhi0_pins: sd0 {
346 347
		groups = "sdhi0_data4", "sdhi0_ctrl";
		function = "sdhi0";
348 349 350 351 352 353 354
		power-source = <3300>;
	};

	sdhi0_pins_uhs: sd0_uhs {
		groups = "sdhi0_data4", "sdhi0_ctrl";
		function = "sdhi0";
		power-source = <1800>;
355 356 357
	};

	sdhi2_pins: sd2 {
358 359
		groups = "sdhi2_data4", "sdhi2_ctrl";
		function = "sdhi2";
360 361 362 363 364 365 366
		power-source = <3300>;
	};

	sdhi2_pins_uhs: sd2_uhs {
		groups = "sdhi2_data4", "sdhi2_ctrl";
		function = "sdhi2";
		power-source = <1800>;
367 368
	};

369
	mmc1_pins: mmc1 {
370 371
		groups = "mmc1_data8", "mmc1_ctrl";
		function = "mmc1";
372
	};
373

374
	qspi_pins: qspi {
375 376
		groups = "qspi_ctrl", "qspi_data4";
		function = "qspi";
377
	};
378

379
	msiof1_pins: msiof1 {
380
		groups = "msiof1_clk", "msiof1_sync", "msiof1_rx",
381
				 "msiof1_tx";
382
		function = "msiof1";
383
	};
384

385
	i2c0_pins: i2c0 {
386 387
		groups = "i2c0";
		function = "i2c0";
388 389
	};

390
	iic0_pins: iic0 {
391 392
		groups = "iic0";
		function = "iic0";
393 394
	};

395
	iic1_pins: iic1 {
396 397
		groups = "iic1";
		function = "iic1";
398 399
	};

400
	iic2_pins: iic2 {
401 402
		groups = "iic2";
		function = "iic2";
403 404
	};

405
	iic3_pins: iic3 {
406 407
		groups = "iic3";
		function = "iic3";
408
	};
409

410
	hsusb_pins: hsusb {
411 412
		groups = "usb0_ovc_vbus";
		function = "usb0";
413 414
	};

415
	usb0_pins: usb0 {
416 417
		groups = "usb0";
		function = "usb0";
418 419 420
	};

	usb1_pins: usb1 {
421 422
		groups = "usb1";
		function = "usb1";
423 424 425
	};

	usb2_pins: usb2 {
426 427
		groups = "usb2";
		function = "usb2";
428
	};
429

430
	vin1_pins: vin1 {
431 432
		groups = "vin1_data8", "vin1_clk";
		function = "vin1";
433
	};
434 435

	sound_pins: sound {
436 437
		groups = "ssi0129_ctrl", "ssi0_data", "ssi1_data";
		function = "ssi";
438 439 440
	};

	sound_clk_pins: sound_clk {
441 442
		groups = "audio_clk_a";
		function = "audio_clk";
443
	};
444 445
};

446 447 448 449 450 451
&ether {
	pinctrl-0 = <&ether_pins &phy1_pins>;
	pinctrl-names = "default";

	phy-handle = <&phy1>;
	renesas,ether-link-active-low;
452
	status = "okay";
453 454 455 456 457

	phy1: ethernet-phy@1 {
		reg = <1>;
		interrupt-parent = <&irqc0>;
		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
458
		micrel,led-mode = <1>;
459 460 461
	};
};

462
&cmt0 {
463
	status = "okay";
464 465
};

466 467 468 469 470 471 472 473
&mmcif1 {
	pinctrl-0 = <&mmc1_pins>;
	pinctrl-names = "default";

	vmmc-supply = <&fixedregulator3v3>;
	bus-width = <8>;
	non-removable;
	status = "okay";
474
};
475 476 477 478

&sata1 {
	status = "okay";
};
479

480
&qspi {
481 482 483 484 485 486
	pinctrl-0 = <&qspi_pins>;
	pinctrl-names = "default";

	status = "okay";

	flash: flash@0 {
487
		compatible = "spansion,s25fl512s", "jedec,spi-nor";
488 489
		reg = <0>;
		spi-max-frequency = <30000000>;
490 491
		spi-tx-bus-width = <4>;
		spi-rx-bus-width = <4>;
492 493
		spi-cpha;
		spi-cpol;
494 495
		m25p,fast-read;

496
		partitions {
497
			compatible = "fixed-partitions";
498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514
			#address-cells = <1>;
			#size-cells = <1>;

			partition@0 {
				label = "loader";
				reg = <0x00000000 0x00040000>;
				read-only;
			};
			partition@40000 {
				label = "user";
				reg = <0x00040000 0x00400000>;
				read-only;
			};
			partition@440000 {
				label = "flash";
				reg = <0x00440000 0x03bc0000>;
			};
515 516 517
		};
	};
};
518

519 520
&scif0 {
	pinctrl-0 = <&scif0_pins>;
521 522 523 524 525
	pinctrl-names = "default";

	status = "okay";
};

526 527
&scifa1 {
	pinctrl-0 = <&scifa1_pins>;
528 529 530 531 532
	pinctrl-names = "default";

	status = "okay";
};

533 534 535 536 537
&scif_clk {
	clock-frequency = <14745600>;
	status = "okay";
};

538 539 540 541 542 543 544 545 546 547 548 549 550 551 552
&msiof1 {
	pinctrl-0 = <&msiof1_pins>;
	pinctrl-names = "default";

	status = "okay";

	pmic: pmic@0 {
		compatible = "renesas,r2a11302ft";
		reg = <0>;
		spi-max-frequency = <6000000>;
		spi-cpol;
		spi-cpha;
	};
};

553 554
&sdhi0 {
	pinctrl-0 = <&sdhi0_pins>;
555 556
	pinctrl-1 = <&sdhi0_pins_uhs>;
	pinctrl-names = "default", "state_uhs";
557 558 559 560

	vmmc-supply = <&vcc_sdhi0>;
	vqmmc-supply = <&vccq_sdhi0>;
	cd-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
561
	sd-uhs-sdr50;
562 563 564 565 566
	status = "okay";
};

&sdhi2 {
	pinctrl-0 = <&sdhi2_pins>;
567 568
	pinctrl-1 = <&sdhi2_pins_uhs>;
	pinctrl-names = "default", "state_uhs";
569 570 571 572

	vmmc-supply = <&vcc_sdhi2>;
	vqmmc-supply = <&vccq_sdhi2>;
	cd-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>;
573
	sd-uhs-sdr50;
574 575
	status = "okay";
};
576

577 578 579
&cpu0 {
	cpu0-supply = <&vdd_dvfs>;
};
580

581 582 583 584 585
&i2c0	{
	pinctrl-0 = <&i2c0_pins>;
	pinctrl-names = "i2c-exio";
};

586
&iic0	{
587
	pinctrl-0 = <&iic0_pins>;
588
	pinctrl-names = "i2c-exio";
589 590
};

591
&iic1	{
592
	status = "okay";
593
	pinctrl-0 = <&iic1_pins>;
594
	pinctrl-names = "default";
595 596
};

597
&iic2	{
598
	status = "okay";
599
	pinctrl-0 = <&iic2_pins>;
600
	pinctrl-names = "default";
601

602 603
	clock-frequency = <100000>;

604
	ak4643: codec@12 {
605 606 607 608 609
		compatible = "asahi-kasei,ak4643";
		#sound-dai-cells = <0>;
		reg = <0x12>;
	};

610 611 612 613 614 615 616 617 618 619 620 621
	composite-in@20 {
		compatible = "adi,adv7180";
		reg = <0x20>;
		remote = <&vin1>;

		port {
			adv7180: endpoint {
				bus-width = <8>;
				remote-endpoint = <&vin1ep0>;
			};
		};
	};
622 623 624 625 626

	hdmi@39 {
		compatible = "adi,adv7511w";
		reg = <0x39>;
		interrupt-parent = <&gpio1>;
627
		interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653

		adi,input-depth = <8>;
		adi,input-colorspace = "rgb";
		adi,input-clock = "1x";
		adi,input-style = <1>;
		adi,input-justification = "evenly";

		ports {
			#address-cells = <1>;
			#size-cells = <0>;

			port@0 {
				reg = <0>;
				adv7511_in: endpoint {
					remote-endpoint = <&du_out_lvds0>;
				};
			};

			port@1 {
				reg = <1>;
				adv7511_out: endpoint {
					remote-endpoint = <&hdmi_con>;
				};
			};
		};
	};
654 655
};

656
&iic3 {
657
	pinctrl-names = "default";
658
	pinctrl-0 = <&iic3_pins>;
659 660
	status = "okay";

661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676
	pmic@58 {
		compatible = "dlg,da9063";
		reg = <0x58>;
		interrupt-parent = <&irqc0>;
		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
		interrupt-controller;

		rtc {
			compatible = "dlg,da9063-rtc";
		};

		wdt {
			compatible = "dlg,da9063-watchdog";
		};
	};

677
	vdd_dvfs: regulator@68 {
678
		compatible = "dlg,da9210";
679
		reg = <0x68>;
680 681
		interrupt-parent = <&irqc0>;
		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
682 683 684 685 686 687

		regulator-min-microvolt = <1000000>;
		regulator-max-microvolt = <1000000>;
		regulator-boot-on;
		regulator-always-on;
	};
688
};
689 690 691 692 693 694 695 696 697 698 699 700 701

&pci0 {
	status = "okay";
	pinctrl-0 = <&usb0_pins>;
	pinctrl-names = "default";
};

&pci1 {
	status = "okay";
	pinctrl-0 = <&usb1_pins>;
	pinctrl-names = "default";
};

702 703 704 705 706 707
&xhci {
	status = "okay";
	pinctrl-0 = <&usb2_pins>;
	pinctrl-names = "default";
};

708 709 710 711 712
&pci2 {
	status = "okay";
	pinctrl-0 = <&usb2_pins>;
	pinctrl-names = "default";
};
713

714 715 716 717 718 719 720
&hsusb {
	status = "okay";
	pinctrl-0 = <&hsusb_pins>;
	pinctrl-names = "default";
	renesas,enable-gpio = <&gpio5 18 GPIO_ACTIVE_HIGH>;
};

721 722 723 724
&usbphy {
	status = "okay";
};

725 726 727 728 729
/* composite video input */
&vin1 {
	pinctrl-0 = <&vin1_pins>;
	pinctrl-names = "default";

730
	status = "okay";
731 732 733 734 735 736 737 738 739 740 741

	port {
		#address-cells = <1>;
		#size-cells = <0>;

		vin1ep0: endpoint {
			remote-endpoint = <&adv7180>;
			bus-width = <8>;
		};
	};
};
742 743 744 745 746

&rcar_sound {
	pinctrl-0 = <&sound_pins &sound_clk_pins>;
	pinctrl-names = "default";

747
	/* Single DAI */
748 749 750 751 752 753
	#sound-dai-cells = <0>;

	status = "okay";

	rcar_sound,dai {
		dai0 {
754 755
			playback = <&ssi0 &src2 &dvc0>;
			capture  = <&ssi1 &src3 &dvc1>;
756 757 758 759 760 761 762
		};
	};
};

&ssi1 {
	shared-pin;
};