Fix uart_mini initialization and emulation
This commit is contained in:
@@ -26,7 +26,7 @@ aarch64_set32r:
|
||||
|
||||
.globl aarch64_delay
|
||||
aarch64_delay:
|
||||
subs x0, x0, 0x01
|
||||
subs x0, x0, 1
|
||||
bne aarch64_delay
|
||||
ret
|
||||
|
||||
|
||||
@@ -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 = . ;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user