aboutsummaryrefslogtreecommitdiff
path: root/hw/m68k
diff options
context:
space:
mode:
authorLaurent Vivier <laurent@vivier.eu>2019-12-19 21:14:39 +0100
committerLaurent Vivier <laurent@vivier.eu>2020-01-07 13:35:53 +0100
commiteb064db94ccd62f054019f41fb8be3f268463a13 (patch)
tree1d0fe04ce2fb0dea2eb6a25962a48aef09df8f05 /hw/m68k
parentb2619c158ab5ab71990de9d514c4e36e178d4fc6 (diff)
q800: add a block backend to the PRAM
This allows to save and restore the content of the PRAM. It may be useful if we want to check the configuration or to change it. The backend is added using mtd interface, for instance: ... -drive file=pram.img,format=raw,if=mtd ... where pram.img is the file where the data will be stored, its size must be 256 bytes. Signed-off-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20191219201439.84804-3-laurent@vivier.eu>
Diffstat (limited to 'hw/m68k')
-rw-r--r--hw/m68k/q800.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c
index 4ca8678007..0c445c74bf 100644
--- a/hw/m68k/q800.c
+++ b/hw/m68k/q800.c
@@ -158,6 +158,7 @@ static void q800_init(MachineState *machine)
NubusBus *nubus;
GLUEState *irq;
qemu_irq *pic;
+ DriveInfo *dinfo;
linux_boot = (kernel_filename != NULL);
@@ -200,6 +201,11 @@ static void q800_init(MachineState *machine)
/* VIA */
via_dev = qdev_create(NULL, TYPE_MAC_VIA);
+ dinfo = drive_get(IF_MTD, 0, 0);
+ if (dinfo) {
+ qdev_prop_set_drive(via_dev, "drive", blk_by_legacy_dinfo(dinfo),
+ &error_abort);
+ }
qdev_init_nofail(via_dev);
sysbus = SYS_BUS_DEVICE(via_dev);
sysbus_mmio_map(sysbus, 0, VIA_BASE);