mirror of
https://github.com/ivoszbg/uniLoader.git
synced 2026-08-15 05:18:32 +00:00
main: Move initialization of board_data to the stack
When the board_data is initialized at compile time, it is placed into the data section, which doesn't get relocated by the linker. The resulting address of the board_data that is passed to board_init lies within reserved memory and the device crashes.
This commit is contained in:
30
main/main.c
30
main/main.c
@@ -8,23 +8,23 @@
|
||||
#include <string.h>
|
||||
#include <lib/debug.h>
|
||||
|
||||
/*
|
||||
* Provide an empty board config that has
|
||||
* to be filled in the board files
|
||||
* TODO: figure out why having it in
|
||||
* the board files makes devices reboot.
|
||||
*/
|
||||
struct board_data board = {
|
||||
.name = "default",
|
||||
.ops = {
|
||||
[BOARD_OP_INIT] = BOARD_OP_INIT,
|
||||
[BOARD_OP_LATE_INIT] = BOARD_OP_LATE_INIT,
|
||||
[BOARD_OP_DRIVER_SETUP] = BOARD_OP_DRIVER_SETUP,
|
||||
}
|
||||
};
|
||||
|
||||
void main(void* dt, void* kernel, void* ramdisk)
|
||||
{
|
||||
/*
|
||||
* Provide an empty board config that has
|
||||
* to be filled in the board files
|
||||
* TODO: figure out why having it in
|
||||
* the board files makes devices reboot.
|
||||
*/
|
||||
struct board_data board = {
|
||||
.name = "default",
|
||||
.ops = {
|
||||
[BOARD_OP_INIT] = BOARD_OP_INIT,
|
||||
[BOARD_OP_LATE_INIT] = BOARD_OP_LATE_INIT,
|
||||
[BOARD_OP_DRIVER_SETUP] = BOARD_OP_DRIVER_SETUP,
|
||||
}
|
||||
};
|
||||
|
||||
/* Initialize SoC and Board specific peripherals/quirks */
|
||||
init_board_funcs(&board);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user