qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/21] hw: Remove implicit sysbus_mmio_map() from pflash APIs
@ 2023-01-09 12:08 Philippe Mathieu-Daudé
  2023-01-09 12:08 ` [PATCH v2 01/21] hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width' Philippe Mathieu-Daudé
                   ` (21 more replies)
  0 siblings, 22 replies; 44+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-01-09 12:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Philippe Mathieu-Daudé

Since v1:
- Do not introduce pflash_cfi_create(), directly
  open-code pflash_cfi_register() before removing it (Peter)
- Added R-b tags

Paving the road toward heterogeneous QEMU, the limitations of
having a single machine sysbus become more apparent.

The sysbus_mmio_map() API forces the caller to map a sysbus
device to an address on the system bus (system bus here is
the root MemoryRegion returned by get_system_memory() ).

This is not practical when each core has its own address
space and group of cores have access to a part of the
peripherals.

Experimenting with the PFLASH devices. Here the fix is
quite easy: open-code the pflash_cfi_register() functions.

Since we were touching the PFLASH API, we restricted the
PFlashCFI0X structures to their models. The API now deals
with a generic qdev pointer (DeviceState*).

Please review,

Phil.

Based-on: <20230109115316.2235-1-philmd@linaro.org>
          "hw/arm: Cleanups before pflash refactor"
Based-on: <20230109120154.2868-1-philmd@linaro.org>
          "hw/misc: Cleanups around PFLASH use"

Philippe Mathieu-Daudé (21):
  hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width'
  hw/block: Pass DeviceState to pflash_cfi01_get_blk()
  hw/block: Use pflash_cfi01_get_blk() in pflash_cfi01_legacy_drive()
  hw/block: Pass DeviceState to pflash_cfi01_get_memory()
  hw/arm: Use generic DeviceState instead of PFlashCFI01
  hw/loongarch: Use generic DeviceState instead of PFlashCFI01
  hw/riscv: Use generic DeviceState instead of PFlashCFI01
  hw/i386: Use generic DeviceState instead of PFlashCFI01
  hw/xtensa: Use generic DeviceState instead of PFlashCFI01
  hw/sh4: Open-code pflash_cfi02_register()
  hw/arm/digic: Open-code pflash_cfi02_register()
  hw/arm/musicpal: Open-code pflash_cfi02_register()
  hw/arm/xilinx_zynq: Open-code pflash_cfi02_register()
  hw/block: Remove unused pflash_cfi02_register()
  hw/block: Make PFlashCFI02 QOM declaration internal
  hw/arm: Open-code pflash_cfi01_register()
  hw/microblaze: Open-code pflash_cfi01_register()
  hw/mips: Open-code pflash_cfi01_register()
  hw/ppc: Open-code pflash_cfi01_register()
  hw/block: Remove unused pflash_cfi01_register()
  hw/block: Make PFlashCFI01 QOM declaration internal

 hw/arm/collie.c                          | 16 ++++++---
 hw/arm/digic_boards.c                    | 26 ++++++++++----
 hw/arm/gumstix.c                         | 32 +++++++++++++----
 hw/arm/mainstone.c                       | 19 +++++++---
 hw/arm/musicpal.c                        | 21 +++++++----
 hw/arm/omap_sx1.c                        | 31 +++++++++++-----
 hw/arm/sbsa-ref.c                        |  8 ++---
 hw/arm/versatilepb.c                     | 18 +++++++---
 hw/arm/vexpress.c                        | 10 +++---
 hw/arm/virt.c                            |  6 ++--
 hw/arm/xilinx_zynq.c                     | 20 ++++++++---
 hw/arm/z2.c                              | 17 +++++++--
 hw/block/pflash_cfi01.c                  | 45 ++++++------------------
 hw/block/pflash_cfi02.c                  | 40 ++-------------------
 hw/i386/pc_sysfw.c                       |  6 ++--
 hw/loongarch/virt.c                      |  9 +++--
 hw/microblaze/petalogix_ml605_mmu.c      | 18 ++++++----
 hw/microblaze/petalogix_s3adsp1800_mmu.c | 16 ++++++---
 hw/mips/malta.c                          | 18 ++++++----
 hw/ppc/e500.c                            |  2 +-
 hw/ppc/sam460ex.c                        | 19 +++++++---
 hw/ppc/virtex_ml507.c                    | 15 ++++++--
 hw/riscv/virt.c                          |  7 ++--
 hw/sh4/r2d.c                             | 21 ++++++++---
 hw/xtensa/xtfpga.c                       |  6 ++--
 include/hw/arm/virt.h                    |  3 +-
 include/hw/block/flash.h                 | 37 ++-----------------
 include/hw/i386/pc.h                     |  3 +-
 include/hw/loongarch/virt.h              |  3 +-
 include/hw/riscv/virt.h                  |  3 +-
 30 files changed, 276 insertions(+), 219 deletions(-)

