From owner-freebsd-arm@freebsd.org Tue Mar 7 22:25:39 2017 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 0FEC0D0280F for ; Tue, 7 Mar 2017 22:25:39 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 991FA12AA for ; Tue, 7 Mar 2017 22:25:38 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: fb0c2694-0384-11e7-95b5-6dfd7dbb0ee5 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id fb0c2694-0384-11e7-95b5-6dfd7dbb0ee5; Tue, 07 Mar 2017 22:25:35 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id v27MPOh0004384; Tue, 7 Mar 2017 15:25:24 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1488925524.18764.55.camel@freebsd.org> Subject: Re: Odd-looking serial console prompt on RPI2 From: Ian Lepore To: "Jayachandran C." Cc: Michael Tuexen , freebsd-arm@freebsd.org, Oleksandr Tymoshenko Date: Tue, 07 Mar 2017 15:25:24 -0700 In-Reply-To: References: <20170227195647.GA91329@www.zefox.net> <20170301200112.ymwkfd64tzz5f3b2@mutt-hbsd> <4194F030-4E5C-4EB6-82D7-FD725E3B7CEF@fh-muenster.de> <20170302000334.GA99403@www.zefox.net> <1488419304.60166.26.camel@freebsd.org> <20170302020116.GA98466@bluezbox.com> <1488420309.60166.32.camel@freebsd.org> <1488664965.69705.24.camel@freebsd.org> <1488817492.18764.14.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Tue, 07 Mar 2017 22:25:39 -0000 On Wed, 2017-03-08 at 03:18 +0530, Jayachandran C. wrote: > On Mon, Mar 6, 2017 at 9:54 PM, Ian Lepore wrote: > > > > On Mon, 2017-03-06 at 13:59 +0530, Jayachandran C. wrote: > > > > > > Hi Ian, > > > > > > On Sun, Mar 5, 2017 at 3:32 AM, Ian Lepore > > > wrote: > > > > > > > > > > > > On Sat, 2017-03-04 at 22:24 +0530, Jayachandran C. wrote: > > > > > > > > > > > > > > > On Thu, Mar 2, 2017 at 7:35 AM, Ian Lepore > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > On Wed, 2017-03-01 at 18:01 -0800, Oleksandr Tymoshenko > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > Ian Lepore (ian@freebsd.org) wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Wed, 2017-03-01 at 16:03 -0800, bob prohaska wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Wed, Mar 01, 2017 at 09:20:13PM +0100, Michael > > > > > > > > > Tuexen > > > > > > > > > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Interesting... Let us know what works and what > > > > > > > > > > doesn't... > > > > > > > > > > > > > > > > > > > > Best regards > > > > > > > > > > Michael > > > > > > > > > > > > > > > > > > > As of FreeBSD 12.0-CURRENT (RPI2) #0 r314450: Wed > > > > > > > > > Mar  1 > > > > > > > > > 14:48:26 > > > > > > > > > PST > > > > > > > > > 2017 > > > > > > > > > the serial console is still corrupt (output > > > > > > > > > truncated, > > > > > > > > > input > > > > > > > > > not > > > > > > > > > echoed > > > > > > > > > but treated like the enter key).  The serial console > > > > > > > > > does > > > > > > > > > seem to > > > > > > > > > work > > > > > > > > > with U-boot and loader, so I don't think it's the > > > > > > > > > upstream > > > > > > > > > hardware. > > > > > > > > > > > > > > > > > > The HDMI console looks normal and USB keyboard input > > > > > > > > > seems to > > > > > > > > > work. > > > > > > > > > > > > > > > > > > There have been several updates to > > > > > > > > > /usr/src/sys/dev/uart > > > > > > > > > and > > > > > > > > > it > > > > > > > > > looks > > > > > > > > > as if kernel updates are still coming. Maybe the job > > > > > > > > > simply > > > > > > > > > isn't > > > > > > > > > done yet. > > > > > > > > > > > > > > > > > > bob > > > > > > > > > > > > > > > > > It seems like this might be caused by r314318.  Can > > > > > > > > someone > > > > > > > > having > > > > > > > > this problem confirm if 314317 works and 314318 fails? > > > > > > > Tested on my RPi2, 314317 - works, 314318 - broken > > > > > > > > > > > > > CC'ing jchandra@. > > > > > > > > > > > > I wonder if there is some bad interaction when the same > > > > > > uart is > > > > > > used as > > > > > > a console and a tty? > > > > > I don't have a RPi3 setup to test now, I will look at the > > > > > code > > > > > again > > > > > to see if > > > > > I can find an issue. > > > > > > > > > > Otherwise I will revert the change until we can find why the > > > > > RPi > > > > > UART > > > > > breaks > > > > > with these changes. > > > > > > > > > > Thanks, > > > > > JC. > > > > The bugs should be fixed as of r314682.  It looks like the bugs > > > > have > > > > long been in the pl011 driver, but were masked by having a fifo > > > > depth > > > > of 1 byte -- it all sorta worked by accident previously. > > > Looked thru r314681 and r314682, thanks for fixing this up. > > > > > > There seems to be a difference in behavior in IFLS settings on > > > different > > > platforms. I did not see a reasonable way to handle the tx fifo > > > being > > > full > > > when sc_txbuf is partially used, which is why I skipped this case > > > in > > > the > > > original commit - that was a mistake. > > > > > > Thanks, > > > JC. > > Hmm.  Does that imply the changes I made to set the fifo trigger > > level > > to 3/4 may not work on some other platforms?  I was only able to > > test > > on rpi-b. > I tested on QEMU's emulated pl011 and it works there too. > > I was thinking that IFLS behaved differently on ThunderX and that is > why my original code worked there. But after going thru the spec > again, > it looks like the FIFO in newer pl011 implementations is 32 entry > deep, > and that may be real reason why ThunderX did not have any issues. > > JC. > _______________________________________________ Yep, apparently rev r1p5, which can be detected at runtime, increased the size of the fifos.  But, just to add a bit of drama, the bcm2835 (rpi) scewed up and identified its pl011 as r1p5 even though it only has 16 byte fifos.  It looks like there is some info in the rpi dts file that we can use to tell the difference.  I can probably whip up something to fix all this later tonight. -- Ian