Skip to content

hw/arm: xilinx_zynq: Fix upstream U-Boot boot failure

Bin Meng qemu-arm qemu-devel 3 versions – Applied

Status from this message: Applied to target-arm.next, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 6 repliesApplied
  2. v25 patches 9 repliesSuperseded
  3. v13 patches 12 repliesSuperseded

Changes in v3 from the cover letter

- new patch: hw/char: cadence_uart: Log a guest error when unclocked or in reset

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/6hw/misc: zynq_slcr: Correctly compute output clocks in the reset exit phasehw/misc/zynq_slcr.c+18 -130 replies
2/6hw/char: cadence_uart: Disable transmit when input clock is disabledhw/char/cadence_uart.c+5 -00 replies
3/6hw/char: cadence_uart: Move clock/reset check to uart_can_receive()hw/char/cadence_uart.c+10 -71 reply
4/6hw/char: cadence_uart: Convert to memop_with_attrs() opshw/char/cadence_uart.c+15 -111 reply
5/6hw/char: cadence_uart: Ignore access when unclocked or in reset for uart_{read, write}()hw/char/cadence_uart.c+10 -51 reply
6/6hw/char: cadence_uart: Log a guest error when device is unclocked or in resethw/char/cadence_uart.c+8 -01 reply

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAlistair FrancisEdgar E. Iglesias
SeriesR-b
1/6A-b R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/6] hw/arm: xilinx_zynq: Fix upstream U-Boot boot failure

As of today, when booting upstream U-Boot for Xilinx Zynq, the UART does not receive anything. Debugging shows that the UART input clock frequency is zero which prevents the UART from receiving anything as. per the logic in uart_receive().

Note the U-Boot can still output data to the UART tx fifo, which should not happen, as the design seems to prevent the data transmission when clock is not enabled but somehow it only applies to the Rx side.

For anyone who is interested to give a try, here is the U-Boot defconfig:

$ make xilinx_zynq_virt_defconfig

and QEMU commands to test U-Boot:

$ qemu-system-arm -M xilinx-zynq-a9 -m 1G -display none -serial null -serial stdio \
    -device loader,file=u-boot-dtb.bin,addr=0x4000000,cpu-num=0

Note U-Boot used to boot properly in QEMU 4.2.0 which is the QEMU version used in current U-Boot's CI testing. The UART clock changes were introduced by the following 3 commits:

38867cb7ec90 ("hw/misc/zynq_slcr: add clock generation for uarts") b636db306e06 ("hw/char/cadence_uart: add clock support") 5b49a34c6800 ("hw/arm/xilinx_zynq: connect uart clocks to slcr")

Changes in v3:
- new patch: hw/char: cadence_uart: Log a guest error when unclocked or in reset

Changes in v2:
- avoid declaring variables mid-scope
- new patch: hw/char: cadence_uart: Convert to memop_with_attrs() ops
- new patch: hw/char: cadence_uart: Ignore access when unclocked or in reset for uart_{read,write}()

Bin Meng (6):
hw/misc: zynq_slcr: Correctly compute output clocks in the reset exit
phase
hw/char: cadence_uart: Disable transmit when input clock is disabled hw/char: cadence_uart: Move clock/reset check to uart_can_receive() hw/char: cadence_uart: Convert to memop_with_attrs() ops hw/char: cadence_uart: Ignore access when unclocked or in reset for

    uart_{read,write}()

hw/char: cadence_uart: Log a guest error when device is unclocked or
in reset

 hw/char/cadence_uart.c | 61 +++++++++++++++++++++++++++++-------------
 hw/misc/zynq_slcr.c    | 31 ++++++++++++---------
 2 files changed, 61 insertions(+), 31 deletions(-)
Signature · 1 line
2.25.1