-- 
2.38.1



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

end of thread, other threads:[~2023-01-17  8:12 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-09 12:08 [PATCH v2 00/21] hw: Remove implicit sysbus_mmio_map() from pflash APIs Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 01/21] hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width' Philippe Mathieu-Daudé
2023-01-09 13:33   ` BALATON Zoltan
2023-01-09 13:56     ` Philippe Mathieu-Daudé
2023-01-09 14:18       ` BALATON Zoltan
2023-01-09 15:14         ` Philippe Mathieu-Daudé
2023-01-09 14:33       ` Daniel P. Berrangé
2023-01-09 15:17         ` Philippe Mathieu-Daudé
2023-01-13 13:37       ` Peter Maydell
2023-01-16  6:40         ` Markus Armbruster
2023-01-16  8:41           ` Philippe Mathieu-Daudé
2023-01-17  8:11             ` Markus Armbruster
2023-01-09 12:08 ` [PATCH v2 02/21] hw/block: Pass DeviceState to pflash_cfi01_get_blk() Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 03/21] hw/block: Use pflash_cfi01_get_blk() in pflash_cfi01_legacy_drive() Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 04/21] hw/block: Pass DeviceState to pflash_cfi01_get_memory() Philippe Mathieu-Daudé
2023-01-09 23:42   ` Bernhard Beschow
2023-01-13 13:40     ` Peter Maydell
2023-01-09 12:08 ` [PATCH v2 05/21] hw/arm: Use generic DeviceState instead of PFlashCFI01 Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 06/21] hw/loongarch: " Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 07/21] hw/riscv: " Philippe Mathieu-Daudé
2023-01-09 22:57   ` Alistair Francis
2023-01-09 12:08 ` [PATCH v2 08/21] hw/i386: " Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 09/21] hw/xtensa: " Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 10/21] hw/sh4: Open-code pflash_cfi02_register() Philippe Mathieu-Daudé
2023-01-09 13:40   ` BALATON Zoltan
2023-01-09 13:51     ` Philippe Mathieu-Daudé
2023-01-09 14:06       ` BALATON Zoltan
2023-01-09 12:08 ` [PATCH v2 11/21] hw/arm/digic: " Philippe Mathieu-Daudé
2023-01-13 13:47   ` Peter Maydell
2023-01-09 12:08 ` [PATCH v2 12/21] hw/arm/musicpal: " Philippe Mathieu-Daudé
2023-01-13 13:48   ` Peter Maydell
2023-01-09 12:08 ` [PATCH v2 13/21] hw/arm/xilinx_zynq: " Philippe Mathieu-Daudé
2023-01-13 13:55   ` Peter Maydell
2023-01-09 12:08 ` [PATCH v2 14/21] hw/block: Remove unused pflash_cfi02_register() Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 15/21] hw/block: Make PFlashCFI02 QOM declaration internal Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 16/21] hw/arm: Open-code pflash_cfi01_register() Philippe Mathieu-Daudé
2023-01-13 14:03   ` Peter Maydell
2023-01-09 12:08 ` [PATCH v2 17/21] hw/microblaze: " Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 18/21] hw/mips: " Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 19/21] hw/ppc: " Philippe Mathieu-Daudé
2023-01-09 13:52   ` BALATON Zoltan
2023-01-09 12:08 ` [PATCH v2 20/21] hw/block: Remove unused pflash_cfi01_register() Philippe Mathieu-Daudé
2023-01-09 12:08 ` [PATCH v2 21/21] hw/block: Make PFlashCFI01 QOM declaration internal Philippe Mathieu-Daudé
2023-01-09 12:13 ` [PATCH v2 00/21] hw: Remove implicit sysbus_mmio_map() from pflash APIs Philippe Mathieu-Daudé

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).