From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tuomas Tynkkynen Date: Fri, 9 Mar 2018 18:04:44 +0200 Subject: [U-Boot] [PATCH v2 2/2] bcm283x_pl011: Flush RX queue after setting baud rate In-Reply-To: <20180307210825.50709-3-agraf@suse.de> References: <20180307210825.50709-1-agraf@suse.de> <20180307210825.50709-3-agraf@suse.de> Message-ID: <20180309180444.5d1a8e61@duuni> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de On Wed, 7 Mar 2018 22:08:25 +0100 Alexander Graf wrote: > After the UART was initialized, we may still have bogus data in the > RX queue if it was enabled with incorrect pin muxing before. >=20 > So let's flush the RX queue whenever we initialize baud rates. >=20 > This fixes a regression with the dynamic pinmuxing code when enable_uart= =3D1 > is not set in config.txt on Raspberry Pis that use pl011 for serial. >=20 > Fixes: caf2233b28 ("bcm283x: Add pinctrl driver") > Reported-by: G=C3=B6ran Lundberg > Reported-by: Peter Robinson > Signed-off-by: Alexander Graf >=20 > --- >=20 > v1 -> v2: >=20 > - correctly drain the queue > --- > drivers/serial/serial_bcm283x_pl011.c | 25 ++++++++++++++++++++++++- > drivers/serial/serial_pl01x.c | 10 +++++----- > drivers/serial/serial_pl01x_internal.h | 7 ++++++- > 3 files changed, 35 insertions(+), 7 deletions(-) >=20 On a RPi 1, with no enable_uart in config.txt: Tested-by: Tuomas Tynkkynen