1 |
27 |
unneback |
#ifndef CYGONCE_HAL_VAR_ARCH_H
|
2 |
|
|
#define CYGONCE_HAL_VAR_ARCH_H
|
3 |
|
|
//==========================================================================
|
4 |
|
|
//
|
5 |
|
|
// var_arch.h
|
6 |
|
|
//
|
7 |
|
|
// Architecture specific abstractions
|
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): hmt, nickg
|
46 |
|
|
// Contributors: nickg
|
47 |
|
|
// Date: 2001-05-24
|
48 |
|
|
// Purpose: Define architecture abstractions
|
49 |
|
|
// Description: This file contains any extra or modified definitions for
|
50 |
|
|
// this variant of the architecture.
|
51 |
|
|
// Usage: #include <cyg/hal/var_arch.h>
|
52 |
|
|
//
|
53 |
|
|
//####DESCRIPTIONEND####
|
54 |
|
|
//
|
55 |
|
|
//==========================================================================
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
// -------------------------------------------------------------------------
|
59 |
|
|
// Although the VR4100 is really a 64 bit CPU, we have defined
|
60 |
|
|
// target_register_t elsewhere to be 32-bits because we only support
|
61 |
|
|
// 32-bit mode. Registers will still be sent to GDB as 64-bit, but that's
|
62 |
|
|
// not relevant for CYG_HAL_GDB_REG.
|
63 |
|
|
|
64 |
|
|
#define CYG_HAL_GDB_REG CYG_WORD32
|
65 |
|
|
|
66 |
|
|
//--------------------------------------------------------------------------
|
67 |
|
|
// Now defines for all the system controller registers
|
68 |
|
|
//
|
69 |
|
|
// These all exist at base 0x1000_0000 in physical memory.
|
70 |
|
|
|
71 |
|
|
#define MIPS_KSEG0_BASE (0x80000000u)
|
72 |
|
|
#define MIPS_KSEG1_BASE (0xA0000000u)
|
73 |
|
|
|
74 |
|
|
#define UPD985XX_SYSTEM_BASE (0x10000000u)
|
75 |
|
|
|
76 |
|
|
#define MIPS_IO_BASE (MIPS_KSEG1_BASE + UPD985XX_SYSTEM_BASE)
|
77 |
|
|
|
78 |
|
|
#define UPD985XX_SYSCTL_OFF (0x0000u)
|
79 |
|
|
#define UPD985XX_SYSUSB_OFF (0x1000u)
|
80 |
|
|
#define UPD985XX_SYSETH_OFF (0x2000u)
|
81 |
|
|
|
82 |
|
|
#define UPD985XX_SYSCTL_REG( n ) ((volatile unsigned int *)\
|
83 |
|
|
(MIPS_IO_BASE + UPD985XX_SYSCTL_OFF + (unsigned)(n)))
|
84 |
|
|
#define UPD985XX_SYSUSB_REG( n ) ((volatile unsigned int *)\
|
85 |
|
|
(MIPS_IO_BASE + UPD985XX_SYSUSB_OFF + (unsigned)(n)))
|
86 |
|
|
#define UPD985XX_SYSETH_REG( n ) ((volatile unsigned int *)\
|
87 |
|
|
(MIPS_IO_BASE + UPD985XX_SYSETH_OFF + (unsigned)(n)))
|
88 |
|
|
|
89 |
|
|
// This for the few that we need in assembly
|
90 |
|
|
#define UPD985XX_SYSCTL_ADDR( n ) (0xb0000000 + (n))
|
91 |
|
|
|
92 |
|
|
// (the noise at the end of these lines is the default value)
|
93 |
|
|
#define S_GMR UPD985XX_SYSCTL_REG( 0x00) // General Mode Register 00000000H
|
94 |
|
|
#define S_GSR UPD985XX_SYSCTL_REG( 0x04) // General Status Register unknown
|
95 |
|
|
#define S_ISR UPD985XX_SYSCTL_REG( 0x08) // Interrupt Status Register 00000000H
|
96 |
|
|
#define S_IMR UPD985XX_SYSCTL_REG( 0x0C) // Interrupt Mask Register 00000000H
|
97 |
|
|
#define S_NSR UPD985XX_SYSCTL_REG( 0x10) // NMI Status Register 00000000H
|
98 |
|
|
#define S_NMR UPD985XX_SYSCTL_REG( 0x14) // NMI Mask Register 00000000H
|
99 |
|
|
#define S_VER UPD985XX_SYSCTL_REG( 0x18) // Version Register 00000301H
|
100 |
|
|
// N/A UPD985XX_SYSCTL_REG( 0x1C) reserved 00000000H
|
101 |
|
|
#define S_GIOER UPD985XX_SYSCTL_REG( 0x20) // GPIO Output Enable Register 00000000H
|
102 |
|
|
#define S_GOPR UPD985XX_SYSCTL_REG( 0x24) // GPIO Output (Write) Register 00000000H
|
103 |
|
|
#define S_GIPR UPD985XX_SYSCTL_REG( 0x28) // GPIO Input (Read) Register 00000000H
|
104 |
|
|
// N/A UPD985XX_SYSCTL_REG( 0x2C) // Reserved unknown
|
105 |
|
|
#define S_WRCR UPD985XX_SYSCTL_REG( 0x30) // Warm Reset Control Register 00000000H
|
106 |
|
|
#define S_WRSR UPD985XX_SYSCTL_REG( 0x34) // Warm Reset Status Register 00000000H
|
107 |
|
|
#define S_PWCR UPD985XX_SYSCTL_REG( 0x38) // Power Control Register 00000000H
|
108 |
|
|
#define S_PWSR UPD985XX_SYSCTL_REG( 0x3C) // Power Control Status Register 00000000H
|
109 |
|
|
// N/A UPD985XX_SYSCTL_REG( 0x40) Reserved unknown
|
110 |
|
|
#define ITCNTR UPD985XX_SYSCTL_REG( 0x4C) // IBUS Timeout Timer Control Register 00000000H
|
111 |
|
|
#define ITSETR UPD985XX_SYSCTL_REG( 0x50) // IBUS Timeout Timer Set Register 80000000H
|
112 |
|
|
// N/A UPD985XX_SYSCTL_REG( 0x54) Reserved unknown
|
113 |
|
|
// UPD985XX_SYSCTL_REG( 0x7F)
|
114 |
|
|
#define UARTRBR UPD985XX_SYSCTL_REG( 0x80) // UART, Receiver Buffer Register [DLAB=0,READ] unknown
|
115 |
|
|
#define UARTTHR UPD985XX_SYSCTL_REG( 0x80) // UART, Transmitter Holding Register [DLAB=0,WRITE] unknown
|
116 |
|
|
#define UARTDLL UPD985XX_SYSCTL_REG( 0x80) // UART, Divisor Latch LSB Register [DLAB=1] unknown
|
117 |
|
|
#define UARTIER UPD985XX_SYSCTL_REG( 0x84) // UART, Interrupt Enable Register [DLAB=0] unknown
|
118 |
|
|
#define UARTDLM UPD985XX_SYSCTL_REG( 0x84) // UART, Divisor Latch MSB Register [DLAB=1] unknown
|
119 |
|
|
#define UARTIIR UPD985XX_SYSCTL_REG( 0x88) // UART, Interrupt ID Register [READ] unknown
|
120 |
|
|
// The uPD985xx devices do not support UART FIFOs.
|
121 |
|
|
#define UARTFCR UPD985XX_SYSCTL_REG( 0x88) // UART, FIFO control Register [WRITE]
|
122 |
|
|
#define UARTLCR UPD985XX_SYSCTL_REG( 0x8C) // UART, Line control Register unknown
|
123 |
|
|
#define UARTMCR UPD985XX_SYSCTL_REG( 0x90) // UART, Modem Control Register unknown
|
124 |
|
|
#define UARTLSR UPD985XX_SYSCTL_REG( 0x94) // UART, Line status Register unknown
|
125 |
|
|
#define UARTMSR UPD985XX_SYSCTL_REG( 0x98) // UART, Modem Status Register unknown
|
126 |
|
|
#define UARTSCR UPD985XX_SYSCTL_REG( 0x9C) // UART, Scratch Register unknown
|
127 |
|
|
#define DSUCNTR UPD985XX_SYSCTL_REG( 0xA0) // DSU Control Register 00000000H
|
128 |
|
|
#define DSUSETR UPD985XX_SYSCTL_REG( 0xA4) // DSU Dead Time Set Register 80000000H
|
129 |
|
|
#define DSUCLRR UPD985XX_SYSCTL_REG( 0xA8) // DSU Clear Register 00000000H
|
130 |
|
|
#define DSUTIMR UPD985XX_SYSCTL_REG( 0xAC) // DSU Elapsed Time Register 00000000H
|
131 |
|
|
#define TMMR UPD985XX_SYSCTL_REG( 0xB0) // Timer Mode Register 00000000H
|
132 |
|
|
#define TM0CSR UPD985XX_SYSCTL_REG( 0xB4) // Timer CH0 Count Set Register 00000000H
|
133 |
|
|
#define TM1CSR UPD985XX_SYSCTL_REG( 0xB8) // Timer CH1 Count Set Register 00000000H
|
134 |
|
|
#define TM0CCR UPD985XX_SYSCTL_REG( 0xBC) // Timer CH0 Current Count Register FFFFFFFFH
|
135 |
|
|
#define TM1CCR UPD985XX_SYSCTL_REG( 0xC0) // Timer CH1 Current Count Register FFFFFFFFH
|
136 |
|
|
// N/A UPD985XX_SYSCTL_REG( 0xC4) Reserved unknown
|
137 |
|
|
// UPD985XX_SYSCTL_REG( 0xCF)
|
138 |
|
|
#define ECCR UPD985XX_SYSCTL_REG( 0xD0) // EEPROM Command Control Register 00000000H
|
139 |
|
|
#define ERDR UPD985XX_SYSCTL_REG( 0xD4) // EEPROM Read Data Register 80000000H
|
140 |
|
|
#define MACAR1 UPD985XX_SYSCTL_REG( 0xD8) // MAC Address Register 1 00000000H
|
141 |
|
|
#define MACAR2 UPD985XX_SYSCTL_REG( 0xDC) // MAC Address Register 2 00000000H
|
142 |
|
|
#define MACAR3 UPD985XX_SYSCTL_REG( 0xE0) // MAC Address Register 3 00000000H
|
143 |
|
|
// N/A UPD985XX_SYSCTL_REG( 0xE4) Reserved unknown
|
144 |
|
|
// UPD985XX_SYSCTL_REG( 0xFF)
|
145 |
|
|
#define RMMDR UPD985XX_SYSCTL_REG(0x100) // Boot ROM Mode Register 00000000H
|
146 |
|
|
#define RMATR UPD985XX_SYSCTL_REG(0x104) // Boot ROM Access Timing Register 00000000H
|
147 |
|
|
#define SDMDR UPD985XX_SYSCTL_REG(0x108) // SDRAM Mode Register 00000330H
|
148 |
|
|
#define SDTSR UPD985XX_SYSCTL_REG(0x10C) // SDRAM Type Selection Register 00000000H
|
149 |
|
|
#define SDPTR UPD985XX_SYSCTL_REG(0x110) // SDRAM Precharge Timing Register 00000142H
|
150 |
|
|
// N/A UPD985XX_SYSCTL_REG(0x114) ---- ---- Reserved unknown
|
151 |
|
|
// UPD985XX_SYSCTL_REG(0x11B)
|
152 |
|
|
#define SDRMR UPD985XX_SYSCTL_REG(0x11C) // SDRAM Refresh Mode Register 00000200H
|
153 |
|
|
#define SDRCR UPD985XX_SYSCTL_REG(0x120) // SDRAM Refresh Timer Count Register 00000200H
|
154 |
|
|
#define MBCR UPD985XX_SYSCTL_REG(0x124) // Memory Bus Control Register 00000000H
|
155 |
|
|
#define MESR UPD985XX_SYSCTL_REG(0x128) // Memory Error Status Register 00000000H
|
156 |
|
|
#define MEAR UPD985XX_SYSCTL_REG(0x12C) // Memory Error Address Register 00000000H
|
157 |
|
|
|
158 |
|
|
// The few that we need from assembly
|
159 |
|
|
#define S_ISR_ADR UPD985XX_SYSCTL_ADDR( 0x08) // Interrupt Status Register 00000000H
|
160 |
|
|
#define S_IMR_ADR UPD985XX_SYSCTL_ADDR( 0x0C) // Interrupt Mask Register 00000000H
|
161 |
|
|
|
162 |
|
|
#define RMMDR_ADR UPD985XX_SYSCTL_ADDR(0x100) // Boot ROM Mode Register 00000000H
|
163 |
|
|
#define RMATR_ADR UPD985XX_SYSCTL_ADDR(0x104) // Boot ROM Access Timing Register 00000000H
|
164 |
|
|
#define SDMDR_ADR UPD985XX_SYSCTL_ADDR(0x108) // SDRAM Mode Register 00000330H
|
165 |
|
|
#define SDTSR_ADR UPD985XX_SYSCTL_ADDR(0x10C) // SDRAM Type Selection Register 00000000H
|
166 |
|
|
#define SDPTR_ADR UPD985XX_SYSCTL_ADDR(0x110) // SDRAM Precharge Timing Register 00000142H
|
167 |
|
|
|
168 |
|
|
#define SDRMR_ADR UPD985XX_SYSCTL_ADDR(0x11C) // SDRAM Refresh Mode Register 00000200H
|
169 |
|
|
#define SDRCR_ADR UPD985XX_SYSCTL_ADDR(0x120) // SDRAM Refresh Timer Count Register 00000200H
|
170 |
|
|
#define MBCR_ADR UPD985XX_SYSCTL_ADDR(0x124) // Memory Bus Control Register 00000000H
|
171 |
|
|
#define MESR_ADR UPD985XX_SYSCTL_ADDR(0x128) // Memory Error Status Register 00000000H
|
172 |
|
|
#define MEAR_ADR UPD985XX_SYSCTL_ADDR(0x12C) // Memory Error Address Register 00000000H
|
173 |
|
|
|
174 |
|
|
// ---------------------------------------------------------------------------
|
175 |
|
|
// Contents of all these glorious registers:
|
176 |
|
|
|
177 |
|
|
// --------- general ---------
|
178 |
|
|
// S_GMR General Mode Register 00000000H
|
179 |
|
|
#define S_GMR_CRST 1 // Cold Reset
|
180 |
|
|
#define S_GMR_IAEN 2 // IBUS Arbiter Enable
|
181 |
|
|
#define S_GMR_MPFD 4 // Memory-to-CPU Prefetch FIFO disable
|
182 |
|
|
#define S_GMR_UCSEL 8 // UART Source Clock Selection (0 = CPU, 1 = ext)
|
183 |
|
|
#define S_GMR_HSWP (1<<8) // HIF Block Data swap function disable
|
184 |
|
|
#define S_GMR_MSWP (1<<9) // MIF Block Data swap function disable
|
185 |
|
|
|
186 |
|
|
// S_GSR General Status Register
|
187 |
|
|
#define S_GSR_ENDCEN 1
|
188 |
|
|
#define S_GSR_CCLKSEL 2
|
189 |
|
|
|
190 |
|
|
// S_ISR Interrupt Status Register 00000000H
|
191 |
|
|
#define S_ISR_TM0IS (1<<0) // TIMER CH0 interrupt.
|
192 |
|
|
#define S_ISR_TM1IS (1<<1) // TIMER CH1 interrupt.
|
193 |
|
|
#define S_ISR_UARTIS (1<<2) // UART interrupt.
|
194 |
|
|
#define S_ISR_EXTIS (1<<3) // External Interrupt.
|
195 |
|
|
#define S_ISR_WUIS (1<<4) // Wakeup Interrupt.
|
196 |
|
|
|
197 |
|
|
// S_IMR Interrupt Mask Register 00000000H
|
198 |
|
|
// see S_ISR; write a 1 to unmask, 0 to mask.
|
199 |
|
|
|
200 |
|
|
// S_NSR NMI Status Register 00000000H
|
201 |
|
|
// S_NMR NMI Mask Register 00000000H
|
202 |
|
|
|
203 |
|
|
// S_VER Version Register 00000301H
|
204 |
|
|
|
205 |
|
|
// --------- GPIO ---------
|
206 |
|
|
// S_GIOER GPIO Output Enable Register 00000000H
|
207 |
|
|
// S_GOPR GPIO Output (Write) Register 00000000H
|
208 |
|
|
// S_GIPR GPIO Input (Read) Register 00000000H
|
209 |
|
|
// 16-bit regsiters that do the utterly obvious thing.
|
210 |
|
|
|
211 |
|
|
// --------- reset ---------
|
212 |
|
|
// S_WRCR Warm Reset Control Register 00000000H
|
213 |
|
|
#define S_WRCR_USBWR (1<<0) // Warm Reset request for USB Controller
|
214 |
|
|
#define S_WRCR_MACWR (1<<1) // Warm Reset request for Ethernet Controller
|
215 |
|
|
#define S_WRCR_UARTWR (1<<4) // Warm Reset request for UART
|
216 |
|
|
|
217 |
|
|
// S_WRSR Warm Reset Status Register 00000000H
|
218 |
|
|
// See S_WRCR; 1 <=> Ready, 0 <=> performing warm reset.
|
219 |
|
|
|
220 |
|
|
// --------- power control of USB/ETH peripherals ---------
|
221 |
|
|
// S_PWCR Power Control Register 00000000H
|
222 |
|
|
// S_PWSR Power Control Status Register 00000000H
|
223 |
|
|
|
224 |
|
|
// --------- bus timouts ---------
|
225 |
|
|
// ITCNTR IBUS Timeout Timer Control Register 00000000H
|
226 |
|
|
// ITSETR IBUS Timeout Timer Set Register 80000000H
|
227 |
|
|
|
228 |
|
|
// --------- UART ---------
|
229 |
|
|
// UARTRBR UART, Receiver Buffer Register [DLAB=0,READ]
|
230 |
|
|
// UARTTHR UART, Transmitter Holding Register [DLAB=0,WRITE]
|
231 |
|
|
// UARTDLL UART, Divisor Latch LSB Register [DLAB=1]
|
232 |
|
|
// The external (18.432MHz) clock is not present. See S_GMR_UCSEL.
|
233 |
|
|
// See also UARTDLM below. So we use the internal 50MHz clock.
|
234 |
|
|
|
235 |
|
|
//#define UARTCLOCK (18432000)
|
236 |
|
|
#define UARTCLOCK (50 * 1000 * 1000)
|
237 |
|
|
#define UARTDLL_VAL( _baud_ ) ((UARTCLOCK / 16) / (_baud_) )
|
238 |
|
|
|
239 |
|
|
// UARTIER UART, Interrupt Enable Register [DLAB=0]
|
240 |
|
|
#define UARTIER_ERBFI (1<<0) // UART Receive data Buffer Full Interrupt
|
241 |
|
|
#define UARTIER_ERBEI (1<<1) // UART Transmitter Buffer empty Interrupt
|
242 |
|
|
#define UARTIER_ERBLI (1<<2) // UART Line status Interrupts
|
243 |
|
|
#define UARTIER_ERBMI (1<<3) // UART Modem status Interrupts
|
244 |
|
|
|
245 |
|
|
// UARTDLM UART, Divisor Latch MSB Register [DLAB=1]
|
246 |
|
|
#define UARTDLM_ANY_BAUD (0)
|
247 |
|
|
#define UARTDLM_VAL( _baud_ ) (UARTDLL_VAL( _baud_ ) >> 8)
|
248 |
|
|
|
249 |
|
|
// UARTIIR UART, Interrupt ID Register [READ]
|
250 |
|
|
#define UARTIIR_INTPENDL (1<<0) // No Pending interrupts
|
251 |
|
|
|
252 |
|
|
// mask to give one of:
|
253 |
|
|
#define UARTIIR_UIID_MASK (7<<1) // Indicates the priority level of pending interrupt.
|
254 |
|
|
|
255 |
|
|
#define UARTIIR_RXERROR (3<<1) // Receiver Line Error
|
256 |
|
|
#define UARTIIR_RXD_AVAIL (2<<1) // Received data available
|
257 |
|
|
#define UARTIIR_CHAR_TO (6<<1) // Character timeout
|
258 |
|
|
#define UARTIIR_TX_EMPTY (1<<1) // Transmitter Register Empty
|
259 |
|
|
#define UARTIIR_MODEM (0<<1) // Modem Status: CTS_L, DSR_L or DCD_L
|
260 |
|
|
|
261 |
|
|
// UARTFCR UART, FIFO control Register [WRITE]
|
262 |
|
|
// ...is not supported. But nontheless it appears necessary to write it.
|
263 |
|
|
#define UARTFCR_16550_MODE (6) // and clear the FIFOs.
|
264 |
|
|
|
265 |
|
|
// UARTLCR UART, Line control Register
|
266 |
|
|
// Word length
|
267 |
|
|
#define UARTLCR_8 (0x03)
|
268 |
|
|
#define UARTLCR_7 (0x02)
|
269 |
|
|
// Stop bits
|
270 |
|
|
#define UARTLCR_STB1 (0x00)
|
271 |
|
|
#define UARTLCR_STB2 (0x04)
|
272 |
|
|
// Parity
|
273 |
|
|
#define UARTLCR_NOP (0x00)
|
274 |
|
|
#define UARTLCR_EP (0x18)
|
275 |
|
|
#define UARTLCR_OP (0x08)
|
276 |
|
|
|
277 |
|
|
// Just predefine the pattern for 8-N-1...
|
278 |
|
|
#define UARTLCR_8N1 (0x03)
|
279 |
|
|
|
280 |
|
|
// Divisor latch access bit; or this with one of the above.
|
281 |
|
|
#define UARTLCR_DLAB (0x80)
|
282 |
|
|
|
283 |
|
|
// UARTMCR UART, Modem Control Register
|
284 |
|
|
#define UARTMCR_DTR (1<<0) // Data Terminal Ready.
|
285 |
|
|
#define UARTMCR_RTS (1<<1) // Request To Send.
|
286 |
|
|
|
287 |
|
|
// UARTLSR UART, Line status Register
|
288 |
|
|
#define UARTLSR_DR (1<<0) // Receive-Data Ready.
|
289 |
|
|
#define UARTLSR_OE (1<<1) // Receive-Data Overrun Error.
|
290 |
|
|
#define UARTLSR_PE (1<<2) // Receive-Data Parity Error.
|
291 |
|
|
#define UARTLSR_FE (1<<3) // Receive-Data Framing Error.
|
292 |
|
|
#define UARTLSR_BI (1<<4) // Break Interrupt.
|
293 |
|
|
#define UARTLSR_THRE (1<<5) // Transmitter Holding Register Empty.
|
294 |
|
|
#define UARTLSR_TEMT (1<<6) // Transmitter Empty.
|
295 |
|
|
#define UARTLSR_RFERR (1<<7) // Receiver FIFO Error.
|
296 |
|
|
|
297 |
|
|
// UARTMSR UART, Modem Status Register
|
298 |
|
|
#define UARTMSR_DCTS (1<<0) // Delta Clear To Send.
|
299 |
|
|
#define UARTMSR_DDSR (1<<1) // Delta Data Set Ready.
|
300 |
|
|
#define UARTMSR_TERI (1<<2) // Trailing Edge Ring Indicato
|
301 |
|
|
#define UARTMSR_DDCD (1<<3) // Delta Data Carrier Detect.
|
302 |
|
|
#define UARTMSR_CTS (1<<4) // Clear To Send.
|
303 |
|
|
#define UARTMSR_DSR (1<<5) // Data Set Ready.
|
304 |
|
|
#define UARTMSR_RI (1<<6) // Ring Indicator.
|
305 |
|
|
#define UARTMSR_DCD (1<<7) // Data Carrier Detect.
|
306 |
|
|
|
307 |
|
|
// UARTSCR UART, Scratch Register unknown
|
308 |
|
|
|
309 |
|
|
|
310 |
|
|
// --------- watchdog aka dead man's switch ---------
|
311 |
|
|
// DSUCNTR DSU Control Register 00000000H
|
312 |
|
|
// DSUSETR DSU Dead Time Set Register 80000000H
|
313 |
|
|
// DSUCLRR DSU Clear Register 00000000H
|
314 |
|
|
// DSUTIMR DSU Elapsed Time Register 00000000H
|
315 |
|
|
|
316 |
|
|
// --------- additional timers ---------
|
317 |
|
|
// TMMR Timer Mode Register 00000000H
|
318 |
|
|
// TM0CSR Timer CH0 Count Set Register 00000000H
|
319 |
|
|
// TM1CSR Timer CH1 Count Set Register 00000000H
|
320 |
|
|
// TM0CCR Timer CH0 Current Count Register FFFFFFFFH
|
321 |
|
|
// TM1CCR Timer CH1 Current Count Register FFFFFFFFH
|
322 |
|
|
|
323 |
|
|
// --------- serial eeprom ---------
|
324 |
|
|
// ECCR EEPROM Command Control Register 00000000H
|
325 |
|
|
// ERDR EEPROM Read Data Register 80000000H
|
326 |
|
|
// MACAR1 MAC Address Register 1 00000000H
|
327 |
|
|
// MACAR2 MAC Address Register 2 00000000H
|
328 |
|
|
// MACAR3 MAC Address Register 3 00000000H
|
329 |
|
|
|
330 |
|
|
// --------- memory control ---------
|
331 |
|
|
// RMMDR Boot ROM Mode Register 00000000H
|
332 |
|
|
// RMATR Boot ROM Access Timing Register 00000000H
|
333 |
|
|
#define RMMDR_FLASH_WRITE_ENABLE (0x100)
|
334 |
|
|
|
335 |
|
|
#define RMMDR_28F640 (0)
|
336 |
|
|
#define RMMDR_28F320 (0)
|
337 |
|
|
#define RMMDR_29LV160_120 (3) // sic. from customer doc
|
338 |
|
|
#define RMMDR_29LV160_90 (3) // even though "3" is a reserved value
|
339 |
|
|
#define RMMDR_29LV160_70 (3) // maybe it means "1".
|
340 |
|
|
|
341 |
|
|
#define RMATR_28F640 (5)
|
342 |
|
|
#define RMATR_28F320 (4)
|
343 |
|
|
#define RMATR_29LV160_120 (5)
|
344 |
|
|
#define RMATR_29LV160_90 (4)
|
345 |
|
|
#define RMATR_29LV160_70 (3)
|
346 |
|
|
|
347 |
|
|
// SDMDR SDRAM Mode Register 00000330H
|
348 |
|
|
// SDTSR SDRAM Type Selection Register 00000000H
|
349 |
|
|
// SDPTR SDRAM Precharge Timing Register 00000142H
|
350 |
|
|
// SDRMR SDRAM Refresh Mode Register 00000200H
|
351 |
|
|
// SDRCR SDRAM Refresh Timer Count Register 00000200H
|
352 |
|
|
|
353 |
|
|
#if 1
|
354 |
|
|
// initial settings from customer doc.
|
355 |
|
|
#define SDMDR_INIT (0x230) // 230 from the hardware, 330 from doc
|
356 |
|
|
#define SDTSR_INIT (0x180 | 0x20 | 0x1)
|
357 |
|
|
#define SDPTR_INIT (0x111)
|
358 |
|
|
#define SDRMR_INIT (0x600)
|
359 |
|
|
#else
|
360 |
|
|
// optimized setting "don't be used before qualification"
|
361 |
|
|
#define SDMDR_INIT (0x120)
|
362 |
|
|
#define SDTSR_INIT (0x180 | 0x20 | 0x1)
|
363 |
|
|
#define SDPTR_INIT (0x100)
|
364 |
|
|
#define SDRMR_INIT (0x600)
|
365 |
|
|
#endif
|
366 |
|
|
|
367 |
|
|
// These are used for decoding SEGV types.
|
368 |
|
|
// MBCR Memory Bus Control Register 00000000H
|
369 |
|
|
// MESR Memory Error Status Register 00000000H
|
370 |
|
|
// MEAR Memory Error Address Register 00000000H
|
371 |
|
|
|
372 |
|
|
// --------------------------------------------------------------------------
|
373 |
|
|
#endif // CYGONCE_HAL_VAR_ARCH_H
|
374 |
|
|
// End of var_arch.h
|