Linux booting issue with edk2 uefi on riscv64 qemu


Palanivel Duraisamy
 

Hi,

I am trying to boot Linux Kernel with statically linked initramfs on QEMU-riscv64 target.
I followed the steps provided in the link "https://github.com/riscv-admin/riscv-uefi-edk2-docs".
Built firmware for u540 board using the command "build -a RISCV64 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc -t GCC5".
Ran the command "qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd" to boot Linux.
I am getting uefi shell prompt. The uefi map commands gives "map: No mapping found." error.

I would like to know the procedure to bring up Linux with UEFI firmware.

Regards
Palanivel


Chang, Abner
 

[AMD Official Use Only - General]

Hi Palanivel,
U540 should be able to boot to kernel if follow the steps mentioned in https://github.com/riscv-admin/riscv-uefi-edk2-docs, everything was fine back to that moment.
However, both me and Daniel were no longer with RISC-V. I add Sunil to the loop see if he can help on this. Atish atishp@... was the collaborator for booting U540 edk2 binary to kernel on qemu. I am not sure if he could give some advices on this or not.

Thanks
Abner

-----Original Message-----
From: discuss@edk2.groups.io <discuss@edk2.groups.io> On Behalf Of
Palanivel Duraisamy via groups.io
Sent: Tuesday, January 10, 2023 3:40 PM
To: discuss@edk2.groups.io
Subject: [edk2-discuss] Linux booting issue with edk2 uefi on riscv64 qemu

Caution: This message originated from an External Source. Use proper
caution when opening attachments, clicking links, or responding.


Hi,

I am trying to boot Linux Kernel with statically linked initramfs on QEMU-
riscv64 target.
I followed the steps provided in the link
"https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgith
ub.com%2Friscv-admin%2Friscv-uefi-edk2-
docs&data=05%7C01%7Cabner.chang%40amd.com%7Cf47ed9aa16354a9cac3
908daf37a63c3%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C6380
90004229569795%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiL
CJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sd
ata=zwyqm7ld1EANTy39vriuIMcP8uHDL8DIqZgJFRZdmoY%3D&reserved=0".
Built firmware for u540 board using the command "build -a RISCV64 -p
Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc
-t GCC5".
Ran the command "qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -
bios U540.fd" to boot Linux.
I am getting uefi shell prompt. The uefi map commands gives "map: No
mapping found." error.

I would like to know the procedure to bring up Linux with UEFI firmware.

Regards
Palanivel




Palanivel Duraisamy
 

Hi Sunil,

I followed the given instructions in the document.
I am getting UEFI shell prompt.
The document says the following commands(step 6) need to be run on uefi shell.
FS0 has the linux-riscv64.elf file.

embeddedramdisk 4f2f3d7b-35ef-411b-9d26-e76ecacbaf8b
map -r
fs0:

The "embbedramdisk" command in my setup fails.
I think this command is missing and some modifications in EDK2 are needed to add this command.

I am ok with "virt" machine type.

Thanks
Palanivel
________________________________
From: Sunil V L <sunilvl@...>
Sent: 11 January 2023 20:55
To: discuss@edk2.groups.io <discuss@edk2.groups.io>; Palanivel Duraisamy <Palanivel.d@...>
Subject: Re: [edk2-discuss] Linux booting issue with edk2 uefi on riscv64 qemu

Hi Palanivel,

Could you follow the instructions at
https://github.com/riscv-admin/riscv-uefi-edk2-docs/blob/master/README.md

I am not the maintainer of this SoC. But let me know if you see any
issues. I will try to help.

Having said that, there is a series I am working on to support qemu virt
machine which is not yet merged. If you are fine with "virt" machine
instead of U540, let me know. It has latest design and supports disks
similar to other architectures.

Regards
Sunil

On Mon, Jan 09, 2023 at 11:39:38PM -0800, Palanivel Duraisamy wrote:
Hi,

I am trying to boot Linux Kernel with statically linked initramfs on QEMU-riscv64 target.
I followed the steps provided in the link "https://github.com/riscv-admin/riscv-uefi-edk2-docs".
Built firmware for u540 board using the command "build -a RISCV64 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc -t GCC5".
Ran the command "qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd" to boot Linux.
I am getting uefi shell prompt. The uefi map commands gives "map: No mapping found." error.

I would like to know the procedure to bring up Linux with UEFI firmware.

Regards
Palanivel




[EXT]


Palanivel Duraisamy
 

Thanks, Sunil.

Linux boots with this firmware on 'virt' machine.

Regards,
Palanivel
________________________________
From: Sunil V L <sunilvl@...>
Sent: 12 January 2023 19:16
To: Palanivel Duraisamy <Palanivel.d@...>
Cc: discuss@edk2.groups.io <discuss@edk2.groups.io>
Subject: Re: [edk2-discuss] Linux booting issue with edk2 uefi on riscv64 qemu

Hi Palanivel,

Please follow the steps in
https://github.com/vlsunil/riscv-uefi-edk2-docs/wiki/RISC-V-Qemu-Virt-support

Let me know how it goes!

Thanks
Sunil

On Thu, Jan 12, 2023 at 07:43:53AM +0000, Palanivel Duraisamy wrote:
Hi Sunil,

