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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [mn10300/] [stb/] [current/] [include/] [platform.inc] - Blame information for rev 786

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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