Device Tree

From Renesas.info
Jump to navigation Jump to search


RZ-G

  • This page contains helpful notes about Device Tree configurations

RZ Specific Files

  • Device Tree files for Renesas SoC and evaluation boards are under the directory arch/arm64/boot/dts/renesas
  • Below is the list of Device Tree files used for the Renesas Evaluation boards.
RZ/G2H HiHope                
File Description
r8a774e1.dtsi RZ/G2H Device Tree containing all peripherals
hihope-common.dtsi
hihope-rev2.dtsi
hihope-rev4.dtsi
hihope-rzg2-ex-aistarvision-mipi-adapter-2.1.dtsi
hihope-rzg2-ex-aistarvision-mipi-adapter-2.4.dtsi
hihope-rzg2-ex.dtsi
hihope-rzg2-ex-lvds.dtsi
r8a774e1-hihope-rzg2h.dts
r8a774e1-hihope-rzg2h-ex.dts
r8a774e1-hihope-rzg2h-ex-idk-1110wr.dts
rzg2-advantech-idk-1110wr-panel.dtsi
r8a774e1-hihope-rzg2h-ex-mipi-2.1.dts
r8a774e1-hihope-rzg2h-ex-mipi-2.4.dts
RZ/G2N HiHope                
File Description
r8a774b1.dtsi RZ/G2N Device Tree containing all peripherals
r8a774b1-hihope-rzg2n.dts
r8a774b1-hihope-rzg2n-ex.dts
r8a774b1-hihope-rzg2n-ex-idk-1110wr.dts
r8a774b1-hihope-rzg2n-ex-mipi-2.1.dts
r8a774b1-hihope-rzg2n-ex-mipi-2.4.dts
r8a774b1-hihope-rzg2n-rev2.dts
r8a774b1-hihope-rzg2n-rev2-ex.dts
r8a774b1-hihope-rzg2n-rev2-ex-idk-1110wr.dts
rzg2-advantech-idk-1110wr-panel.dtsi
r8a774b1-hihope-rzg2n-rev2-ex-mipi-2.1.dts
r8a774b1-hihope-rzg2n-rev2-ex-mipi-2.4.dts
RZ/G2M HiHope                
File Description
r8a774a1.dtsi RZ/G2M Device Tree containing all peripherals
r8a774a1-hihope-rzg2m.dts
r8a774a1-hihope-rzg2m-ex.dts
r8a774a1-hihope-rzg2m-ex-idk-1110wr.dts
rzg2-advantech-idk-1110wr-panel.dtsi
r8a774a1-hihope-rzg2m-ex-mipi-2.1.dts
r8a774a1-hihope-rzg2m-ex-mipi-2.4.dts
r8a774a1-hihope-rzg2m-rev2.dts
r8a774a1-hihope-rzg2m-rev2-ex.dts
r8a774a1-hihope-rzg2m-rev2-ex-idk-1110wr.dts
r8a774a1-hihope-rzg2m-rev2-ex-mipi-2.1.dts
r8a774a1-hihope-rzg2m-rev2-ex-mipi-2.4.dts
r8a774a3.dtsi
r8a774a3-hihope-rzg2m.dts
r8a774a3-hihope-rzg2m-ex.dts
r8a774a3-hihope-rzg2m-ex-idk-1110wr.dts
rzg2-advantech-idk-1110wr-panel.dtsi
r8a774a3-hihope-rzg2m-ex-mipi-2.1.dts
r8a774a3-hihope-rzg2m-ex-mipi-2.4.dts
RZ/G2E EK874                
File Description
r8a774c0.dtsi RZ/G2E Device Tree containing all peripherals
r8a774c0-cat874.dts
r8a774c0-cat874-revc.dts
r8a774c0-ek874.dts
r8a774c0-ek874-idk-2121wr.dts
r8a774c0-ek874-mipi-2.1.dts
r8a774c0-ek874-mipi-2.4.dts
r8a774c0-ek874-revc.dts
r8a774c0-ek874-revc-idk-2121wr.dts
rzg2-advantech-idk-1110wr-panel.dtsi
r8a774c0-ek874-revc-mipi-2.1.dts
r8a774c0-ek874-revc-mipi-2.4.dts
r8a774c0-es10-cat874.dts
r8a774c0-es10.dtsi
r8a774c0-es10-ek874.dts
r8a774c0-es10-ek874-idk-2121wr.dts
r8a774c0-es10-ek874-mipi-2.1.dts
r8a774c0-es10-ek874-mipi-2.4.dts
cat874-common.dtsi
cat875.dtsi
RZ/G2L SMARC                  
File Description
r9a07g044.dtsi RZ/G2L family SoC common parts
r9a07g044l.dtsi Specific to RZ/G2L (R9A07G044L) SoC
r9a07g044l1.dtsi Specific to RZ/G2L (R9A07G044L single cortex A55) SoC
r9a07g044l2.dtsi Specific to RZ/G2L (R9A07G044L dual cortex A55) SoC
rz-smarc-common.dtsi
rzg2l-smarc.dtsi
rzg2l-smarc-pinfunction.dtsi
rzg2l-smarc-som.dtsi
r9a07g044l2-smarc.dts
RZ/G2LC SMARC                
File Description
r9a07g044c1.dtsi RZ/G2LC Device Tree containing all peripherals
r9a07g044c2.dtsi RZ/G2LC Device Tree containing all peripherals
r9a07g044c2-smarc.dts
rzg2lc-smarc.dtsi
rzg2lc-smarc-pinfunction.dtsi
rzg2lc-smarc-som.dtsi
RZ/G2UL SMARC                
File Description
rzg2ul-smarc.dtsi
r9a07g043.dtsi RZ/G2UL Device Tree containing all peripherals
r9a07g043u11.dtsi
r9a07g043u11-smarc.dts
r9a07g043u12.dtsi
RZ/V2L SMARC                
File Description
r9a07g054.dtsi RZ/V2L Device Tree containing all peripherals
r9a07g054l1.dtsi
r9a07g054l2-dev.dts
r9a07g054l2.dtsi
r9a07g054l2-smarc.dts

