[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 8/8] mac_oldworld: Allow specifying nvram backing store
From: |
Mark Cave-Ayland |
Subject: |
[PULL 8/8] mac_oldworld: Allow specifying nvram backing store |
Date: |
Mon, 6 Feb 2023 22:07:22 +0000 |
From: BALATON Zoltan <balaton@eik.bme.hu>
Add a way to set a backing store for the mac_nvram. Use -drive
file=nvram.img,format=raw,if=mtd to specify backing file where
nvram.img must be MACIO_NVRAM_SIZE which is 8192 bytes.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id:
<1aadee8f0ca0f56cf1b7c45c3944676a07d91de9.1675297286.git.balaton@eik.bme.hu>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/ppc/mac_oldworld.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index 5a7b25a4a8..2e4cc3fe0b 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -102,7 +102,7 @@ static void ppc_heathrow_init(MachineState *machine)
DeviceState *dev, *pic_dev, *grackle_dev;
BusState *adb_bus;
uint16_t ppc_boot_device;
- DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
+ DriveInfo *dinfo, *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
void *fw_cfg;
uint64_t tbfreq = kvm_enabled() ? kvmppc_get_tbfreq() : TBFREQ;
@@ -245,6 +245,12 @@ static void ppc_heathrow_init(MachineState *machine)
qdev_prop_set_chr(dev, "chrA", serial_hd(0));
qdev_prop_set_chr(dev, "chrB", serial_hd(1));
+ dinfo = drive_get(IF_MTD, 0, 0);
+ if (dinfo) {
+ dev = DEVICE(object_resolve_path_component(macio, "nvram"));
+ qdev_prop_set_drive(dev, "drive", blk_by_legacy_dinfo(dinfo));
+ }
+
pci_realize_and_unref(PCI_DEVICE(macio), pci_bus, &error_fatal);
pic_dev = DEVICE(object_resolve_path_component(macio, "pic"));
--
2.30.2
- [PULL 0/8] qemu-macppc queue 20230206, Mark Cave-Ayland, 2023/02/06
- [PULL 1/8] input/adb: Only include header where needed, Mark Cave-Ayland, 2023/02/06
- [PULL 2/8] mac_{old, new}world: Use local variable instead of qdev_get_machine(), Mark Cave-Ayland, 2023/02/06
- [PULL 3/8] hw/misc/macio: Avoid some QOM casts, Mark Cave-Ayland, 2023/02/06
- [PULL 4/8] hw/misc/macio: Rename sysbus_dev to sbd for consistency and brevity, Mark Cave-Ayland, 2023/02/06
- [PULL 5/8] hw/misc/macio: Remove some single use local variables, Mark Cave-Ayland, 2023/02/06
- [PULL 6/8] hw/misc/macio: Return bool from functions taking errp, Mark Cave-Ayland, 2023/02/06
- [PULL 7/8] mac_nvram: Add block backend to persist NVRAM contents, Mark Cave-Ayland, 2023/02/06
- [PULL 8/8] mac_oldworld: Allow specifying nvram backing store,
Mark Cave-Ayland <=
- Re: [PULL 0/8] qemu-macppc queue 20230206, Peter Maydell, 2023/02/07