From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, deller@gmx.de, svens@stackframe.org,
Markus Armbruster <armbru@redhat.com>,
Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PULL v3 04/11] hppa: add emulation of LASI PS2 controllers
Date: Tue, 18 Feb 2020 09:29:18 +0100 [thread overview]
Message-ID: <6e093940-3439-4e66-86db-01eea375a183@redhat.com> (raw)
In-Reply-To: <20200124232009.12928-5-richard.henderson@linaro.org>
Cc'ing Eduardo/Markus.
On 1/25/20 12:20 AM, Richard Henderson wrote:
> From: Sven Schnelle <svens@stackframe.org>
>
> Signed-off-by: Sven Schnelle <svens@stackframe.org>
> Message-Id: <20191220211512.3289-5-svens@stackframe.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> include/hw/input/lasips2.h | 16 ++
> include/hw/input/ps2.h | 1 +
> hw/hppa/lasi.c | 10 +-
> hw/input/lasips2.c | 291 +++++++++++++++++++++++++++++++++++++
> hw/input/ps2.c | 5 +
> hw/hppa/Kconfig | 1 +
> hw/input/Kconfig | 3 +
> hw/input/Makefile.objs | 1 +
> hw/input/trace-events | 5 +
> 9 files changed, 332 insertions(+), 1 deletion(-)
> create mode 100644 include/hw/input/lasips2.h
> create mode 100644 hw/input/lasips2.c
>
> diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h
> new file mode 100644
> index 0000000000..0cd7b59064
> --- /dev/null
> +++ b/include/hw/input/lasips2.h
> @@ -0,0 +1,16 @@
> +/*
> + * QEMU LASI PS/2 emulation
> + *
> + * Copyright (c) 2019 Sven Schnelle
> + *
> + */
> +#ifndef HW_INPUT_LASIPS2_H
> +#define HW_INPUT_LASIPS2_H
> +
> +#include "exec/hwaddr.h"
> +
> +#define TYPE_LASIPS2 "lasips2"
> +
> +void lasips2_init(MemoryRegion *address_space, hwaddr base, qemu_irq irq);
> +
> +#endif /* HW_INPUT_LASIPS2_H */
[...]
> +
> +void lasips2_init(MemoryRegion *address_space,
> + hwaddr base, qemu_irq irq)
> +{
> + LASIPS2State *s;
> +
> + s = g_malloc0(sizeof(LASIPS2State));
At the current QOM conversion rate, we should have all devices QOM'ified
by 2027, so please do not introduce non-QOM devices...
Does anyone have an idea how we could refuse them using checkpatch?
> +
> + s->irq = irq;
> + s->mouse.id = 1;
> + s->kbd.parent = s;
> + s->mouse.parent = s;
> +
> + vmstate_register(NULL, base, &vmstate_lasips2, s);
> +
> + s->kbd.dev = ps2_kbd_init(ps2dev_update_irq, &s->kbd);
> + s->mouse.dev = ps2_mouse_init(ps2dev_update_irq, &s->mouse);
> +
> + memory_region_init_io(&s->kbd.reg, NULL, &lasips2_reg_ops, &s->kbd,
> + "lasips2-kbd", 0x100);
> + memory_region_add_subregion(address_space, base, &s->kbd.reg);
> +
> + memory_region_init_io(&s->mouse.reg, NULL, &lasips2_reg_ops, &s->mouse,
> + "lasips2-mouse", 0x100);
> + memory_region_add_subregion(address_space, base + 0x100, &s->mouse.reg);
> +}
> diff --git a/hw/input/ps2.c b/hw/input/ps2.c
> index 0b671b6339..f8746d2f52 100644
> --- a/hw/input/ps2.c
> +++ b/hw/input/ps2.c
> @@ -192,6 +192,11 @@ static void ps2_reset_queue(PS2State *s)
> q->count = 0;
> }
>
> +int ps2_queue_empty(PS2State *s)
> +{
> + return s->queue.count == 0;
> +}
> +
> void ps2_queue_noirq(PS2State *s, int b)
> {
> PS2Queue *q = &s->queue;
> diff --git a/hw/hppa/Kconfig b/hw/hppa/Kconfig
> index 2a7b38d6d6..7f9be7f25c 100644
> --- a/hw/hppa/Kconfig
> +++ b/hw/hppa/Kconfig
> @@ -11,3 +11,4 @@ config DINO
> select MC146818RTC
> select LSI_SCSI_PCI
> select LASI_82596
> + select LASIPS2
> diff --git a/hw/input/Kconfig b/hw/input/Kconfig
> index 287f08887b..25c77a1b87 100644
> --- a/hw/input/Kconfig
> +++ b/hw/input/Kconfig
> @@ -41,3 +41,6 @@ config VHOST_USER_INPUT
>
> config TSC210X
> bool
> +
> +config LASIPS2
> + select PS2
> diff --git a/hw/input/Makefile.objs b/hw/input/Makefile.objs
> index a1bc502ed0..f98f635685 100644
> --- a/hw/input/Makefile.objs
> +++ b/hw/input/Makefile.objs
> @@ -15,3 +15,4 @@ common-obj-$(CONFIG_VHOST_USER_INPUT) += vhost-user-input.o
> obj-$(CONFIG_MILKYMIST) += milkymist-softusb.o
> obj-$(CONFIG_PXA2XX) += pxa2xx_keypad.o
> obj-$(CONFIG_TSC210X) += tsc210x.o
> +obj-$(CONFIG_LASIPS2) += lasips2.o
> diff --git a/hw/input/trace-events b/hw/input/trace-events
> index cf072fa2f8..a2888fd10c 100644
> --- a/hw/input/trace-events
> +++ b/hw/input/trace-events
> @@ -53,3 +53,8 @@ tsc2005_sense(const char *state) "touchscreen sense %s"
>
> # virtio-input.c
> virtio_input_queue_full(void) "queue full"
> +
> +# lasips2.c
> +lasips2_reg_read(unsigned int size, int id, uint64_t addr, const char *name, uint64_t val) "%u %d addr 0x%"PRIx64 "%s -> 0x%"PRIx64
> +lasips2_reg_write(unsigned int size, int id, uint64_t addr, const char *name, uint64_t val) "%u %d addr 0x%"PRIx64 "%s <- 0x%"PRIx64
> +lasips2_intr(unsigned int val) "%d"
>
next prev parent reply other threads:[~2020-02-18 8:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 23:19 [PULL v3 00/11] target/hppa patch queue Richard Henderson
2020-01-24 23:19 ` [PULL v3 01/11] hw/hppa/dino.c: Improve emulation of Dino PCI chip Richard Henderson
2020-01-24 23:20 ` [PULL v3 02/11] hppa: Add support for LASI chip with i82596 NIC Richard Henderson
2020-02-17 17:56 ` Peter Maydell
2020-03-02 19:23 ` Helge Deller
2020-03-02 19:31 ` Peter Maydell
2020-03-02 20:34 ` Helge Deller
2020-03-02 23:25 ` Philippe Mathieu-Daudé
2020-03-05 13:05 ` Philippe Mathieu-Daudé
2020-01-24 23:20 ` [PULL v3 03/11] ps2: accept 'Set Key Make and Break' commands Richard Henderson
2020-01-24 23:20 ` [PULL v3 04/11] hppa: add emulation of LASI PS2 controllers Richard Henderson
2020-02-18 8:29 ` Philippe Mathieu-Daudé [this message]
2020-01-24 23:20 ` [PULL v3 05/11] hppa: Switch to tulip NIC by default Richard Henderson
2020-01-24 23:20 ` [PULL v3 06/11] seabios-hppa: update to latest version Richard Henderson
2020-01-24 23:20 ` [PULL v3 07/11] hppa: Add emulation of Artist graphics Richard Henderson
2020-01-24 23:20 ` [PULL v3 08/11] hw/hppa/machine: Correctly check the firmware is in PDC range Richard Henderson
2020-01-24 23:20 ` [PULL v3 09/11] hw/hppa/machine: Restrict the total memory size to 3GB Richard Henderson
2020-01-24 23:20 ` [PULL v3 10/11] hw/hppa/machine: Map the PDC memory region with higher priority Richard Henderson
2020-01-24 23:20 ` [PULL v3 11/11] target/hppa: Allow, but diagnose, LDCW aligned only mod 4 Richard Henderson
2020-01-27 11:23 ` [PULL v3 00/11] target/hppa patch queue Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6e093940-3439-4e66-86db-01eea375a183@redhat.com \
--to=philmd@redhat.com \
--cc=armbru@redhat.com \
--cc=deller@gmx.de \
--cc=ehabkost@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=svens@stackframe.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).