# BRCM_VERSION=3
[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 UART_CLK_EN     0x0008
35
36   uint32        pll_control;
37 #define SOFT_RESET      0x00000001
38
39   uint32        IrqMask;
40   uint32        IrqStatus;
41
42   uint32        ExtIrqCfg;
43 #define EI_SENSE_SHFT   0
44 #define EI_STATUS_SHFT  4
45 #define EI_CLEAR_SHFT   8
46 #define EI_MASK_SHFT    12
47 #define EI_INSENS_SHFT  16
48 #define EI_LEVEL_SHFT   20
49 } IntControl;
50
51 #define INTC_BASE     0xfffe0000
52 #define PERF ((volatile IntControl * const) INTC_BASE)
53
54 typedef struct UartChannel {
55   byte          unused0;
56   byte          control;
57 #define BRGEN           0x80    /* Control register bit defs */
58 #define TXEN            0x40
59 #define RXEN            0x20
60 #define TXPARITYEN      0x08
61 #define TXPARITYEVEN    0x04
62 #define RXPARITYEN      0x02
63 #define RXPARITYEVEN    0x01
64   byte          config;
65 #define BITS5SYM        0x00
66 #define BITS6SYM        0x10
67 #define BITS7SYM        0x20
68 #define BITS8SYM        0x30
69 #define XMITBREAK       0x40
70 #define ONESTOP         0x07
71 #define TWOSTOP         0x0f
72
73   byte          fifoctl;
74 #define RSTTXFIFOS      0x80
75 #define RSTRXFIFOS      0x40
76   uint32        baudword;
77
78   byte          txf_levl;
79   byte          rxf_levl;
80   byte          fifocfg;
81   byte          prog_out;
82
83   byte          unused1;
84   byte          DeltaIPEdgeNoSense;
85   byte          DeltaIPConfig_Mask;
86   byte          DeltaIP_SyncIP;
87   uint16        intMask;
88   uint16        intStatus;
89 #define TXUNDERR        0x0002
90 #define TXOVFERR        0x0004
91 #define TXFIFOEMT       0x0020
92 #define RXOVFERR        0x0080
93 #define RXFIFONE        0x0800
94 #define RXFRAMERR       0x1000
95 #define RXPARERR        0x2000
96 #define RXBRK           0x4000
97
98   uint16        unused2;
99   uint16        Data;
100   uint32                unused3;
101   uint32                unused4;
102 } Uart;
103
104 #define UART_BASE     0xfffe0300
105 #define UART ((volatile Uart * const) UART_BASE)
106
107 typedef struct GpioControl {
108   uint16        unused0;
109   byte          unused1;
110   byte          TBusSel;
111
112   uint16        unused2;
113   uint16        GPIODir;
114   byte          unused3;
115   byte          Leds;
116   uint16        GPIOio;
117
118   uint32        UartCtl;
119 } GpioControl;
120
121 #define GPIO_BASE     0xfffe0400
122 #define GPIO ((volatile GpioControl * const) GPIO_BASE)
123
124 #define GPIO_NUM_MAX_BITS_MASK          0x0f
125 #define GPIO_NUM_TO_MASK(X)             (1 << ((X) & GPIO_NUM_MAX_BITS_MASK))
126
127 #if __cplusplus
128 }
129 #endif
130
131 #endif
132