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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [sh/] [cq7708/] [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/CQ7708 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/CQ7708 board definitions.
48
## Description: This file contains various definitions and macros that are
49
##              useful for writing assembly code for the SH/CQ7708 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
 
80
BSC_settings_table:
81
        # These are the settings set by the ROM Monitor.
82
 
83
        .word   (CYGARC_REG_FRQCR & 0x0000FFFF)
84
        .word   CYGARC_REG_FRQCR_INIT
85
 
86
        # BCR1: Areas 3 are SDRAM
87
        .word   (CYGARC_REG_BCR1 & 0x0000FFFF)
88
        .word   0x0010
89
        # BCR2: Bus size of areas 2,4 are 8 bits
90
        .word   (CYGARC_REG_BCR2 & 0x0000FFFF)
91
        .word   0x3ddc
92
        # WCR1: 3 wait-state cycles inserted for all areas
93
        .word   (CYGARC_REG_WCR1 & 0x0000FFFF)
94
        .word   0x3fff
95
        # WCR2: cs0=8wait cs1=0wait cs2=0wait cs3=2wait cs4=4wait */
96
        .word   (CYGARC_REG_WCR2 & 0x0000FFFF)
97
        .word   0x0246
98
        # MCR:  dram setting 10 bit
99
        .word   (CYGARC_REG_MCR & 0x0000FFFF)
100
        .word   0x0074
101
        # RTCSR: refresh timer control
102
        .word   (CYGARC_REG_RTCSR & 0x0000FFFF)
103
        .word   (0xa500 | 0x0010)
104
        # RTCOR: refresh time constant
105
        .word   (CYGARC_REG_RTCOR & 0x0000FFFF)
106
        .word   (0xa500 | 0x003a)
107
 
108
        # Table end
109
        .word   0
110
 
111
        .align  2
112
2:
113
        .endm
114
 
115
#------------------------------------------------------------------------------
116
# Monitor initialization.
117
 
118
#ifndef CYGPKG_HAL_SH_MON_DEFINED
119
 
120
#if     defined(CYG_HAL_STARTUP_ROM) ||                 \
121
        (       defined(CYG_HAL_STARTUP_RAM) &&         \
122
                !defined(CYGSEM_HAL_USE_ROM_MONITOR))
123
 
124
        # If we are starting up from ROM, or we are starting in
125
        # RAM and NOT using a ROM monitor, initialize the VSR table.
126
 
127
        .macro  hal_mon_init
128
        mov.l   $hal_vsr_table,r3
129
        # Write exception vectors
130
        mov.l   $cyg_hal_default_exception_vsr,r4
131
        mov     #CYGNUM_HAL_VSR_EXCEPTION_COUNT,r5
132
1:      mov.l   r4,@r3
133
        add     #4,r3
134
        dt      r5
135
        bf      1b
136
        # Write interrupt vector
137
        mov.l   $cyg_hal_default_interrupt_vsr,r4
138
        mov.l   $hal_vsr_table,r3
139
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
140
        mov.l   r4,@r3
141
        bra     2f
142
         nop
143
        .align  2
144
 
145
        SYM_PTR_REF(cyg_hal_default_exception_vsr)
146
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
147
        SYM_PTR_REF(hal_vsr_table)
148
2:
149
        .endm
150
 
151
#elif defined(CYG_HAL_STARTUP_RAM) && defined(CYGSEM_HAL_USE_ROM_MONITOR)
152
 
153
        # Initialize the VSR table entries
154
        # We only take control of the interrupt vector,
155
        # the rest are left to the ROM for now...
156
 
157
        .macro  hal_mon_init
158
        # Write interrupt vector
159
        mov.l   $hal_vsr_table,r3
160
        mov.l   $cyg_hal_default_interrupt_vsr,r4
161
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
162
        mov.l   r4,@r3
163
        bra     2f
164
         nop
165
        .align  2
166
 
167
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
168
        SYM_PTR_REF(hal_vsr_table)
169
2:
170
        .endm
171
 
172
#else
173
 
174
        .macro  hal_mon_init
175
        .endm
176
 
177
#endif
178
 
179
 
180
#define CYGPKG_HAL_SH_MON_DEFINED
181
 
182
#endif // CYGPKG_HAL_SH_MON_DEFINED
183
 
184
#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.