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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [freertos-6.1.1/] [Demo/] [lwIP_MCF5235_GCC/] [system/] [mcf5xxx.S] - Blame information for rev 612

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

Line No. Rev Author Line
1 583 jeremybenn
/*
2
 * Lowest level routines for all ColdFire processors. Based on the
3
 * MCF523x examples from Freescale.
4
 *
5
 * Freescale explicitly grants the redistribution and modification
6
 * of these source files. The complete licensing information is
7
 * available in the file LICENSE_FREESCALE.TXT.
8
 *
9
 * Modifications Copyright (c) 2006 Christian Walter 
10
 *
11
 * File: $Id: mcf5xxx.S 2 2011-07-17 20:13:17Z filepang@gmail.com $
12
 */
13
 
14
  .global asm_set_ipl
15
  .global _asm_set_ipl
16
  .global mcf5xxx_wr_cacr
17
  .global _mcf5xxx_wr_cacr
18
  .global mcf5xxx_wr_acr0
19
  .global _mcf5xxx_wr_acr0
20
  .global mcf5xxx_wr_acr1
21
  .global _mcf5xxx_wr_acr1
22
  .global mcf5xxx_wr_acr2
23
  .global _mcf5xxx_wr_acr2
24
  .global mcf5xxx_wr_acr3
25
  .global _mcf5xxx_wr_acr3
26
  .global mcf5xxx_wr_other_sp
27
  .global _mcf5xxx_wr_other_sp
28
  .global mcf5xxx_wr_other_a7
29
  .global _mcf5xxx_wr_other_a7
30
  .global mcf5xxx_wr_vbr
31
  .global _mcf5xxx_wr_vbr
32
  .global mcf5xxx_wr_macsr
33
  .global _mcf5xxx_wr_macsr
34
  .global mcf5xxx_wr_mask
35
  .global _mcf5xxx_wr_mask
36
  .global mcf5xxx_wr_acc0
37
  .global _mcf5xxx_wr_acc0
38
  .global mcf5xxx_wr_accext01
39
  .global _mcf5xxx_wr_accext01
40
  .global mcf5xxx_wr_accext23
41
  .global _mcf5xxx_wr_accext23
42
  .global mcf5xxx_wr_acc1
43
  .global _mcf5xxx_wr_acc1
44
  .global mcf5xxx_wr_acc2
45
  .global _mcf5xxx_wr_acc2
46
  .global mcf5xxx_wr_acc3
47
  .global _mcf5xxx_wr_acc3
48
  .global mcf5xxx_wr_sr
49
  .global _mcf5xxx_wr_sr
50
  .global mcf5xxx_wr_rambar0
51
  .global _mcf5xxx_wr_rambar0
52
  .global mcf5xxx_wr_rambar1
53
  .global _mcf5xxx_wr_rambar1
54
  .global mcf5xxx_wr_mbar
55
  .global _mcf5xxx_wr_mbar
56
  .global mcf5xxx_wr_mbar0
57
  .global _mcf5xxx_wr_mbar0
58
  .global mcf5xxx_wr_mbar1
59
  .global _mcf5xxx_wr_mbar1
60
 
61
  .text
62
 
63
/********************************************************************/
64
/*
65
 * This routines changes the IPL to the value passed into the routine.
66
 * It also returns the old IPL value back.
67
 * Calling convention from C:
68
 *   old_ipl = asm_set_ipl(new_ipl);
69
 * For the Diab Data C compiler, it passes return value thru D0.
70
 * Note that only the least significant three bits of the passed
71
 * value are used.
72
 */
73
 
74
asm_set_ipl:
75
_asm_set_ipl:
76
  link  a6,#-8
77
  movem.l d6-d7,(sp)
78
 
79
  move.w  sr,d7   /* current sr  */
80
 
81
  move.l  d7,d0   /* prepare return value  */
82
  andi.l  #0x0700,d0  /* mask out IPL  */
83
  lsr.l #8,d0   /* IPL   */
84
 
85
  move.l  8(a6),d6  /* get argument  */
86
  andi.l  #0x07,d6    /* least significant three bits  */
87
  lsl.l #8,d6   /* move over to make mask  */
88
 
89
  andi.l  #0x0000F8FF,d7  /* zero out current IPL  */
90
  or.l  d6,d7     /* place new IPL in sr   */
91
  move.w  d7,sr
92
 
93
  movem.l (sp),d6-d7
94
  lea   8(sp),sp
95
  unlk  a6
96
  rts
97
 
98
/********************************************************************/
99
/*
100
 * These routines write to the special purpose registers in the ColdFire
101
 * core.  Since these registers are write-only in the supervisor model,
102
 * no corresponding read routines exist.
103
 */
104
 
105
mcf5xxx_wr_cacr:
106
_mcf5xxx_wr_cacr:
107
    move.l  4(sp),d0
108
    .long   0x4e7b0002      /* movec d0,cacr   */
109
    nop
110
    rts
