From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
"Aleksandar Markovic" <aleksandar.qemu.devel@gmail.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Aurelien Jarno" <aurelien@aurel32.net>
Subject: [PATCH v2 1/2] hw/mips/mipssim: Use MMIO serial device on fake ISA I/O
Date: Mon, 7 Sep 2020 03:15:37 +0200 [thread overview]
Message-ID: <20200907011538.818996-2-philmd@redhat.com> (raw)
In-Reply-To: <20200907011538.818996-1-philmd@redhat.com>
The 'mipssim' is not a real hardware, it is a simulator.
There is an ISA MMIO space mapped at 0x1fd00000, however
this is not a real ISA bus (no ISA IRQ). So can not use
the TYPE_ISA_SERIAL device...
Instead we have been using a plain MMIO device, but named
it IO.
TYPE_SERIAL_IO is a superset of TYPE_SERIAL_MM, using
regshift=0 and endianness=DEVICE_LITTLE_ENDIAN.
Directly use the TYPE_SERIAL_MM device, enforcing the
regshift/endianness values. 'regshift' default is already
'0'. 'endianness' is meaningless for 8-bit accesses.
This change breaks migration back compatibility, but
this is not an issue for the mipssim machine.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
hw/mips/mipssim.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/mips/mipssim.c b/hw/mips/mipssim.c
index 1b3b7622035..5d4ad74828d 100644
--- a/hw/mips/mipssim.c
+++ b/hw/mips/mipssim.c
@@ -216,10 +216,11 @@ mips_mipssim_init(MachineState *machine)
* MIPS CPU INT2, which is interrupt 4.
*/
if (serial_hd(0)) {
- DeviceState *dev = qdev_new(TYPE_SERIAL_IO);
+ DeviceState *dev = qdev_new(TYPE_SERIAL_MM);
qdev_prop_set_chr(dev, "chardev", serial_hd(0));
- qdev_set_legacy_instance_id(dev, 0x3f8, 2);
+ qdev_prop_set_uint8(dev, "regshift", 0);
+ qdev_prop_set_uint8(dev, "endianness", DEVICE_LITTLE_ENDIAN);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, env->irq[4]);
sysbus_add_io(SYS_BUS_DEVICE(dev), 0x3f8,
--
2.26.2
next prev parent reply other threads:[~2020-09-07 1:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-07 1:15 [PATCH v2 0/2] hw/char: Remove TYPE_SERIAL_IO Philippe Mathieu-Daudé
2020-09-07 1:15 ` Philippe Mathieu-Daudé [this message]
2020-09-12 8:07 ` [PATCH v2 1/2] hw/mips/mipssim: Use MMIO serial device on fake ISA I/O Paolo Bonzini
2020-09-07 1:15 ` [PATCH v2 2/2] hw/char/serial: Remove TYPE_SERIAL_IO (superset of TYPE_SERIAL_MM) Philippe Mathieu-Daudé
2020-09-11 23:05 ` [PATCH v2 0/2] hw/char: Remove TYPE_SERIAL_IO Richard Henderson
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=20200907011538.818996-2-philmd@redhat.com \
--to=philmd@redhat.com \
--cc=aleksandar.qemu.devel@gmail.com \
--cc=aleksandar.rikalo@syrmia.com \
--cc=aurelien@aurel32.net \
--cc=jiaxun.yang@flygoat.com \
--cc=marcandre.lureau@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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).