34 lines
1.1 KiB
C
34 lines
1.1 KiB
C
// SPDX-License-Identifier: GPL-2.0-only
|
|
/*
|
|
* Copyright (c) 2022, Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
|
|
* Copyright (c) 2026, Igor Belwon <igor.belwon@mentallysanemainliners.org>
|
|
*/
|
|
|
|
#include <lib/debug.h>
|
|
#include <main/boot.h>
|
|
#include <main/boot-fdt.h>
|
|
#include <string.h>
|
|
|
|
void boot_kernel(void* dt, void* kernel, void* ramdisk)
|
|
{
|
|
#ifdef CONFIG_LIBFDT
|
|
patch_dtb(&dt);
|
|
#endif
|
|
|
|
printk(KERN_INFO, "Booting kernel...\n");
|
|
|
|
printk(KERN_INFO, "[DEBUG] addresses overview::\n");
|
|
printk(KERN_INFO, " -> Kernel entry (Jump target for K64) : 0x%lx\n", (unsigned long)kernel);
|
|
printk(KERN_INFO, " -> DTB pointer : 0x%lx\n", (unsigned long)dt);
|
|
printk(KERN_INFO, " -> Ramdisk pointer : 0x%lx\n", (unsigned long)ramdisk);
|
|
|
|
#ifdef CONFIG_LIBFDT
|
|
unsigned int *fdt_magic = (unsigned int *)dt;
|
|
if (fdt_magic) {
|
|
printk(KERN_INFO, " -> FDT Magic Check : 0x%x (Expected: 0xd00dfeed)\n", *fdt_magic);
|
|
}
|
|
#endif
|
|
|
|
arch_load_kernel(kernel, dt, ramdisk);
|
|
}
|