111
 
112
mcf5xxx_wr_acr0:
113
_mcf5xxx_wr_acr0:
114
    move.l  4(sp),d0
115
    .long   0x4e7b0004      /* movec d0,ACR0  */
116
    nop
117
    rts
118
 
119
mcf5xxx_wr_acr1:
120
_mcf5xxx_wr_acr1:
121
    move.l  4(sp),d0
122
    .long   0x4e7b0005      /* movec d0,ACR1  */
123
    nop
124
    rts
125
 
126
mcf5xxx_wr_acr2:
127
_mcf5xxx_wr_acr2:
128
    move.l  4(sp),d0
129
    .long   0x4e7b0006      /* movec d0,ACR2  */
130
    nop
131
    rts
132
 
133
mcf5xxx_wr_acr3:
134
_mcf5xxx_wr_acr3:
135
    move.l  4(sp),d0
136
    .long   0x4e7b0007      /* movec d0,ACR3  */
137
    nop
138
    rts
139
 
140
mcf5xxx_wr_other_sp:
141
_mcf5xxx_wr_other_sp:
142
mcf5xxx_wr_other_a7:
143
_mcf5xxx_wr_other_a7:
144
  move.l  4(sp),d0
145
  .long 0x4e7b0800    /* movec d0,OTHER_A7 */
146
  nop
147
  rts
148
 
149
mcf5xxx_wr_vbr:
150
_mcf5xxx_wr_vbr:
151
  move.l  4(sp),d0
152
  .long 0x4e7b0801    /* movec d0,VBR */
153
  nop
154
  rts
155
 
156
mcf5xxx_wr_macsr:
157
_mcf5xxx_wr_macsr:
158
    move.l  4(sp),d0
159
    .long   0x4e7b0804      /* movec d0,MACSR */
160
    nop
161
    rts
162
 
163
mcf5xxx_wr_mask:
164
_mcf5xxx_wr_mask:
165
    move.l  4(sp),d0
166
    .long   0x4e7b0805      /* movec d0,MASK  */
167
    nop
168
    rts
169
 
170
mcf5xxx_wr_acc0:
171
_mcf5xxx_wr_acc0:
172
    move.l  4(sp),d0
173
    .long   0x4e7b0806      /* movec d0,ACC0  */
174
    nop
175
    rts
176
 
177
mcf5xxx_wr_accext01:
178
_mcf5xxx_wr_accext01:
179
    move.l  4(sp),d0
180
    .long   0x4e7b0807      /* movec d0,ACCEXT01  */
181
    nop
182
    rts
183
 
184
mcf5xxx_wr_accext23:
185
_mcf5xxx_wr_accext23:
186
    move.l  4(sp),d0
187
    .long   0x4e7b0808      /* movec d0,ACCEXT23  */
188
    nop
189
    rts
190
 
191
mcf5xxx_wr_acc1:
192
_mcf5xxx_wr_acc1:
193
    move.l  4(sp),d0
194
    .long   0x4e7b0809      /* movec d0,ACC1  */
195
    nop
196
    rts
197
 
198
mcf5xxx_wr_acc2:
199
_mcf5xxx_wr_acc2:
200
    move.l  4(sp),d0
201
    .long   0x4e7b080A      /* movec d0,ACC2  */
202
    nop
203
    rts
204
 
205
mcf5xxx_wr_acc3:
206
_mcf5xxx_wr_acc3:
207
    move.l  4(sp),d0
208
    .long   0x4e7b080B      /* movec d0,ACC3  */
209
    nop
210
    rts
211
 
212
mcf5xxx_wr_sr:
213
_mcf5xxx_wr_sr:
214
  move.l  4(sp),d0
215
  move.w  d0,SR
216
  rts
217
 
218
mcf5xxx_wr_rambar0:
219
_mcf5xxx_wr_rambar0:
220
    move.l  4(sp),d0
221
    .long   0x4e7b0C04      /* movec d0,RAMBAR0 */
222
    nop
223
    rts
224
 
225
mcf5xxx_wr_rambar1:
226
_mcf5xxx_wr_rambar1:
227
    move.l  4(sp),d0
228
    .long   0x4e7b0C05      /* movec d0,RAMBAR1 */
229
    nop
230
    rts
231
 
232
mcf5xxx_wr_mbar:
233
_mcf5xxx_wr_mbar:
234
mcf5xxx_wr_mbar0:
235
_mcf5xxx_wr_mbar0:
236
    move.l  4(sp),d0
237
    .long   0x4e7b0C0F      /* movec d0,MBAR0 */
238
    nop
239
    rts
240
 
241
mcf5xxx_wr_mbar1:
242
_mcf5xxx_wr_mbar1:
243
    move.l  4(sp),d0
244
    .long   0x4e7b0C0E      /* movec d0,MBAR1 */
245
    nop
246
    rts
247
 
248
  .end
249
/********************************************************************/

powered by: WebSVN 2.1.0

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