Files
La1c102TmpProject/System/Startup/wakeup.S
T
2026-08-25 21:47:54 -04:00

29 lines
640 B
ArmAsm

#include "regdef.h"
#include "csrdef.h"
#include "tools-asm.h"
#include "start.h"
.global cpu_sleep
cpu_sleep:
SAVE_REGS_ALL(REGS_MEM)
dbar 0
li.w t1, PMU_BASE
1: ld.w t0, t1,PMU_CommandW
andi t0, t0, 0x1
beqz t0, 1b
st.w t0, t1,PMU_CommandW
idle 0
.global wakeup_reset
wakeup_reset:
la a0, msg_wakeup
bl outputstring
RESTORE_REGS_ALL(REGS_MEM)
csrwr t0, CSR_KScratch1
/*enable interrupt*/
li.w t0, 0x4
csrxchg t0, t0, CSR_CRMD //enter pmu_handler
csrrd t0, CSR_KScratch1
jirl zero, ra, 0