Hi, BiBo
On 8/10/23 5:58 PM, bibo mao wrote:
Xianglai,
I reply inline.
在 2023/8/10 15:42, xianglai li 写道:
1.Add edk2-platform submodule
2.Added loongarch UEFI BIOS support to compiled scripts.
The description is somewhat too simple, it should be paragraph.
Okay, I'll describe it in detail in the next version.
3.The cross-compilation toolchain on x86 can be obtained from the link below:
https://github.com/loongson/build-tools/tree/2022.09.06
Fedora38 has LoongArch cross-compiler rpm package, maybe we do not need this.
Okay, I'll remove it in the next version.
Cc: Paolo Bonzini <pbonz...@redhat.com>
Cc: "Marc-André Lureau" <marcandre.lur...@redhat.com>
Cc: "Daniel P. Berrangé" <berra...@redhat.com>
Cc: Thomas Huth <th...@redhat.com>
Cc: "Philippe Mathieu-Daudé" <phi...@linaro.org>
Cc: Gerd Hoffmann <kra...@redhat.com>
Cc: Xiaojuan Yang <yangxiaoj...@loongson.cn>
Cc: Song Gao <gaos...@loongson.cn>
Cc: Bibo Mao <maob...@loongson.cn>
Signed-off-by: xianglai li <lixiang...@loongson.cn>
---
.gitmodules | 3 +++
meson.build | 2 +-
pc-bios/meson.build | 2 ++
roms/edk2-build.config | 14 ++++++++++++++
roms/edk2-build.py | 4 ++--
roms/edk2-platforms | 1 +
6 files changed, 23 insertions(+), 3 deletions(-)
create mode 160000 roms/edk2-platforms
diff --git a/.gitmodules b/.gitmodules
index 73cae4cd4d..0cb57123fa 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -43,3 +43,6 @@
[submodule "tests/lcitool/libvirt-ci"]
path = tests/lcitool/libvirt-ci
url = https://gitlab.com/libvirt/libvirt-ci.git
+[submodule "roms/edk2-platforms"]
+ path = roms/edk2-platforms
+ url = https://github.com/tianocore/edk2-platforms.git
diff --git a/meson.build b/meson.build
index 98e68ef0b1..b398caf2ce 100644
--- a/meson.build
+++ b/meson.build
@@ -153,7 +153,7 @@ if targetos != 'darwin'
modular_tcg = ['i386-softmmu', 'x86_64-softmmu']
endif
-edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_64-softmmu' ]
+edk2_targets = [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu',
'x86_64-softmmu', 'loongarch64-softmmu' ]
unpack_edk2_blobs = false
foreach target : edk2_targets
if target in target_dirs
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index a7224ef469..fc73222b6c 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -9,6 +9,8 @@ if unpack_edk2_blobs
'edk2-i386-vars.fd',
'edk2-x86_64-code.fd',
'edk2-x86_64-secure-code.fd',
+ 'edk2-loongarch64-code.fd',
+ 'edk2-loongarch64-vars.fd',
]
foreach f : fds
diff --git a/roms/edk2-build.config b/roms/edk2-build.config
index 66ef9ffcb9..7960c4c2c5 100644
--- a/roms/edk2-build.config
+++ b/roms/edk2-build.config
@@ -1,5 +1,6 @@
[global]
core = edk2
+pkgs = edk2-platforms
####################################################################################
# options
@@ -122,3 +123,16 @@ plat = RiscVVirtQemu
dest = ../pc-bios
cpy1 = FV/RISCV_VIRT.fd edk2-riscv.fd
pad1 = edk2-riscv.fd 32m
+
+####################################################################################
+# LoongArch64
+
+[build.loongach64.qemu]
+conf = Platform/Loongson/LoongArchQemuPkg/Loongson.dsc
+arch = LOONGARCH64
+plat = LoongArchQemu
+dest = ../pc-bios
+cpy1 = FV/QEMU_EFI.fd edk2-loongarch64-code.fd
+pad1 = edk2-loongarch64-code.fd 4m
+cpy2 = FV/QEMU_VARS.fd edk2-loongarch64-vars.fd
+pad2 = edk2-loongarch64-vars.fd 16m
diff --git a/roms/edk2-build.py b/roms/edk2-build.py
index 870893f7c8..dbd641e51e 100755
--- a/roms/edk2-build.py
+++ b/roms/edk2-build.py
@@ -269,8 +269,8 @@ def prepare_env(cfg):
# for cross builds
if binary_exists('arm-linux-gnu-gcc'):
os.environ['GCC5_ARM_PREFIX'] = 'arm-linux-gnu-'
- if binary_exists('loongarch64-linux-gnu-gcc'):
- os.environ['GCC5_LOONGARCH64_PREFIX'] = 'loongarch64-linux-gnu-'
+ if binary_exists('loongarch64-unknown-linux-gnu-gcc'):
+ os.environ['GCC5_LOONGARCH64_PREFIX'] =
'loongarch64-unknown-linux-gnu-'
I think loongarch64-unknown-linux- is not necessary here, loongarch64-linux-gnu-
is default prefix on Fedora38, else there will be too many prefix names :)
Ok!I'll fix it in the next version.
Thanks,
xianglai.
Regards
Bibo Mao
hostarch = os.uname().machine
if binary_exists('aarch64-linux-gnu-gcc') and hostarch != 'aarch64':
diff --git a/roms/edk2-platforms b/roms/edk2-platforms
new file mode 160000
index 0000000000..84ccada592
--- /dev/null
+++ b/roms/edk2-platforms
@@ -0,0 +1 @@
+Subproject commit 84ccada59257a8151a592a416017fbb03b8ed3cf