Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Mar 2017 16:37:45 -0500
From:      Shawn Webb <shawn.webb@hardenedbsd.org>
To:        Ian Lepore <ian@freebsd.org>
Cc:        freebsd-arm@freebsd.org
Subject:   Re: Odd-looking serial console prompt on RPI2
Message-ID:  <20170311213745.eyn6kh26f76c2qu4@mutt-hbsd>
In-Reply-To: <20170311191926.le5ort7zdinxwppz@mutt-hbsd>
References:  <1488420309.60166.32.camel@freebsd.org> <CA%2B7sy7Bv=-2mx2MJP18ZnbNp2yO2hKukw=KALn711txaxsk=rg@mail.gmail.com> <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> <20170311191926.le5ort7zdinxwppz@mutt-hbsd>

next in thread | previous in thread | raw e-mail | index | archive | help

--gtbwqqbx4jbaqj5u
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sat, Mar 11, 2017 at 02:19:26PM -0500, Shawn Webb wrote:
> 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
>=20
> Cool. I'll give that patch a shot soon.

The second revision patch worked beautifully. Thank you very much!

--=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

--gtbwqqbx4jbaqj5u
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAljEbicACgkQaoRlj1JF
bu6XCxAAoR+sRYJ9tkfPWjGusLCvVmamlXxsiuw6ZfAzssaOvMDeh2jhA8AgoK8g
xM92Tn7pE+H1/dJpq6W2sQuwmp3rnkUKDSk/zw3xymjCWBeq8jS4m5OrkxJiYiy+
+zt+rmQ10IoW6Q+eoZBTRZXinnNXp7kVdeWTs/pMeEK+HkU4pjTrPbsWoXB3V0wo
wo43+BjWRE9Gen/ZxUnVXNDVMOEsdP2rUmuVDZfbG8e4iEESNuIVQVhk9Lx/I7G5
47K3cp1LzMdmdWtM8DmXs6XCRYdbT9Iy7eTJJdLDn9A2kUY/teLaIdBvqWu19pKM
Hb/2APiPVgl2fkBnssi+uiSE6efBWB0RdcpDVnov6nDL7EKwKdqirUrjGRytbTFb
hXu5Bw9g12ILiCANzfaYuXlVYkdoDRfMPByu3EPFKJLnfIhWzpJnZC6KNYCa5lrw
nWy/q+hI07pQjepIsZtCML8PvJC398d5Gy7bt4/Y0s+Ma/+fpCEF/ZydFRYd2tiL
25ZF0N/+D2sonauARhSYFuUUr1Wwc5bKaRlUgBgut+tGgrZaUf7senO7PwnTf+VQ
ZQmJd4TSPpK2KSs8+GaJ1ibaKgfhChVtNuA0s/mD+0l3ybUtXsqTGqVWwt9adSQD
IGZg5P0jEzlQ6X8esKuNfexxt8h8L0j4GsSxIlxG/EGKWeMMqA8=
=WHyw
-----END PGP SIGNATURE-----

--gtbwqqbx4jbaqj5u--



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