Last active
January 20, 2020 01:06
-
-
Save benmezger/cc66b8271700487ae5db3aa1769bdcb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Move section to .init that is allocatable and executable. */ | |
.section .init, "ax" | |
.align 2 | |
.global _start | |
_start: | |
.cfi_startproc | |
.cfi_undefined ra | |
# _setup_mtrap if interrupt is not enabled | |
#csrr t0, mstatus | |
#beqz t0, _setup_mtrap | |
.option push | |
.option norelax | |
la gp, __global_pointer$ | |
.option pop | |
la sp, __stack_top | |
add s0, sp, zero | |
# a0 contains the hartid | |
# a1 contains a pointer to the machine description (FDT) | |
jal initialize_hart | |
jal _setup_mtrap | |
jal zero, main | |
.cfi_endproc | |
.end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct fdt_node * | |
scan_node(uint32_t *dt_struct) | |
{ | |
struct device _dv; | |
int i; | |
int len = sizeof(device_tbl) / sizeof(device_tbl[0]); | |
for (i = 0; i < len; i++) { | |
if (strcmp(device_tbl[i].name, (const char *)dt_struct + 1)) { | |
struct fdt_node *node; | |
node->name = dt_struct + 1; | |
.... | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment