virt.c (052e6534c49ebef8901824b77abc39271f0d852e) virt.c (9d3f7108bc43e93ceef7faa27c87eea8295c33ed)
1/*
2 * QEMU RISC-V VirtIO Board
3 *
4 * Copyright (c) 2017 SiFive, Inc.
5 *
6 * RISC-V machine with 16550a UART and VirtIO MMIO
7 *
8 * This program is free software; you can redistribute it and/or modify it

--- 1223 unchanged lines hidden (view full) ---

1232static void virt_machine_done(Notifier *notifier, void *data)
1233{
1234 RISCVVirtState *s = container_of(notifier, RISCVVirtState,
1235 machine_done);
1236 const MemMapEntry *memmap = virt_memmap;
1237 MachineState *machine = MACHINE(s);
1238 target_ulong start_addr = memmap[VIRT_DRAM].base;
1239 target_ulong firmware_end_addr, kernel_start_addr;
1/*
2 * QEMU RISC-V VirtIO Board
3 *
4 * Copyright (c) 2017 SiFive, Inc.
5 *
6 * RISC-V machine with 16550a UART and VirtIO MMIO
7 *
8 * This program is free software; you can redistribute it and/or modify it

--- 1223 unchanged lines hidden (view full) ---

1232static void virt_machine_done(Notifier *notifier, void *data)
1233{
1234 RISCVVirtState *s = container_of(notifier, RISCVVirtState,
1235 machine_done);
1236 const MemMapEntry *memmap = virt_memmap;
1237 MachineState *machine = MACHINE(s);
1238 target_ulong start_addr = memmap[VIRT_DRAM].base;
1239 target_ulong firmware_end_addr, kernel_start_addr;
1240 const char *firmware_name = riscv_default_firmware_name(&s->soc[0]);
1240 uint32_t fdt_load_addr;
1241 uint64_t kernel_entry;
1242
1243 /*
1244 * Only direct boot kernel is currently supported for KVM VM,
1245 * so the "-bios" parameter is not supported when KVM is enabled.
1246 */
1247 if (kvm_enabled()) {
1248 if (machine->firmware) {
1249 if (strcmp(machine->firmware, "none")) {
1250 error_report("Machine mode firmware is not supported in "
1251 "combination with KVM.");
1252 exit(1);
1253 }
1254 } else {
1255 machine->firmware = g_strdup("none");
1256 }
1257 }
1258
1241 uint32_t fdt_load_addr;
1242 uint64_t kernel_entry;
1243
1244 /*
1245 * Only direct boot kernel is currently supported for KVM VM,
1246 * so the "-bios" parameter is not supported when KVM is enabled.
1247 */
1248 if (kvm_enabled()) {
1249 if (machine->firmware) {
1250 if (strcmp(machine->firmware, "none")) {
1251 error_report("Machine mode firmware is not supported in "
1252 "combination with KVM.");
1253 exit(1);
1254 }
1255 } else {
1256 machine->firmware = g_strdup("none");
1257 }
1258 }
1259
1259 if (riscv_is_32bit(&s->soc[0])) {
1260 firmware_end_addr = riscv_find_and_load_firmware(machine,
1261 RISCV32_BIOS_BIN, start_addr, NULL);
1262 } else {
1263 firmware_end_addr = riscv_find_and_load_firmware(machine,
1264 RISCV64_BIOS_BIN, start_addr, NULL);
1265 }
1260 firmware_end_addr = riscv_find_and_load_firmware(machine, firmware_name,
1261 start_addr, NULL);
1266
1267 /*
1268 * Init fw_cfg. Must be done before riscv_load_fdt, otherwise the device
1269 * tree cannot be altered and we get FDT_ERR_NOSPACE.
1270 */
1271 s->fw_cfg = create_fw_cfg(machine);
1272 rom_set_fw(s->fw_cfg);
1273

--- 425 unchanged lines hidden ---
1262
1263 /*
1264 * Init fw_cfg. Must be done before riscv_load_fdt, otherwise the device
1265 * tree cannot be altered and we get FDT_ERR_NOSPACE.
1266 */
1267 s->fw_cfg = create_fw_cfg(machine);
1268 rom_set_fw(s->fw_cfg);
1269

--- 425 unchanged lines hidden ---