qemu-cr16/hw/cr16c/boot.c
Jonas Bewig 3fc0f53606
CR16C: Clean up boards
Implement a generic virt board and the basic structure for the Gigaset DE410 board.
2025-08-14 10:39:59 +02:00

22 lines
601 B
C

#include "boot.h"
#include "hw/loader.h"
#include "qemu/datadir.h"
#include "qemu/error-report.h"
bool cr16c_load_firmware(CR16CCPU *cpu, MemoryRegion *mr, const char *firmware) {
/* Adapted from arm implementation */
g_autofree char *filename = NULL;
int ret;
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, firmware);
if (!filename) {
error_report("Could not find firmware image");
return false;
}
ret = load_image_mr(filename, mr);
if (ret < 0) {
error_report("Failed to load firmware image");
return false;
}
return true;
}