OpenCores
URL https://opencores.org/ocsvn/minsoc/minsoc/trunk

Subversion Repositories minsoc

[/] [minsoc/] [trunk/] [sw/] [support/] [reset.S] - Blame information for rev 49

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 rfajardo
/* Support file for c based tests */
2
#include "spr_defs.h"
3
#include "board.h"
4
#include "mc.h"
5
 
6 47 rfajardo
    .section .stack
7
    .space STACK_SIZE
8 2 rfajardo
_stack:
9
 
10 47 rfajardo
    .section .reset, "ax"
11 2 rfajardo
 
12 47 rfajardo
    .org    0x100
13 2 rfajardo
_reset_vector:
14 47 rfajardo
    l.nop
15
    l.nop
16
    l.addi  r2,r0,0x0
17
    l.addi  r3,r0,0x0
18
    l.addi  r4,r0,0x0
19
    l.addi  r5,r0,0x0
20
    l.addi  r6,r0,0x0
21
    l.addi  r7,r0,0x0
22
    l.addi  r8,r0,0x0
23
    l.addi  r9,r0,0x0
24
    l.addi  r10,r0,0x0
25
    l.addi  r11,r0,0x0
26
    l.addi  r12,r0,0x0
27
    l.addi  r13,r0,0x0
28
    l.addi  r14,r0,0x0
29
    l.addi  r15,r0,0x0
30
    l.addi  r16,r0,0x0
31
    l.addi  r17,r0,0x0
32
    l.addi  r18,r0,0x0
33
    l.addi  r19,r0,0x0
34
    l.addi  r20,r0,0x0
35
    l.addi  r21,r0,0x0
36
    l.addi  r22,r0,0x0
37
    l.addi  r23,r0,0x0
38
    l.addi  r24,r0,0x0
39
    l.addi  r25,r0,0x0
40
    l.addi  r26,r0,0x0
41
    l.addi  r27,r0,0x0
42
    l.addi  r28,r0,0x0
43
    l.addi  r29,r0,0x0
44
    l.addi  r30,r0,0x0
45
    l.addi  r31,r0,0x0
46 2 rfajardo
 
47 47 rfajardo
/*
48
    l.movhi r3,hi(MC_BASE_ADDR)
49
    l.ori   r3,r3,MC_BA_MASK
50
    l.addi  r5,r0,0x00
51
    l.sw    0(r3),r5
52
*/
53
    l.movhi r3,hi(_start)
54
    l.ori   r3,r3,lo(_start)
55
    l.jr    r3
56
    l.nop
57 2 rfajardo
 
58 47 rfajardo
    .section .text
59 2 rfajardo
 
60
_start:
61
 
62
.if IC | DC
63 47 rfajardo
    /* Flush IC and/or DC */
64
    l.addi  r10,r0,0
65
    l.addi  r11,r0,0
66
    l.addi  r12,r0,0
67 2 rfajardo
.if IC
68 47 rfajardo
    l.addi  r11,r0,IC_SIZE
69 2 rfajardo
.endif
70
.if DC
71 47 rfajardo
    l.addi    r12,r0,DC_SIZE
72 2 rfajardo
.endif
73 47 rfajardo
    l.sfleu    r12,r11
74
    l.bf    loop
75
    l.nop
76
    l.add    r11,r0,r12
77 2 rfajardo
loop:
78
.if IC
79 47 rfajardo
    l.mtspr r0,r10,SPR_ICBIR
80 2 rfajardo
.endif
81
.if DC
82 47 rfajardo
    l.mtspr r0,r10,SPR_DCBIR
83 2 rfajardo
.endif
84 47 rfajardo
    l.sfne  r10,r11
85
    l.bf    loop
86
    l.addi  r10,r10,16
87 2 rfajardo
 
88 47 rfajardo
    /* Enable IC and/or DC */
89
    l.addi  r10,r0,(SPR_SR_SM)
90 2 rfajardo
.if IC
91 47 rfajardo
    l.ori    r10,r10,(SPR_SR_ICE)
92 2 rfajardo
.endif
93
.if DC
94 47 rfajardo
    l.ori    r10,r10,(SPR_SR_DCE)
95 2 rfajardo
.endif
96 47 rfajardo
    l.mtspr r0,r10,SPR_SR
97
    l.nop
98
    l.nop
99
    l.nop
100
    l.nop
101
    l.nop
102 2 rfajardo
.endif
103
 
104 47 rfajardo
/* Set stack pointer */
105
    l.movhi r1,hi(_stack)
106
    l.ori   r1,r1,lo(_stack)
107 2 rfajardo
 
108 47 rfajardo
/* Jump to main */
109
    l.movhi r2,hi(reset)
110
    l.ori   r2,r2,lo(reset)
111
    l.jr    r2
112
    l.nop
113 2 rfajardo
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.