mirror of
https://github.com/jserv/armv8-hello.git
synced 2025-05-22 02:43:17 +00:00
initial import of armv8-hello
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#include "reg.h"
|
||||
|
||||
.text
|
||||
|
||||
.globl _start
|
||||
_start:
|
||||
/* init UART (38400 8N1) */
|
||||
ldr x4, =UART_BASE // UART base
|
||||
mov w5, #0x10 // IBRD
|
||||
str w5, [x4, #0x24]
|
||||
mov w5, #0xc300
|
||||
orr w5, w5, #0x0001 // CR
|
||||
str w5, [x4, #0x30]
|
||||
|
||||
/* check CPU ID */
|
||||
mrs x0, mpidr_el1
|
||||
tst x0, #15
|
||||
b.ne other_cpu
|
||||
b.eq boot_cpu
|
||||
|
||||
boot_cpu:
|
||||
/* configure stack */
|
||||
adrp x0, stacktop
|
||||
mov sp, x0
|
||||
|
||||
b main
|
||||
|
||||
other_cpu:
|
||||
b other_cpu
|
||||
Reference in New Issue
Block a user