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

Subversion Repositories minsoc

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

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

powered by: WebSVN 2.1.0

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