I followed the given instructions in the document.
I am getting UEFI shell prompt.
The document says the following commands(step 6) need to be run on uefi shell.
FS0 has the linux-riscv64.elf file.

embeddedramdisk 4f2f3d7b-35ef-411b-9d26-e76ecacbaf8b
map -r
fs0:

The "embbedramdisk" command in my setup fails.
I think this command is missing and some modifications in EDK2 are needed to add this command.

I am ok with "virt" machine type.

Thanks
Palanivel
________________________________
From: Sunil V L <sunilvl@...>
Sent: 11 January 2023 20:55
To: discuss@edk2.groups.io <discuss@edk2.groups.io>; Palanivel Duraisamy <Palanivel.d@...>
Subject: Re: [edk2-discuss] Linux booting issue with edk2 uefi on riscv64 qemu

Hi Palanivel,

Could you follow the instructions at
https://github.com/riscv-admin/riscv-uefi-edk2-docs/blob/master/README.md

I am not the maintainer of this SoC. But let me know if you see any
issues. I will try to help.

Having said that, there is a series I am working on to support qemu virt
machine which is not yet merged. If you are fine with "virt" machine
instead of U540, let me know. It has latest design and supports disks
similar to other architectures.

Regards
Sunil

On Mon, Jan 09, 2023 at 11:39:38PM -0800, Palanivel Duraisamy wrote:
Hi,

I am trying to boot Linux Kernel with statically linked initramfs on QEMU-riscv64 target.
I followed the steps provided in the link "https://github.com/riscv-admin/riscv-uefi-edk2-docs".
Built firmware for u540 board using the command "build -a RISCV64 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc -t GCC5".
Ran the command "qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd" to boot Linux.
I am getting uefi shell prompt. The uefi map commands gives "map: No mapping found." error.

I would like to know the procedure to bring up Linux with UEFI firmware.

Regards
Palanivel




[EXT]
[EXT]


Sunil V L
 

Hi Palanivel,

Could you follow the instructions at
https://github.com/riscv-admin/riscv-uefi-edk2-docs/blob/master/README.md

I am not the maintainer of this SoC. But let me know if you see any
issues. I will try to help.

Having said that, there is a series I am working on to support qemu virt
machine which is not yet merged. If you are fine with "virt" machine
instead of U540, let me know. It has latest design and supports disks
similar to other architectures.

Regards
Sunil

On Mon, Jan 09, 2023 at 11:39:38PM -0800, Palanivel Duraisamy wrote:
Hi,

I am trying to boot Linux Kernel with statically linked initramfs on QEMU-riscv64 target.
I followed the steps provided in the link "https://github.com/riscv-admin/riscv-uefi-edk2-docs".
Built firmware for u540 board using the command "build -a RISCV64 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc -t GCC5".
Ran the command "qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd" to boot Linux.
I am getting uefi shell prompt. The uefi map commands gives "map: No mapping found." error.

I would like to know the procedure to bring up Linux with UEFI firmware.

Regards
Palanivel





Sunil V L
 

Hi Palanivel,

Please follow the steps in
https://github.com/vlsunil/riscv-uefi-edk2-docs/wiki/RISC-V-Qemu-Virt-support

Let me know how it goes!

Thanks
Sunil

On Thu, Jan 12, 2023 at 07:43:53AM +0000, Palanivel Duraisamy wrote:
Hi Sunil,

I followed the given instructions in the document.
I am getting UEFI shell prompt.
The document says the following commands(step 6) need to be run on uefi shell.
FS0 has the linux-riscv64.elf file.

embeddedramdisk 4f2f3d7b-35ef-411b-9d26-e76ecacbaf8b
map -r
fs0:

The "embbedramdisk" command in my setup fails.
I think this command is missing and some modifications in EDK2 are needed to add this command.

I am ok with "virt" machine type.

Thanks
Palanivel
________________________________
From: Sunil V L <sunilvl@...>
Sent: 11 January 2023 20:55
To: discuss@edk2.groups.io <discuss@edk2.groups.io>; Palanivel Duraisamy <Palanivel.d@...>
Subject: Re: [edk2-discuss] Linux booting issue with edk2 uefi on riscv64 qemu

Hi Palanivel,

Could you follow the instructions at
https://github.com/riscv-admin/riscv-uefi-edk2-docs/blob/master/README.md

I am not the maintainer of this SoC. But let me know if you see any
issues. I will try to help.

Having said that, there is a series I am working on to support qemu virt
machine which is not yet merged. If you are fine with "virt" machine
instead of U540, let me know. It has latest design and supports disks
similar to other architectures.

Regards
Sunil

On Mon, Jan 09, 2023 at 11:39:38PM -0800, Palanivel Duraisamy wrote:
Hi,

I am trying to boot Linux Kernel with statically linked initramfs on QEMU-riscv64 target.
I followed the steps provided in the link "https://github.com/riscv-admin/riscv-uefi-edk2-docs".
Built firmware for u540 board using the command "build -a RISCV64 -p Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc -t GCC5".
Ran the command "qemu-system-riscv64 -cpu sifive-u54 -machine sifive_u -bios U540.fd" to boot Linux.
I am getting uefi shell prompt. The uefi map commands gives "map: No mapping found." error.

I would like to know the procedure to bring up Linux with UEFI firmware.

Regards
Palanivel




[EXT]