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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [sh/] [edk7708/] [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
##      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) 1998, 1999, 2000, 2001, 2002, 2003 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:        2000-02-02
47
## Purpose:     SH/EDK7708 board definitions.
48
## Description: This file contains various definitions and macros that are
49
##              useful for writing assembly code for the SH/EDK7708 board.
50
## Usage:
51
##              #include 
52
##              ...
53
##
54
##
55
######DESCRIPTIONEND####
56
##
57
##=============================================================================
58
 
59
#include 
60
 
61
#include 
62
#include 
63
 
64
#------------------------------------------------------------------------------
65
# Hardware initialization.
66
 
67
        .macro  hal_hardware_init
68
        // Set up the Bus State Controller
69
        mova     BSC_settings_table,r0
70
        mov      r0,r3
71
1:      mov.w    @r3+,r0                // Address (or zero)
72
        cmp/eq   #0,r0
73
        bt       2f
74
        mov.w    @r3+,r1                // data
75
        bra      1b
76
        mov.w    r1,@r0                // delay slot
77
 
78
        .align  2
79
BSC_settings_table:
80
        # These are the settings set by the Hitachi ROM Monitor.
81
 
82
        .word   (CYGARC_REG_FRQCR & 0x0000FFFF)
83
        .word   CYGARC_REG_FRQCR_INIT
84
 
85
        # BCR2: Bus size of areas 1-6 to 32 bits
86
        .word   (CYGARC_REG_BCR2 & 0x0000FFFF)
87
        .word   0x3ffc
88
        # BCR1: Areas 2 and 3 are SDRAM
89
        .word   (CYGARC_REG_BCR1 & 0x0000FFFF)
90
        .word   0x080c
91
        # BCR2: Bus size of areas 1-6 to 32 bits [note: second write!]
92
        .word   (CYGARC_REG_BCR2 & 0x0000FFFF)
93
        .word   0x3ffc
94
        # WCR1: 3 wait-state cycles inserted for all areas
95
        .word   (CYGARC_REG_WCR1 & 0x0000FFFF)
96
        .word   0x3fff
97
        # WCR2: extra wait states and full pitch for burst
98
        .word   (CYGARC_REG_WCR2 & 0x0000FFFF)
99
        .word   0xffd7
100
        # MCR: RAS/CAS & burst timing area 2/3
101
        .word   (CYGARC_REG_MCR & 0x0000FFFF)
102
        .word   0x963c
103
        # RTCNT: refresh counter (needs a5 in top byte to accept write)
104
        .word   (CYGARC_REG_RTCNT & 0x0000FFFF)
105
        .word   (0xa500 | 0x0000)
106
        # RTCOR: refresh time constant (needs a5 in top byte to accept write)
107
        .word   (CYGARC_REG_RTCOR & 0x0000FFFF)
108
        .word   (0xa500 | 0x003b)
109
        # RFCR:  refresh count register (needs a4 in top byte to accept write)
110
        .word   (CYGARC_REG_RFCR & 0x0000FFFF)
111
        .word   (0xa400 | 0x0000)
112
        # RTCSR: refresh timer control (needs a5 in top byte to accept write)
113
        .word   (CYGARC_REG_RTCSR & 0x0000FFFF)
114
        .word   (0xa500 | 0x0008)
115
 
116
        # Set SDMR to 0x220
117
        .word    0xd880
118
        .word    0
119
 
120
        # Table end
121
        .word   0
122
 
123
        .align  2
124
2:
125
        .endm
126
 
127
#------------------------------------------------------------------------------
128
# Monitor initialization.
129
 
130
#ifndef CYGPKG_HAL_SH_MON_DEFINED
131
 
132
#if     !defined(CYG_HAL_STARTUP_RAM) ||                \
133
        (       defined(CYG_HAL_STARTUP_RAM) &&         \
134
                !defined(CYGSEM_HAL_USE_ROM_MONITOR))
135
 
136
        # If we are not starting up from RAM, or we are starting in
137
        # RAM and NOT using a ROM monitor, initialize the VSR table.
138
 
139
        .macro  hal_mon_init
140
        mov.l   $hal_vsr_table,r3
141
        # Write exception vectors
142
        mov.l   $cyg_hal_default_exception_vsr,r4
143
        mov     #CYGNUM_HAL_VSR_EXCEPTION_COUNT,r5
144
1:      mov.l   r4,@r3
145
        add     #4,r3
146
        dt      r5
147
        bf      1b
148
        # Write interrupt vector
149
        mov.l   $cyg_hal_default_interrupt_vsr,r4
150
        mov.l   $hal_vsr_table,r3
151
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
152
        mov.l   r4,@r3
153
        bra     2f
154
         nop
155
        .align  2
156
 
157
        SYM_PTR_REF(cyg_hal_default_exception_vsr)
158
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
159
        SYM_PTR_REF(hal_vsr_table)
160
2:
161
        .endm
162
 
163
#elif defined(CYG_HAL_STARTUP_RAM) && defined(CYGSEM_HAL_USE_ROM_MONITOR)
164
 
165
        # Initialize the VSR table entries
166
        # We only take control of the interrupt vector,
167
        # the rest are left to the ROM for now...
168
 
169
        .macro  hal_mon_init
170
        # Write interrupt vector
171
        mov.l   $hal_vsr_table,r3
172
        mov.l   $cyg_hal_default_interrupt_vsr,r4
173
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
174
        mov.l   r4,@r3
175
        bra     2f
176
         nop
177
        .align  2
178
 
179
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
180
        SYM_PTR_REF(hal_vsr_table)
181
2:
182
        .endm
183
 
184
#else
185
 
186
        .macro  hal_mon_init
187
        .endm
188
 
189
#endif
190
 
191
 
192
#define CYGPKG_HAL_SH_MON_DEFINED
193
 
194
#endif // CYGPKG_HAL_SH_MON_DEFINED
195
 
196
#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.