mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
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>
This commit is contained in:
parent
b2619c158a
commit
eb064db94c
3 changed files with 74 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue