Skip to content

Commit 55d4a89

Browse files
committed
Added load of rom and .roadata
1 parent 31abff8 commit 55d4a89

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

hw/xtensa/esp32.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include "qemu/log.h"
1313
#include "qemu/error-report.h"
1414
#include "qapi/error.h"
15+
#include "qemu-common.h"
1516
#include "hw/hw.h"
1617
#include "hw/boards.h"
1718
#include "hw/loader.h"
@@ -474,6 +475,16 @@ static void esp32_soc_init(Object *obj)
474475
qdev_init_gpio_in_named(DEVICE(s), esp32_cpu_reset, ESP32_RTC_CPU_RESET_GPIO, ESP32_CPU_COUNT);
475476
qdev_init_gpio_in_named(DEVICE(s), esp32_cpu_stall, ESP32_RTC_CPU_STALL_GPIO, ESP32_CPU_COUNT);
476477
qdev_init_gpio_in_named(DEVICE(s), esp32_clk_update, ESP32_RTC_CLK_UPDATE_GPIO, 1);
478+
479+
const char *rom_filename = "rom.bin";
480+
481+
rom_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, rom_filename);
482+
if (!rom_filename ||
483+
load_image_targphys(rom_filename, 0x40000000, 794624/*412384*/) < 0) {
484+
error_report("unable to load ROM image '%s'\n", rom_filename);
485+
exit(EXIT_FAILURE);
486+
}
487+
477488
}
478489

479490
static Property esp32_soc_properties[] = {

0 commit comments

Comments
 (0)