grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v5 9/9] tests: add support for LoongArch


From: Xiaotian Wu
Subject: Re: [PATCH v5 9/9] tests: add support for LoongArch
Date: Tue, 2 Aug 2022 12:59:34 +0800
User-agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0


在 2022/8/2 上午6:33, Glenn Washburn 写道:
On Fri, 29 Jul 2022 15:12:01 +0800
Xiaotian Wu <wuxiaotian@loongson.cn> wrote:

Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
---
  tests/ahci_test.in       |  2 +-
  tests/ehci_test.in       |  2 +-
  tests/ohci_test.in       |  2 +-
  tests/partmap_test.in    |  2 +-
  tests/pata_test.in       |  2 +-
  tests/uhci_test.in       |  2 +-
  tests/util/grub-shell.in | 16 ++++++++++++++++
  7 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/tests/ahci_test.in b/tests/ahci_test.in
index 6d2e61d4e..70646a24e 100644
--- a/tests/ahci_test.in
+++ b/tests/ahci_test.in
@@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
      mips*-arc | mips*-qemu_mips)
        exit 77;;
      # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
  esac
diff --git a/tests/ehci_test.in b/tests/ehci_test.in
index df671b4b6..bf823a5de 100644
--- a/tests/ehci_test.in
+++ b/tests/ehci_test.in
@@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
      mips*-arc | mips*-qemu_mips)
        exit 77;;
      # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
  esac
diff --git a/tests/ohci_test.in b/tests/ohci_test.in
index 741ad881f..a40d3bc0a 100644
--- a/tests/ohci_test.in
+++ b/tests/ohci_test.in
@@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
      mips*-arc | mips*-qemu_mips)
        exit 77;;
      # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
  esac
diff --git a/tests/partmap_test.in b/tests/partmap_test.in
index 4138e88fe..6db59ce38 100644
--- a/tests/partmap_test.in
+++ b/tests/partmap_test.in
@@ -90,7 +90,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
      mipsel-arc)
        disk=arc/scsi0/disk0/rdisk0
        ;;
-    arm*-efi)
+    arm*-efi|loongarch64-efi)
        disk=hd2
The "loongarch64-efi" pattern should be separate and have "disk=hd1"
because the drive is set to show up as hd1 in the grub-shell.in changes
below.

This is indeed a issue. When I delete loongarch64-efi and use the default hd0 directly, the partmap_test passed.


        ;;
      *)
diff --git a/tests/pata_test.in b/tests/pata_test.in
index 31144a8fd..4d0e7d573 100644
--- a/tests/pata_test.in
+++ b/tests/pata_test.in
@@ -33,7 +33,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
      i386-efi)
        exit 77;;
      # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
      i386-ieee1275)
        disk=hdb
diff --git a/tests/uhci_test.in b/tests/uhci_test.in
index 5aa5eb726..de199a281 100644
--- a/tests/uhci_test.in
+++ b/tests/uhci_test.in
@@ -30,7 +30,7 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" in
      mips*-arc | mips*-qemu_mips)
        exit 77;;
      # FIXME: No native drivers are available for those
-    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi)
+    powerpc-ieee1275 | sparc64-ieee1275 | arm*-efi | loongarch64-efi)
        exit 77;;
  esac
diff --git a/tests/util/grub-shell.in b/tests/util/grub-shell.in
index 4828afb7c..b82c8243f 100644
--- a/tests/util/grub-shell.in
+++ b/tests/util/grub-shell.in
@@ -194,6 +194,15 @@ case "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" 
in
        disk="device virtio-blk-device,drive=hd1 -drive if=none,id=hd1,file="
        serial_port=efi0
        ;;
+    loongarch64-efi)
+       qemu=qemu-system-loongarch64
+       boot=hd
+       console=console
+       trim=1
+       qemuopts="-machine virt -cpu la464 -smp 2 -nographic -bios 
/usr/share/qemu/edk2-loongarch64-code.fd $qemuopts"
This would be better as:

   qemuopts="-machine virt -cpu la464 -smp 2 -nographic -L "${srcdir}"
-bios edk2-loongarch64-code.fd $qemuopts"

This allows a non-system bios to be used when placed in the grub source
directory and otherwise the file will be searched for in
/usr/share/qemu and other system paths.
Ok, I will change it in the v6 patch series.
+       disk="device virtio-blk-pci,drive=hd1 -drive if=none,id=hd1,file="
+       serial_port=
+       ;;
      *)
        boot=hd
        qemu=qemu-system-i386
@@ -395,6 +404,8 @@ fi
  if [ x$boot = xhd ]; then
      if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ 
"${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then
        device="device virtio-blk-device,drive=hd0 -drive if=none,id=hd0,file="
+    elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = 
loongarch64-efi ]; then
+       device="device virtio-blk-pci,drive=hd0 -drive if=none,id=hd0,file="
      elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = mips-arc 
]; then
        device="hdb "
      else
@@ -405,6 +416,8 @@ fi
  if [ x$boot = xcd ]; then
      if [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm64-efi ] || [ 
"${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = arm-efi ]; then
        device="device virtio-blk-device,drive=cd0 -drive 
if=none,id=cd0,media=cdrom,file="
+    elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = 
loongarch64-efi ]; then
+       device="device virtio-blk-pci,drive=cd0 -drive 
if=none,id=cd0,media=cdrom,file="
      elif [ "${grub_modinfo_target_cpu}-${grub_modinfo_platform}" = powerpc-ieee1275 ] 
&& [ x$pseries != xy ] ; then
        device="-drive if=ide,media=cdrom,file="
      else
@@ -509,6 +522,9 @@ elif [ x$boot = xemu ]; then
      test -n "$debug" || rm -rf "$rootdir"
      test -n "$debug" || rm -f "$roottar"
  else
+    if [ -n "$debug" ]; then
+      echo "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout 
-${device}"${isofile}" ${bootdev} >> /tmp/grub-shell.run
+    fi
This change should not be in this patch series. I have similar
functionality that should get included in the grub-shell patch series I
have pending review.
Sorry, this is my carelessness, this is just for my own debugging.
Glenn

      timeout -s KILL $timeout "${qemu}" ${qemuopts} ${serial_null} -serial file:/dev/stdout 
-${device}"${isofile}" ${bootdev} | cat | tr -d "\r" | do_trim
  fi
  if [ x$boot = xcoreboot ]; then
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

--
Best Regards
Xiaotian Wu




reply via email to

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