hw/char/pl011: Add support for loopback
authorTong Ho <tong.ho@amd.com>
Tue, 27 Feb 2024 05:48:55 +0000 (21:48 -0800)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 5 Mar 2024 13:22:55 +0000 (13:22 +0000)
commitf576e0733ccb023cde94acc7897c78a4871a09d0
tree41502e18b2221d61f0ded054c0ae54ef0259eb74
parent0820e097fa844b13e9246c1210b89265a0e0cc5b
hw/char/pl011: Add support for loopback

This patch adds loopback for sent characters, sent BREAK,
and modem-control signals.

Loopback of send and modem-control is often used for uart
self tests in real hardware but missing from current pl011
model, resulting in self-test failures when running in QEMU.

This implementation matches what is observed in real pl011
hardware placed in loopback mode:
1. Input characters and BREAK events from serial backend
   are ignored, but
2. Both TX characters and BREAK events are still sent to
   serial backend, in addition to be looped back to RX.

Signed-off-by: Tong Ho <tong.ho@amd.com>
Signed-off-by: Francisco Iglesias <francisco.iglesias@amd.com>
Message-id: 20240227054855.44204-1-tong.ho@amd.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/char/pl011.c