From owner-freebsd-arm@freebsd.org Sat Mar 11 19:19:29 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 2E458D0748C for ; Sat, 11 Mar 2017 19:19:29 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D66E7931 for ; Sat, 11 Mar 2017 19:19:28 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x231.google.com with SMTP id p64so200097024qke.1 for ; Sat, 11 Mar 2017 11:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=iSDwyNhgA3RYtdTXAVfTnx2q19Is6FpVvBt0YMoHBmw=; b=yQaZ83on6UyEo33Z/wSR2EGbzftwdg4g/lVkwZ/gCLT5Fq8aT1twjzecLuLWfRx3iY PBVwEyEYEJqus/ffDDZiA4R4Z2PEkmgw1KNhFRDB9G9iH4O+zX92DwWoOWG8gpCs7CvV agt0Mn2guyxbr363W0pJpH6kDoDvpEPwg4W8KNSTJOZsS//aJhvCpHUpireJdsecTN8p ZAl8jVC6Top1HAHpt2ockxpsmqaiz3TxD4gsNr1TzHONoUEdzG8/SYacIxDVyhMzDcPm poGrFYcsDV+FE+C9tvoz0kD1jXRE1AJjkKB53GUwiAWWPrBebxMO9RK0uaZm+MwVQhu8 kUGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=iSDwyNhgA3RYtdTXAVfTnx2q19Is6FpVvBt0YMoHBmw=; b=GKoWjF73rrd9pXoCfKLuZ5XslWocRAbRbE+VWEQ/rzew69xLnLZH9aZBdYVApZVvIM GwOwBrWe+jDyOWtblBxcWtdT+bG89iJ8wEOmy0u1RoPFdJCKDUgyZVNUEvfNz4Ffh5Ni c6FI7Kw140ughOjvq8W0wTpxcftb6fXwf5kk/p7kBwE9mpFBfsxPDAQXcUtae/eOm5Nu DHtLkbqqryDDRHnPun5FuAeQVXIkAHMAi2xbmktTVMrGXTRHq1XKIirK/FC9C7+tkrWx kigcGfBIA6ndYeAaS6l+NJUdAhSNBfWfNpyuF7T4sVW2nKboaOqgMKSSuL4mITPOzIdi pwLg== X-Gm-Message-State: AFeK/H0v0GbMSn9CD8HltUCFoB1eIYK35aO7cR255N06lIJqE3m/8maouYo6M92pyDLGV4LW X-Received: by 10.55.99.18 with SMTP id x18mr25478131qkb.185.1489259968009; Sat, 11 Mar 2017 11:19:28 -0800 (PST) Received: from mutt-hbsd (pool-100-16-218-40.bltmmd.fios.verizon.net. [100.16.218.40]) by smtp.gmail.com with ESMTPSA id q188sm8875004qkf.20.2017.03.11.11.19.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 11 Mar 2017 11:19:27 -0800 (PST) Date: Sat, 11 Mar 2017 14:19:26 -0500 From: Shawn Webb To: Ian Lepore Cc: freebsd-arm@freebsd.org Subject: Re: Odd-looking serial console prompt on RPI2 Message-ID: <20170311191926.le5ort7zdinxwppz@mutt-hbsd> References: <20170302020116.GA98466@bluezbox.com> <1488420309.60166.32.camel@freebsd.org> <1488664965.69705.24.camel@freebsd.org> <20170307190937.r7n45xj67tnhevv4@mutt-hbsd> <20170307192918.2garie2ow6lzekg7@mutt-hbsd> <20170311174940.bze4k7ndjdemmu4l@mutt-hbsd> <1489255444.40576.57.camel@freebsd.org> <20170311180947.ro5obisuaemvudkp@mutt-hbsd> <1489259878.40576.62.camel@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="i57yfzzai7uts5vr" Content-Disposition: inline In-Reply-To: <1489259878.40576.62.camel@freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20170206 (1.7.2) 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: Sat, 11 Mar 2017 19:19:29 -0000 --i57yfzzai7uts5vr Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 11, 2017 at 12:17:58PM -0700, Ian Lepore wrote: > On Sat, 2017-03-11 at 13:09 -0500, Shawn Webb wrote: > > On Sat, Mar 11, 2017 at 11:04:04AM -0700, Ian Lepore wrote: > > >=20 > > > On Sat, 2017-03-11 at 12:49 -0500, Shawn Webb wrote: > > > >=20 > > > > On Tue, Mar 07, 2017 at 02:29:18PM -0500, Shawn Webb wrote: > > > > >=20 > > > > >=20 > > > > > On Tue, Mar 07, 2017 at 02:09:37PM -0500, Shawn Webb wrote: > > > > > >=20 > > > > > >=20 > > > > > > On Sat, Mar 04, 2017 at 03:02:45PM -0700, Ian Lepore wrote: > > > > > > >=20 > > > > > > >=20 > > > > > > > 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. > > > > > > Thanks for the fix! But it looks to be only partial. When I > > > > > > connect to > > > > > > the serial console via either cu or screen, I don't get > > > > > > corrupted > > > > > > text, > > > > > > but no keypresses are registered. Hitting enter at the login > > > > > > prompt does > > > > > > absolutely nothing. I'm at the latest commit of > > > > > > hardened/current/master > > > > > > on HardenedBSD for both the RPI3 and my laptop. > > > > > >=20 > > > > > > I'm using this serial cable from Adafruit: > > > > > > https://www.adafruit.com/product/954 > > > > > It looks like I had a bad cable. Sorry for the line noise. > > > > > Switching to > > > > > a different cable worked. > > > > Looks like the problem is back, but manifest in a different way. > > > > Screenshot: > > > >=20 > > > > https://goo.gl/photos/XYx6v1jCTVCGrnhd6 > > > >=20 > > > > Thanks, > > > >=20 > > > I wonder if rpi3 needs the same smaller-fifo fix as a 32-bit rpi. > > > ?Just > > > to test that theory, can you see if the attached patch fixes > > > problem? > > > ?If it does, I'll figure out how to detect rpi3 at runtime and set > > > the > > > sizes properly. > > >=20 > > > -- Ian > > >=20 > > > Index: sys/dev/uart/uart_dev_pl011.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > > > --- sys/dev/uart/uart_dev_pl011.c (revision 314917) > > > +++ sys/dev/uart/uart_dev_pl011.c (working copy) > > > @@ -464,7 +464,7 @@ uart_pl011_bus_probe(struct uart_softc *sc) > > > ? is_bcm2835 =3D ofw_bus_is_compatible(sc->sc_dev, > > > "brcm,bcm2835-pl011") || > > > ? ????ofw_bus_is_compatible(sc->sc_dev, "broadcom,bcm2835- > > > uart"); > > > ?#else > > > - is_bcm2835 =3D false; > > > + is_bcm2835 =3D true; > > > ?#endif > > > ? hwrev =3D __uart_getreg(&sc->sc_bas, UART_PIDREG_2) >> 4; > > > ? if (hwrev <=3D 2 || is_bcm2835) { > > Sure. I'll report back either tonight or tomorrow. > >=20 > > Thanks, > >=20 >=20 > Actually, I think a proper solution will be something like the attached > patch. ?After some spelunking on the web I think the rpi3 fifos are the > smaller size because the fdt data contains the linux-style workaround > (which overrides the primecell periphid value with fdt data). ?This > patch looks for that in addition to looking for the rpi compatible > strings (still required to handle old-style freebsd fdt data). >=20 > -- Ian Cool. I'll give that patch a shot soon. Thanks a lot! --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --i57yfzzai7uts5vr Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAljETbsACgkQaoRlj1JF bu6ZDg//To8zE+axviS5/yWwhL0tAbGp8NBLVGa2BYNENK8Cr0rffwC7CGw6BMB9 z4VTCNQiZ/nEUY0q7MZEUb0FxSyMWOvswdEgZCugmj8+soBwPUIsc9haYr48hPdN JePXi5WOex7F8dfgvigwM102H62Ggm7N1MuIisBlk8gT7mDBUj9J/OWKyF/Cnlzc fbEHjehpUA+8GIOB/kUoff4O1910cVMpIwysc5yuyXeSX7nYliWGgA9ZFrC6HgSu XG8PbxH1O/nysmYmOkhg4m4ZfA2Wfv/tHh7XFT9ypYRiFFvBOzKpNrrnbn62Bc6D 1TQv6Y7zV/epuKvxokHMwO7fg1dPXhNcdAdfD6d1lW79t8XxEQvXaJaYMqaHS0MJ rH8nTntwrXuN9BBwBJzflorJb4qNhlQ2TJHUZau9GabwdRmKENX/K+w1Zh7IlyKO PC7cvpyr1U3YKtjtWcnoOTD+mYeVhAJ9y6TNf81onEy0WEwl9ydaRGN4SvS1/lro pYezS0pq4ykDUe/ZgtLOm2ulJEwJXBXYsho9r9degPxmZu1sncmymKK9Xc1JsN4D 3hmXbq3Gzf+9ZmWnI8wokXFnS4HwrYDEuLd1ZyjUyc6leDRuUvcAyN/V+41AK3iI chu6Wpuhz0494JUwS3x8NX3Wg+882Lu8gX71rv00dq1PoCqkgG0= =ut3c -----END PGP SIGNATURE----- --i57yfzzai7uts5vr--