Asami Doi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
util: Add new util to make a payload for QEMU/AArch64
[WIP] This CL allows to make a payload for QEMU/AArch64. 1. Build a kernel 2. Get a dtb file from QEMU by the command 3. Make a FIT image from payload.its by mkimage
Signed-off-by: Asami Doi d0iasm.pub@gmail.com Change-Id: Ie299f5391ddc2fa3a71c9fdc988b2965f8742f10 --- A util/qemu_aarch64/Makefile A util/qemu_aarch64/payload.its 2 files changed, 53 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/34367/1
diff --git a/util/qemu_aarch64/Makefile b/util/qemu_aarch64/Makefile new file mode 100644 index 0000000..f0f5501 --- /dev/null +++ b/util/qemu_aarch64/Makefile @@ -0,0 +1,16 @@ +# +# This file is part of the coreboot project. +# +# Copyright (C) 2019 Asami Doi d0iasm.pub@gmail.com +# +# SPDX-License-Identifier: GPL-2.0-or-later + +payload: linux virt.dtb + mkimage -f payload.its payload.itb + +linux: + #TODO: Download the latest linux kernel and build it. + #TODO: Look up how to compress the kernel. + +virt.dtb: + qemu-system-aarch64 -machine virt-2.9,dumpdtb=virt.dtb -nographic diff --git a/util/qemu_aarch64/payload.its b/util/qemu_aarch64/payload.its new file mode 100644 index 0000000..d8e0e64 --- /dev/null +++ b/util/qemu_aarch64/payload.its @@ -0,0 +1,37 @@ +/dts-v1/; +/ { + description = "Image for QEMU/AArch64 with the latest Linux kernel and the FDT blob of QEMU virt machine"; + #address-cells = <1>; + images { + kernel@1 { + description = "Latest Linux kernel"; + data = /incbin/("./vmlinux"); + type = "kernel"; + arch = "arm"; + os = "linux"; + compression = "gzip"; + load = <0x40000000>; + entry = <0x40000000>; + hash@1 { + algo = "crc32"; + }; + hash@2 { + algo = "sha1"; + }; + }; + + fdt@1 { + description = "Flattened Device Tree blob for QEMU virt machine"; + data = /incbin/("./virt.dtb"); + type = "flat_dt"; + arch = "arm"; + compression = "gzip"; + hash@1 { + algo = "crc32"; + }; + hash@2 { + algo = "sha1"; + }; + }; + }; +};
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 1:
(7 comments)
This change is ready for review.
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/Makefile File util/qemu_aarch64/Makefile:
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/Makefile@... PS1, Line 8: payload: linux virt.dtb Ideally, all output should go into a subdirectory ("out" or "build" or such) and there should be a 'clean' target to delete that.
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/Makefile@... PS1, Line 13: #TODO: Look up how to compress the kernel. I don't think this should be in this Makefile TBH, it's a little far out of scope. Just tell people to pass a VMLINUZ=... variable in here (or zImage or however the kernel is called for aarch64 again).
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/Makefile@... PS1, Line 17: nit: maybe a 'help' target that's also the default target that explains the other available targets?
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... File util/qemu_aarch64/payload.its:
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 10: arch = "arm"; I think this should be arm64? (coreboot doesn't actually use it.)
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 12: compression = "gzip"; coreboot doesn't support gzip compression, we only have "lzma" and "lz4". You can compress a file with
cbfs-compression-tool rawcompress <infile> <outfile> <algo>
Using cbfs-compression-tool has the advantage that the user doesn't need the official utility installed first. It should normally be available under coreboot/build/util/ (although if someone passed a custom obj= path to the main coreboot make invocation it would be somewhere else... I guess you'll need to give the user a way to manually override the path for that case).
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 13: load = <0x40000000>; Nothing below here is used by coreboot, I think you might as well leave it out (or does mkimage choke then?).
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 36: }; You also need a config node like this:
configurations { default = "conf@1"; conf@1 { kernel = "kernel@1"; fdt = "fdt@1"; compatible = "qemu,qemu-aarch64" } }
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/34367
to look at the new patch set (#2).
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
util: Add new util to make a payload for QEMU/AArch64
This CL allows to make a payload for QEMU/AArch64. 1. Get a dtb file from QEMU by the command 3. Make a FIT image from payload.its by mkimage
Signed-off-by: Asami Doi d0iasm.pub@gmail.com Change-Id: Ie299f5391ddc2fa3a71c9fdc988b2965f8742f10 --- A util/qemu_aarch64/Makefile A util/qemu_aarch64/payload.its 2 files changed, 69 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/34367/2
Asami Doi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
(7 comments)
I'm thinking to write shell/python script to generate payload.its because I want to use an environmental variable (e.g. specifying the place of Linux kernel) but .its file seems not to support variables. In this case, Makefile will change and payload.its will be removed.
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/Makefile File util/qemu_aarch64/Makefile:
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/Makefile@... PS1, Line 8: payload: linux virt.dtb
Ideally, all output should go into a subdirectory ("out" or "build" or such) and there should be a ' […]
I updated the output directory to "build" and added 'clean' target.
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/Makefile@... PS1, Line 13: #TODO: Look up how to compress the kernel.
I don't think this should be in this Makefile TBH, it's a little far out of scope. […]
OK. I removed 'linux' target. I don't know how to use environmental variables in .its file so I probably have to write a script for dynamically generating .its file which has environmental variables such as kernel file name.
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/Makefile@... PS1, Line 17:
nit: maybe a 'help' target that's also the default target that explains the other available targets?
Ack
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... File util/qemu_aarch64/payload.its:
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 10: arch = "arm";
I think this should be arm64? (coreboot doesn't actually use it. […]
You're right. Thank you!
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 12: compression = "gzip"; cbfs-compression-tool seems to rewrite the magic number. The magic number is 0x5d000080 when I don't use cbfs-compression-tool. (It doesn't work well either.).
FIT: Compat preference (lowest to highest priority) : qemu,qemu-aarch64 FIT: config config@1 (default), kernel kernel@1, fdt fdt@1, compat qemu,qemu-aarch64 (match) FIT: Choosing best match config@1 for compat qemu,qemu-aarch64. Invalid device tree magic 0x01000010! ERROR: Failed to unflatten the FDT.
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 13: load = <0x40000000>;
Nothing below here is used by coreboot, I think you might as well leave it out (or does mkimage chok […]
I deleted entry, hash@1, and hash@2 in kernel@1 and hash@1 and hash@2 in fdt@1.
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 36: }; I don't know why but the line compatible = "qemu,qemu-aarch64" emits the following error. It moves to the next stage when I deleted the compatible line.
FIT: config config@1 (default), kernel kernel@1, fdt fdt@1, compat qemu,qemu-aarch64 (match) FIT: Choosing best match config@1 for compat qemu,qemu-aarch64. Invalid device tree magic 0x5d000080! ERROR: Failed to unflatten the FDT.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
I don't see the benefit. It's not related to qemu_aarch64 at all.
1) That's already in the documentation 2) That's already integrated into the make system if you select LinuxBoot payload.
Asami Doi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
Patch Set 2:
I don't see the benefit. It's not related to qemu_aarch64 at all.
- That's already in the documentation
- That's already integrated into the make system if you select LinuxBoot payload.
Thank you for your comment. I can understand that it's enough to cover how to make a payload. I can write the whole .its code and procedures in Documentation/mainboard/emulation/qemu-aarch64.md.
Integrated LinuxBoot doesn't work well now. I did 'LINUXBOOT_CROSS_COMPILE=aarch64-linux-gnu- make' and got the following error. MAKE Linux 5.2.1 cp: cannot stat '../../../.xz': No such file or directory make[2]: *** [targets/linux.mk:119: ../../../payloads/external/LinuxBoot/linuxboot/uImage] Error 1 make[1]: *** [Makefile:55: kernel] Error 2 make: *** [payloads/external/Makefile.inc:266: linuxboot] Error 2
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
Patch Set 2:
Patch Set 2:
I don't see the benefit. It's not related to qemu_aarch64 at all.
- That's already in the documentation
- That's already integrated into the make system if you select LinuxBoot payload.
Thank you for your comment. I can understand that it's enough to cover how to make a payload. I can write the whole .its code and procedures in Documentation/mainboard/emulation/qemu-aarch64.md.
Integrated LinuxBoot doesn't work well now. I did 'LINUXBOOT_CROSS_COMPILE=aarch64-linux-gnu- make' and got the following error. MAKE Linux 5.2.1 cp: cannot stat '../../../.xz': No such file or directory make[2]: *** [targets/linux.mk:119: ../../../payloads/external/LinuxBoot/linuxboot/uImage] Error 1 make[1]: *** [Makefile:55: kernel] Error 2 make: *** [payloads/external/Makefile.inc:266: linuxboot] Error 2
That error is generated if you didn't include a initramfs. I'll fix the Makefile to output better error messages.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
(3 comments)
I'm thinking to write shell/python script to generate payload.its because I want to use an environmental variable (e.g. specifying the place of Linux kernel) but .its file seems not to support variables.
You could just put a marker string like ###KERNEL_FILE### in it, copy it into the build directory and then use 'sed' to replace it with what you want? See the rule for fmap.fmd in coreboot's toplevel Makefile.inc, it does something similar. We try to avoid Python dependencies where possible.
I don't see the benefit. It's not related to qemu_aarch64 at all.
- That's already in the documentation
- That's already integrated into the make system if you select LinuxBoot payload.
Not everyone is using LinuxBoot? I think having something that helps people in building a simple FIT image from scratch may be useful... whether it should be tied to QEMU or not is debatable (for non-QEMU boards you'd have to pass a .dts or .dtb in as well, then). I guess we could consider integrating this into payloads/external/linux instead of having a separate thing under util/, maybe that would be better?
For payloads/external/LinuxBoot, I agree that it would be nice to integrate support for auto-generating the DTB when using QEMU there.
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... File util/qemu_aarch64/payload.its:
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 12: compression = "gzip";
cbfs-compression-tool seems to rewrite the magic number. […]
The magic number of what? This compresses the whole file, so of course any magic numbers in there will also be compressed afterwards. coreboot should decompress it before it does anything else with it. The fact that you got "Failed to unflatten" without a message about the decompression before that suggests that it didn't detect the compression attribute right... are you sure that you had compression = "lz4" (or "lzma") in the .its script that you built?
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 13: load = <0x40000000>;
I deleted entry, hash@1, and hash@2 in kernel@1 and hash@1 and hash@2 in fdt@1.
You should be able to delete 'load' as well, we don't use it.
https://review.coreboot.org/c/coreboot/+/34367/1/util/qemu_aarch64/payload.i... PS1, Line 36: };
I don't know why but the line compatible = "qemu,qemu-aarch64" emits the following error. […]
No, this looks correct... what does it say when you don't have that node? In that case, it shouldn't find any FDT and should die.
Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
Patch Set 2:
(3 comments)
I'm thinking to write shell/python script to generate payload.its because I want to use an environmental variable (e.g. specifying the place of Linux kernel) but .its file seems not to support variables.
You could just put a marker string like ###KERNEL_FILE### in it, copy it into the build directory and then use 'sed' to replace it with what you want? See the rule for fmap.fmd in coreboot's toplevel Makefile.inc, it does something similar. We try to avoid Python dependencies where possible.
I don't see the benefit. It's not related to qemu_aarch64 at all.
- That's already in the documentation
- That's already integrated into the make system if you select LinuxBoot payload.
Not everyone is using LinuxBoot? I think having something that helps people in building a simple FIT image from scratch may be useful... whether it should be tied to QEMU or not is debatable (for non-QEMU boards you'd have to pass a .dts or .dtb in as well, then). I guess we could consider integrating this into payloads/external/linux instead of having a separate thing under util/, maybe that would be better?
For payloads/external/LinuxBoot, I agree that it would be nice to integrate support for auto-generating the DTB when using QEMU there.
The LinuxBoot payload (if it wouldn't be broken right now on arm64), allows you to include any combination of kernel, DTS and initramfs. It's totally unrelated to u-root. The Linux payload is deprecated and LinuxBoot should be used instead.
Duplicating code from LinuxBoot doesn't seem like a good idea.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
The LinuxBoot payload (if it wouldn't be broken right now on arm64), allows you to include any combination of kernel, DTS and initramfs. It's totally unrelated to u-root. The Linux payload is deprecated and LinuxBoot should be used instead.
Oh, I see. That's seems like unfortunate naming, though? If this is meant to be the default thing that all Linux kernel payloads use, it should probably just be called Linux (and if the existing payloads/external/linux doesn't do anything that can't be done better with the LinuxBoot one, we should remove it and maybe reuse that name?).
Anyway, if that's the case I agree that rather than adding this util, the functionality should be included in that payload.
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
For payloads/external/LinuxBoot, I agree that it would be nice to integrate support for auto-generating the DTB when using QEMU there.
+1 if we can get the build system to do it.
The LinuxBoot payload (if it wouldn't be broken right now on arm64), allows you to include any combination of kernel, DTS and initramfs. It's totally unrelated to u-root.
+1 We should fix LinuxBoot so it works with arm64.
The Linux payload is deprecated and LinuxBoot should be used instead.
Can we add a (Deprecated) message to the Kconfig, so people use LinuxBoot instead?
Raul Rangel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
Patch Set 2:
The LinuxBoot payload (if it wouldn't be broken right now on arm64), allows you to include any combination of kernel, DTS and initramfs. It's totally unrelated to u-root. The Linux payload is deprecated and LinuxBoot should be used instead.
Oh, I see. That's seems like unfortunate naming, though? If this is meant to be the default thing that all Linux kernel payloads use, it should probably just be called Linux (and if the existing payloads/external/linux doesn't do anything that can't be done better with the LinuxBoot one, we should remove it and maybe reuse that name?).
Anyway, if that's the case I agree that rather than adding this util, the functionality should be included in that payload.
I would vote for not reusing the name. LinuxBoot is its own project, so calling it Linux would be confusing imo.
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
I would vote for not reusing the name. LinuxBoot is its own project, so calling it Linux would be confusing imo.
Well, what is payload/external/LinuxBoot supposed to be, then? Is it supposed to be purely for LinuxBoot (meaning something built off the code referred to from linuxboot.org) and nothing else? In that case, we should have something else to build other payloads. Or is it supposed to be the general Linux-as-payload building option, which allows you to either provide your own kernel/fdt/initramfs or select from a range of predefined ones (where only LinuxBoot/u-root happens to be implemented at the moment)? In that case, it shouldn't be called LinuxBoot. It would be okay to call the suboption that builds the LinuxBoot/u-root-specific initramfs (i.e. the thing that's currently called CONFIG_LINUXBOOT_UROOT) "LinuxBoot", but not the whole thing.
(I have to admit I don't actually know what the stuff at https://github.com/linuxboot/linuxboot does or how it relates to u-root. It looks like the payload Makefile/Kconfig doesn't refer to that at all, only to the u-root repo? Is one a dependency of the other? Either way, both are pretty clearly proper nouns referring to one specific project with its own code base, not a general concept, so a payload configuration for a general concept shouldn't be named after them.)
Asami Doi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
Thank you for all of your comments! In my understanding, LinuxBoot is one of the options for a coreboot's payload and it can pass the execution to any Linux distributions (OSes). So, we can use LinuxBoot as a payload when we want to run Linux. The flow is here: coreboot -> LinuxBoot -> Linux (or any OSes)
If I understand correctly, I will do the following things: 1. I will mark this CL to "abandoned" 2. I will build and add DTB to LinuxBoot payload automatically when a user wants to run coreboot on QEMU/AArch64 3. I will investigate how to run LinuxBoot on QEMU/AArch64
In relation to 3, I'm trying to run coreboot with LinuxBoot on QEMU/AArch64 (could build it with u-boot v3.0.0, couldn't do it with the master version). I now got the following exception. I will investigate that my implementation is wrong or LinuxBoot has a something problem.
BS: BS_PAYLOAD_LOAD times (us): entry 0 run 1300157 exit 84 BS: Entering BS_PAYLOAD_BOOT state. Jumping to boot code at 0000000040080000(0000000040000000) exception _sync_elx_64 ELR = 0xffff00001009020c ESR = 0x5e000000 FAR = 0xffffffff00000000 SPSR = 0x80000085 X00 = 0x0000000084000000 X01 = 0x0000000000000000 X02 = 0x0000000000000000 X03 = 0x0000000000000000 X04 = 0x0000000000000000 X05 = 0x0000000000000000 X06 = 0x0000000000000000 X07 = 0x0000000000000000 X08 = 0x0000000000000008 X09 = 0xfffffffffffffff9 X10 = 0x0101010101010101 X11 = 0x0000000000000004 X12 = 0x0101010101010101 X13 = 0x0000000000000018 X14 = 0xffffffffffffffff X15 = 0x000000000000000a X16 = 0x0000000000000000 X17 = 0x0000000000000000 X18 = 0x0000000000000000 X19 = 0xffff000010cf8548 X20 = 0xffff80003fcf27a0 X21 = 0x0000000000000000 X22 = 0xffff000010e240c0 X23 = 0xffff000010cf8000 X24 = 0xffff000010d16848 X25 = 0x0000000000000040 X26 = 0xffff000010adfb94 X27 = 0xffff000010af527c X28 = 0x0000000081000200 X29 = 0xffff000010cf3e40 X30 = 0xffff0000106c3b10 SP = 0x00000000600828d0 Dumping stack: ...
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
Thank you for all of your comments! In my understanding, LinuxBoot is one of the options for a coreboot's payload and it can pass the execution to any Linux distributions (OSes). So, we can use LinuxBoot as a payload when we want to run Linux. The flow is here:
coreboot -> LinuxBoot -> Linux (or any OSes)
There is no real LinuxBoot "step" in between there. Linux *is* the payload. payloads/external/LinuxBoot isn't really a payload in itself, it's just a bunch of build infrastructure that builds Linux as a payload for you. At runtime, coreboot hands off directly to the Linux kernel. (That's why I was arguing that it's misnamed and should just be named payloads/external/linux.)
In relation to 3, I'm trying to run coreboot with LinuxBoot on QEMU/AArch64 (could build it with u-boot v3.0.0, couldn't do it with the master version). I now got the following exception. I will investigate that my implementation is wrong or LinuxBoot has a something problem.
Hmmm... interesting. ESR = 0x5e00000 means "SMC instruction execution in AArch64 state, when SMC is not disabled." (see description for ESR_EL3 in the Armv8 Architecture Reference Manual). So I think(?) that's just a normal SMC entry, the problem is that you don't have a real SMC handler installed (the stuff you see is just coreboot's crashdump exception handler which was left over in memory after coreboot was finished... since the kernel starts in EL2, nothing ever overwrites the EL3 interrupt vectors).
So your main problem is essentially that you're running a kernel that expects PSCI to be available without loading Trusted Firmware. A workaround would be to disable PSCI in the kernel (if that's even still possible these days... try deleting the "arm,psci" node in the device tree). But the real solution would of course be to get Trusted Firmware working for QEMU. For that you need to 'select ARM64_USE_ARM_TRUSTED_FIRMWARE' in your Kconfig and add 'BL31_MAKEARGS += PLAT=qemu' to your Makefile. That should get it to build and run, but whether it will work I have no idea (I don't know who developed the QEMU port in TF, but they probably didn't design it to be used with coreboot). You may need to fix some things within TF to get that to work.
Asami Doi has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
So your main problem is essentially that you're running a kernel that expects PSCI to be available without loading Trusted Firmware. A workaround would be to disable PSCI in the kernel (if that's even still possible these days... try deleting the "arm,psci" node in the device tree). But the real solution would of course be to get Trusted Firmware working for QEMU. For that you need to 'select ARM64_USE_ARM_TRUSTED_FIRMWARE' in your Kconfig and add 'BL31_MAKEARGS += PLAT=qemu' to your Makefile. That should get it to build and run, but whether it will work I have no idea (I don't know who developed the QEMU port in TF, but they probably didn't design it to be used with coreboot). You may need to fix some things within TF to get that to work.
I removed "arm,psci" from DTS and it worked without errors but the kernel made nothing output after booting. Now, I'm investigating how to run trusted firmware on QEMU.
I will close this CL so let's discuss the problems on https://review.coreboot.org/c/coreboot/+/33387/
Asami Doi has abandoned this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Abandoned
Julius Werner has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/34367 )
Change subject: util: Add new util to make a payload for QEMU/AArch64 ......................................................................
Patch Set 2:
I removed "arm,psci" from DTS and it worked without errors but the kernel made nothing output after booting.
You never actually managed to boot it all the way with coreboot yet, right? If so, I'd expect that removing the line solves that issue and you're just running into something else. You should figure out the right 'earlycon' parameter you need to add to your command line (that depends on what UART interface QEMU is emulating, not sure) so that you see early log messages, and that will hopefully get you further.
That said, supporting Trusted Firmware with QEMU would be great so I hope you can do it anyway!