1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/*
* nds32_init.inc
*
* NDS32 architecture startup assembler header file
*
*/
.macro nds32_init
! Initialize GP for data access
la $gp, _SDA_BASE_
#if defined(__NDS32_EXT_EX9__)
! Check HW for EX9
mfsr $r0, $MSC_CFG
li $r1, (1 << 24)
and $r2, $r0, $r1
beqz $r2, 1f
! Initialize the table base of EX9 instruction
la $r0, _ITB_BASE_
mtusr $r0, $ITB
1:
#endif
#if defined(__NDS32_EXT_FPU_DP__) || defined(__NDS32_EXT_FPU_SP__)
! Enable FPU
mfsr $r0, $FUCOP_CTL
ori $r0, $r0, #0x1
mtsr $r0, $FUCOP_CTL
dsb
! Enable denormalized flush-to-Zero mode
fmfcsr $r0
ori $r0,$r0,#0x1000
fmtcsr $r0
dsb
#endif
! Initialize default stack pointer
la $sp, _stack
.endm
|