2022-06-14 14:14:56 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <main.h>
|
2023-07-19 19:48:06 +00:00
|
|
|
#include <string.h>
|
2022-06-14 14:14:56 +00:00
|
|
|
|
|
|
|
void main(void* dt, void* kernel) {
|
|
|
|
/* Initialize SoC and Board specific peripherals/quirks */
|
2023-07-18 11:41:37 +00:00
|
|
|
|
|
|
|
/* TODO: Find a better way to make this more universal (since devices like arm64 Samsung Galaxies enable FB after soc_init) */
|
|
|
|
#ifdef CONFIG_SIMPLE_FB
|
|
|
|
clean_fb((char*)CONFIG_FRAMEBUFFER_BASE, CONFIG_FRAMEBUFFER_WIDTH, CONFIG_FRAMEBUFFER_HEIGHT, CONFIG_FRAMEBUFFER_STRIDE);
|
|
|
|
#endif
|
2022-06-14 14:14:56 +00:00
|
|
|
soc_init();
|
2022-06-14 16:51:51 +00:00
|
|
|
printk("soc_init() passed!");
|
2022-06-14 14:14:56 +00:00
|
|
|
|
|
|
|
board_init();
|
2022-06-14 16:51:51 +00:00
|
|
|
printk("board_init() passed!");
|
2022-06-14 14:14:56 +00:00
|
|
|
|
|
|
|
/* Copy kernel to memory and boot */
|
2022-06-14 16:51:51 +00:00
|
|
|
printk("Booting linux...");
|
2023-07-18 11:41:37 +00:00
|
|
|
|
|
|
|
memcpy((void*)CONFIG_PAYLOAD_ENTRY, kernel, (unsigned long) &kernel_size);
|
|
|
|
load_kernel(dt, 0, 0, 0, (void*)CONFIG_PAYLOAD_ENTRY);
|
|
|
|
|
|
|
|
/* We shouldn't get there */
|
|
|
|
while(1) {}
|
2022-06-14 14:14:56 +00:00
|
|
|
}
|