[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/23] hw/char: cadence_uart: Log a guest error when device is unc
From: |
Peter Maydell |
Subject: |
[PULL 06/23] hw/char: cadence_uart: Log a guest error when device is unclocked or in reset |
Date: |
Mon, 13 Sep 2021 17:11:27 +0100 |
From: Bin Meng <bmeng.cn@gmail.com>
We've got SW that expects FSBL (Bootlooader) to setup clocks and
resets. It's quite common that users run that SW on QEMU without
FSBL (FSBL typically requires the Xilinx tools installed). That's
fine, since users can stil use -device loader to enable clocks etc.
To help folks understand what's going, a log (guest-error) message
would be helpful here. In particular with the serial port since
things will go very quiet if they get things wrong.
Suggested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-id: 20210901124521.30599-7-bmeng.cn@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/char/cadence_uart.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/char/cadence_uart.c b/hw/char/cadence_uart.c
index 5f5a4645ac0..c069a30842e 100644
--- a/hw/char/cadence_uart.c
+++ b/hw/char/cadence_uart.c
@@ -240,6 +240,8 @@ static int uart_can_receive(void *opaque)
/* ignore characters when unclocked or in reset */
if (!clock_is_enabled(s->refclk) || device_is_in_reset(DEVICE(s))) {
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: uart is unclocked or in reset\n",
+ __func__);
return 0;
}
@@ -376,6 +378,8 @@ static void uart_event(void *opaque, QEMUChrEvent event)
/* ignore characters when unclocked or in reset */
if (!clock_is_enabled(s->refclk) || device_is_in_reset(DEVICE(s))) {
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: uart is unclocked or in reset\n",
+ __func__);
return;
}
@@ -413,6 +417,8 @@ static MemTxResult uart_write(void *opaque, hwaddr offset,
/* ignore access when unclocked or in reset */
if (!clock_is_enabled(s->refclk) || device_is_in_reset(DEVICE(s))) {
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: uart is unclocked or in reset\n",
+ __func__);
return MEMTX_ERROR;
}
@@ -478,6 +484,8 @@ static MemTxResult uart_read(void *opaque, hwaddr offset,
/* ignore access when unclocked or in reset */
if (!clock_is_enabled(s->refclk) || device_is_in_reset(DEVICE(s))) {
+ qemu_log_mask(LOG_GUEST_ERROR, "%s: uart is unclocked or in reset\n",
+ __func__);
return MEMTX_ERROR;
}
--
2.20.1
- [PULL 00/23] target-arm queue, Peter Maydell, 2021/09/13
- [PULL 01/23] hw/misc: zynq_slcr: Correctly compute output clocks in the reset exit phase, Peter Maydell, 2021/09/13
- [PULL 02/23] hw/char: cadence_uart: Disable transmit when input clock is disabled, Peter Maydell, 2021/09/13
- [PULL 03/23] hw/char: cadence_uart: Move clock/reset check to uart_can_receive(), Peter Maydell, 2021/09/13
- [PULL 04/23] hw/char: cadence_uart: Convert to memop_with_attrs() ops, Peter Maydell, 2021/09/13
- [PULL 05/23] hw/char: cadence_uart: Ignore access when unclocked or in reset for uart_{read, write}(), Peter Maydell, 2021/09/13
- [PULL 06/23] hw/char: cadence_uart: Log a guest error when device is unclocked or in reset,
Peter Maydell <=
- [PULL 07/23] hw/arm/virt: KVM: Probe for KVM_CAP_ARM_VM_IPA_SIZE when creating scratch VM, Peter Maydell, 2021/09/13
- [PULL 08/23] hw/arm: Add support for kudo-bmc board., Peter Maydell, 2021/09/13
- [PULL 09/23] hw/intc: GICv3 ITS initial framework, Peter Maydell, 2021/09/13
- [PULL 11/23] hw/intc: GICv3 ITS command queue framework, Peter Maydell, 2021/09/13
- [PULL 10/23] hw/intc: GICv3 ITS register definitions added, Peter Maydell, 2021/09/13
- [PULL 15/23] tests/data/acpi/virt: Add IORT files for ITS, Peter Maydell, 2021/09/13
- [PULL 13/23] hw/intc: GICv3 ITS Feature enablement, Peter Maydell, 2021/09/13
- [PULL 14/23] hw/intc: GICv3 redistributor ITS processing, Peter Maydell, 2021/09/13
- [PULL 18/23] target/arm: Take an exception if PSTATE.IL is set, Peter Maydell, 2021/09/13
- [PULL 16/23] hw/arm/virt: add ITS support in virt GIC, Peter Maydell, 2021/09/13