Le 20/10/2021 à 12:10, Cédric Le Goater a écrit :
I dont understand how
static bd_t bd;
can be updated in the kernel.
It's not updated in the kernel.
It is supposed to be provided by UBoot to Linux Kernel. But modern
kernels don't take that anymore, they take a device tree. For this
reason cuboot takes the content of bd to build/update the device tree.
Looks like QEMU also provides the bd, see ref405ep_init()
I managed to get a kernel booting with the following change (and with
CONFIG_ETHERNET removed)
diff --git a/arch/powerpc/boot/cuboot-hotfoot.c
b/arch/powerpc/boot/cuboot-hotfoot.c
index 888a6b9bfead..63a9545ff55d 100644
--- a/arch/powerpc/boot/cuboot-hotfoot.c
+++ b/arch/powerpc/boot/cuboot-hotfoot.c
@@ -132,6 +132,12 @@ void platform_init(unsigned long r3, unsigned long
r4, unsigned long r5,
unsigned long r6, unsigned long r7)
{
CUBOOT_INIT();
+ bd.bi_intfreq = 133333333;
+ bd.bi_busfreq = 33333333;
+ bd.bi_procfreq = 133333333;
+ bd.bi_plb_busfreq = 33333333;
+ bd.bi_pci_busfreq = 33333333;
+ bd.bi_opbfreq = 33333333;
platform_ops.fixups = hotfoot_fixups;
platform_ops.exit = ibm40x_dbcr_reset;
fdt_init(_dtb_start);