Serial ports on Orange Pi One

Milan Obuch freebsd-arm at dino.sk
Thu Oct 27 20:19:04 UTC 2016


Hi,

I managed to get additional three serial ports into functional state.
Basically it was just a matter of putting some description into dts
file, namely add following at the end of dts file and build new dtb:

&pio {
	uart1_pins_a: uart1 at 0 {
		allwinner,pins = "PG6", "PG7", "PG8", "PG8";
		allwinner,function = "uart1";
		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
	};

	uart2_pins_a: uart2 at 0 {
		allwinner,pins = "PA0", "PA1", "PA2", "PA3";
		allwinner,function = "uart2";
		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
	};

	uart3_pins_a: uart3 at 0 {
		allwinner,pins = "PA13", "PA14";
		allwinner,function = "uart3";
		allwinner,drive = <SUN4I_PINCTRL_10_MA>;
		allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
	};

};

&uart1 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart1_pins_a>;
	status = "okay";
};

&uart2 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart2_pins_a>;
	status = "okay";
};

&uart3 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart3_pins_a>;
	status = "okay";
};

That's basically the same definition as for uart0. There is one strange
'property' of added ports - actual line speed is desired speed divided
by four, but for uart0 (console) speed is 115200 as set in dtb file...
so if I set baudrate on Orange Pi One port to 9600, the other side need
to be set to 1200.

I looked into dts if I can find any way to fix this, with no success.
In H3 datasheet I am not able to find how clocks are being generated
for uarts, but there should be simple solution to this I think. Any
hints?

One more note, uart1 and uart2 has CTS and RTS pins in addition to RX
and TX found in all four ports, but I did not check whether they have
any effect on serial port's function nor I have any idea how to chceck
it.

By the way, I am using Danny Braniss' dts found at
http://www.cs.huji.ac.il/~danny/orangepi-one.dts as basis for my
experiments.

Regards,
Milan


More information about the freebsd-arm mailing list