MT7621 enable 3 UARTS

Hello,

I'm developing with a MT7621 board and I've found in the datasheet there are actually 3 hardware UART ports on the SoC. I do have /dev/ttyS0, /dev/ttyS1 and /dev/ttyS2 but the S1 and S2 don't actually work.

I can see the following in dmesg:

[ 2.830750] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled
[ 2.844668] console [ttyS0] disabled
[ 2.851707] 1e000c00.uartlite: ttyS0 at MMIO 0x1e000c00 (irq = 33, base_baud = 3125000) is a 16550A
[ 2.869660] console [ttyS0] enabled

It seems the driver can see that the UART has indeed 3 ports but doesn't enable them. I probably need to enable/disable some registers. Can someone help me with this?

Update:

I think I need to do this in the dts file of my board because now the UART's will be turned off in favor of having the GPIO ports enabled. Can anybody tell me a bit more about these device tree files?

Kind regards,
Daan

Hello,

I´m trying to enable the uart2 and uart3 on the mt7621.dtsi file but nothing changed.

Did you had success?

Hello aviaoj,

Yes I got all three uarts working these are my uart entries for the mt7621.dtsi file:

uartlite: uartlite@c00 {
			compatible = "ns16550a";
			reg = <0xc00 0x100>;

			clocks = <&sysclock>;
			clock-frequency = <50000000>;

			interrupt-parent = <&gic>;
			interrupts = <GIC_SHARED 26 IRQ_TYPE_LEVEL_HIGH>;

			reg-shift = <2>;
			reg-io-width = <4>;
			no-loopback-test;
		};

		uart2: uart2@d00 {
			status = "okay";

			compatible = "ns16550a";
			reg = <0xd00 0x100>;

			clocks = <&sysclock>;
			clock-frequency = <50000000>;

			interrupt-parent = <&gic>;
			interrupts = <GIC_SHARED 27 IRQ_TYPE_LEVEL_HIGH>;

			current-speed = <9600>;

			reg-shift = <2>;
			reg-io-width = <4>;

			pinctrl-names = "default";
			pinctrl-0 = <&uart2_pins>;
		};

		uart3: uart3@e00 {
			status = "okay";

			compatible = "ns16550a";
			reg = <0xe00 0x100>;

			clocks = <&sysclock>;
			clock-frequency = <50000000>;

			interrupt-parent = <&gic>;
			interrupts = <GIC_SHARED 28 IRQ_TYPE_LEVEL_HIGH>;

			current-speed = <9600>;

			reg-shift = <2>;
			reg-io-width = <4>;

			pinctrl-names = "default";
			pinctrl-0 = <&uart3_pins>;
		};
3 Likes

Hello,

Tested and working ok.

Thank you very much for your help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.