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

Subversion Repositories openrisc

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

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
##      Hitachi HS7729PCI 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 Red Hat, 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 version.
18
##
19
## eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20
## WARRANTY; without even the implied warranty of MERCHANTABILITY or
21
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
22
## for more details.
23
##
24
## You should have received a copy of the GNU General Public License along
25
## with eCos; if not, write to the Free Software Foundation, Inc.,
26
## 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
27
##
28
## As a special exception, if other files instantiate templates or use macros
29
## or inline functions from this file, or you compile this file and link it
30
## with other works to produce a work based on this file, this file does not
31
## by itself cause the resulting work to be covered by the GNU General Public
32
## License. However the source code for this file must still be made available
33
## in accordance with section (3) of the GNU General Public License.
34
##
35
## This exception does not invalidate any other reasons why a work based on
36
## this file might be covered by the GNU General Public License.
37
##
38
## Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39
## at http://sources.redhat.com/ecos/ecos-license/
40
## -------------------------------------------
41
#####ECOSGPLCOPYRIGHTEND####
42
##=============================================================================
43
#######DESCRIPTIONBEGIN####
44
##
45
## Author(s):   jskov
46
## Contributors:jskov, gthomas
47
## Date:        2001-05-25
48
## Purpose:     Hitachi HS7729PCI platform startup
49
## Description: This file contains various definitions and macros that are
50
##              useful for writing assembly code for the Hitachi HS7729PCI
51
##              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
        .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
86
        .word   CYGARC_REG_BCR1,  0x0008
87
        .word   CYGARC_REG_BCR2,  0x2be0
88
        .word   CYGARC_REG_BCR3,  0x0000
89
        .word   CYGARC_REG_WCR1,  0x0c30
90
        .word   CYGARC_REG_WCR2,  0x6cdf
91
        .word   CYGARC_REG_MCR,   0x0014
92
        # Settings from bootrom delivered with board
93
        .word   CYGARC_REG_DCR,   0x0000
94
        .word   CYGARC_REG_PCR,   0x0000
95
        .word   CYGARC_REG_RTCOR, 0xa580
96
        .word   CYGARC_REG_RFCR,  0xa400
97
        .word   CYGARC_REG_RTCNT, 0xa500
98
        .word   CYGARC_REG_RTCSR, 0xa508
99
        .word   0
100
 
101
2:
102
        mov.l    $SDMR,r1               // Turns on SDRAM controller
103
        mov.l    $SDMR_val,r2
104
        mov.b    r2,@r1
105
 
106
        mov.l    $SDRAM,r1
107
        mov.l    $SDRAM_val,r2
108
        mov.l    r2,@r1
109
 
110
        mova     Post_settings_table,r0
111
        mov      r0,r3
112
1:      mov.l    @r3+,r0                // Address (or zero)
113
        cmp/eq   #0,r0
114
        bt       4f
115
        mov.l    @r3+,r1                // data
116
        bra      1b
117
         mov.w    r1,@r0                // delay slot
118
 
119
        .align  4
120
$SDMR:  .long   0xffffe880
121
$SDMR_val:
122
        .long   0
123
$SDRAM:
124
        .long   CYGARC_REG_SD0001_SDRAM
125
$SDRAM_val:
126
        .long   CYGARC_REG_SD0001_SDRAM_INIT
127
 
128
Post_settings_table:
129
        # PFC settings from bootrom
130
        .long   CYGARC_REG_PACR,0x0000
131
        .long   CYGARC_REG_PBCR,0x0000
132
        .long   CYGARC_REG_PCCR,0x5555
133
        .long   CYGARC_REG_PDCR,0x0055
134
        .long   CYGARC_REG_PECR,0xaa8a
135
        .long   CYGARC_REG_PFCR,0xaaaa
136
        .long   CYGARC_REG_PGCR,0xaaaa
137
        .long   CYGARC_REG_PHCR,0x6a00
138
        .long   CYGARC_REG_PJCR,0x0000
139
        .long   CYGARC_REG_PKCR,0x0000
140
        .long   CYGARC_REG_PLCR,0xaaaa
141
        .long   CYGARC_REG_SCPCR,0x0000
142
        .long   0
143
4:
144
        .endm
145
 
146
#------------------------------------------------------------------------------
147
# Monitor initialization.
148
 
149
#ifndef CYGPKG_HAL_SH_MON_DEFINED
150
 
151
#if     !defined(CYG_HAL_STARTUP_RAM) ||                \
152
        (       defined(CYG_HAL_STARTUP_RAM) &&         \
153
                !defined(CYGSEM_HAL_USE_ROM_MONITOR))
154
 
155
        # If we are not starting up from RAM, or we are starting in
156
        # RAM and NOT using a ROM monitor, initialize the VSR table.
157
 
158
        .macro  hal_mon_init
159
        mov.l   $hal_vsr_table,r3
160
        # Write exception vectors
161
        mov.l   $cyg_hal_default_exception_vsr,r4
162
        mov     #CYGNUM_HAL_VSR_EXCEPTION_COUNT,r5
163
1:      mov.l   r4,@r3
164
        add     #4,r3
165
        dt      r5
166
        bf      1b
167
        # Write interrupt vector
168
        mov.l   $cyg_hal_default_interrupt_vsr,r4
169
        mov.l   $hal_vsr_table,r3
170
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
171
        mov.l   r4,@r3
172
        bra     2f
173
         nop
174
        .align  2
175
 
176
        SYM_PTR_REF(cyg_hal_default_exception_vsr)
177
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
178
        SYM_PTR_REF(hal_vsr_table)
179
2:
180
        .endm
181
 
182
#elif defined(CYG_HAL_STARTUP_RAM) && defined(CYGSEM_HAL_USE_ROM_MONITOR)
183
 
184
        # Initialize the VSR table entries
185
        # We only take control of the interrupt vector,
186
        # the rest are left to the ROM for now...
187
 
188
        .macro  hal_mon_init
189
        # Write interrupt vector
190
        mov.l   $hal_vsr_table,r3
191
        mov.l   $cyg_hal_default_interrupt_vsr,r4
192
        add     #CYGNUM_HAL_VECTOR_INTERRUPT*4,r3
193
        mov.l   r4,@r3
194
        bra     2f
195
         nop
196
        .align  2
197
 
198
        SYM_PTR_REF(cyg_hal_default_interrupt_vsr)
199
        SYM_PTR_REF(hal_vsr_table)
200
2:
201
        .endm
202
 
203
#else
204
 
205
        .macro  hal_mon_init
206
        .endm
207
 
208
#endif
209
 
210
 
211
#define CYGPKG_HAL_SH_MON_DEFINED
212
 
213
#endif // CYGPKG_HAL_SH_MON_DEFINED
214
 
215
#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.