Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33387 )
Change subject: mainboard/emulation/qemu-aarch64: Add new board for ARMv8 ......................................................................
Patch Set 16:
(3 comments)
Patch Set 16:
(19 comments)
Thank you for your reviews. I add a documentation, deleted cpu/armltd/cortex-a53, and updated files. I have some things I don't understand yet.
I'm trying to add a payload LinuxBoot by selecting it via 'make menuconfig'. However, I got the following error: make LINUXBOOT_CROSS_COMPILE=aarch64-linux-gnu- ... cp: -r not specified; omitting directory '../../../' make[2]: *** [targets/linux.mk:112: linuxboot/target.dtb] Error 1 make[1]: *** [Makefile:55: kernel] Error 2 make: *** [payloads/external/Makefile.inc:266: linuxboot] Error 2
I think this error relates to the second question about FDT.
What is an FDT and how can I use it? I looked it up and found an FDT is a flattened device tree which is used especially for ARM system. We can configure peripherals via an FDT dynamically. How can I pass an FDT when building the image?
When generating the uImage, you must include a DTB. When you build LinuxBoot, you need to specify a "Compiled devicetree file", that is a DTB. too.
You can gernate one from qemu by runing qemu-system-aarch64 -machine virt-2.9,dumpdtb=file.dtb ... Please convert the DTB to DTS and store it in the mainboard directory.
https://review.coreboot.org/c/coreboot/+/33387/15/src/mainboard/emulation/qe... File src/mainboard/emulation/qemu-aarch64/bootblock_custom.S:
https://review.coreboot.org/c/coreboot/+/33387/15/src/mainboard/emulation/qe... PS15, Line 11: ENTRY(_start)
Sorry, I only have a few knowledge about FDT. […]
boot rom is the code run by the SoC itself, before coreboot's bootblock is executed. I guess qemu passes a pointer to FDT in x0. As Julius said it's likely easier to add a static DTS file to the mainboard directory.
https://review.coreboot.org/c/coreboot/+/33387/15/src/mainboard/emulation/qe... File src/mainboard/emulation/qemu-aarch64/mainboard.c:
https://review.coreboot.org/c/coreboot/+/33387/15/src/mainboard/emulation/qe... PS15, Line 28: ram_resource(dev, 0, VIRT_DRAM_START >> 10, discovered << 10);
Sorry, does "discover resources" mean BS_DEV_RESOURCES?
have a look at "mainboard/emulation/qemu-i440fx/northbridge.c" It calls ram_resource in "cpu_pci_domain_read_resources":
static struct device_operations pci_domain_ops = { .read_resources = cpu_pci_domain_read_resources,
https://review.coreboot.org/c/coreboot/+/33387/15/src/mainboard/emulation/qe... File src/mainboard/emulation/qemu-aarch64/timer.c:
https://review.coreboot.org/c/coreboot/+/33387/15/src/mainboard/emulation/qe... PS15, Line 9: void udelay(unsigned int n);
src/arch/arm64/arch_timer.c will be enable when we select CONFIG_ARM64_USE_ARCH_TIMER. […]
Have a look at "soc/qualcomm/sdm845/timer.c" It just implements init_timer(). You can do that in a similar way.