mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-29 23:53:33 +08:00
serial: zynq: Initialize uart only before relocation
This issue was found when OF_LIVE was enabled that there are scrambled
chars on the console like this:
Chip ID: zu3eg
Watchdog: Started��j� sdhci@ff160000: 0, sdhci@ff170000: 1
In: serial@ff010000
I found a solution for this problem exactly the same as I found later in
serial_msm fixed by:
"serial: serial_msm: initialize uart only before relocation"
(sha1: 7e5ad796bc
)
What it is happening is that output TX fifo still contains chars to be
sent and _uart_zynq_serial_init() resets TX fifo even in the middle of
transfer.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
e90d2659e4
commit
a673025535
@ -15,6 +15,8 @@
|
|||||||
#include <linux/compiler.h>
|
#include <linux/compiler.h>
|
||||||
#include <serial.h>
|
#include <serial.h>
|
||||||
|
|
||||||
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
#define ZYNQ_UART_SR_TXACTIVE BIT(11) /* TX active */
|
#define ZYNQ_UART_SR_TXACTIVE BIT(11) /* TX active */
|
||||||
#define ZYNQ_UART_SR_TXFULL BIT(4) /* TX FIFO full */
|
#define ZYNQ_UART_SR_TXFULL BIT(4) /* TX FIFO full */
|
||||||
#define ZYNQ_UART_SR_RXEMPTY BIT(1) /* RX FIFO empty */
|
#define ZYNQ_UART_SR_RXEMPTY BIT(1) /* RX FIFO empty */
|
||||||
@ -137,6 +139,10 @@ static int zynq_serial_probe(struct udevice *dev)
|
|||||||
{
|
{
|
||||||
struct zynq_uart_priv *priv = dev_get_priv(dev);
|
struct zynq_uart_priv *priv = dev_get_priv(dev);
|
||||||
|
|
||||||
|
/* No need to reinitialize the UART after relocation */
|
||||||
|
if (gd->flags & GD_FLG_RELOC)
|
||||||
|
return 0;
|
||||||
|
|
||||||
_uart_zynq_serial_init(priv->regs);
|
_uart_zynq_serial_init(priv->regs);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user