qemu-patch-raspberry4/hw/char
Philippe Mathieu-Daudé 24ce762df7 hw/char/mchp_pfsoc_mmuart: Use a MemoryRegion container
Our device have 2 different I/O regions:
- a 16550 UART mapped for 32-bit accesses
- 13 extra registers

Instead of mapping each region on the main bus, introduce
a container, map the 2 devices regions on the container,
and map the container on the main bus.

Before:

  (qemu) info mtree
    ...
    0000000020100000-000000002010001f (prio 0, i/o): serial
    0000000020100020-000000002010101f (prio 0, i/o): mchp.pfsoc.mmuart
    0000000020102000-000000002010201f (prio 0, i/o): serial
    0000000020102020-000000002010301f (prio 0, i/o): mchp.pfsoc.mmuart
    0000000020104000-000000002010401f (prio 0, i/o): serial
    0000000020104020-000000002010501f (prio 0, i/o): mchp.pfsoc.mmuart
    0000000020106000-000000002010601f (prio 0, i/o): serial
    0000000020106020-000000002010701f (prio 0, i/o): mchp.pfsoc.mmuart

After:

  (qemu) info mtree
    ...
    0000000020100000-0000000020100fff (prio 0, i/o): mchp.pfsoc.mmuart
      0000000020100000-000000002010001f (prio 0, i/o): serial
      0000000020100020-0000000020100fff (prio 0, i/o): mchp.pfsoc.mmuart.regs
    0000000020102000-0000000020102fff (prio 0, i/o): mchp.pfsoc.mmuart
      0000000020102000-000000002010201f (prio 0, i/o): serial
      0000000020102020-0000000020102fff (prio 0, i/o): mchp.pfsoc.mmuart.regs
    0000000020104000-0000000020104fff (prio 0, i/o): mchp.pfsoc.mmuart
      0000000020104000-000000002010401f (prio 0, i/o): serial
      0000000020104020-0000000020104fff (prio 0, i/o): mchp.pfsoc.mmuart.regs
    0000000020106000-0000000020106fff (prio 0, i/o): mchp.pfsoc.mmuart
      0000000020106000-000000002010601f (prio 0, i/o): serial
      0000000020106020-0000000020106fff (prio 0, i/o): mchp.pfsoc.mmuart.regs

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Tested-by: Bin Meng <bin.meng@windriver.com>
Message-id: 20210925133407.1259392-3-f4bug@amsat.org
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
2021-10-07 08:41:33 +10:00
..
avr_usart.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
bcm2835_aux.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
cadence_uart.c hw/char: cadence_uart: Log a guest error when device is unclocked or in reset 2021-09-13 16:07:21 +01:00
cmsdk-apb-uart.c chardev: mark explicitly first argument as poisoned 2021-08-05 16:15:33 +04:00
debugcon.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
digic-uart.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
escc.c escc: fix STATUS_SYNC bit in R_STATUS register 2021-09-08 11:09:45 +01:00
etraxfs_ser.c hw: Replace anti-social QOM type names 2021-03-19 15:18:43 +01:00
exynos4210_uart.c hw/char/exynos4210_uart: Fix missing call to report ready for input 2021-02-02 17:00:54 +00:00
goldfish_tty.c hw/char: add goldfish-tty 2021-03-15 21:02:03 +01:00
grlib_apbuart.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
ibex_uart.c hw/char: ibex_uart: Register device in 'input' category 2021-10-07 08:41:33 +10:00
imx_serial.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
ipoctal232.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
Kconfig hw/char: Add config for shakti uart 2021-09-01 11:59:12 +10:00
mcf_uart.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
mchp_pfsoc_mmuart.c hw/char/mchp_pfsoc_mmuart: Use a MemoryRegion container 2021-10-07 08:41:33 +10:00
meson.build hw/char: Add config for shakti uart 2021-09-01 11:59:12 +10:00
nrf51_uart.c chardev: mark explicitly first argument as poisoned 2021-08-05 16:15:33 +04:00
omap_uart.c serial: start making SerialMM a sysbus device 2020-01-07 17:23:30 +04:00
parallel-isa.c isa: Convert uses of isa_create() with Coccinelle 2020-06-15 22:05:28 +02:00
parallel.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
pl011.c hw/char/pl011: add support for sending break 2021-08-25 10:48:50 +01:00
renesas_sci.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
riscv_htif.c hw: Do not include hw/sysbus.h if it is not necessary 2021-05-02 17:24:50 +02:00
sclpconsole-lm.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
sclpconsole.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
serial-isa.c hw/char/serial-{isa, pci}: Alias QDEV properties from generic serial object 2020-09-30 19:09:20 +02:00
serial-pci-multi.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
serial-pci.c hw/char/serial-{isa, pci}: Alias QDEV properties from generic serial object 2020-09-30 19:09:20 +02:00
serial.c chardev: mark explicitly first argument as poisoned 2021-08-05 16:15:33 +04:00
sh_serial.c chardev: Use QEMUChrEvent enum in IOEventHandler typedef 2020-01-08 11:15:35 +01:00
shakti_uart.c hw/char: shakti_uart: Register device in 'input' category 2021-10-07 08:41:33 +10:00
sifive_uart.c hw/char: sifive_uart: Register device in 'input' category 2021-10-07 08:41:33 +10:00
spapr_vty.c Do not include cpu.h if it's not really necessary 2021-05-02 17:24:51 +02:00
stm32f2xx_usart.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00
terminal3270.c s390x: css: report errors from ccw_dstream_read/write 2021-04-09 10:52:13 +02:00
trace-events escc: introduce escc_hard_reset_chn() for hardware reset 2021-09-08 11:09:45 +01:00
trace.h trace: switch position of headers to what Meson requires 2020-08-21 06:18:24 -04:00
virtio-console.c chardev: mark explicitly first argument as poisoned 2021-08-05 16:15:33 +04:00
virtio-serial-bus.c qbus: Rename qbus_create_inplace() to qbus_init() 2021-09-30 13:42:10 +01:00
xen_console.c Include sysemu/sysemu.h a lot less 2019-08-16 13:31:53 +02:00
xilinx_uartlite.c qdev: Move softmmu properties to qdev-properties-system.h 2020-12-18 15:20:17 -05:00