Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform/Loongson: Modify loongarch uefi firmware size #191

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lixianglai
Copy link
Contributor

@lixianglai lixianglai commented Sep 7, 2024

After the loongarch flash block size is changed from 128K to 256K,
qemu requires that the UEFI firmware size be aligned with the flash block size(256K).
Otherwise, the firmware cannot be loaded,
Use the following code to resolve the old firmware loading problem:
mv QEMU_EFI.fd QEMU_EFI.fd-bak
cat QEMU_EFI.fd-bak /dev/zero | head -c 16m > ./QEMU_EFI.fd
mv QEMU_VARS.fd QEMU_VARS.fd-bak
cat QEMU_VARS.fd-bak /dev/zero | head -c 16m > ./QEMU_VARS.fd

For the new firmware, we refer to other architecture UEFI and
set the UEFI firmware size to align with the flash block size(256K).

So for this patch, we set the UEFI firmware size to 256K alignment.

Cc: Bibo Mao [email protected]
Cc: Chao Li [email protected]

After the loongarch flash block size is changed from 128K to 256K,
qemu requires that the UEFI firmware size be aligned with the flash block size(256K).
Otherwise, the firmware cannot be loaded,
Use the following code to resolve the old firmware loading problem:
mv QEMU_EFI.fd  QEMU_EFI.fd-bak
cat QEMU_EFI.fd-bak  /dev/zero | head -c 16m > ./QEMU_EFI.fd
mv QEMU_VARS.fd  QEMU_VARS.fd-bak
cat QEMU_VARS.fd-bak /dev/zero | head -c 16m > ./QEMU_VARS.fd

For the new firmware, we refer to other architecture UEFI and
set the UEFI firmware size to align with the flash block size(256K).

So for this patch, we set the UEFI firmware size to 256K alignment.

Cc: Bibo Mao <[email protected]>
Cc: Chao Li <[email protected]>
Signed-off-by: Xianglai Li <[email protected]>
@lixianglai lixianglai changed the title Platform/Loongson: Modify loongarch uefi firmware block size Platform/Loongson: Modify loongarch uefi firmware size Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant