Adding UARTs into device tree

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

Yuval
Posts: 6
Joined: Sun Dec 04, 2016 6:22 pm

Adding UARTs into device tree

Sun Dec 04, 2016 7:08 pm

I'm working with SAMA5D2 and the latest demo: linux4sam-poky-sama5d2_xplained-5.5.img.bz2

The default .dtsi file contains uart1 and uart3 and they both works fine

Code: Select all

			uart1: serial@f8020000 {
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_uart1_default>;
				status = "okay";
			};

			uart3: serial@fc008000 {
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_uart3_default>;
				status = "okay";
			};

....
....
			pinctrl_uart1_default: uart1_default {
				pinmux = <PIN_PD2__URXD1>,
					 <PIN_PD3__UTXD1>;
				bias-disable;
			};

			pinctrl_uart3_default: uart3_default {
				pinmux = <PIN_PB11__URXD3>,
					 <PIN_PB12__UTXD3>;
				bias-disable;
			};

Code: Select all

	aliases {
		serial0 = &uart1;
		serial1 = &uart3;
		tcb0 = &tcb0;
		tcb1 = &tcb1;
		i2s0 = &i2s0;
		i2s1 = &i2s1;
	};
I add one more device, uart2:

Code: Select all

			uart2: serial@f8024000 {
				pinctrl-names = "default";
				pinctrl-0 = <&pinctrl_uart2_default>;
				status = "okay";
			};
   
....
....
			pinctrl_uart2_default: uart2_default {
				pinmux = <PIN_PD23__URXD2>,
					 <PIN_PD24__UTXD2>;
				bias-disable;
			};



and into aliases:

Code: Select all

	aliases {
		serial0 = &uart1;
		serial1 = &uart3;
                serial2 = &uart2;
		tcb0 = &tcb0;
		tcb1 = &tcb1;
		i2s0 = &i2s0;
		i2s1 = &i2s1;
	};



When i boot the kernel with this new device tree, i see this 3 devices (with correct addresses):
/dev/ttyS0, /dev/ttyS1, /dev/ttyS2

but there is no RX or TX communication with uart2 and now also uart3 not working (no RX/TX comm.)


Can someone please tell me if i do something wrong?


Thanks
Yuval
blue_z
Location: USA
Posts: 1509
Joined: Thu Apr 19, 2007 10:15 pm

Re: Adding UARTs into device tree

Tue Dec 06, 2016 1:35 am

Yuval wrote:The default .dtsi file contains uart1 and uart3 ...
You write that as if there is only file involved, whereas in actuality you are referencing two different files and haven't even bothered to mention the top-level dts file that you're using.
Yuval wrote:Can someone please tell me if i do something wrong?
Beside breaking the modularity/layering of the Device Tree files, you probably have pin multiplexing conflicts.
Use the pin tables in the SoC datasheet to determine the potential conflicts, and then study the DT files for what has been enabled.
Or enable DEBUG in the pinctrl subsystem.

Regards

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 1 guest