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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [sh/] [se77x9/] [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 SE77x9 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, gthomas
46
## Date:        2001-06-12
47
## Purpose:     Hitachi SE77x9 platform startup
48
## Description: This file contains various definitions and macros that are
49
##              useful for writing assembly code for the Hitachi SE77x9
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
        .macro  hal_hardware_init
69
#ifndef CYG_HAL_STARTUP_RAM
70
        // Set up the Bus State Controller
71
        mova     BSC_settings_table,r0
72
        mov      r0,r3
73
1:      mov.w    @r3+,r0                // Address (or zero)
74
        cmp/eq   #0,r0
75
        bt       2f
76
        mov.w    @r3+,r1                // data
77
        bra      1b
78
         mov.w    r1,@r0                // delay slot
79
 
80
        .align  2
81
BSC_settings_table:
82
        .word   CYGARC_REG_WTCSR, 0xA502
83
        .word   CYGARC_REG_WTCNT, 0x5A00
84
        .word   CYGARC_REG_FRQCR, CYGARC_REG_FRQCR_INIT
85
        # Settings from Hitachi docs for SE7709A
86
#ifdef CYGNUM_HAL_SH_SE77X9_SDRAM_SETUP
87
        .word   CYGARC_REG_BCR1,  0x0008
88
#else
89
        .word   CYGARC_REG_BCR1,  0x0810
90
#endif
91
        .word   CYGARC_REG_BCR2,  0x2ef0
92
        .word   CYGARC_REG_BCR3,  0x0000
93
        .word   CYGARC_REG_WCR1,  0x0c30
94
#ifdef CYGNUM_HAL_SH_SE77X9_SDRAM_SETUP
95
        .word   CYGARC_REG_WCR2,  0x7ddb
96
        .word   CYGARC_REG_MCR,   0x002c
97
#else
98
        .word   CYGARC_REG_WCR2,  0x5d5a
99
        .word   CYGARC_REG_MCR,   0x0055
100
#endif
101
        .word   CYGARC_REG_DCR,   0x0000
102
        .word   CYGARC_REG_PCR,   0x0000
103
#ifdef CYGNUM_HAL_SH_SE77X9_SDRAM_SETUP
104
        .word   CYGARC_REG_RTCOR, 0xa580
105
#else
106
        .word   CYGARC_REG_RTCOR, 0xa54e
107
#endif
108
        .word   CYGARC_REG_RFCR,  0xa400
109
        .word   CYGARC_REG_RTCNT, 0xa500
110
        .word   CYGARC_REG_RTCSR, 0xa508
111
        .word   0
112
 
113
2:
114
#ifdef CYGNUM_HAL_SH_SE77X9_SDRAM_SETUP
115
        mov.l    $SDMR,r1               // Turns on SDRAM controller
116
        mov.l    $SDMR_val,r2
117
        mov.b    r2,@r1
118
#endif
119
        mova     Post_settings_table,r0
120
        mov      r0,r3
121
1:      mov.l    @r3+,r0                // Address (or zero)
122
        cmp/eq   #0,r0
123
        bt       4f
124
        mov.l    @r3+,r1                // data
125
        bra      1b
126
         mov.w    r1,@r0                // delay slot
127
 
128
        .align  4
129
#ifdef CYGNUM_HAL_SH_SE77X9_SDRAM_SETUP
130
$SDMR:  .long   0xffffe088
131
$SDMR_val:
132
        .long   0
133
#endif
134
 
135
Post_settings_table:
136
        .long   CYGNUM_HAL_SH_SE77X9_LEDS_BASE,0x5555   // leds
137
        .long   0
138
4:
139
#endif // CYG_HAL_STARTUP_RAM
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.