diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2007-10-18 22:10:10 -0400 |
---|---|---|
committer | Dale Farnsworth <dale@farnsworth.org> | 2007-10-23 11:23:00 -0400 |
commit | e2734d6c61e0fd2b0f3aeac01e8dcd36c99b1a13 (patch) | |
tree | bcd8fcc0667a1846d19756d90d1ce5618af5d4e7 | |
parent | c4a6a2ab5e99980b10d1eef761cd95f2a19ba46d (diff) |
mv643xx_eth: Move ethernet register definitions into private header
Move the mv643xx's ethernet-related register definitions from
include/linux/mv643xx.h into drivers/net/mv643xx_eth.h, since
they aren't of any use outside the ethernet driver.
Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Acked-by: Tzachi Perelstein <tzachi@marvell.com>
Signed-off-by: Dale Farnsworth <dale@farnsworth.org>
-rw-r--r-- | drivers/net/mv643xx_eth.h | 308 | ||||
-rw-r--r-- | include/linux/mv643xx.h | 302 |
2 files changed, 307 insertions, 303 deletions
diff --git a/drivers/net/mv643xx_eth.h b/drivers/net/mv643xx_eth.h index be669eb23788..20acd2e52456 100644 --- a/drivers/net/mv643xx_eth.h +++ b/drivers/net/mv643xx_eth.h | |||
@@ -7,7 +7,7 @@ | |||
7 | #include <linux/workqueue.h> | 7 | #include <linux/workqueue.h> |
8 | #include <linux/mii.h> | 8 | #include <linux/mii.h> |
9 | 9 | ||
10 | #include <linux/mv643xx.h> | 10 | #include <linux/mv643xx_eth.h> |
11 | 11 | ||
12 | #include <asm/dma-mapping.h> | 12 | #include <asm/dma-mapping.h> |
13 | 13 | ||
@@ -51,6 +51,312 @@ | |||
51 | ETH_VLAN_HLEN + ETH_FCS_LEN) | 51 | ETH_VLAN_HLEN + ETH_FCS_LEN) |
52 | #define ETH_RX_SKB_SIZE (dev->mtu + ETH_WRAPPER_LEN + dma_get_cache_alignment()) | 52 | #define ETH_RX_SKB_SIZE (dev->mtu + ETH_WRAPPER_LEN + dma_get_cache_alignment()) |
53 | 53 | ||
54 | /****************************************/ | ||
55 | /* Ethernet Unit Registers */ | ||
56 | /****************************************/ | ||
57 | |||
58 | #define MV643XX_ETH_PHY_ADDR_REG 0x2000 | ||
59 | #define MV643XX_ETH_SMI_REG 0x2004 | ||
60 | #define MV643XX_ETH_UNIT_DEFAULT_ADDR_REG 0x2008 | ||
61 | #define MV643XX_ETH_UNIT_DEFAULTID_REG 0x200c | ||
62 | #define MV643XX_ETH_UNIT_INTERRUPT_CAUSE_REG 0x2080 | ||
63 | #define MV643XX_ETH_UNIT_INTERRUPT_MASK_REG 0x2084 | ||
64 | #define MV643XX_ETH_UNIT_INTERNAL_USE_REG 0x24fc | ||
65 | #define MV643XX_ETH_UNIT_ERROR_ADDR_REG 0x2094 | ||
66 | #define MV643XX_ETH_BAR_0 0x2200 | ||
67 | #define MV643XX_ETH_BAR_1 0x2208 | ||
68 | #define MV643XX_ETH_BAR_2 0x2210 | ||
69 | #define MV643XX_ETH_BAR_3 0x2218 | ||
70 | #define MV643XX_ETH_BAR_4 0x2220 | ||
71 | #define MV643XX_ETH_BAR_5 0x2228 | ||
72 | #define MV643XX_ETH_SIZE_REG_0 0x2204 | ||
73 | #define MV643XX_ETH_SIZE_REG_1 0x220c | ||
74 | #define MV643XX_ETH_SIZE_REG_2 0x2214 | ||
75 | #define MV643XX_ETH_SIZE_REG_3 0x221c | ||
76 | #define MV643XX_ETH_SIZE_REG_4 0x2224 | ||
77 | #define MV643XX_ETH_SIZE_REG_5 0x222c | ||
78 | #define MV643XX_ETH_HEADERS_RETARGET_BASE_REG 0x2230 | ||
79 | #define MV643XX_ETH_HEADERS_RETARGET_CONTROL_REG 0x2234 | ||
80 | #define MV643XX_ETH_HIGH_ADDR_REMAP_REG_0 0x2280 | ||
81 | #define MV643XX_ETH_HIGH_ADDR_REMAP_REG_1 0x2284 | ||
82 | #define MV643XX_ETH_HIGH_ADDR_REMAP_REG_2 0x2288 | ||
83 | #define MV643XX_ETH_HIGH_ADDR_REMAP_REG_3 0x228c | ||
84 | #define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290 | ||
85 | #define MV643XX_ETH_ACCESS_PROTECTION_REG(port) (0x2294 + (port<<2)) | ||
86 | #define MV643XX_ETH_MIB_COUNTERS_BASE(port) (0x3000 + (port<<7)) | ||
87 | #define MV643XX_ETH_PORT_CONFIG_REG(port) (0x2400 + (port<<10)) | ||
88 | #define MV643XX_ETH_PORT_CONFIG_EXTEND_REG(port) (0x2404 + (port<<10)) | ||
89 | #define MV643XX_ETH_MII_SERIAL_PARAMETRS_REG(port) (0x2408 + (port<<10)) | ||
90 | #define MV643XX_ETH_GMII_SERIAL_PARAMETRS_REG(port) (0x240c + (port<<10)) | ||
91 | #define MV643XX_ETH_VLAN_ETHERTYPE_REG(port) (0x2410 + (port<<10)) | ||
92 | #define MV643XX_ETH_MAC_ADDR_LOW(port) (0x2414 + (port<<10)) | ||
93 | #define MV643XX_ETH_MAC_ADDR_HIGH(port) (0x2418 + (port<<10)) | ||
94 | #define MV643XX_ETH_SDMA_CONFIG_REG(port) (0x241c + (port<<10)) | ||
95 | #define MV643XX_ETH_DSCP_0(port) (0x2420 + (port<<10)) | ||
96 | #define MV643XX_ETH_DSCP_1(port) (0x2424 + (port<<10)) | ||
97 | #define MV643XX_ETH_DSCP_2(port) (0x2428 + (port<<10)) | ||
98 | #define MV643XX_ETH_DSCP_3(port) (0x242c + (port<<10)) | ||
99 | #define MV643XX_ETH_DSCP_4(port) (0x2430 + (port<<10)) | ||
100 | #define MV643XX_ETH_DSCP_5(port) (0x2434 + (port<<10)) | ||
101 | #define MV643XX_ETH_DSCP_6(port) (0x2438 + (port<<10)) | ||
102 | #define MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port) (0x243c + (port<<10)) | ||
103 | #define MV643XX_ETH_VLAN_PRIORITY_TAG_TO_PRIORITY(port) (0x2440 + (port<<10)) | ||
104 | #define MV643XX_ETH_PORT_STATUS_REG(port) (0x2444 + (port<<10)) | ||
105 | #define MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(port) (0x2448 + (port<<10)) | ||
106 | #define MV643XX_ETH_TX_QUEUE_FIXED_PRIORITY(port) (0x244c + (port<<10)) | ||
107 | #define MV643XX_ETH_PORT_TX_TOKEN_BUCKET_RATE_CONFIG(port) (0x2450 + (port<<10)) | ||
108 | #define MV643XX_ETH_MAXIMUM_TRANSMIT_UNIT(port) (0x2458 + (port<<10)) | ||
109 | #define MV643XX_ETH_PORT_MAXIMUM_TOKEN_BUCKET_SIZE(port) (0x245c + (port<<10)) | ||
110 | #define MV643XX_ETH_INTERRUPT_CAUSE_REG(port) (0x2460 + (port<<10)) | ||
111 | #define MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port) (0x2464 + (port<<10)) | ||
112 | #define MV643XX_ETH_INTERRUPT_MASK_REG(port) (0x2468 + (port<<10)) | ||
113 | #define MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port) (0x246c + (port<<10)) | ||
114 | #define MV643XX_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port) (0x2470 + (port<<10)) | ||
115 | #define MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port) (0x2474 + (port<<10)) | ||
116 | #define MV643XX_ETH_RX_MINIMAL_FRAME_SIZE_REG(port) (0x247c + (port<<10)) | ||
117 | #define MV643XX_ETH_RX_DISCARDED_FRAMES_COUNTER(port) (0x2484 + (port<<10)) | ||
118 | #define MV643XX_ETH_PORT_DEBUG_0_REG(port) (0x248c + (port<<10)) | ||
119 | #define MV643XX_ETH_PORT_DEBUG_1_REG(port) (0x2490 + (port<<10)) | ||
120 | #define MV643XX_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port) (0x2494 + (port<<10)) | ||
121 | #define MV643XX_ETH_INTERNAL_USE_REG(port) (0x24fc + (port<<10)) | ||
122 | #define MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port) (0x2680 + (port<<10)) | ||
123 | #define MV643XX_ETH_CURRENT_SERVED_TX_DESC_PTR(port) (0x2684 + (port<<10)) | ||
124 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(port) (0x260c + (port<<10)) | ||
125 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_1(port) (0x261c + (port<<10)) | ||
126 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_2(port) (0x262c + (port<<10)) | ||
127 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_3(port) (0x263c + (port<<10)) | ||
128 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_4(port) (0x264c + (port<<10)) | ||
129 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_5(port) (0x265c + (port<<10)) | ||
130 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_6(port) (0x266c + (port<<10)) | ||
131 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_7(port) (0x267c + (port<<10)) | ||
132 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(port) (0x26c0 + (port<<10)) | ||
133 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_1(port) (0x26c4 + (port<<10)) | ||
134 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_2(port) (0x26c8 + (port<<10)) | ||
135 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_3(port) (0x26cc + (port<<10)) | ||
136 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_4(port) (0x26d0 + (port<<10)) | ||
137 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_5(port) (0x26d4 + (port<<10)) | ||
138 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_6(port) (0x26d8 + (port<<10)) | ||
139 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_7(port) (0x26dc + (port<<10)) | ||
140 | #define MV643XX_ETH_TX_QUEUE_0_TOKEN_BUCKET_COUNT(port) (0x2700 + (port<<10)) | ||
141 | #define MV643XX_ETH_TX_QUEUE_1_TOKEN_BUCKET_COUNT(port) (0x2710 + (port<<10)) | ||
142 | #define MV643XX_ETH_TX_QUEUE_2_TOKEN_BUCKET_COUNT(port) (0x2720 + (port<<10)) | ||
143 | #define MV643XX_ETH_TX_QUEUE_3_TOKEN_BUCKET_COUNT(port) (0x2730 + (port<<10)) | ||
144 | #define MV643XX_ETH_TX_QUEUE_4_TOKEN_BUCKET_COUNT(port) (0x2740 + (port<<10)) | ||
145 | #define MV643XX_ETH_TX_QUEUE_5_TOKEN_BUCKET_COUNT(port) (0x2750 + (port<<10)) | ||
146 | #define MV643XX_ETH_TX_QUEUE_6_TOKEN_BUCKET_COUNT(port) (0x2760 + (port<<10)) | ||
147 | #define MV643XX_ETH_TX_QUEUE_7_TOKEN_BUCKET_COUNT(port) (0x2770 + (port<<10)) | ||
148 | #define MV643XX_ETH_TX_QUEUE_0_TOKEN_BUCKET_CONFIG(port) (0x2704 + (port<<10)) | ||
149 | #define MV643XX_ETH_TX_QUEUE_1_TOKEN_BUCKET_CONFIG(port) (0x2714 + (port<<10)) | ||
150 | #define MV643XX_ETH_TX_QUEUE_2_TOKEN_BUCKET_CONFIG(port) (0x2724 + (port<<10)) | ||
151 | #define MV643XX_ETH_TX_QUEUE_3_TOKEN_BUCKET_CONFIG(port) (0x2734 + (port<<10)) | ||
152 | #define MV643XX_ETH_TX_QUEUE_4_TOKEN_BUCKET_CONFIG(port) (0x2744 + (port<<10)) | ||
153 | #define MV643XX_ETH_TX_QUEUE_5_TOKEN_BUCKET_CONFIG(port) (0x2754 + (port<<10)) | ||
154 | #define MV643XX_ETH_TX_QUEUE_6_TOKEN_BUCKET_CONFIG(port) (0x2764 + (port<<10)) | ||
155 | #define MV643XX_ETH_TX_QUEUE_7_TOKEN_BUCKET_CONFIG(port) (0x2774 + (port<<10)) | ||
156 | #define MV643XX_ETH_TX_QUEUE_0_ARBITER_CONFIG(port) (0x2708 + (port<<10)) | ||
157 | #define MV643XX_ETH_TX_QUEUE_1_ARBITER_CONFIG(port) (0x2718 + (port<<10)) | ||
158 | #define MV643XX_ETH_TX_QUEUE_2_ARBITER_CONFIG(port) (0x2728 + (port<<10)) | ||
159 | #define MV643XX_ETH_TX_QUEUE_3_ARBITER_CONFIG(port) (0x2738 + (port<<10)) | ||
160 | #define MV643XX_ETH_TX_QUEUE_4_ARBITER_CONFIG(port) (0x2748 + (port<<10)) | ||
161 | #define MV643XX_ETH_TX_QUEUE_5_ARBITER_CONFIG(port) (0x2758 + (port<<10)) | ||
162 | #define MV643XX_ETH_TX_QUEUE_6_ARBITER_CONFIG(port) (0x2768 + (port<<10)) | ||
163 | #define MV643XX_ETH_TX_QUEUE_7_ARBITER_CONFIG(port) (0x2778 + (port<<10)) | ||
164 | #define MV643XX_ETH_PORT_TX_TOKEN_BUCKET_COUNT(port) (0x2780 + (port<<10)) | ||
165 | #define MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(port) (0x3400 + (port<<10)) | ||
166 | #define MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(port) (0x3500 + (port<<10)) | ||
167 | #define MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE(port) (0x3600 + (port<<10)) | ||
168 | |||
169 | /* These macros describe Ethernet Port configuration reg (Px_cR) bits */ | ||
170 | #define MV643XX_ETH_UNICAST_NORMAL_MODE 0 | ||
171 | #define MV643XX_ETH_UNICAST_PROMISCUOUS_MODE (1<<0) | ||
172 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_0 0 | ||
173 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_1 (1<<1) | ||
174 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_2 (1<<2) | ||
175 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_3 ((1<<2) | (1<<1)) | ||
176 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_4 (1<<3) | ||
177 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_5 ((1<<3) | (1<<1)) | ||
178 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_6 ((1<<3) | (1<<2)) | ||
179 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_7 ((1<<3) | (1<<2) | (1<<1)) | ||
180 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_0 0 | ||
181 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_1 (1<<4) | ||
182 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_2 (1<<5) | ||
183 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_3 ((1<<5) | (1<<4)) | ||
184 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_4 (1<<6) | ||
185 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_5 ((1<<6) | (1<<4)) | ||
186 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_6 ((1<<6) | (1<<5)) | ||
187 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_7 ((1<<6) | (1<<5) | (1<<4)) | ||
188 | #define MV643XX_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP 0 | ||
189 | #define MV643XX_ETH_REJECT_BC_IF_NOT_IP_OR_ARP (1<<7) | ||
190 | #define MV643XX_ETH_RECEIVE_BC_IF_IP 0 | ||
191 | #define MV643XX_ETH_REJECT_BC_IF_IP (1<<8) | ||
192 | #define MV643XX_ETH_RECEIVE_BC_IF_ARP 0 | ||
193 | #define MV643XX_ETH_REJECT_BC_IF_ARP (1<<9) | ||
194 | #define MV643XX_ETH_TX_AM_NO_UPDATE_ERROR_SUMMARY (1<<12) | ||
195 | #define MV643XX_ETH_CAPTURE_TCP_FRAMES_DIS 0 | ||
196 | #define MV643XX_ETH_CAPTURE_TCP_FRAMES_EN (1<<14) | ||
197 | #define MV643XX_ETH_CAPTURE_UDP_FRAMES_DIS 0 | ||
198 | #define MV643XX_ETH_CAPTURE_UDP_FRAMES_EN (1<<15) | ||
199 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_0 0 | ||
200 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_1 (1<<16) | ||
201 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_2 (1<<17) | ||
202 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_3 ((1<<17) | (1<<16)) | ||
203 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_4 (1<<18) | ||
204 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_5 ((1<<18) | (1<<16)) | ||
205 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_6 ((1<<18) | (1<<17)) | ||
206 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_7 ((1<<18) | (1<<17) | (1<<16)) | ||
207 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_0 0 | ||
208 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_1 (1<<19) | ||
209 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_2 (1<<20) | ||
210 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_3 ((1<<20) | (1<<19)) | ||
211 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_4 (1<<21) | ||
212 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_5 ((1<<21) | (1<<19)) | ||
213 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_6 ((1<<21) | (1<<20)) | ||
214 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_7 ((1<<21) | (1<<20) | (1<<19)) | ||
215 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_0 0 | ||
216 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_1 (1<<22) | ||
217 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_2 (1<<23) | ||
218 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_3 ((1<<23) | (1<<22)) | ||
219 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_4 (1<<24) | ||
220 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_5 ((1<<24) | (1<<22)) | ||
221 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_6 ((1<<24) | (1<<23)) | ||
222 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_7 ((1<<24) | (1<<23) | (1<<22)) | ||
223 | |||
224 | #define MV643XX_ETH_PORT_CONFIG_DEFAULT_VALUE \ | ||
225 | MV643XX_ETH_UNICAST_NORMAL_MODE | \ | ||
226 | MV643XX_ETH_DEFAULT_RX_QUEUE_0 | \ | ||
227 | MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_0 | \ | ||
228 | MV643XX_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \ | ||
229 | MV643XX_ETH_RECEIVE_BC_IF_IP | \ | ||
230 | MV643XX_ETH_RECEIVE_BC_IF_ARP | \ | ||
231 | MV643XX_ETH_CAPTURE_TCP_FRAMES_DIS | \ | ||
232 | MV643XX_ETH_CAPTURE_UDP_FRAMES_DIS | \ | ||
233 | MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_0 | \ | ||
234 | MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_0 | \ | ||
235 | MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_0 | ||
236 | |||
237 | /* These macros describe Ethernet Port configuration extend reg (Px_cXR) bits*/ | ||
238 | #define MV643XX_ETH_CLASSIFY_EN (1<<0) | ||
239 | #define MV643XX_ETH_SPAN_BPDU_PACKETS_AS_NORMAL 0 | ||
240 | #define MV643XX_ETH_SPAN_BPDU_PACKETS_TO_RX_QUEUE_7 (1<<1) | ||
241 | #define MV643XX_ETH_PARTITION_DISABLE 0 | ||
242 | #define MV643XX_ETH_PARTITION_ENABLE (1<<2) | ||
243 | |||
244 | #define MV643XX_ETH_PORT_CONFIG_EXTEND_DEFAULT_VALUE \ | ||
245 | MV643XX_ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \ | ||
246 | MV643XX_ETH_PARTITION_DISABLE | ||
247 | |||
248 | /* These macros describe Ethernet Port Sdma configuration reg (SDCR) bits */ | ||
249 | #define MV643XX_ETH_RIFB (1<<0) | ||
250 | #define MV643XX_ETH_RX_BURST_SIZE_1_64BIT 0 | ||
251 | #define MV643XX_ETH_RX_BURST_SIZE_2_64BIT (1<<1) | ||
252 | #define MV643XX_ETH_RX_BURST_SIZE_4_64BIT (1<<2) | ||
253 | #define MV643XX_ETH_RX_BURST_SIZE_8_64BIT ((1<<2) | (1<<1)) | ||
254 | #define MV643XX_ETH_RX_BURST_SIZE_16_64BIT (1<<3) | ||
255 | #define MV643XX_ETH_BLM_RX_NO_SWAP (1<<4) | ||
256 | #define MV643XX_ETH_BLM_RX_BYTE_SWAP 0 | ||
257 | #define MV643XX_ETH_BLM_TX_NO_SWAP (1<<5) | ||
258 | #define MV643XX_ETH_BLM_TX_BYTE_SWAP 0 | ||
259 | #define MV643XX_ETH_DESCRIPTORS_BYTE_SWAP (1<<6) | ||
260 | #define MV643XX_ETH_DESCRIPTORS_NO_SWAP 0 | ||
261 | #define MV643XX_ETH_TX_BURST_SIZE_1_64BIT 0 | ||
262 | #define MV643XX_ETH_TX_BURST_SIZE_2_64BIT (1<<22) | ||
263 | #define MV643XX_ETH_TX_BURST_SIZE_4_64BIT (1<<23) | ||
264 | #define MV643XX_ETH_TX_BURST_SIZE_8_64BIT ((1<<23) | (1<<22)) | ||
265 | #define MV643XX_ETH_TX_BURST_SIZE_16_64BIT (1<<24) | ||
266 | |||
267 | #define MV643XX_ETH_IPG_INT_RX(value) ((value & 0x3fff) << 8) | ||
268 | |||
269 | #define MV643XX_ETH_PORT_SDMA_CONFIG_DEFAULT_VALUE \ | ||
270 | MV643XX_ETH_RX_BURST_SIZE_4_64BIT | \ | ||
271 | MV643XX_ETH_IPG_INT_RX(0) | \ | ||
272 | MV643XX_ETH_TX_BURST_SIZE_4_64BIT | ||
273 | |||
274 | /* These macros describe Ethernet Port serial control reg (PSCR) bits */ | ||
275 | #define MV643XX_ETH_SERIAL_PORT_DISABLE 0 | ||
276 | #define MV643XX_ETH_SERIAL_PORT_ENABLE (1<<0) | ||
277 | #define MV643XX_ETH_FORCE_LINK_PASS (1<<1) | ||
278 | #define MV643XX_ETH_DO_NOT_FORCE_LINK_PASS 0 | ||
279 | #define MV643XX_ETH_ENABLE_AUTO_NEG_FOR_DUPLX 0 | ||
280 | #define MV643XX_ETH_DISABLE_AUTO_NEG_FOR_DUPLX (1<<2) | ||
281 | #define MV643XX_ETH_ENABLE_AUTO_NEG_FOR_FLOW_CTRL 0 | ||
282 | #define MV643XX_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL (1<<3) | ||
283 | #define MV643XX_ETH_ADV_NO_FLOW_CTRL 0 | ||
284 | #define MV643XX_ETH_ADV_SYMMETRIC_FLOW_CTRL (1<<4) | ||
285 | #define MV643XX_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX 0 | ||
286 | #define MV643XX_ETH_FORCE_FC_MODE_TX_PAUSE_DIS (1<<5) | ||
287 | #define MV643XX_ETH_FORCE_BP_MODE_NO_JAM 0 | ||
288 | #define MV643XX_ETH_FORCE_BP_MODE_JAM_TX (1<<7) | ||
289 | #define MV643XX_ETH_FORCE_BP_MODE_JAM_TX_ON_RX_ERR (1<<8) | ||
290 | #define MV643XX_ETH_SERIAL_PORT_CONTROL_RESERVED (1<<9) | ||
291 | #define MV643XX_ETH_FORCE_LINK_FAIL 0 | ||
292 | #define MV643XX_ETH_DO_NOT_FORCE_LINK_FAIL (1<<10) | ||
293 | #define MV643XX_ETH_RETRANSMIT_16_ATTEMPTS 0 | ||
294 | #define MV643XX_ETH_RETRANSMIT_FOREVER (1<<11) | ||
295 | #define MV643XX_ETH_DISABLE_AUTO_NEG_SPEED_GMII (1<<13) | ||
296 | #define MV643XX_ETH_ENABLE_AUTO_NEG_SPEED_GMII 0 | ||
297 | #define MV643XX_ETH_DTE_ADV_0 0 | ||
298 | #define MV643XX_ETH_DTE_ADV_1 (1<<14) | ||
299 | #define MV643XX_ETH_DISABLE_AUTO_NEG_BYPASS 0 | ||
300 | #define MV643XX_ETH_ENABLE_AUTO_NEG_BYPASS (1<<15) | ||
301 | #define MV643XX_ETH_AUTO_NEG_NO_CHANGE 0 | ||
302 | #define MV643XX_ETH_RESTART_AUTO_NEG (1<<16) | ||
303 | #define MV643XX_ETH_MAX_RX_PACKET_1518BYTE 0 | ||
304 | #define MV643XX_ETH_MAX_RX_PACKET_1522BYTE (1<<17) | ||
305 | #define MV643XX_ETH_MAX_RX_PACKET_1552BYTE (1<<18) | ||
306 | #define MV643XX_ETH_MAX_RX_PACKET_9022BYTE ((1<<18) | (1<<17)) | ||
307 | #define MV643XX_ETH_MAX_RX_PACKET_9192BYTE (1<<19) | ||
308 | #define MV643XX_ETH_MAX_RX_PACKET_9700BYTE ((1<<19) | (1<<17)) | ||
309 | #define MV643XX_ETH_SET_EXT_LOOPBACK (1<<20) | ||
310 | #define MV643XX_ETH_CLR_EXT_LOOPBACK 0 | ||
311 | #define MV643XX_ETH_SET_FULL_DUPLEX_MODE (1<<21) | ||
312 | #define MV643XX_ETH_SET_HALF_DUPLEX_MODE 0 | ||
313 | #define MV643XX_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX (1<<22) | ||
314 | #define MV643XX_ETH_DISABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX 0 | ||
315 | #define MV643XX_ETH_SET_GMII_SPEED_TO_10_100 0 | ||
316 | #define MV643XX_ETH_SET_GMII_SPEED_TO_1000 (1<<23) | ||
317 | #define MV643XX_ETH_SET_MII_SPEED_TO_10 0 | ||
318 | #define MV643XX_ETH_SET_MII_SPEED_TO_100 (1<<24) | ||
319 | |||
320 | #define MV643XX_ETH_MAX_RX_PACKET_MASK (0x7<<17) | ||
321 | |||
322 | #define MV643XX_ETH_PORT_SERIAL_CONTROL_DEFAULT_VALUE \ | ||
323 | MV643XX_ETH_DO_NOT_FORCE_LINK_PASS | \ | ||
324 | MV643XX_ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \ | ||
325 | MV643XX_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \ | ||
326 | MV643XX_ETH_ADV_SYMMETRIC_FLOW_CTRL | \ | ||
327 | MV643XX_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \ | ||
328 | MV643XX_ETH_FORCE_BP_MODE_NO_JAM | \ | ||
329 | (1<<9) /* reserved */ | \ | ||
330 | MV643XX_ETH_DO_NOT_FORCE_LINK_FAIL | \ | ||
331 | MV643XX_ETH_RETRANSMIT_16_ATTEMPTS | \ | ||
332 | MV643XX_ETH_ENABLE_AUTO_NEG_SPEED_GMII | \ | ||
333 | MV643XX_ETH_DTE_ADV_0 | \ | ||
334 | MV643XX_ETH_DISABLE_AUTO_NEG_BYPASS | \ | ||
335 | MV643XX_ETH_AUTO_NEG_NO_CHANGE | \ | ||
336 | MV643XX_ETH_MAX_RX_PACKET_9700BYTE | \ | ||
337 | MV643XX_ETH_CLR_EXT_LOOPBACK | \ | ||
338 | MV643XX_ETH_SET_FULL_DUPLEX_MODE | \ | ||
339 | MV643XX_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX | ||
340 | |||
341 | /* These macros describe Ethernet Serial Status reg (PSR) bits */ | ||
342 | #define MV643XX_ETH_PORT_STATUS_MODE_10_BIT (1<<0) | ||
343 | #define MV643XX_ETH_PORT_STATUS_LINK_UP (1<<1) | ||
344 | #define MV643XX_ETH_PORT_STATUS_FULL_DUPLEX (1<<2) | ||
345 | #define MV643XX_ETH_PORT_STATUS_FLOW_CONTROL (1<<3) | ||
346 | #define MV643XX_ETH_PORT_STATUS_GMII_1000 (1<<4) | ||
347 | #define MV643XX_ETH_PORT_STATUS_MII_100 (1<<5) | ||
348 | /* PSR bit 6 is undocumented */ | ||
349 | #define MV643XX_ETH_PORT_STATUS_TX_IN_PROGRESS (1<<7) | ||
350 | #define MV643XX_ETH_PORT_STATUS_AUTONEG_BYPASSED (1<<8) | ||
351 | #define MV643XX_ETH_PORT_STATUS_PARTITION (1<<9) | ||
352 | #define MV643XX_ETH_PORT_STATUS_TX_FIFO_EMPTY (1<<10) | ||
353 | /* PSR bits 11-31 are reserved */ | ||
354 | |||
355 | #define MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE 800 | ||
356 | #define MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE 400 | ||
357 | |||
358 | #define MV643XX_ETH_DESC_SIZE 64 | ||
359 | |||
54 | #define ETH_RX_QUEUES_ENABLED (1 << 0) /* use only Q0 for receive */ | 360 | #define ETH_RX_QUEUES_ENABLED (1 << 0) /* use only Q0 for receive */ |
55 | #define ETH_TX_QUEUES_ENABLED (1 << 0) /* use only Q0 for transmit */ | 361 | #define ETH_TX_QUEUES_ENABLED (1 << 0) /* use only Q0 for transmit */ |
56 | 362 | ||
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h index e67d7eceb660..d2ae6185f03b 100644 --- a/include/linux/mv643xx.h +++ b/include/linux/mv643xx.h | |||
@@ -659,117 +659,6 @@ | |||
659 | /* Ethernet Unit Registers */ | 659 | /* Ethernet Unit Registers */ |
660 | /****************************************/ | 660 | /****************************************/ |
661 | 661 | ||
662 | #define MV643XX_ETH_PHY_ADDR_REG 0x2000 | ||
663 | #define MV643XX_ETH_SMI_REG 0x2004 | ||
664 | #define MV643XX_ETH_UNIT_DEFAULT_ADDR_REG 0x2008 | ||
665 | #define MV643XX_ETH_UNIT_DEFAULTID_REG 0x200c | ||
666 | #define MV643XX_ETH_UNIT_INTERRUPT_CAUSE_REG 0x2080 | ||
667 | #define MV643XX_ETH_UNIT_INTERRUPT_MASK_REG 0x2084 | ||
668 | #define MV643XX_ETH_UNIT_INTERNAL_USE_REG 0x24fc | ||
669 | #define MV643XX_ETH_UNIT_ERROR_ADDR_REG 0x2094 | ||
670 | #define MV643XX_ETH_BAR_0 0x2200 | ||
671 | #define MV643XX_ETH_BAR_1 0x2208 | ||
672 | #define MV643XX_ETH_BAR_2 0x2210 | ||
673 | #define MV643XX_ETH_BAR_3 0x2218 | ||
674 | #define MV643XX_ETH_BAR_4 0x2220 | ||
675 | #define MV643XX_ETH_BAR_5 0x2228 | ||
676 | #define MV643XX_ETH_SIZE_REG_0 0x2204 | ||
677 | #define MV643XX_ETH_SIZE_REG_1 0x220c | ||
678 | #define MV643XX_ETH_SIZE_REG_2 0x2214 | ||
679 | #define MV643XX_ETH_SIZE_REG_3 0x221c | ||
680 | #define MV643XX_ETH_SIZE_REG_4 0x2224 | ||
681 | #define MV643XX_ETH_SIZE_REG_5 0x222c | ||
682 | #define MV643XX_ETH_HEADERS_RETARGET_BASE_REG 0x2230 | ||
683 | #define MV643XX_ETH_HEADERS_RETARGET_CONTROL_REG 0x2234 | ||
684 | #define MV643XX_ETH_HIGH_ADDR_REMAP_REG_0 0x2280 | ||
685 | #define MV643XX_ETH_HIGH_ADDR_REMAP_REG_1 0x2284 | ||
686 | #define MV643XX_ETH_HIGH_ADDR_REMAP_REG_2 0x2288 | ||
687 | #define MV643XX_ETH_HIGH_ADDR_REMAP_REG_3 0x228c | ||
688 | #define MV643XX_ETH_BASE_ADDR_ENABLE_REG 0x2290 | ||
689 | #define MV643XX_ETH_ACCESS_PROTECTION_REG(port) (0x2294 + (port<<2)) | ||
690 | #define MV643XX_ETH_MIB_COUNTERS_BASE(port) (0x3000 + (port<<7)) | ||
691 | #define MV643XX_ETH_PORT_CONFIG_REG(port) (0x2400 + (port<<10)) | ||
692 | #define MV643XX_ETH_PORT_CONFIG_EXTEND_REG(port) (0x2404 + (port<<10)) | ||
693 | #define MV643XX_ETH_MII_SERIAL_PARAMETRS_REG(port) (0x2408 + (port<<10)) | ||
694 | #define MV643XX_ETH_GMII_SERIAL_PARAMETRS_REG(port) (0x240c + (port<<10)) | ||
695 | #define MV643XX_ETH_VLAN_ETHERTYPE_REG(port) (0x2410 + (port<<10)) | ||
696 | #define MV643XX_ETH_MAC_ADDR_LOW(port) (0x2414 + (port<<10)) | ||
697 | #define MV643XX_ETH_MAC_ADDR_HIGH(port) (0x2418 + (port<<10)) | ||
698 | #define MV643XX_ETH_SDMA_CONFIG_REG(port) (0x241c + (port<<10)) | ||
699 | #define MV643XX_ETH_DSCP_0(port) (0x2420 + (port<<10)) | ||
700 | #define MV643XX_ETH_DSCP_1(port) (0x2424 + (port<<10)) | ||
701 | #define MV643XX_ETH_DSCP_2(port) (0x2428 + (port<<10)) | ||
702 | #define MV643XX_ETH_DSCP_3(port) (0x242c + (port<<10)) | ||
703 | #define MV643XX_ETH_DSCP_4(port) (0x2430 + (port<<10)) | ||
704 | #define MV643XX_ETH_DSCP_5(port) (0x2434 + (port<<10)) | ||
705 | #define MV643XX_ETH_DSCP_6(port) (0x2438 + (port<<10)) | ||
706 | #define MV643XX_ETH_PORT_SERIAL_CONTROL_REG(port) (0x243c + (port<<10)) | ||
707 | #define MV643XX_ETH_VLAN_PRIORITY_TAG_TO_PRIORITY(port) (0x2440 + (port<<10)) | ||
708 | #define MV643XX_ETH_PORT_STATUS_REG(port) (0x2444 + (port<<10)) | ||
709 | #define MV643XX_ETH_TRANSMIT_QUEUE_COMMAND_REG(port) (0x2448 + (port<<10)) | ||
710 | #define MV643XX_ETH_TX_QUEUE_FIXED_PRIORITY(port) (0x244c + (port<<10)) | ||
711 | #define MV643XX_ETH_PORT_TX_TOKEN_BUCKET_RATE_CONFIG(port) (0x2450 + (port<<10)) | ||
712 | #define MV643XX_ETH_MAXIMUM_TRANSMIT_UNIT(port) (0x2458 + (port<<10)) | ||
713 | #define MV643XX_ETH_PORT_MAXIMUM_TOKEN_BUCKET_SIZE(port) (0x245c + (port<<10)) | ||
714 | #define MV643XX_ETH_INTERRUPT_CAUSE_REG(port) (0x2460 + (port<<10)) | ||
715 | #define MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port) (0x2464 + (port<<10)) | ||
716 | #define MV643XX_ETH_INTERRUPT_MASK_REG(port) (0x2468 + (port<<10)) | ||
717 | #define MV643XX_ETH_INTERRUPT_EXTEND_MASK_REG(port) (0x246c + (port<<10)) | ||
718 | #define MV643XX_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port) (0x2470 + (port<<10)) | ||
719 | #define MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port) (0x2474 + (port<<10)) | ||
720 | #define MV643XX_ETH_RX_MINIMAL_FRAME_SIZE_REG(port) (0x247c + (port<<10)) | ||
721 | #define MV643XX_ETH_RX_DISCARDED_FRAMES_COUNTER(port) (0x2484 + (port<<10)) | ||
722 | #define MV643XX_ETH_PORT_DEBUG_0_REG(port) (0x248c + (port<<10)) | ||
723 | #define MV643XX_ETH_PORT_DEBUG_1_REG(port) (0x2490 + (port<<10)) | ||
724 | #define MV643XX_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port) (0x2494 + (port<<10)) | ||
725 | #define MV643XX_ETH_INTERNAL_USE_REG(port) (0x24fc + (port<<10)) | ||
726 | #define MV643XX_ETH_RECEIVE_QUEUE_COMMAND_REG(port) (0x2680 + (port<<10)) | ||
727 | #define MV643XX_ETH_CURRENT_SERVED_TX_DESC_PTR(port) (0x2684 + (port<<10)) | ||
728 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_0(port) (0x260c + (port<<10)) | ||
729 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_1(port) (0x261c + (port<<10)) | ||
730 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_2(port) (0x262c + (port<<10)) | ||
731 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_3(port) (0x263c + (port<<10)) | ||
732 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_4(port) (0x264c + (port<<10)) | ||
733 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_5(port) (0x265c + (port<<10)) | ||
734 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_6(port) (0x266c + (port<<10)) | ||
735 | #define MV643XX_ETH_RX_CURRENT_QUEUE_DESC_PTR_7(port) (0x267c + (port<<10)) | ||
736 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_0(port) (0x26c0 + (port<<10)) | ||
737 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_1(port) (0x26c4 + (port<<10)) | ||
738 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_2(port) (0x26c8 + (port<<10)) | ||
739 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_3(port) (0x26cc + (port<<10)) | ||
740 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_4(port) (0x26d0 + (port<<10)) | ||
741 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_5(port) (0x26d4 + (port<<10)) | ||
742 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_6(port) (0x26d8 + (port<<10)) | ||
743 | #define MV643XX_ETH_TX_CURRENT_QUEUE_DESC_PTR_7(port) (0x26dc + (port<<10)) | ||
744 | #define MV643XX_ETH_TX_QUEUE_0_TOKEN_BUCKET_COUNT(port) (0x2700 + (port<<10)) | ||
745 | #define MV643XX_ETH_TX_QUEUE_1_TOKEN_BUCKET_COUNT(port) (0x2710 + (port<<10)) | ||
746 | #define MV643XX_ETH_TX_QUEUE_2_TOKEN_BUCKET_COUNT(port) (0x2720 + (port<<10)) | ||
747 | #define MV643XX_ETH_TX_QUEUE_3_TOKEN_BUCKET_COUNT(port) (0x2730 + (port<<10)) | ||
748 | #define MV643XX_ETH_TX_QUEUE_4_TOKEN_BUCKET_COUNT(port) (0x2740 + (port<<10)) | ||
749 | #define MV643XX_ETH_TX_QUEUE_5_TOKEN_BUCKET_COUNT(port) (0x2750 + (port<<10)) | ||
750 | #define MV643XX_ETH_TX_QUEUE_6_TOKEN_BUCKET_COUNT(port) (0x2760 + (port<<10)) | ||
751 | #define MV643XX_ETH_TX_QUEUE_7_TOKEN_BUCKET_COUNT(port) (0x2770 + (port<<10)) | ||
752 | #define MV643XX_ETH_TX_QUEUE_0_TOKEN_BUCKET_CONFIG(port) (0x2704 + (port<<10)) | ||
753 | #define MV643XX_ETH_TX_QUEUE_1_TOKEN_BUCKET_CONFIG(port) (0x2714 + (port<<10)) | ||
754 | #define MV643XX_ETH_TX_QUEUE_2_TOKEN_BUCKET_CONFIG(port) (0x2724 + (port<<10)) | ||
755 | #define MV643XX_ETH_TX_QUEUE_3_TOKEN_BUCKET_CONFIG(port) (0x2734 + (port<<10)) | ||
756 | #define MV643XX_ETH_TX_QUEUE_4_TOKEN_BUCKET_CONFIG(port) (0x2744 + (port<<10)) | ||
757 | #define MV643XX_ETH_TX_QUEUE_5_TOKEN_BUCKET_CONFIG(port) (0x2754 + (port<<10)) | ||
758 | #define MV643XX_ETH_TX_QUEUE_6_TOKEN_BUCKET_CONFIG(port) (0x2764 + (port<<10)) | ||
759 | #define MV643XX_ETH_TX_QUEUE_7_TOKEN_BUCKET_CONFIG(port) (0x2774 + (port<<10)) | ||
760 | #define MV643XX_ETH_TX_QUEUE_0_ARBITER_CONFIG(port) (0x2708 + (port<<10)) | ||
761 | #define MV643XX_ETH_TX_QUEUE_1_ARBITER_CONFIG(port) (0x2718 + (port<<10)) | ||
762 | #define MV643XX_ETH_TX_QUEUE_2_ARBITER_CONFIG(port) (0x2728 + (port<<10)) | ||
763 | #define MV643XX_ETH_TX_QUEUE_3_ARBITER_CONFIG(port) (0x2738 + (port<<10)) | ||
764 | #define MV643XX_ETH_TX_QUEUE_4_ARBITER_CONFIG(port) (0x2748 + (port<<10)) | ||
765 | #define MV643XX_ETH_TX_QUEUE_5_ARBITER_CONFIG(port) (0x2758 + (port<<10)) | ||
766 | #define MV643XX_ETH_TX_QUEUE_6_ARBITER_CONFIG(port) (0x2768 + (port<<10)) | ||
767 | #define MV643XX_ETH_TX_QUEUE_7_ARBITER_CONFIG(port) (0x2778 + (port<<10)) | ||
768 | #define MV643XX_ETH_PORT_TX_TOKEN_BUCKET_COUNT(port) (0x2780 + (port<<10)) | ||
769 | #define MV643XX_ETH_DA_FILTER_SPECIAL_MULTICAST_TABLE_BASE(port) (0x3400 + (port<<10)) | ||
770 | #define MV643XX_ETH_DA_FILTER_OTHER_MULTICAST_TABLE_BASE(port) (0x3500 + (port<<10)) | ||
771 | #define MV643XX_ETH_DA_FILTER_UNICAST_TABLE_BASE(port) (0x3600 + (port<<10)) | ||
772 | |||
773 | /*******************************************/ | 662 | /*******************************************/ |
774 | /* CUNIT Registers */ | 663 | /* CUNIT Registers */ |
775 | /*******************************************/ | 664 | /*******************************************/ |
@@ -1087,197 +976,6 @@ struct mv64xxx_i2c_pdata { | |||
1087 | u32 retries; | 976 | u32 retries; |
1088 | }; | 977 | }; |
1089 | 978 | ||
1090 | /* These macros describe Ethernet Port configuration reg (Px_cR) bits */ | ||
1091 | #define MV643XX_ETH_UNICAST_NORMAL_MODE 0 | ||
1092 | #define MV643XX_ETH_UNICAST_PROMISCUOUS_MODE (1<<0) | ||
1093 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_0 0 | ||
1094 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_1 (1<<1) | ||
1095 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_2 (1<<2) | ||
1096 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_3 ((1<<2) | (1<<1)) | ||
1097 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_4 (1<<3) | ||
1098 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_5 ((1<<3) | (1<<1)) | ||
1099 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_6 ((1<<3) | (1<<2)) | ||
1100 | #define MV643XX_ETH_DEFAULT_RX_QUEUE_7 ((1<<3) | (1<<2) | (1<<1)) | ||
1101 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_0 0 | ||
1102 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_1 (1<<4) | ||
1103 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_2 (1<<5) | ||
1104 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_3 ((1<<5) | (1<<4)) | ||
1105 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_4 (1<<6) | ||
1106 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_5 ((1<<6) | (1<<4)) | ||
1107 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_6 ((1<<6) | (1<<5)) | ||
1108 | #define MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_7 ((1<<6) | (1<<5) | (1<<4)) | ||
1109 | #define MV643XX_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP 0 | ||
1110 | #define MV643XX_ETH_REJECT_BC_IF_NOT_IP_OR_ARP (1<<7) | ||
1111 | #define MV643XX_ETH_RECEIVE_BC_IF_IP 0 | ||
1112 | #define MV643XX_ETH_REJECT_BC_IF_IP (1<<8) | ||
1113 | #define MV643XX_ETH_RECEIVE_BC_IF_ARP 0 | ||
1114 | #define MV643XX_ETH_REJECT_BC_IF_ARP (1<<9) | ||
1115 | #define MV643XX_ETH_TX_AM_NO_UPDATE_ERROR_SUMMARY (1<<12) | ||
1116 | #define MV643XX_ETH_CAPTURE_TCP_FRAMES_DIS 0 | ||
1117 | #define MV643XX_ETH_CAPTURE_TCP_FRAMES_EN (1<<14) | ||
1118 | #define MV643XX_ETH_CAPTURE_UDP_FRAMES_DIS 0 | ||
1119 | #define MV643XX_ETH_CAPTURE_UDP_FRAMES_EN (1<<15) | ||
1120 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_0 0 | ||
1121 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_1 (1<<16) | ||
1122 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_2 (1<<17) | ||
1123 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_3 ((1<<17) | (1<<16)) | ||
1124 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_4 (1<<18) | ||
1125 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_5 ((1<<18) | (1<<16)) | ||
1126 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_6 ((1<<18) | (1<<17)) | ||
1127 | #define MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_7 ((1<<18) | (1<<17) | (1<<16)) | ||
1128 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_0 0 | ||
1129 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_1 (1<<19) | ||
1130 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_2 (1<<20) | ||
1131 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_3 ((1<<20) | (1<<19)) | ||
1132 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_4 (1<<21) | ||
1133 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_5 ((1<<21) | (1<<19)) | ||
1134 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_6 ((1<<21) | (1<<20)) | ||
1135 | #define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_7 ((1<<21) | (1<<20) | (1<<19)) | ||
1136 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_0 0 | ||
1137 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_1 (1<<22) | ||
1138 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_2 (1<<23) | ||
1139 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_3 ((1<<23) | (1<<22)) | ||
1140 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_4 (1<<24) | ||
1141 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_5 ((1<<24) | (1<<22)) | ||
1142 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_6 ((1<<24) | (1<<23)) | ||
1143 | #define MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_7 ((1<<24) | (1<<23) | (1<<22)) | ||
1144 | |||
1145 | #define MV643XX_ETH_PORT_CONFIG_DEFAULT_VALUE \ | ||
1146 | MV643XX_ETH_UNICAST_NORMAL_MODE | \ | ||
1147 | MV643XX_ETH_DEFAULT_RX_QUEUE_0 | \ | ||
1148 | MV643XX_ETH_DEFAULT_RX_ARP_QUEUE_0 | \ | ||
1149 | MV643XX_ETH_RECEIVE_BC_IF_NOT_IP_OR_ARP | \ | ||
1150 | MV643XX_ETH_RECEIVE_BC_IF_IP | \ | ||
1151 | MV643XX_ETH_RECEIVE_BC_IF_ARP | \ | ||
1152 | MV643XX_ETH_CAPTURE_TCP_FRAMES_DIS | \ | ||
1153 | MV643XX_ETH_CAPTURE_UDP_FRAMES_DIS | \ | ||
1154 | MV643XX_ETH_DEFAULT_RX_TCP_QUEUE_0 | \ | ||
1155 | MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_0 | \ | ||
1156 | MV643XX_ETH_DEFAULT_RX_BPDU_QUEUE_0 | ||
1157 | |||
1158 | /* These macros describe Ethernet Port configuration extend reg (Px_cXR) bits*/ | ||
1159 | #define MV643XX_ETH_CLASSIFY_EN (1<<0) | ||
1160 | #define MV643XX_ETH_SPAN_BPDU_PACKETS_AS_NORMAL 0 | ||
1161 | #define MV643XX_ETH_SPAN_BPDU_PACKETS_TO_RX_QUEUE_7 (1<<1) | ||
1162 | #define MV643XX_ETH_PARTITION_DISABLE 0 | ||
1163 | #define MV643XX_ETH_PARTITION_ENABLE (1<<2) | ||
1164 | |||
1165 | #define MV643XX_ETH_PORT_CONFIG_EXTEND_DEFAULT_VALUE \ | ||
1166 | MV643XX_ETH_SPAN_BPDU_PACKETS_AS_NORMAL | \ | ||
1167 | MV643XX_ETH_PARTITION_DISABLE | ||
1168 | |||
1169 | /* These macros describe Ethernet Port Sdma configuration reg (SDCR) bits */ | ||
1170 | #define MV643XX_ETH_RIFB (1<<0) | ||
1171 | #define MV643XX_ETH_RX_BURST_SIZE_1_64BIT 0 | ||
1172 | #define MV643XX_ETH_RX_BURST_SIZE_2_64BIT (1<<1) | ||
1173 | #define MV643XX_ETH_RX_BURST_SIZE_4_64BIT (1<<2) | ||
1174 | #define MV643XX_ETH_RX_BURST_SIZE_8_64BIT ((1<<2) | (1<<1)) | ||
1175 | #define MV643XX_ETH_RX_BURST_SIZE_16_64BIT (1<<3) | ||
1176 | #define MV643XX_ETH_BLM_RX_NO_SWAP (1<<4) | ||
1177 | #define MV643XX_ETH_BLM_RX_BYTE_SWAP 0 | ||
1178 | #define MV643XX_ETH_BLM_TX_NO_SWAP (1<<5) | ||
1179 | #define MV643XX_ETH_BLM_TX_BYTE_SWAP 0 | ||
1180 | #define MV643XX_ETH_DESCRIPTORS_BYTE_SWAP (1<<6) | ||
1181 | #define MV643XX_ETH_DESCRIPTORS_NO_SWAP 0 | ||
1182 | #define MV643XX_ETH_TX_BURST_SIZE_1_64BIT 0 | ||
1183 | #define MV643XX_ETH_TX_BURST_SIZE_2_64BIT (1<<22) | ||
1184 | #define MV643XX_ETH_TX_BURST_SIZE_4_64BIT (1<<23) | ||
1185 | #define MV643XX_ETH_TX_BURST_SIZE_8_64BIT ((1<<23) | (1<<22)) | ||
1186 | #define MV643XX_ETH_TX_BURST_SIZE_16_64BIT (1<<24) | ||
1187 | |||
1188 | #define MV643XX_ETH_IPG_INT_RX(value) ((value & 0x3fff) << 8) | ||
1189 | |||
1190 | #define MV643XX_ETH_PORT_SDMA_CONFIG_DEFAULT_VALUE \ | ||
1191 | MV643XX_ETH_RX_BURST_SIZE_4_64BIT | \ | ||
1192 | MV643XX_ETH_IPG_INT_RX(0) | \ | ||
1193 | MV643XX_ETH_TX_BURST_SIZE_4_64BIT | ||
1194 | |||
1195 | /* These macros describe Ethernet Port serial control reg (PSCR) bits */ | ||
1196 | #define MV643XX_ETH_SERIAL_PORT_DISABLE 0 | ||
1197 | #define MV643XX_ETH_SERIAL_PORT_ENABLE (1<<0) | ||
1198 | #define MV643XX_ETH_FORCE_LINK_PASS (1<<1) | ||
1199 | #define MV643XX_ETH_DO_NOT_FORCE_LINK_PASS 0 | ||
1200 | #define MV643XX_ETH_ENABLE_AUTO_NEG_FOR_DUPLX 0 | ||
1201 | #define MV643XX_ETH_DISABLE_AUTO_NEG_FOR_DUPLX (1<<2) | ||
1202 | #define MV643XX_ETH_ENABLE_AUTO_NEG_FOR_FLOW_CTRL 0 | ||
1203 | #define MV643XX_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL (1<<3) | ||
1204 | #define MV643XX_ETH_ADV_NO_FLOW_CTRL 0 | ||
1205 | #define MV643XX_ETH_ADV_SYMMETRIC_FLOW_CTRL (1<<4) | ||
1206 | #define MV643XX_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX 0 | ||
1207 | #define MV643XX_ETH_FORCE_FC_MODE_TX_PAUSE_DIS (1<<5) | ||
1208 | #define MV643XX_ETH_FORCE_BP_MODE_NO_JAM 0 | ||
1209 | #define MV643XX_ETH_FORCE_BP_MODE_JAM_TX (1<<7) | ||
1210 | #define MV643XX_ETH_FORCE_BP_MODE_JAM_TX_ON_RX_ERR (1<<8) | ||
1211 | #define MV643XX_ETH_SERIAL_PORT_CONTROL_RESERVED (1<<9) | ||
1212 | #define MV643XX_ETH_FORCE_LINK_FAIL 0 | ||
1213 | #define MV643XX_ETH_DO_NOT_FORCE_LINK_FAIL (1<<10) | ||
1214 | #define MV643XX_ETH_RETRANSMIT_16_ATTEMPTS 0 | ||
1215 | #define MV643XX_ETH_RETRANSMIT_FOREVER (1<<11) | ||
1216 | #define MV643XX_ETH_DISABLE_AUTO_NEG_SPEED_GMII (1<<13) | ||
1217 | #define MV643XX_ETH_ENABLE_AUTO_NEG_SPEED_GMII 0 | ||
1218 | #define MV643XX_ETH_DTE_ADV_0 0 | ||
1219 | #define MV643XX_ETH_DTE_ADV_1 (1<<14) | ||
1220 | #define MV643XX_ETH_DISABLE_AUTO_NEG_BYPASS 0 | ||
1221 | #define MV643XX_ETH_ENABLE_AUTO_NEG_BYPASS (1<<15) | ||
1222 | #define MV643XX_ETH_AUTO_NEG_NO_CHANGE 0 | ||
1223 | #define MV643XX_ETH_RESTART_AUTO_NEG (1<<16) | ||
1224 | #define MV643XX_ETH_MAX_RX_PACKET_1518BYTE 0 | ||
1225 | #define MV643XX_ETH_MAX_RX_PACKET_1522BYTE (1<<17) | ||
1226 | #define MV643XX_ETH_MAX_RX_PACKET_1552BYTE (1<<18) | ||
1227 | #define MV643XX_ETH_MAX_RX_PACKET_9022BYTE ((1<<18) | (1<<17)) | ||
1228 | #define MV643XX_ETH_MAX_RX_PACKET_9192BYTE (1<<19) | ||
1229 | #define MV643XX_ETH_MAX_RX_PACKET_9700BYTE ((1<<19) | (1<<17)) | ||
1230 | #define MV643XX_ETH_SET_EXT_LOOPBACK (1<<20) | ||
1231 | #define MV643XX_ETH_CLR_EXT_LOOPBACK 0 | ||
1232 | #define MV643XX_ETH_SET_FULL_DUPLEX_MODE (1<<21) | ||
1233 | #define MV643XX_ETH_SET_HALF_DUPLEX_MODE 0 | ||
1234 | #define MV643XX_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX (1<<22) | ||
1235 | #define MV643XX_ETH_DISABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX 0 | ||
1236 | #define MV643XX_ETH_SET_GMII_SPEED_TO_10_100 0 | ||
1237 | #define MV643XX_ETH_SET_GMII_SPEED_TO_1000 (1<<23) | ||
1238 | #define MV643XX_ETH_SET_MII_SPEED_TO_10 0 | ||
1239 | #define MV643XX_ETH_SET_MII_SPEED_TO_100 (1<<24) | ||
1240 | |||
1241 | #define MV643XX_ETH_MAX_RX_PACKET_MASK (0x7<<17) | ||
1242 | |||
1243 | #define MV643XX_ETH_PORT_SERIAL_CONTROL_DEFAULT_VALUE \ | ||
1244 | MV643XX_ETH_DO_NOT_FORCE_LINK_PASS | \ | ||
1245 | MV643XX_ETH_ENABLE_AUTO_NEG_FOR_DUPLX | \ | ||
1246 | MV643XX_ETH_DISABLE_AUTO_NEG_FOR_FLOW_CTRL | \ | ||
1247 | MV643XX_ETH_ADV_SYMMETRIC_FLOW_CTRL | \ | ||
1248 | MV643XX_ETH_FORCE_FC_MODE_NO_PAUSE_DIS_TX | \ | ||
1249 | MV643XX_ETH_FORCE_BP_MODE_NO_JAM | \ | ||
1250 | (1<<9) /* reserved */ | \ | ||
1251 | MV643XX_ETH_DO_NOT_FORCE_LINK_FAIL | \ | ||
1252 | MV643XX_ETH_RETRANSMIT_16_ATTEMPTS | \ | ||
1253 | MV643XX_ETH_ENABLE_AUTO_NEG_SPEED_GMII | \ | ||
1254 | MV643XX_ETH_DTE_ADV_0 | \ | ||
1255 | MV643XX_ETH_DISABLE_AUTO_NEG_BYPASS | \ | ||
1256 | MV643XX_ETH_AUTO_NEG_NO_CHANGE | \ | ||
1257 | MV643XX_ETH_MAX_RX_PACKET_9700BYTE | \ | ||
1258 | MV643XX_ETH_CLR_EXT_LOOPBACK | \ | ||
1259 | MV643XX_ETH_SET_FULL_DUPLEX_MODE | \ | ||
1260 | MV643XX_ETH_ENABLE_FLOW_CTRL_TX_RX_IN_FULL_DUPLEX | ||
1261 | |||
1262 | /* These macros describe Ethernet Serial Status reg (PSR) bits */ | ||
1263 | #define MV643XX_ETH_PORT_STATUS_MODE_10_BIT (1<<0) | ||
1264 | #define MV643XX_ETH_PORT_STATUS_LINK_UP (1<<1) | ||
1265 | #define MV643XX_ETH_PORT_STATUS_FULL_DUPLEX (1<<2) | ||
1266 | #define MV643XX_ETH_PORT_STATUS_FLOW_CONTROL (1<<3) | ||
1267 | #define MV643XX_ETH_PORT_STATUS_GMII_1000 (1<<4) | ||
1268 | #define MV643XX_ETH_PORT_STATUS_MII_100 (1<<5) | ||
1269 | /* PSR bit 6 is undocumented */ | ||
1270 | #define MV643XX_ETH_PORT_STATUS_TX_IN_PROGRESS (1<<7) | ||
1271 | #define MV643XX_ETH_PORT_STATUS_AUTONEG_BYPASSED (1<<8) | ||
1272 | #define MV643XX_ETH_PORT_STATUS_PARTITION (1<<9) | ||
1273 | #define MV643XX_ETH_PORT_STATUS_TX_FIFO_EMPTY (1<<10) | ||
1274 | /* PSR bits 11-31 are reserved */ | ||
1275 | |||
1276 | #define MV643XX_ETH_PORT_DEFAULT_TRANSMIT_QUEUE_SIZE 800 | ||
1277 | #define MV643XX_ETH_PORT_DEFAULT_RECEIVE_QUEUE_SIZE 400 | ||
1278 | |||
1279 | #define MV643XX_ETH_DESC_SIZE 64 | ||
1280 | |||
1281 | /* Watchdog Platform Device, Driver Data */ | 979 | /* Watchdog Platform Device, Driver Data */ |
1282 | #define MV64x60_WDT_NAME "mv64x60_wdt" | 980 | #define MV64x60_WDT_NAME "mv64x60_wdt" |
1283 | 981 | ||