qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v7 24/29] hw/loongarch: Add default bios startup support.


From: Richard Henderson
Subject: Re: [RFC PATCH v7 24/29] hw/loongarch: Add default bios startup support.
Date: Mon, 28 Mar 2022 21:27:14 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

On 3/28/22 06:57, Xiaojuan Yang wrote:
Signed-off-by: Xiaojuan Yang<yangxiaojuan@loongson.cn>
Signed-off-by: Song Gao<gaosong@loongson.cn>
---
  hw/loongarch/Kconfig             |  4 ++
  hw/loongarch/fw_cfg.c            | 33 ++++++++++++++
  hw/loongarch/fw_cfg.h            | 15 +++++++
  hw/loongarch/loongson3.c         | 76 +++++++++++++++++++++++++++++++-
  hw/loongarch/meson.build         |  1 +
  include/hw/loongarch/loongarch.h |  8 ++++
  6 files changed, 135 insertions(+), 2 deletions(-)
  create mode 100644 hw/loongarch/fw_cfg.c
  create mode 100644 hw/loongarch/fw_cfg.h

Not within this patch, but you will want to create a submodule for this bios image, as we do for roms/edk2 etc. You will want to commit a pre-built image as well, like we do for other targets.

+    /* load the BIOS image. */
+    filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
+                              machine->firmware ?: LOONGSON3_BIOSNAME);
+    if (filename) {
+        bios_size = load_image_targphys(filename, LA_BIOS_BASE, LA_BIOS_SIZE);
+        lams->fw_cfg = loongarch_fw_cfg_init(ram_size, machine);
+        rom_set_fw(lams->fw_cfg);
+        g_free(filename);
+    } else {
+        bios_size = -1;
+    }

While loading the efi bios may be the most common usage, it's not efficient for simple tests. I think you should attempt to load an elf image, and only if that fails treat it as the firmware blob that efi builds.

Or not require a bios image if -kernel is present, or something.
At the moment one cannot run the tests/tcg/multiarch tests without 
loongarch.bios.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]