qemu-patch-raspberry4/hw/nvram
Mark Cave-Ayland 38f3adc34d fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers
When looking to instantiate a TYPE_FW_CFG_MEM or TYPE_FW_CFG_IO device to be
able to wire it up differently, it is much more convenient for the caller to
instantiate the device and have the fw_cfg default files already preloaded
during realize.

Move fw_cfg_init1() to the end of both the fw_cfg_mem_realize() and
fw_cfg_io_realize() functions so it no longer needs to be called manually
when instantiating the device, and also rename it to fw_cfg_common_realize()
which better describes its new purpose.

Since it is now the responsibility of the machine to wire up the fw_cfg device
it is necessary to introduce a object_property_add_child() call into
fw_cfg_init_io() and fw_cfg_init_mem() to link the fw_cfg device to the root
machine object as before.

Finally with the previous change to fw_cfg_find() we can now remove the
assert() preventing multiple fw_cfg devices being instantiated and replace
them with a simple call to fw_cfg_find() at realize time instead. This allows
us to remove FW_CFG_NAME and FW_CFG_PATH since they are no longer required.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Message-Id: <1500025208-14827-3-git-send-email-mark.cave-ayland@ilande.co.uk>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-07-17 15:41:30 -03:00
..
chrp_nvram.c nvram: Move the remaining CHRP NVRAM related code to chrp_nvram.[ch] 2016-10-28 09:36:58 +11:00
ds1225y.c hw: Clean up includes 2016-01-29 15:07:25 +00:00
eeprom93xx.c vmstate: error hint for failed equal checks 2017-06-28 11:18:44 +02:00
fw_cfg.c fw_cfg: move qdev_init_nofail() from fw_cfg_init1() to callers 2017-07-17 15:41:30 -03:00
mac_nvram.c migration: consolidate VMStateField.start 2017-02-13 17:27:13 +00:00
Makefile.objs nvram: Introduce helper functions for CHRP "system" and "free space" partitions 2016-10-28 09:36:58 +11:00
spapr_nvram.c spapr_nvram: Check return value from blk_getlength() 2017-06-06 09:18:32 +10:00
trace-events trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00