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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [mn10300/] [stb/] [v2_0/] [include/] [platform.inc] - Blame information for rev 773

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

Line No. Rev Author Line
1 27 unneback
#ifndef CYGONCE_HAL_PLATFORM_INC
2
#define CYGONCE_HAL_PLATFORM_INC
3
##=============================================================================
4
##
5
##      platform.inc
6
##
7
##      STB board assembler header file
8
##
9
##=============================================================================
10
#####ECOSGPLCOPYRIGHTBEGIN####
11
## -------------------------------------------
12
## This file is part of eCos, the Embedded Configurable Operating System.
13
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
14
##
15
## eCos is free software; you can redistribute it and/or modify it under
16
## the terms of the GNU General Public License as published by the Free
17
## Software Foundation; either version 2 or (at your option) any later version.
18
##
19
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
21
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22
## for more details.
23
##
24
## You should have received a copy of the GNU General Public License along
25
## with eCos; if not, write to the Free Software Foundation, Inc.,
26
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27
##
28
## As a special exception, if other files instantiate templates or use macros
29
## or inline functions from this file, or you compile this file and link it
30
## with other works to produce a work based on this file, this file does not
31
## by itself cause the resulting work to be covered by the GNU General Public
32
## License. However the source code for this file must still be made available
33
## in accordance with section (3) of the GNU General Public License.
34
##
35
## This exception does not invalidate any other reasons why a work based on
36
## this file might be covered by the GNU General Public License.
37
##
38
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39
## at http://sources.redhat.com/ecos/ecos-license/
40
## -------------------------------------------
41
#####ECOSGPLCOPYRIGHTEND####
42
##=============================================================================
43
#######DESCRIPTIONBEGIN####
44
##
45
## Author(s):   nickg
46
## Contributors:        nickg
47
## Date:        1999-04-06
48
## Purpose:     STB board definitions.
49
## Description: This file contains various definitions and macros that are
50
##              useful for writing assembly code for the STB board.
51
## Usage:
52
##              #include 
53
##              ...
54
##
55
##
56
######DESCRIPTIONEND####
57
##
58
##=============================================================================
59
 
60
#include 
61
 
62
 
63
#------------------------------------------------------------------------------
64
# Diagnostics macros.
65
 
66
#define CYG_HAL_DIAG_LED_ADDRESS1 0x83f90000
67
#define CYG_HAL_DIAG_LED_ADDRESS2 0x81f90000
68
#define CYG_HAL_DIAG_LED_ADDRESS3 hal_diag_led_state
69
 
70
        .macro  hal_diag_data
71
        .globl  hal_diag_led_state
72
hal_diag_led_state:     .long   0xffffffff
73
hal_diag_intr_count:    .long   0
74
        .endm
75
 
76
        .macro  hal_diag_init
77
        mov     0xFFFFFFFF,d0
78
        mov     CYG_HAL_DIAG_LED_ADDRESS1,a0
79
        mov     d0,(a0)
80
        mov     CYG_HAL_DIAG_LED_ADDRESS2,a0
81
        mov     d0,(a0)
82
        mov     CYG_HAL_DIAG_LED_ADDRESS3,a0
83
        mov     d0,(a0)
84
 
85
        mov     0xd4002000,a0   # SR control regs
86
        mov     0xd4003000,a1   # timer control regs
87
        mov     99,d0
88
        movbu   d0,(16,a1)
89
        mov     0x80,d0
90
        movbu   d0,(a1)
91
        clr     d0
92
        movbu   d0,(4,a0)
93
        mov     0xc084,d0
94
        movhu   d0,(a0)
95
 
96
        jmp     1f
97
 
98
hal_diag_digits:
99
        .byte   0x81    # 0
100
        .byte   0xf3    # 1
101
        .byte   0x49    # 2
102
        .byte   0x61    # 3
103
        .byte   0x33    # 4
104
        .byte   0x25    # 5
105
        .byte   0x05    # 6
106
        .byte   0xf1    # 7
107
        .byte   0x01    # 8
108
        .byte   0x21    # 9
109
        .byte   0x11    # A
110
        .byte   0x07    # B
111
        .byte   0x8d    # C
112
        .byte   0x43    # D
113
        .byte   0x0d    # E
114
        .byte   0x1d    # F
115
 
116
hal_diag_hex_digits:
117
        .ascii  "0123456789ABCDEF"
