Skip to content

Commit

Permalink
Add fixup_dtb() to struct board
Browse files Browse the repository at this point in the history
This will be called after the dtb was found and (possibly) relocated, so
board specific DT cleanups can be implemented.
  • Loading branch information
zonque committed Jun 11, 2018
1 parent eaa2fa4 commit 40d24e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions board.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
#include "types.h"
#include "atags.h"

struct board;

struct board {
void *dtb;
size_t dtb_size;
void *kernel;
const char *compatible;
void (*fixup_dtb)(const struct board *);
};

struct board *match_board(u32 machid, const struct tag *);
Expand Down
4 changes: 4 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,15 @@ void main(u32 dummy, u32 machid, struct tag *tags)
#ifdef RELOCATE_DTB
dtb = RELOCATE_DTB;
memcpy(dtb, board->dtb, board->dtb_size);
board->dtb = dtb;
#else
dtb = board->dtb;
#endif
}

if (board->fixup_dtb)
board->fixup_dtb(board);

putstr("Booting into Linux kernel ...\n");
start_kernel(0, 0xffffffff, dtb);
}

0 comments on commit 40d24e6

Please sign in to comment.