Patchwork [RFC,v8,4/4] remove rom_reset()

login
register
mail settings
Submitter Olivia Yin
Date Dec. 6, 2012, 4 a.m.
Message ID <1354766444-1103-5-git-send-email-hong-hua.yin@freescale.com>
Download mbox | patch
Permalink /patch/204131/
State New
Headers show

Comments

Olivia Yin - Dec. 6, 2012, 4 a.m.
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.yin@freescale.com>
---
 hw/loader.c |   24 +++---------------------
 1 files changed, 3 insertions(+), 21 deletions(-)

Patch

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;
 }