added files
[bcm963xx.git] / bcmdrivers / opensource / include / bcm963xx / 6345_map_part.h
1 /*
2 <:copyright-gpl 
3  Copyright 2002 Broadcom Corp. All Rights Reserved. 
4  
5  This program is free software; you can distribute it and/or modify it 
6  under the terms of the GNU General Public License (Version 2) as 
7  published by the Free Software Foundation. 
8  
9  This program is distributed in the hope it will be useful, but WITHOUT 
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
11  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License 
12  for more details. 
13  
14  You should have received a copy of the GNU General Public License along 
15  with this program; if not, write to the Free Software Foundation, Inc., 
16  59 Temple Place - Suite 330, Boston MA 02111-1307, USA. 
17 :>
18 */
19
20 #ifndef __BCM6345_MAP_H
21 #define __BCM6345_MAP_H
22
23 #if __cplusplus
24 extern "C" {
25 #endif
26
27 #include "bcmtypes.h"
28 #include "6345_intr.h"
29
30 typedef struct IntControl {
31   uint32        RevID;
32   uint16        testControl;
33   uint16        blkEnables;
34 #define USB_CLK_EN      0x0100
35 #define EMAC_CLK_EN     0x0080
36 #define UART_CLK_EN     0x0008
37 #define CPU_CLK_EN      0x0001
38
39   uint32        pll_control;
40 #define SOFT_RESET      0x00000001
41
42   uint32        IrqMask;
43   uint32        IrqStatus;
44
45   uint32        ExtIrqCfg;
46 #define EI_SENSE_SHFT   0
47 #define EI_STATUS_SHFT  4
48 #define EI_CLEAR_SHFT   8
49 #define EI_MASK_SHFT    12
50 #define EI_INSENS_SHFT  16
51 #define EI_LEVEL_SHFT   20
52 } IntControl;
53
54 #define INTC_BASE     0xfffe0000
55 #define PERF ((volatile IntControl * const) INTC_BASE)
56
57 #define TIMR_BASE     0xfffe0200    
58 typedef struct Timer {
59   uint16        unused0;
60   byte          TimerMask;
61 #define TIMER0EN        0x01
62 #define TIMER1EN        0x02
63 #define TIMER2EN        0x04
64   byte          TimerInts;
65 #define TIMER0          0x01
66 #define TIMER1          0x02
67 #define TIMER2          0x04
68 #define WATCHDOG        0x08
69   uint32        TimerCtl0;
70   uint32        TimerCtl1;
71   uint32        TimerCtl2;
72 #define TIMERENABLE     0x80000000
73 #define RSTCNTCLR       0x40000000      
74   uint32        TimerCnt0;
75   uint32        TimerCnt1;
76   uint32        TimerCnt2;
77   uint32        WatchDogDefCount;
78
79   /* Write 0xff00 0x00ff to Start timer
80    * Write 0xee00 0x00ee to Stop and re-load default count
81    * Read from this register returns current watch dog count
82    */
83   uint32        WatchDogCtl;
84
85   /* Number of 40-MHz ticks for WD Reset pulse to last */
86   uint32        WDResetCount;
87 } Timer;
88
89 #define TIMER ((volatile Timer * const) TIMR_BASE)
90
91 typedef struct UartChannel {
92   byte          unused0;
93   byte          control;
94 #define BRGEN           0x80    /* Control register bit defs */
95 #define TXEN            0x40
96 #define RXEN            0x20
97 #define TXPARITYEN      0x08
98 #define TXPARITYEVEN    0x04
99 #define RXPARITYEN      0x02
100 #define RXPARITYEVEN    0x01
101   byte          config;
102 #define BITS5SYM        0x00
103 #define BITS6SYM        0x10
104 #define BITS7SYM        0x20
105 #define BITS8SYM        0x30
106 #define XMITBREAK       0x40
107 #define ONESTOP         0x07
108 #define TWOSTOP         0x0f
109
110   byte          fifoctl;
111 #define RSTTXFIFOS      0x80
112 #define RSTRXFIFOS      0x40
113   uint32        baudword;
114
115   byte          txf_levl;
116   byte          rxf_levl;
117   byte          fifocfg;
118   byte          prog_out;
119
120   byte          unused1;
121   byte          DeltaIPEdgeNoSense;
122   byte          DeltaIPConfig_Mask;
123   byte          DeltaIP_SyncIP;
124   uint16        intMask;
125   uint16        intStatus;
126 #define TXUNDERR        0x0002
127 #define TXOVFERR        0x0004
128 #define TXFIFOEMT       0x0020
129 #define RXOVFERR        0x0080
130 #define RXFIFONE        0x0800
131 #define RXFRAMERR       0x1000
132 #define RXPARERR        0x2000
133 #define RXBRK           0x4000
134
135   uint16        unused2;
136   uint16        Data;
137   uint32                unused3;
138   uint32                unused4;
139 } Uart;
140
141 #define UART_BASE     0xfffe0300
142 #define UART ((volatile Uart * const) UART_BASE)
143
144 typedef struct GpioControl {
145   uint16        unused0;
146   byte          unused1;
147   byte          TBusSel;
148
149   uint16        unused2;
150   uint16        GPIODir;
151   byte          unused3;
152   byte          Leds;
153   uint16        GPIOio;
154
155   uint32        UartCtl;
156 } GpioControl;
157
158 #define GPIO_BASE     0xfffe0400
159 #define GPIO ((volatile GpioControl * const) GPIO_BASE)
160
161 #define GPIO_NUM_MAX_BITS_MASK          0x0f
162 #define GPIO_NUM_TO_MASK(X)             (1 << ((X) & GPIO_NUM_MAX_BITS_MASK))
163
164 #if __cplusplus
165 }
166 #endif
167
168 #endif
169