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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-3.0/] [packages/] [hal/] [powerpc/] [cme555/] [current/] [src/] [cme555.S] - Blame information for rev 786

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 786 skrzyp
##=============================================================================
2
##
3
##      cme555.S
4
##
5
##      CME555 board hardware setup
6
##
7
##=============================================================================
8
## ####ECOSGPLCOPYRIGHTBEGIN####
9
## -------------------------------------------
10
## This file is part of eCos, the Embedded Configurable Operating System.
11
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
12
##
13
## eCos is free software; you can redistribute it and/or modify it under
14
## the terms of the GNU General Public License as published by the Free
15
## Software Foundation; either version 2 or (at your option) any later
16
## version.
17
##
18
## eCos is distributed in the hope that it will be useful, but WITHOUT
19
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20
## FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
21
## for more details.
22
##
23
## You should have received a copy of the GNU General Public License
24
## along with eCos; if not, write to the Free Software Foundation, Inc.,
25
## 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
26
##
27
## As a special exception, if other files instantiate templates or use
28
## macros or inline functions from this file, or you compile this file
29
## and link it with other works to produce a work based on this file,
30
## this file does not by itself cause the resulting work to be covered by
31
## the GNU General Public License. However the source code for this file
32
## must still be made available in accordance with section (3) of the GNU
33
## General Public License v2.
34
##
35
## This exception does not invalidate any other reasons why a work based
36
## on this file might be covered by the GNU General Public License.
37
## -------------------------------------------
38
## ####ECOSGPLCOPYRIGHTEND####
39
##=============================================================================
40
#######DESCRIPTIONBEGIN####
41
##
42
## Author(s):   Bob Koninckx
43
## Contributors:Bob Koninckx
44
## Date:        2001-12-15
45
## Purpose:     cme555 board hardware setup
46
## Description: This file contains any code needed to initialize the
47
##              hardware on a cme555 mpc555 board.
48
##
49
######DESCRIPTIONEND####
50
##
51
##=============================================================================
52
 
53
#include 
54
 
55
#include 
56
#include 
57
 
58
#------------------------------------------------------------------------------
59
 
60
        .globl  hal_hardware_init
61
hal_hardware_init:
62
 
63
#if defined(CYGPKG_HAL_POWERPC_CME555) && defined(CYGPKG_HAL_POWERPC_MPC5xx)
64
        lwi     r3, CYGARC_REG_IMM_BASE             # Base address of control registers
65
 
66
        // Configure external interrupt pins as General purpose I/O. They do not
67
        // have pull-up resistors on the CME555. Add to that that IRQ0 triggers
68
        // a non-maskable reset of the board ... This one gave me nightmares ...
69
        lwi     r4, 0x00000800
70
        stw     r4, (CYGARC_REG_IMM_SIUMCR-CYGARC_REG_IMM_BASE)(r3)
71
        lwi     r4, 0xff88
72
        stw     r4, (CYGARC_REG_IMM_SYPCR-CYGARC_REG_IMM_BASE)(r3)
73
 
74
        // Memory map
75
        // CS0 configuration
76
        // Base address 0x400000, no burst support, 32 bit wide data port
77
        // Valid addresses till 0x43FFFF, no wait states
78
        lwi     r4, 0x00400003
79
        stw     r4, (CYGARC_REG_IMM_BR0-CYGARC_REG_IMM_BASE)(r3)
80
        lwi     r4, 0xfff80002
81
        stw     r4, (CYGARC_REG_IMM_OR0-CYGARC_REG_IMM_BASE)(r3)
82
 
83
        // CS1 configuration
84
        // Base address 0x800000, no burst support, 32 bit wide data port
85
        // Valid adresses till 0x87FFFF, three wait states for access time 70ns
86
        lwi     r4, 0x00800003
87
        stw     r4, (CYGARC_REG_IMM_BR1-CYGARC_REG_IMM_BASE)(r3)
88
        lwi     r4, 0xfff80032
89
        stw     r4, (CYGARC_REG_IMM_OR1-CYGARC_REG_IMM_BASE)(r3)
90
 
91
        // CS2 configuration
92
        // Base address 0xc00000, no burst support, 32 bit wide data port
93
        // Valid adresses till 0xc7FFFF, maximum wait states
94
        lwi     r4, 0x00c00003
95
        stw     r4, (CYGARC_REG_IMM_BR2-CYGARC_REG_IMM_BASE)(r3)
96
        lwi     r4, 0xfff800f2
97
        stw     r4, (CYGARC_REG_IMM_OR2-CYGARC_REG_IMM_BASE)(r3)
98
 
99
        // CS3 configuration
100
        // works for keypad/LCD
101
        // maximum wait states
102
        lwi     r4, 0x01000403
103
        stw     r4, (CYGARC_REG_IMM_BR3-CYGARC_REG_IMM_BASE)(r3)
