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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [sh/] [edk7708/] [v2_0/] [include/] [platform.inc] - Blame information for rev 249

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
##      SH/EDK7708 board assembler header file
8
##
9
##=============================================================================
10
#####ECOSGPLCOPYRIGHTBEGIN####
11
## -------------------------------------------
12
## This file is part of eCos, the Embedded Configurable Operating System.
13
## Copyright (C) 2003 Bart Veer
14
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15
##
16
## eCos is free software; you can redistribute it and/or modify it under
17
## the terms of the GNU General Public License as published by the Free
18
## Software Foundation; either version 2 or (at your option) any later version.
19
##
20
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
21
## 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 along
26
## with eCos; if not, write to the Free Software Foundation, Inc.,
27
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28
##
29
## As a special exception, if other files instantiate templates or use macros
30
## or inline functions from this file, or you compile this file and link it
31
## with other works to produce a work based on this file, this file does not
32
## by itself cause the resulting work to be covered by the GNU General Public
33
## License. However the source code for this file must still be made available
34
## in accordance with section (3) of the GNU General Public License.
35
##
36
## This exception does not invalidate any other reasons why a work based on
37
## this file might be covered by the GNU General Public License.
38
##
39
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
40
## at http://sources.redhat.com/ecos/ecos-license/
41
## -------------------------------------------
42
#####ECOSGPLCOPYRIGHTEND####
43
##=============================================================================
44
#######DESCRIPTIONBEGIN####
45
##
46
## Author(s):   jskov
47
## Contributors:jskov
48
## Date:        2000-02-02
49
## Purpose:     SH/EDK7708 board definitions.
50
## Description: This file contains various definitions and macros that are
51
##              useful for writing assembly code for the SH/EDK7708 board.
52
## Usage:
53
##              #include 
54
##              ...
55
##
56
##
57
######DESCRIPTIONEND####
58
##
59
##=============================================================================
60
 
61
#include 
62
 
63
#include 
64
#include 
65
 
66
#------------------------------------------------------------------------------
67
# Hardware initialization.
68
 
69
        .macro  hal_hardware_init
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
        # These are the settings set by the Hitachi ROM Monitor.
83
 
84
        .word   (CYGARC_REG_FRQCR & 0x0000FFFF)
85
        .word   CYGARC_REG_FRQCR_INIT
86
 
87
        # BCR2: Bus size of areas 1-6 to 32 bits
88
        .word   (CYGARC_REG_BCR2 & 0x0000FFFF)
89
        .word   0x3ffc
90
        # BCR1: Areas 2 and 3 are SDRAM
91
        .word   (CYGARC_REG_BCR1 & 0x0000FFFF)
92
        .word   0x080c
93
        # BCR2: Bus size of areas 1-6 to 32 bits [note: second write!]
94
        .word   (CYGARC_REG_BCR2 & 0x0000FFFF)
95
        .word   0x3ffc
96
        # WCR1: 3 wait-state cycles inserted for all areas
97
        .word   (CYGARC_REG_WCR1 & 0x0000FFFF)
98
        .word   0x3fff
99
        # WCR2: extra wait states and full pitch for burst
100
        .word   (CYGARC_REG_WCR2 & 0x0000FFFF)
101
        .word   0xffd7
102
        # MCR: RAS/CAS & burst timing area 2/3
103
        .word   (CYGARC_REG_MCR & 0x0000FFFF)
104
        .word   0x963c
105
        # RTCNT: refresh counter (needs a5 in top byte to accept write)
106
        .word   (CYGARC_REG_RTCNT & 0x0000FFFF)
107
        .word   (0xa500 | 0x0000)
108
        # RTCOR: refresh time constant (needs a5 in top byte to accept write)
109
        .word   (CYGARC_REG_RTCOR & 0x0000FFFF)
110
        .word   (0xa500 | 0x003b)
111
        # RFCR:  refresh count register (needs a4 in top byte to accept write)
112
        .word   (CYGARC_REG_RFCR & 0x0000FFFF)
113
        .word   (0xa400 | 0x0000)
114
        # RTCSR: refresh timer control (needs a5 in top byte to accept write)
115
        .word   (CYGARC_REG_RTCSR & 0x0000FFFF)
116
        .word   (0xa500 | 0x0008)
117
 
118
        # Set SDMR to 0x220
119
        .word    0xd880
120
        .word    0
121
 
122
        # Table end
123
        .word   0
124
 
125
        .align  2
126
2:
127
        .endm
128
 
129
#------------------------------------------------------------------------------
130
# Monitor initialization.
131
 
132
#ifndef CYGPKG_HAL_SH_MON_DEFINED
133
 
134
#if     !defined(CYG_HAL_STARTUP_RAM) ||                \
135
        (       defined(CYG_HAL_STARTUP_RAM) &&         \
136
                !defined(CYGSEM_HAL_USE_ROM_MONITOR))
137
 
138
        # If we are not starting up from RAM, or we are starting in
139
        # RAM and NOT using a ROM monitor, initialize the VSR table.
140
 
141
        .macro  hal_mon_init
142
        mov.l   $hal_vsr_table,r3
143
        # Write exception vectors
144
        mov.l   $cyg_hal_default_exception_vsr,r4
145
        mov     #CYGNUM_HAL_VSR_EXCEPTION_COUNT,r5
146
1:      mov.l   r4,@r3
147
        add     #4,r3
148
        dt      r5
149
        bf      1b
150
        # Write interrupt vector
151
        mov.l   $cyg_hal_default_interrupt_vsr,r4
152
        mov.l   $hal_vsr_table,r3
153
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
154
        mov.l   r4,@r3
155
        bra     2f
156
         nop
157
        .align  2
158
 
159
        SYM_PTR_REF(cyg_hal_default_exception_vsr)
160
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
161
        SYM_PTR_REF(hal_vsr_table)
162
2:
163
        .endm
164
 
165
#elif defined(CYG_HAL_STARTUP_RAM) && defined(CYGSEM_HAL_USE_ROM_MONITOR)
166
 
167
        # Initialize the VSR table entries
168
        # We only take control of the interrupt vector,
169
        # the rest are left to the ROM for now...
170
 
171
        .macro  hal_mon_init
172
        # Write interrupt vector
173
        mov.l   $hal_vsr_table,r3
174
        mov.l   $cyg_hal_default_interrupt_vsr,r4
175
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
176
        mov.l   r4,@r3
177
        bra     2f
178
         nop
179
        .align  2
180
 
181
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
182
        SYM_PTR_REF(hal_vsr_table)
183
2:
184
        .endm
185
 
186
#else
187
 
188
        .macro  hal_mon_init
189
        .endm
190
 
191
#endif
192
 
193
 
194
#define CYGPKG_HAL_SH_MON_DEFINED
195
 
196
#endif // CYGPKG_HAL_SH_MON_DEFINED
197
 
198
#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.