Fix uart_mini initialization and emulation

This commit is contained in:
2019-12-02 12:59:40 +01:00
parent 417106b967
commit 6c4dba0929
11 changed files with 46 additions and 33 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ aarch64_set32r:
.globl aarch64_delay
aarch64_delay:
subs x0, x0, 0x01
subs x0, x0, 1
bne aarch64_delay
ret
+7 -8
View File
@@ -1,16 +1,15 @@
ENTRY(_start)
SECTIONS
{
/* For some reason qemu UART doesn't work with smaller address */
. = 0x40000000;
.boot . : { boot.o(.text) }
.text.boot : { *(.text.boot) }
.text : { *(.text) }
.rodata : { *(.rodata) }
.data : { *(.data) }
.bss : { *(.bss COMMON) }
. = ALIGN(0x8);
bss_begin = .;
.bss : { *(.bss*) }
bss_end = .;
. = ALIGN(8);
. = . + 0x1000;
. = . + 0x8000;
stack_ptr = . ;
}
+5 -5
View File
@@ -1,7 +1,8 @@
#include "aarch64_reg.h"
.globl _start
.section ".text.boot"
.globl _start
_start:
mrs x0, mpidr_el1 /* Check CPU ID */
@@ -12,10 +13,6 @@ idle:
b idle
set_el:
/* check current exception level */
bl aarch64_get_el
cmp x0, 0x03
bne set_stack
/* set SCTRL_EL1 */
ldr x0, =SCTLR_VALUE_MMU_DISABLED
msr sctlr_el1, x0
@@ -36,6 +33,9 @@ set_el:
set_stack:
ldr x30, =stack_ptr /* defined in aarch64.ld */
mov sp, x30
bl skip
skip:
bl k_main
hang: b hang