Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Oct 2016 22:18:53 +0200
From:      Milan Obuch <freebsd-arm@dino.sk>
To:        freebsd-arm@freebsd.org
Subject:   Serial ports on Orange Pi One
Message-ID:  <20161027221853.6c09d9fd@zeta.dino.sk>

next in thread | raw e-mail | index | archive | help
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@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@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@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20161027221853.6c09d9fd>