From owner-freebsd-arm@freebsd.org Thu Oct 27 20:19:04 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7E27C223B0 for ; Thu, 27 Oct 2016 20:19:04 +0000 (UTC) (envelope-from freebsd-arm@dino.sk) Received: from mailhost.netlabit.sk (mailhost.netlabit.sk [84.245.65.72]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47393FF3 for ; Thu, 27 Oct 2016 20:19:03 +0000 (UTC) (envelope-from freebsd-arm@dino.sk) Received: from zeta.dino.sk (fw3.dino.sk [84.245.95.254]) (AUTH: LOGIN milan) by mailhost.netlabit.sk with ESMTPA; Thu, 27 Oct 2016 22:18:53 +0200 id 00E885A2.5812612D.0000E083 Date: Thu, 27 Oct 2016 22:18:53 +0200 From: Milan Obuch To: freebsd-arm@freebsd.org Subject: Serial ports on Orange Pi One Message-ID: <20161027221853.6c09d9fd@zeta.dino.sk> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; i386-portbld-freebsd10.3) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 20:19:04 -0000 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 = ; allwinner,pull = ; }; uart2_pins_a: uart2@0 { allwinner,pins = "PA0", "PA1", "PA2", "PA3"; allwinner,function = "uart2"; allwinner,drive = ; allwinner,pull = ; }; uart3_pins_a: uart3@0 { allwinner,pins = "PA13", "PA14"; allwinner,function = "uart3"; allwinner,drive = ; allwinner,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