The previous patches reload uimage/initrd/vmlinux reset. Other firmware images
stay in the memory and don't need reload on reset.
So rom_reset() could be removed.

Signed-off-by: Olivia Yin <hong-hua....@freescale.com>
---
 hw/loader.c |   24 +++---------------------
 1 files changed, 3 insertions(+), 21 deletions(-)

diff --git a/hw/loader.c b/hw/loader.c
index 7fb54cb..24b25a7 100644
--- a/hw/loader.c
+++ b/hw/loader.c
@@ -725,26 +725,6 @@ int rom_add_option(const char *file, int32_t bootindex)
     return rom_add_file(file, "genroms", 0, bootindex);
 }
 
-static void rom_reset(void *unused)
-{
-    Rom *rom;
-
-    QTAILQ_FOREACH(rom, &roms, next) {
-        if (rom->fw_file) {
-            continue;
-        }
-        if (rom->data == NULL) {
-            continue;
-        }
-        cpu_physical_memory_write_rom(rom->addr, rom->data, rom->romsize);
-        if (rom->isrom) {
-            /* rom needs to be written only once */
-            g_free(rom->data);
-            rom->data = NULL;
-        }
-    }
-}
-
 int rom_load_all(void)
 {
     hwaddr addr = 0;
@@ -766,8 +746,10 @@ int rom_load_all(void)
         addr += rom->romsize;
         section = memory_region_find(get_system_memory(), rom->addr, 1);
         rom->isrom = section.size && memory_region_is_rom(section.mr);
+        cpu_physical_memory_write_rom(rom->addr, rom->data, rom->romsize);
+        g_free(rom->data);
+        rom->data = NULL;
     }
-    qemu_register_reset(rom_reset, NULL);
     roms_loaded = 1;
     return 0;
 }
-- 
1.7.1



Reply via email to