[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 08/20] hw/xtensa: Use generic DeviceState instead of PFlashCFI01
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 08/20] hw/xtensa: Use generic DeviceState instead of PFlashCFI01 |
Date: |
Wed, 4 Jan 2023 23:04:37 +0100 |
Nothing here requires access to PFlashCFI01 internal fields:
use the inherited generic DeviceState.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/xtensa/xtfpga.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c
index bce3a543b0..b039416fde 100644
--- a/hw/xtensa/xtfpga.c
+++ b/hw/xtensa/xtfpga.c
@@ -165,7 +165,7 @@ static void xtfpga_net_init(MemoryRegion *address_space,
memory_region_add_subregion(address_space, buffers, ram);
}
-static PFlashCFI01 *xtfpga_flash_init(MemoryRegion *address_space,
+static DeviceState *xtfpga_flash_init(MemoryRegion *address_space,
const XtfpgaBoardDesc *board,
DriveInfo *dinfo, int be)
{
@@ -183,7 +183,7 @@ static PFlashCFI01 *xtfpga_flash_init(MemoryRegion
*address_space,
sysbus_realize_and_unref(s, &error_fatal);
memory_region_add_subregion(address_space, board->flash->base,
sysbus_mmio_get_region(s, 0));
- return PFLASH_CFI01(dev);
+ return dev;
}
static uint64_t translate_phys_addr(void *opaque, uint64_t addr)
@@ -231,7 +231,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board,
MachineState *machine)
XtensaMxPic *mx_pic = NULL;
qemu_irq *extints;
DriveInfo *dinfo;
- PFlashCFI01 *flash = NULL;
+ DeviceState *flash = NULL;
const char *kernel_filename = machine->kernel_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *dtb_filename = machine->dtb;
@@ -459,7 +459,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board,
MachineState *machine)
}
} else {
if (flash) {
- MemoryRegion *flash_mr = pflash_cfi01_get_memory(DEVICE(flash));
+ MemoryRegion *flash_mr = pflash_cfi01_get_memory(flash);
MemoryRegion *flash_io = g_malloc(sizeof(*flash_io));
uint32_t size = env->config->sysrom.location[0].size;
--
2.38.1
- [PATCH 00/20] hw: Remove implicit sysbus_mmio_map() from pflash APIs, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 01/20] hw/block: Pass DeviceState to pflash_cfi01_get_blk(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 02/20] hw/block: Use pflash_cfi01_get_blk() in pflash_cfi01_legacy_drive(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 03/20] hw/block: Pass DeviceState to pflash_cfi01_get_memory(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 04/20] hw/arm: Use generic DeviceState instead of PFlashCFI01, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 05/20] hw/loongarch: Use generic DeviceState instead of PFlashCFI01, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 06/20] hw/riscv: Use generic DeviceState instead of PFlashCFI01, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 07/20] hw/i386: Use generic DeviceState instead of PFlashCFI01, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 08/20] hw/xtensa: Use generic DeviceState instead of PFlashCFI01,
Philippe Mathieu-Daudé <=
- [PATCH 09/20] hw/block: Factor pflash_cfi01_create() out of pflash_cfi01_register(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 10/20] hw/arm: Open-code pflash_cfi01_register(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 11/20] hw/microblaze: Open-code pflash_cfi01_register(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 12/20] hw/mips: Open-code pflash_cfi01_register(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 13/20] hw/ppc: Open-code pflash_cfi01_register(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 14/20] hw/block: Remove unused pflash_cfi01_register(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 16/20] hw/block: Factor pflash_cfi02_create() out of pflash_cfi02_register(), Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 15/20] hw/block: Make PFlashCFI01 QOM declaration internal, Philippe Mathieu-Daudé, 2023/01/04
- [PATCH 17/20] hw/arm: Open-code pflash_cfi02_register(), Philippe Mathieu-Daudé, 2023/01/04