104
        lwi     r4, 0xfffe0ff1
105
        stw     r4, (CYGARC_REG_IMM_OR3-CYGARC_REG_IMM_BASE)(r3)
106
 
107
        // And  some other configuration registers
108
#if defined(CYGSEM_HAL_POWERPC_MPC5XX_IFLASH_DUAL_MAP)
109
        lwi     r4, 1
110
#else
111
        lwi     r4, 0
112
#endif
113
        stw     r4, (CYGARC_REG_IMM_DMBR-CYGARC_REG_IMM_BASE)(r3)
114
        lwi     r4, 0
115
        stw     r4, (CYGARC_REG_IMM_DMOR-CYGARC_REG_IMM_BASE)(r3)
116
 
117
        // Limb mode enable, TMBCLK = BUS/16, RTCCLK = Crystal / 16
118
        // generate 40 MHz bus clock
119
        lwi     r4, 0x3010000
120
        stw     r4, (CYGARC_REG_IMM_SCCR-CYGARC_REG_IMM_BASE)(r3)
121
        lwi     r4, 0x900000
122
        stw     r4, (CYGARC_REG_IMM_PLPRCR-CYGARC_REG_IMM_BASE)(r3)
123
 
124
        // Enable the time base and set the freeze flag
125
        lwi     r4, 0x03
126
        sth     r4, (CYGARC_REG_IMM_TBSCR-CYGARC_REG_IMM_BASE)(r3)
127
 
128
        // Unlock the RTC register set
129
        lwi     r4, 0x55ccaa33
130
        stw     r4, (CYGARC_REG_IMM_RTCSCK-CYGARC_REG_IMM_BASE)(r3)
131
        // RTC is clocked by 4MHz crystal, set the freeze flag
132
        lwi     r4, 0x12
133
        sth     r4, (CYGARC_REG_IMM_RTCSC-CYGARC_REG_IMM_BASE)(r3)
134
        // Set the freeze flag for the Periodic interrupt timer
135
        lwi     r4, 0x02
136
        sth     r4, (CYGARC_REG_IMM_PISCR-CYGARC_REG_IMM_BASE)(r3)
137
 
138
        lwi     r4, 0x00
139
        lwi     r5, (CYGARC_REG_IMM_DPTMCR-CYGARC_REG_IMM_BASE)
140
        sthx    r4, r3, r5
141
 
142
        lwi     r4, 0xffa0
143
        lwi     r5, (CYGARC_REG_IMM_RAMBAR-CYGARC_REG_IMM_BASE)
144
        sthx    r4, r3, r5
145
 
146
        lwi     r4, 0x00
147
        lwi     r5, (CYGARC_REG_IMM_PORTQS-CYGARC_REG_IMM_BASE)
148
        sthx    r4, r3, r5
149
 
150
        lwi     r4, 0x00
151
        lwi     r5, (CYGARC_REG_IMM_PQSPAR_DDRQST-CYGARC_REG_IMM_BASE)
152
        sthx    r4, r3, r5
153
        lwi     r5, (CYGARC_REG_IMM_MPIOSMDR-CYGARC_REG_IMM_BASE)
154
        sthx    r4, r3, r5
155
        lwi     r5, (CYGARC_REG_IMM_MPIOSMDDR-CYGARC_REG_IMM_BASE)
156
        sthx    r4, r3, r5
157
        lwi     r5, (CYGARC_REG_IMM_MIOS1TPCR-CYGARC_REG_IMM_BASE)
158
        sthx    r4, r3, r5
159
        lwi     r5, (CYGARC_REG_IMM_SRAMMCR_A-CYGARC_REG_IMM_BASE)
160
        sthx    r4, r3, r5
161
 
162
        lwi     r4, 0x00000000
163
        lwi     r5, (CYGARC_REG_IMM_SGPIODT1-CYGARC_REG_IMM_BASE)
164
        stwx    r4, r3, r5
165
        lwi     r5, (CYGARC_REG_IMM_SGPIODT2-CYGARC_REG_IMM_BASE)
166
        stwx    r4, r3, r5
167
        lwi     r5, (CYGARC_REG_IMM_SGPIOCR-CYGARC_REG_IMM_BASE)
168
        stwx    r4, r3, r5
169
        lwi     r5, (CYGARC_REG_IMM_EMCR-CYGARC_REG_IMM_BASE)
170
        stwx    r4, r3, r5
171
 
172
        // Enable 32 interrupt priorities on the IMB3 unit
173
        lwi     r4, 0x60000000
174
        lwi     r5, (CYGARC_REG_IMM_UMCR-CYGARC_REG_IMM_BASE)
175
        stwx    r4, r3, r5
176
#endif
177
 
178
        sync
179
        blr
180
 
181
#------------------------------------------------------------------------------
182
# end of cme555.S

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.