Internal Renesas boards

  • r9a07g044l2-dev.dts
  • rzg2l-smarc-dev.dtsi

Device Tree Syntax

Top Level (root node)

Compatible for the SoC

  • The .dtsi file for each SoC will have a "compatible" string to specify that SoC it is. If you decide to make your own top level compatible, make sure you include the original SoC string. The reason is that some drivers (the VSP driver for example) look for that SoC string to know what SoC they are running on. If it is missing, it will not load or run correctly.

Here is a correct example of a .dts file for a RZ/G2L board. Notice how "renesas,r9a07g044" is at the end of the line.

/ {
	model = "My Really Cool RZ/G2L Board";
	compatible = "my-rzg2l-board" , "renesas,r9a07g044";

	chosen {
		bootargs = "ignore_loglevel rw root=/dev/mmc0blk1";
		stdout-path = "serial0:115200n8";
	};

};

Display

Audio

Example of MAX9867 codec with MAX98390 Amplifier for RZ/G2L  

Here is an example of a MAX9867 on SSI channel 3, using I2C-3. MAX98390 Amplifier on I2C-2.

This is for the Linux-5.10 kernel. For the older Linux-4.19 kernel, there are some differences.

Pin Setup

&pinctrl {

	/* MAX98390 Amplifier */
	i2c2_pins: i2c2 {
		pinmux = <RZG2L_PORT_PINMUX(42, 3, 1)>, /* SDA */
			 <RZG2L_PORT_PINMUX(42, 4, 1)>; /* SCL */
	};

	/* MAX9867 Codec */
	i2c3_pins: i2c3 {
		pinmux = <RZG2L_PORT_PINMUX(18, 0, 3)>, /* SDA */
			 <RZG2L_PORT_PINMUX(18, 1, 3)>; /* SCL */
	};

	ssi3_pins: ssi3 {
	pinmux = <RZG2L_PORT_PINMUX(31, 0, 5)>, /* BCK */
		<RZG2L_PORT_PINMUX(31, 1, 5)>, /* RCK */
		<RZG2L_PORT_PINMUX(32, 0, 5)>, /* TXD */
		<RZG2L_PORT_PINMUX(32, 1, 5)>; /* RXD */
	};
};

Enable SSI channel

&ssi3 {
	pinctrl-0 = <&ssi3_pins>;
	pinctrl-names = "default";

	#sound-dai-cells = <1>;
	status = "okay";
};

Create a node for the MAX9867

	my_snd: sound {
		compatible = "simple-audio-card";
		simple-audio-card,widgets = "Speaker", "Ext Spk";

		simple-audio-card,routing =
		"Ext Spk", "BE_OUT";
		"Ext Spk", "LOUT",
		"Ext Spk", "ROUT";

		/* MAX98390 Amplifier */
		simple-audio-card,dai-link@0{
			format = "i2s";
			bitclock-master = <&cpu_dai3>;
			frame-master = <&cpu_dai3>;
			mclk-fs = <256>;
			cpu_dai3: cpu {
				sound-dai = <&ssi3>;
			};

			codec_dai3: codec {
				sound-dai = <&max98390>;
				clocks = <&mclk>;
			};
		};

		/* MAX9867 Codec */
		simple-audio-card,dai-link@1{
			format = "i2s";
			bitclock-master = <&cpu_dai0>;
			frame-master = <&cpu_dai0>;
			mclk-fs = <256>;
			cpu_dai0: cpu {
				sound-dai = <&ssi0>;
			};

			codec_dai0: codec {
				sound-dai = <&max9867>;
				clocks = <&mclk>;
			};
		};
	};


I2C node for the Codec and Amp

&i2c2 {
	pinctrl-0 = <&i2c2_pins>;
	pinctrl-names = "default";

	status = "okay";
	clock-frequency = <400000>;

	/* MAX98390 Amplifier */
	max98390: codec@3d {
		status = "okay";
		compatible = "maxim,max98390";
		#sound-dai-cells = <0>;
		reg = <0x3d>;
	};
};

&i2c3 {
	pinctrl-0 = <&i2c3_pins>;
	pinctrl-names = "default";

	status = "okay";
	clock-frequency = <400000>;

	/* MAX9867 Codec */
	max9867: codec@18 {
		status = "okay";
		compatible = "maxim,max9867";
		#sound-dai-cells = <0>;
		reg = <0x18>;
	};
};


Camera

Ethernet

USB

SD Card

eMMC

I2C

SPI

QSPI Flash

UART

CAN

ADC

WDT

PWM

Timer