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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [sh/] [se7751/] [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
##      Hitachi SE7751 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):   jskov
45
## Contributors:jskov
46
## Date:        2001-07-09
47
## Purpose:     Hitachi SE7751 platform startup
48
## Description: This file contains various definitions and macros that are
49
##              useful for writing assembly code for the Hitachi SE7751
50
##              board.
51
## Usage:
52
##              #include 
53
##              ...
54
##
55
##
56
######DESCRIPTIONEND####
57
##
58
##=============================================================================
59
 
60
#include 
61
 
62
#include 
63
#include 
64
 
65
#------------------------------------------------------------------------------
66
# Hardware initialization.
67
 
68
#define END   0
69
#define INT8  1
70
#define INT16 2
71
#define INT32 3
72
#define DELAY 4
73
 
74
        .macro  hal_hardware_init
75
        mova     init_table,r0
76
        mov      r0,r3
77
1:      mov.l    @r3+,r0                // Data type
78
        cmp/eq   #END,r0                // End of table
79
        bf       0f
80
        bra      9f
81
         nop
82
0:      cmp/eq   #INT8,r0
83
        bf       2f
84
        // 8 bit data
85
        mov.l    @r3+,r0                // addr
86
        mov.l    @r3+,r1                // data
87
        bra      1b
88
         mov.b   r1,@r0
89
2:      cmp/eq   #INT16,r0
90
        bf       3f
91
        // 16 bit data
92
        mov.l    @r3+,r0                // addr
93
        mov.l    @r3+,r1                // data
94
        bra      1b
95
         mov.w   r1,@r0
96
3:      cmp/eq   #INT32,r0
97
        bf       4f
98
        // 32 bit data
99
        mov.l    @r3+,r0                // addr
100
        mov.l    @r3+,r1                // data
101
        bra      1b
102
         mov.l   r1,@r0
103
4:      cmp/eq   #DELAY,r0
104
        bf       6f
105
        // delay
106
        mov.l    @r3+,r0                // count
107
5:      cmp/eq   #0,r0
108
        bt       1b
109
        bra      5b
110
         add     #-1,r0
111
6:      bra      1b
112
         nop
113
 
114
        .align  2
115
init_table:
116
        .long   INT16, CYGARC_REG_WTCSR, 0xA502
117
        .long   INT16, CYGARC_REG_WTCNT, 0x5A00
118
        .long   INT16, CYGARC_REG_FRQCR, CYGARC_REG_FRQCR_INIT
119
        .long   INT32, CYGARC_REG_BCR1, 0x00080008
120
        .long   INT16, CYGARC_REG_BCR2, 0x2ffc
121
        .long   INT32, CYGARC_REG_WCR1, 0x02770771
122
        .long   INT32, CYGARC_REG_WCR2, 0x7ffe4fe7
123
        .long   INT32, CYGARC_REG_WCR3, 0x01777771
124
        .long   INT16, CYGARC_REG_PCR,   0x0000
125
        .long   INT16, CYGARC_REG_RTCNT, 0xa500
126
        .long   INT16, CYGARC_REG_RTCOR, 0xa506
127
        .long   INT16, CYGARC_REG_RFCR,  0xa400
128
        .long   INT32, CYGARC_REG_MCR,   0x100901b4
129
        .long   INT8, 0xff940088, 0x00  // CS3 area SDRAM mode register
130
        .long   INT16, CYGARC_REG_RTCSR, 0xa508
131
        .long   DELAY, 100
132
        .long   INT32, CYGARC_REG_MCR,   0x500901b4
133
        .long   INT8, 0xff940088, 0x00  // CS3 area SDRAM mode register
134
        .long   INT16, CYGARC_REG_RTCSR, 0xa518
135
        .long   INT32, CYGARC_REG_PCTRA, 0x00000000
136
        .long   INT32, CYGARC_REG_PCTRB, 0x00000000
137
        .long   INT16, CYGARC_REG_GPIOIC, 0x0000
138
        .long   END
139
9:
140
        .endm
141
 
142
#------------------------------------------------------------------------------
143
# Monitor initialization.
144
 
145
#ifndef CYGPKG_HAL_SH_MON_DEFINED
146
 
147
#if     !defined(CYG_HAL_STARTUP_RAM) ||                \
148
        (       defined(CYG_HAL_STARTUP_RAM) &&         \
149
                !defined(CYGSEM_HAL_USE_ROM_MONITOR))
150
 
151
        # If we are not starting up from RAM, or we are starting in
152
        # RAM and NOT using a ROM monitor, initialize the VSR table.
153
 
154
        .macro  hal_mon_init
155
        mov.l   $hal_vsr_table,r3
156
        # Write exception vectors
157
        mov.l   $cyg_hal_default_exception_vsr,r4
158
        mov     #CYGNUM_HAL_VSR_EXCEPTION_COUNT,r5
159
1:      mov.l   r4,@r3
160
        add     #4,r3
161
        dt      r5
162
        bf      1b
163
        # Write interrupt vector
164
        mov.l   $cyg_hal_default_interrupt_vsr,r4
165
        mov.l   $hal_vsr_table,r3
166
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
167
        mov.l   r4,@r3
168
        bra     2f
169
         nop
170
        .align  2
171
 
172
        SYM_PTR_REF(cyg_hal_default_exception_vsr)
173
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
174
        SYM_PTR_REF(hal_vsr_table)
175
2:
176
        .endm
177
 
178
#elif defined(CYG_HAL_STARTUP_RAM) && defined(CYGSEM_HAL_USE_ROM_MONITOR)
179
 
180
        # Initialize the VSR table entries
181
        # We only take control of the interrupt vector,
182
        # the rest are left to the ROM for now...
183
 
184
        .macro  hal_mon_init
185
        # Write interrupt vector
186
        mov.l   $hal_vsr_table,r3
187
        mov.l   $cyg_hal_default_interrupt_vsr,r4
188
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
189
        mov.l   r4,@r3
190
        bra     2f
191
         nop
192
        .align  2
193
 
194
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
195
        SYM_PTR_REF(hal_vsr_table)
196
2:
197
        .endm
198
 
199
#else
200
 
201
        .macro  hal_mon_init
202
        .endm
203
 
204
#endif
205
 
206
 
207
#define CYGPKG_HAL_SH_MON_DEFINED
208
 
209
#endif // CYGPKG_HAL_SH_MON_DEFINED
210
 
211
#endif // CYGONCE_HAL_PLATFORM_INC

powered by: WebSVN 2.1.0

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