hw/char/pl011: add support for sending break
PATCH 1/1 hw/char/pl011: add support for sending break
Break events are currently only handled by chardev/char-serial.c, so we just ignore errors, which results in no behaviour change for other chardevs.
Signed-off-by Jan Luebbe <[email protected]>
--- hw/char/pl011.c | 6 ++++++ 1 file changed, 6 insertions(+)
hw/char/pl011.c +6 -0
@@ -26,6 +26,7 @@#include "hw/qdev-properties-system.h" #include "migration/vmstate.h" #include "chardev/char-fe.h" +#include "chardev/char-serial.h" #include "qemu/log.h" #include "qemu/module.h" #include "trace.h"
@@ -231,6 +232,11 @@ static void pl011_write(void *opaque, hwaddr offset, s->read_count =0 ; s->read_pos =0 ; } +if ((s->lcr ^ value) &0x1 ) { +int break_enable = value &0x1 ; +qemu_chr_fe_ioctl (&s->chr,CHR_IOCTL_SERIAL_SET_BREAK , + &break_enable); + } s->lcr = value;pl011_set_read_trigger (s);break ;
Signature · 1 line
2.30.2
Peter Maydell
AppliedQuoted 6 lines · Jan Luebbe
Break events are currently only handled by
chardev/char-serial.c, so we just ignore errors, which results in no behaviour change for other chardevs.Signed-off-by Jan Luebbe <[email protected]>
Applied to target-arm.next for 6.2, thanks.
If you're connecting the pl011 to the serial backend, you might also need to implement the CHR_IOCTL_SERIAL_SET_PARAMS handling so that when the guest sets the baud rate etc it actually works... CHR_IOCTL_SERIAL_SET_TIOCM and _GET_TIOCM to wire up the flow control signals will also be helpful I suspect.
-- PMM