All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hw/char/pl011: add support for sending break
@ 2021-08-06 14:47 Jan Luebbe
  2021-08-13 16:28 ` Peter Maydell
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Luebbe @ 2021-08-06 14:47 UTC (permalink / raw)
  To: qemu-arm; +Cc: peter.maydell, Jan Luebbe, qemu-devel, pbonzini

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 <jlu@pengutronix.de>
---
 hw/char/pl011.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/char/pl011.c b/hw/char/pl011.c
index dc85527a5f92..6e2d7f75095c 100644
--- a/hw/char/pl011.c
+++ b/hw/char/pl011.c
@@ -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;
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] hw/char/pl011: add support for sending break
  2021-08-06 14:47 [PATCH] hw/char/pl011: add support for sending break Jan Luebbe
@ 2021-08-13 16:28 ` Peter Maydell
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Maydell @ 2021-08-13 16:28 UTC (permalink / raw)
  To: Jan Luebbe; +Cc: Paolo Bonzini, qemu-arm, QEMU Developers

On Fri, 6 Aug 2021 at 15:47, Jan Luebbe <jlu@pengutronix.de> wrote:
>
> 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 <jlu@pengutronix.de>


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-13 16:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-06 14:47 [PATCH] hw/char/pl011: add support for sending break Jan Luebbe
2021-08-13 16:28 ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.