118
1:
119
 
120
#       hal_diag_led 0
121
#       hal_diag_led 1
122
#       hal_diag_led 2
123
#       hal_diag_led 3
124
#       hal_diag_led 4
125
#       hal_diag_led 5
126
#       hal_diag_led 6
127
#       hal_diag_led 7
128
#       hal_diag_led 8
129
#       hal_diag_led 9
130
#       hal_diag_led 0xa
131
#       hal_diag_led 0xb
132
#       hal_diag_led 0xc
133
#       hal_diag_led 0xd
134
#       hal_diag_led 0xe
135
#       hal_diag_led 0xf
136
 
137
        .endm
138
 
139
        .macro  hal_diag_excpt_start
140
        mov     CYG_HAL_DIAG_LED_ADDRESS3,a0
141
        mov     (a0),d0
142
        xor     0x01000000,d0
143
        mov     d0,(a0)
144
        mov     CYG_HAL_DIAG_LED_ADDRESS1,a0
145
        mov     d0,(a0)
146
        mov     CYG_HAL_DIAG_LED_ADDRESS2,a0
147
        mov     d0,(a0)
148
        .endm
149
 
150
        .macro  hal_diag_intr_start
151
        mov     (hal_diag_intr_count),d1
152
        inc     d1
153
        cmp     100,d1
154
        bne     x\@
155
        clr     d1
156
        mov     CYG_HAL_DIAG_LED_ADDRESS3,a0
157
        mov     (a0),d0
158
        xor     0x00010000,d0
159
        mov     d0,(a0)
160
        mov     CYG_HAL_DIAG_LED_ADDRESS1,a0
161
        mov     d0,(a0)
162
        mov     CYG_HAL_DIAG_LED_ADDRESS2,a0
163
        mov     d0,(a0)
164
x\@:
165
        mov     d1,(hal_diag_intr_count)
166
        .endm
167
 
168
#if 0
169
        .macro  hal_diag_restore
170
        mov     (hal_diag_intr_count),d0
171
        and     0x1000,d0
172
        beq     x\@
173
        mov     CYG_HAL_DIAG_LED_ADDRESS3,a0
174
        mov     (a0),d0
175
        and     0xfffeffff,d0
176
        mov     d0,(a0)
177
        mov     CYG_HAL_DIAG_LED_ADDRESS1,a0
178
        mov     d0,(a0)
179
        mov     CYG_HAL_DIAG_LED_ADDRESS2,a0
180
        mov     d0,(a0)
181
x\@:
182
        .endm
183
#else
184
        .macro  hal_diag_restore
185
        .endm
186
#endif
187
 
188
#if 0
189
        .macro  hal_diag_led val
190
        movm    [d2,d3,a2],(sp)
191
        mov     hal_diag_digits,a2
192
        mov     \val,d2
193
        and     0xf,d2
194
        add     d2,a2
195
        movbu   (a2),d3
196
        mov     CYG_HAL_DIAG_LED_ADDRESS3,a2
197
        mov     (a2),d2
198
        asl     8,d2
199
        or      d3,d2
200
        mov     d2,(a2)
201
        mov     CYG_HAL_DIAG_LED_ADDRESS1,a2
202
        mov     d2,(a2)
203
        mov     CYG_HAL_DIAG_LED_ADDRESS2,a2
204
        mov     d2,(a2)
205
 
206
#       mov     \val,d3
207
#       and     0xf,d3
208
#       mov     hal_diag_hex_digits,a2
209
#       add     d3,a2
210
#       movbu   (a2),d3
211
#       mov     0xd4002000,a2
212
#x2:    movhu   (0,a2),d2
213
#       and     0x20,d2
214
#       bne     2b
215
#       movbu   d3,(8,a2)
216
 
217
        mov     200000,d2
218
1:
219
        add     -1,d2
220
        cmp     0,d2
221
        bne     1b
222
 
223
        movm    (sp),[d2,d3,a2]
224
        .endm
225
#else
226
        .macro  hal_diag_led val
227
        .endm
228
#endif
229
 
230
#define CYGPKG_HAL_MN10300_DIAG_DEFINED
231
 
232
 
233
#------------------------------------------------------------------------------
234
#endif // ifndef CYGONCE_HAL_PLATFORM_INC
235
# end of platform.inc

powered by: WebSVN 2.1.0

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