xref: /illumos-gate/usr/src/uts/common/sys/nxge/nxge_phy_hw.h (revision d2ec54f7875f7e05edd56195adbeb593c947763f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_NXGE_NXGE_PHY_HW_H
27 #define	_SYS_NXGE_NXGE_PHY_HW_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 
32 #ifdef	__cplusplus
33 extern "C" {
34 #endif
35 
36 #include <nxge_defs.h>
37 
38 #define	NXGE_MAX_PHY_PORTS		32
39 #define	NXGE_EXT_PHY_PORT_ST		8
40 
41 #define	NXGE_PMA_PMD_DEV_ADDR		1
42 #define	NXGE_PCS_DEV_ADDR		3
43 #define	NXGE_DEV_ID_REG_1		2
44 #define	NXGE_DEV_ID_REG_2		3
45 #define	NXGE_PHY_ID_REG_1		2
46 #define	NXGE_PHY_ID_REG_2		3
47 
48 #define	BCM8704_CHIP_ID			0x8704
49 #define	BCM8706_CHIP_ID			0x8706
50 
51 /*
52  * The BCM_PHY_ID_MASK is explained below:
53  * The first nibble (bits 0 through 3) is changed with every revision
54  * of the silicon. So these bits are masked out to support future revisions
55  * of the same chip. The third nibble (bits 8 through 11) is changed for
56  * different chips of the same family. So these bits are masked out to
57  * support chips of the same family.
58  */
59 #define	BCM_PHY_ID_MASK			0xfffff0f0
60 #define	BCM8704_DEV_ID			0x206033
61 #define	BCM5464R_PHY_ID			0x2060b1
62 #define	BCM8706_DEV_ID			0x206035
63 #define	BCM5482_PHY_ID			0x143bcb1
64 #define	PHY_BCM8704_FAMILY		(BCM8704_DEV_ID & BCM_PHY_ID_MASK)
65 #define	PHY_BCM5464R_FAMILY		(BCM5464R_PHY_ID & BCM_PHY_ID_MASK)
66 #define	PHY_BCM5482_FAMILY		(BCM5482_PHY_ID & BCM_PHY_ID_MASK)
67 
68 #define	CLAUSE_45_TYPE	1
69 #define	CLAUSE_22_TYPE	2
70 
71 #define	BCM5464_NEPTUNE_PORT_ADDR_BASE		10
72 #define	BCM8704_NEPTUNE_PORT_ADDR_BASE		8
73 #define	BCM8704_N2_PORT_ADDR_BASE		16
74 
75 /*
76  * Phy address for the second NIU port on Goa NEM card can be either
77  * 20 or 17
78  */
79 #define	BCM8706_GOA_PORT_ADDR_BASE		16
80 #define	BCM8706_ALT_GOA_PORT1_ADDR		20
81 /*
82  * Phy addresses for Maramba support. Support for P0 will eventually
83  * be removed.
84  */
85 #define	BCM5464_MARAMBA_P0_PORT_ADDR_BASE	10
86 #define	BCM5464_MARAMBA_P1_PORT_ADDR_BASE	26
87 #define	BCM8704_MARAMBA_PORT_ADDR_BASE		16
88 
89 #define	BCM8704_PMA_PMD_DEV_ADDR		1
90 #define	BCM8704_PCS_DEV_ADDR			3
91 #define	BCM8704_USER_DEV3_ADDR			3
92 #define	BCM8704_PHYXS_ADDR			4
93 #define	BCM8704_USER_DEV4_ADDR			4
94 
95 /* Definitions for BCM 5464R PHY chip */
96 
97 #define	BCM5464R_PHY_ECR	16
98 #define	BCM5464R_PHY_ESR	17
99 #define	BCM5464R_RXERR_CNT	18
100 #define	BCM5464R_FALSECS_CNT	19
101 #define	BCM5464R_RX_NOTOK_CNT	20
102 #define	BCM5464R_ER_DATA	21
103 #define	BCM5464R_RES		22
104 #define	BCM5464R_ER_ACC		23
105 #define	BCM5464R_AUX_CTL	24
106 #define	BCM5464R_AUX_S		25
107 #define	BCM5464R_INTR_S		26
108 #define	BCM5464R_INTR_M		27
109 #define	BCM5464R_MISC		28
110 #define	BCM5464R_MISC1		29
111 #define	BCM5464R_TESTR1		30
112 
113 #define	PHY_BCM_5464R_OUI	0x001018
114 #define	PHY_BCM_5464R_MODEL	0x0B
115 
116 /*
117  * MII Register 16:  PHY Extended Control Register
118  */
119 
120 typedef	union _mii_phy_ecr_t {
121 	uint16_t value;
122 	struct {
123 #ifdef _BIT_FIELDS_HTOL
124 		uint16_t mac_phy_if_mode	: 1;
125 		uint16_t dis_automdicross	: 1;
126 		uint16_t tx_dis			: 1;
127 		uint16_t intr_dis		: 1;
128 		uint16_t force_intr		: 1;
129 		uint16_t bypass_encdec		: 1;
130 		uint16_t bypass_scrdes		: 1;
131 		uint16_t bypass_mlt3		: 1;
132 		uint16_t bypass_rx_sym		: 1;
133 		uint16_t reset_scr		: 1;
134 		uint16_t en_led_traffic		: 1;
135 		uint16_t force_leds_on		: 1;
136 		uint16_t force_leds_off		: 1;
137 		uint16_t res			: 2;
138 		uint16_t gmii_fifo_elas		: 1;
139 #else
140 		uint16_t gmii_fifo_elas		: 1;
141 		uint16_t res			: 2;
142 		uint16_t force_leds_off		: 1;
143 		uint16_t force_leds_on		: 1;
144 		uint16_t en_led_traffic		: 1;
145 		uint16_t reset_scr		: 1;
146 		uint16_t bypass_rx_sym		: 1;
147 		uint16_t bypass_mlt3		: 1;
148 		uint16_t bypass_scrdes		: 1;
149 		uint16_t bypass_encdec		: 1;
150 		uint16_t force_intr		: 1;
151 		uint16_t intr_dis		: 1;
152 		uint16_t tx_dis			: 1;
153 		uint16_t dis_automdicross	: 1;
154 		uint16_t mac_phy_if_mode	: 1;
155 #endif
156 	} bits;
157 } mii_phy_ecr_t, *p_mii_phy_ecr_t;
158 
159 /*
160  * MII Register 17:  PHY Extended Status Register
161  */
162 typedef	union _mii_phy_esr_t {
163 	uint16_t value;
164 	struct {
165 #ifdef _BIT_FIELDS_HTOL
166 		uint16_t anbpsfm		: 1;
167 		uint16_t wsdwngr		: 1;
168 		uint16_t mdi_crst		: 1;
169 		uint16_t intr_s			: 1;
170 		uint16_t rmt_rx_s		: 1;
171 		uint16_t loc_rx_s		: 1;
172 		uint16_t locked			: 1;
173 		uint16_t link_s			: 1;
174 		uint16_t crc_err		: 1;
175 		uint16_t cext_err		: 1;
176 		uint16_t bad_ssd		: 1;
177 		uint16_t bad_esd		: 1;
178 		uint16_t rx_err			: 1;
179 		uint16_t tx_err			: 1;
180 		uint16_t lock_err		: 1;
181 		uint16_t mlt3_cerr		: 1;
182 #else
183 		uint16_t mlt3_cerr		: 1;
184 		uint16_t lock_err		: 1;
185 		uint16_t tx_err			: 1;
186 		uint16_t rx_err			: 1;
187 		uint16_t bad_esd		: 1;
188 		uint16_t bad_ssd		: 1;
189 		uint16_t cext_err		: 1;
190 		uint16_t crc_err		: 1;
191 		uint16_t link_s			: 1;
192 		uint16_t locked			: 1;
193 		uint16_t loc_rx_s		: 1;
194 		uint16_t rmt_rx_s		: 1;
195 		uint16_t intr_s			: 1;
196 		uint16_t mdi_crst		: 1;
197 		uint16_t wsdwngr		: 1;
198 		uint16_t anbpsfm		: 1;
199 #endif
200 	} bits;
201 } mii_phy_esr_t, *p_mii_phy_esr_t;
202 
203 /*
204  * MII Register 18:  Receive Error Counter Register
205  */
206 typedef	union _mii_rxerr_cnt_t {
207 	uint16_t value;
208 	struct {
209 		uint16_t rx_err_cnt		: 16;
210 	} bits;
211 } mii_rxerr_cnt_t, *p_mii_rxerr_cnt_t;
212 
213 /*
214  * MII Register 19:  False Carrier Sense Counter Register
215  */
216 typedef	union _mii_falsecs_cnt_t {
217 	uint16_t value;
218 	struct {
219 #ifdef _BIT_FIELDS_HTOL
220 		uint16_t res			: 8;
221 		uint16_t false_cs_cnt		: 8;
222 #else
223 		uint16_t false_cs_cnt		: 8;
224 		uint16_t res			: 8;
225 #endif
226 	} bits;
227 } mii_falsecs_cnt_t, *p_mii_falsecs_cnt_t;
228 
229 /*
230  * MII Register 20:  Receiver NOT_OK Counter Register
231  */
232 typedef	union _mii_rx_notok_cnt_t {
233 	uint16_t value;
234 	struct {
235 #ifdef _BIT_FIELDS_HTOL
236 		uint16_t l_rx_notok_cnt		: 8;
237 		uint16_t r_rx_notok_cnt		: 8;
238 #else
239 		uint16_t r_rx_notok_cnt		: 8;
240 		uint16_t l_rx_notok_cnt		: 8;
241 #endif
242 	} bits;
243 } mii_rx_notok_cnt_t, *p_mii_rx_notok_t;
244 
245 /*
246  * MII Register 21:  Expansion Register Data Register
247  */
248 typedef	union _mii_er_data_t {
249 	uint16_t value;
250 	struct {
251 		uint16_t reg_data;
252 	} bits;
253 } mii_er_data_t, *p_mii_er_data_t;
254 
255 /*
256  * MII Register 23:  Expansion Register Access Register
257  */
258 typedef	union _mii_er_acc_t {
259 	struct {
260 #ifdef _BIT_FIELDS_HTOL
261 		uint16_t res			: 4;
262 		uint16_t er_sel			: 4;
263 		uint16_t er_acc			: 8;
264 #else
265 		uint16_t er_acc			: 8;
266 		uint16_t er_sel			: 4;
267 		uint16_t res			: 4;
268 #endif
269 	} bits;
270 } mii_er_acc_t, *p_mii_er_acc_t;
271 
272 #define	EXP_RXTX_PKT_CNT		0x0
273 #define	EXP_INTR_STAT			0x1
274 #define	MULTICOL_LED_SEL		0x4
275 #define	MULTICOL_LED_FLASH_RATE_CTL	0x5
276 #define	MULTICOL_LED_BLINK_CTL		0x6
277 #define	CABLE_DIAG_CTL			0x10
278 #define	CABLE_DIAG_RES			0x11
279 #define	CABLE_DIAG_LEN_CH_2_1		0x12
280 #define	CABLE_DIAG_LEN_CH_4_3		0x13
281 
282 /*
283  * MII Register 24:  Auxiliary Control Register
284  */
285 typedef	union _mii_aux_ctl_t {
286 	uint16_t value;
287 	struct {
288 #ifdef _BIT_FIELDS_HTOL
289 		uint16_t ext_lb			: 1;
290 		uint16_t ext_pkt_len		: 1;
291 		uint16_t edge_rate_ctl_1000	: 2;
292 		uint16_t res			: 1;
293 		uint16_t write_1		: 1;
294 		uint16_t res1			: 2;
295 		uint16_t dis_partial_resp	: 1;
296 		uint16_t res2			: 1;
297 		uint16_t edge_rate_ctl_100	: 2;
298 		uint16_t diag_mode		: 1;
299 		uint16_t shadow_reg_sel		: 3;
300 #else
301 		uint16_t shadow_reg_sel		: 3;
302 		uint16_t diag_mode		: 1;
303 		uint16_t edge_rate_ctl_100	: 2;
304 		uint16_t res2			: 1;
305 		uint16_t dis_partial_resp	: 1;
306 		uint16_t res1			: 2;
307 		uint16_t write_1		: 1;
308 		uint16_t res			: 1;
309 		uint16_t edge_rate_ctl_1000	: 2;
310 		uint16_t ext_pkt_len		: 1;
311 		uint16_t ext_lb			: 1;
312 #endif
313 	} bits;
314 } mii_aux_ctl_t, *p_mii_aux_ctl_t;
315 
316 #define	AUX_REG				0x0
317 #define	AUX_10BASET			0x1
318 #define	AUX_PWR_CTL			0x2
319 #define	AUX_MISC_TEST			0x4
320 #define	AUX_MISC_CTL			0x7
321 
322 /*
323  * MII Register 25:  Auxiliary Status Summary Register
324  */
325 typedef	union _mii_aux_s_t {
326 	uint16_t value;
327 	struct {
328 #ifdef _BIT_FIELDS_HTOL
329 		uint16_t an_complete		: 1;
330 		uint16_t an_complete_ack	: 1;
331 		uint16_t an_ack_detect		: 1;
332 		uint16_t an_ability_detect	: 1;
333 		uint16_t an_np_wait		: 1;
334 		uint16_t an_hcd			: 3;
335 		uint16_t pd_fault		: 1;
336 		uint16_t rmt_fault		: 1;
337 		uint16_t an_page_rx		: 1;
338 		uint16_t lp_an_ability		: 1;
339 		uint16_t lp_np_ability		: 1;
340 		uint16_t link_s			: 1;
341 		uint16_t pause_res_rx_dir	: 1;
342 		uint16_t pause_res_tx_dir	: 1;
343 #else
344 		uint16_t pause_res_tx_dir	: 1;
345 		uint16_t pause_res_rx_dir	: 1;
346 		uint16_t link_s			: 1;
347 		uint16_t lp_np_ability		: 1;
348 		uint16_t lp_an_ability		: 1;
349 		uint16_t an_page_rx		: 1;
350 		uint16_t rmt_fault		: 1;
351 		uint16_t pd_fault		: 1;
352 		uint16_t an_hcd			: 3;
353 		uint16_t an_np_wait		: 1;
354 		uint16_t an_ability_detect	: 1;
355 		uint16_t an_ack_detect		: 1;
356 		uint16_t an_complete_ack	: 1;
357 		uint16_t an_complete		: 1;
358 #endif
359 	} bits;
360 } mii_aux_s_t, *p_mii_aux_s_t;
361 
362 /*
363  * MII Register 26, 27:  Interrupt Status and Mask Registers
364  */
365 typedef	union _mii_intr_t {
366 	uint16_t value;
367 	struct {
368 #ifdef _BIT_FIELDS_HTOL
369 		uint16_t res			: 1;
370 		uint16_t illegal_pair_swap	: 1;
371 		uint16_t mdix_status_change	: 1;
372 		uint16_t exceed_hicnt_thres	: 1;
373 		uint16_t exceed_locnt_thres	: 1;
374 		uint16_t an_page_rx		: 1;
375 		uint16_t hcd_nolink		: 1;
376 		uint16_t no_hcd			: 1;
377 		uint16_t neg_unsupported_hcd	: 1;
378 		uint16_t scr_sync_err		: 1;
379 		uint16_t rmt_rx_status_change	: 1;
380 		uint16_t loc_rx_status_change	: 1;
381 		uint16_t duplex_mode_change	: 1;
382 		uint16_t link_speed_change	: 1;
383 		uint16_t link_status_change	: 1;
384 		uint16_t crc_err		: 1;
385 #else
386 		uint16_t crc_err		: 1;
387 		uint16_t link_status_change	: 1;
388 		uint16_t link_speed_change	: 1;
389 		uint16_t duplex_mode_change	: 1;
390 		uint16_t loc_rx_status_change	: 1;
391 		uint16_t rmt_rx_status_change	: 1;
392 		uint16_t scr_sync_err		: 1;
393 		uint16_t neg_unsupported_hcd	: 1;
394 		uint16_t no_hcd			: 1;
395 		uint16_t hcd_nolink		: 1;
396 		uint16_t an_page_rx		: 1;
397 		uint16_t exceed_locnt_thres	: 1;
398 		uint16_t exceed_hicnt_thres	: 1;
399 		uint16_t mdix_status_change	: 1;
400 		uint16_t illegal_pair_swap	: 1;
401 		uint16_t res			: 1;
402 #endif
403 	} bits;
404 } mii_intr_t, *p_mii_intr_t;
405 
406 /*
407  * MII Register 28:  Register 1C Access Register
408  */
409 typedef	union _mii_misc_t {
410 	uint16_t value;
411 	struct {
412 #ifdef _BIT_FIELDS_HTOL
413 		uint16_t w_en			: 1;
414 		uint16_t shadow_reg_sel		: 5;
415 		uint16_t data			: 10;
416 #else
417 		uint16_t data			: 10;
418 		uint16_t shadow_reg_sel		: 5;
419 		uint16_t w_en			: 1;
420 #endif
421 	} bits;
422 } mii_misc_t, *p_mii_misc_t;
423 
424 #define	LINK_LED_MODE			0x2
425 #define	CLK_ALIGN_CTL			0x3
426 #define	WIRE_SP_RETRY			0x4
427 #define	CLK125				0x5
428 #define	LED_STATUS			0x8
429 #define	LED_CONTROL			0x9
430 #define	AUTO_PWR_DOWN			0xA
431 #define	LED_SEL1			0xD
432 #define	LED_SEL2			0xE
433 
434 /*
435  * MII Register 29:  Master/Slave Seed / HCD Status Register
436  */
437 
438 typedef	union _mii_misc1_t {
439 	uint16_t value;
440 	struct {
441 #ifdef _BIT_FIELDS_HTOL
442 		uint16_t en_shadow_reg		: 1;
443 		uint16_t data			: 15;
444 #else
445 		uint16_t data			: 15;
446 		uint16_t en_shadow_reg		: 1;
447 #endif
448 	} bits;
449 } mii_misc1_t, *p_mii_misc1_t;
450 
451 /*
452  * MII Register 30:  Test Register 1
453  */
454 
455 typedef	union _mii_test1_t {
456 	uint16_t value;
457 	struct {
458 #ifdef _BIT_FIELDS_HTOL
459 		uint16_t crc_err_cnt_sel	: 1;
460 		uint16_t res			: 7;
461 		uint16_t manual_swap_mdi_st	: 1;
462 		uint16_t res1			: 7;
463 #else
464 		uint16_t res1			: 7;
465 		uint16_t manual_swap_mdi_st	: 1;
466 		uint16_t res			: 7;
467 		uint16_t crc_err_cnt_sel	: 1;
468 #endif
469 	} bits;
470 } mii_test1_t, *p_mii_test1_t;
471 
472 
473 /* Definitions of BCM8704 */
474 
475 #define	BCM8704_PMD_CONTROL_REG			0
476 #define	BCM8704_PMD_STATUS_REG			0x1
477 #define	BCM8704_PMD_ID_0_REG			0x2
478 #define	BCM8704_PMD_ID_1_REG			0x3
479 #define	BCM8704_PMD_SPEED_ABIL_REG		0x4
480 #define	BCM8704_PMD_DEV_IN_PKG1_REG		0x5
481 #define	BCM8704_PMD_DEV_IN_PKG2_REG		0x6
482 #define	BCM8704_PMD_CONTROL2_REG		0x7
483 #define	BCM8704_PMD_STATUS2_REG			0x8
484 #define	BCM8704_PMD_TRANSMIT_DIS_REG		0x9
485 #define	BCM8704_PMD_RECEIVE_SIG_DETECT		0xa
486 #define	BCM8704_PMD_ORG_UNIQUE_ID_0_REG		0xe
487 #define	BCM8704_PMD_ORG_UNIQUE_ID_1_REG		0xf
488 #define	BCM8704_PCS_CONTROL_REG			0
489 #define	BCM8704_PCS_STATUS1_REG			0x1
490 #define	BCM8704_PCS_ID_0_REG			0x2
491 #define	BCM8704_PCS_ID_1_REG			0x3
492 #define	BCM8704_PCS_SPEED_ABILITY_REG		0x4
493 #define	BCM8704_PCS_DEV_IN_PKG1_REG		0x5
494 #define	BCM8704_PCS_DEV_IN_PKG2_REG		0x6
495 #define	BCM8704_PCS_CONTROL2_REG		0x7
496 #define	BCM8704_PCS_STATUS2_REG			0x8
497 #define	BCM8704_PCS_ORG_UNIQUE_ID_0_REG		0xe
498 #define	BCM8704_PCS_ORG_UNIQUE_ID_1_REG		0xf
499 #define	BCM8704_PCS_STATUS_REG			0x18
500 #define	BCM8704_10GBASE_R_PCS_STATUS_REG	0x20
501 #define	BCM8704_10GBASE_R_PCS_STATUS2_REG	0x21
502 #define	BCM8704_PHYXS_CONTROL_REG		0
503 #define	BCM8704_PHYXS_STATUS_REG		0x1
504 #define	BCM8704_PHY_ID_0_REG			0x2
505 #define	BCM8704_PHY_ID_1_REG			0x3
506 #define	BCM8704_PHYXS_SPEED_ABILITY_REG		0x4
507 #define	BCM8704_PHYXS_DEV_IN_PKG2_REG		0x5
508 #define	BCM8704_PHYXS_DEV_IN_PKG1_REG		0x6
509 #define	BCM8704_PHYXS_STATUS2_REG		0x8
510 #define	BCM8704_PHYXS_ORG_UNIQUE_ID_0_REG	0xe
511 #define	BCM8704_PHYXS_ORG_UNIQUE_ID_1_REG	0xf
512 #define	BCM8704_PHYXS_XGXS_LANE_STATUS_REG	0x18
513 #define	BCM8704_PHYXS_XGXS_TEST_CONTROL_REG	0x19
514 #define	BCM8704_USER_CONTROL_REG		0xC800
515 #define	BCM8704_USER_ANALOG_CLK_REG		0xC801
516 #define	BCM8704_USER_PMD_RX_CONTROL_REG		0xC802
517 #define	BCM8704_USER_PMD_TX_CONTROL_REG		0xC803
518 #define	BCM8704_USER_ANALOG_STATUS0_REG		0xC804
519 #define	BCM8704_CHIP_ID_REG			0xC807
520 #define	BCM8704_USER_OPTICS_DIGITAL_CTRL_REG	0xC808
521 #define	BCM8704_USER_RX2_CONTROL1_REG		0x80C6
522 #define	BCM8704_USER_RX1_CONTROL1_REG		0x80D6
523 #define	BCM8704_USER_RX0_CONTROL1_REG		0x80E6
524 #define	BCM8704_USER_TX_ALARM_STATUS_REG	0x9004
525 
526 /* Rx Channel Control1 Register bits */
527 #define	BCM8704_RXPOL_FLIP			0x20
528 
529 typedef	union _phyxs_control {
530 	uint16_t value;
531 	struct {
532 #ifdef _BIT_FIELDS_HTOL
533 		uint16_t reset			: 1;
534 		uint16_t loopback		: 1;
535 		uint16_t speed_sel2		: 1;
536 		uint16_t res2			: 1;
537 		uint16_t low_power		: 1;
538 		uint16_t res1			: 4;
539 		uint16_t speed_sel1		: 1;
540 		uint16_t speed_sel0		: 4;
541 		uint16_t res0			: 2;
542 #else
543 		uint16_t res0			: 2;
544 		uint16_t speed_sel0		: 4;
545 		uint16_t speed_sel1		: 1;
546 		uint16_t res1			: 4;
547 		uint16_t low_power		: 1;
548 		uint16_t res2			: 1;
549 		uint16_t speed_sel2		: 1;
550 		uint16_t loopback		: 1;
551 		uint16_t reset			: 1;
552 #endif
553 	} bits;
554 } phyxs_control_t, *p_phyxs_control_t, pcs_control_t, *p_pcs_control_t;
555 
556 
557 /* PMD/Optics Digital Control Register (Dev=3 Addr=0xc800) */
558 
559 typedef	union _control {
560 	uint16_t value;
561 	struct {
562 #ifdef _BIT_FIELDS_HTOL
563 		uint16_t optxenb_lvl		: 1;
564 		uint16_t optxrst_lvl		: 1;
565 		uint16_t opbiasflt_lvl		: 1;
566 		uint16_t obtmpflt_lvl		: 1;
567 		uint16_t opprflt_lvl		: 1;
568 		uint16_t optxflt_lvl		: 1;
569 		uint16_t optrxlos_lvl		: 1;
570 		uint16_t oprxflt_lvl		: 1;
571 		uint16_t optxon_lvl		: 1;
572 		uint16_t res1			: 7;
573 #else
574 		uint16_t res1			: 7;
575 		uint16_t optxon_lvl		: 1;
576 		uint16_t oprxflt_lvl		: 1;
577 		uint16_t optrxlos_lvl		: 1;
578 		uint16_t optxflt_lvl		: 1;
579 		uint16_t opprflt_lvl		: 1;
580 		uint16_t obtmpflt_lvl		: 1;
581 		uint16_t opbiasflt_lvl		: 1;
582 		uint16_t optxrst_lvl		: 1;
583 		uint16_t optxenb_lvl		: 1;
584 #endif
585 	} bits;
586 } control_t, *p_control_t;
587 
588 typedef	union _pmd_tx_control {
589 	uint16_t value;
590 	struct {
591 #ifdef _BIT_FIELDS_HTOL
592 		uint16_t res1			: 7;
593 		uint16_t xfp_clken		: 1;
594 		uint16_t tx_dac_txd		: 2;
595 		uint16_t tx_dac_txck		: 2;
596 		uint16_t tsd_lpwren		: 1;
597 		uint16_t tsck_lpwren		: 1;
598 		uint16_t cmu_lpwren		: 1;
599 		uint16_t sfiforst		: 1;
600 #else
601 		uint16_t sfiforst		: 1;
602 		uint16_t cmu_lpwren		: 1;
603 		uint16_t tsck_lpwren		: 1;
604 		uint16_t tsd_lpwren		: 1;
605 		uint16_t tx_dac_txck		: 2;
606 		uint16_t tx_dac_txd		: 2;
607 		uint16_t xfp_clken		: 1;
608 		uint16_t res1			: 7;
609 #endif
610 	} bits;
611 } pmd_tx_control_t, *p_pmd_tx_control_t;
612 
613 
614 /* PMD/Optics Digital Control Register (Dev=3 Addr=0xc808) */
615 
616 
617 /* PMD/Optics Digital Control Register (Dev=3 Addr=0xc808) */
618 
619 typedef	union _optics_dcntr {
620 	uint16_t value;
621 	struct {
622 #ifdef _BIT_FIELDS_HTOL
623 		uint16_t fault_mode		: 1;
624 		uint16_t tx_pwrdown		: 1;
625 		uint16_t rx_pwrdown		: 1;
626 		uint16_t ext_flt_en		: 1;
627 		uint16_t opt_rst		: 1;
628 		uint16_t pcs_tx_inv_b		: 1;
629 		uint16_t pcs_rx_inv		: 1;
630 		uint16_t res3			: 2;
631 		uint16_t gpio_sel		: 2;
632 		uint16_t res2			: 1;
633 		uint16_t lpbk_err_dis		: 1;
634 		uint16_t res1			: 2;
635 		uint16_t txonoff_pwdwn_dis	: 1;
636 #else
637 		uint16_t txonoff_pwdwn_dis	: 1;
638 		uint16_t res1			: 2;
639 		uint16_t lpbk_err_dis		: 1;
640 		uint16_t res2			: 1;
641 		uint16_t gpio_sel		: 2;
642 		uint16_t res3			: 2;
643 		uint16_t pcs_rx_inv		: 1;
644 		uint16_t pcs_tx_inv_b		: 1;
645 		uint16_t opt_rst		: 1;
646 		uint16_t ext_flt_en		: 1;
647 		uint16_t rx_pwrdown		: 1;
648 		uint16_t tx_pwrdown		: 1;
649 		uint16_t fault_mode		: 1;
650 #endif
651 	} bits;
652 } optics_dcntr_t, *p_optics_dcntr_t;
653 
654 /* PMD Receive Signal Detect Register (Dev = 1 Register Address = 0x000A) */
655 
656 #define	PMD_RX_SIG_DET3			0x10
657 #define	PMD_RX_SIG_DET2			0x08
658 #define	PMD_RX_SIG_DET1			0x04
659 #define	PMD_RX_SIG_DET0			0x02
660 #define	GLOB_PMD_RX_SIG_OK		0x01
661 
662 /* 10GBase-R PCS Status Register (Dev = 3, Register Address = 0x0020) */
663 
664 #define	PCS_10GBASE_RX_LINK_STATUS	0x1000
665 #define	PCS_PRBS31_ABLE			0x0004
666 #define	PCS_10GBASE_R_HI_BER		0x0002
667 #define	PCS_10GBASE_R_PCS_BLK_LOCK	0x0001
668 
669 /* XGXS Lane Status Register (Dev = 4, Register Address = 0x0018) */
670 
671 #define	XGXS_LANE_ALIGN_STATUS		0x1000
672 #define	XGXS_PATTERN_TEST_ABILITY	0x0800
673 #define	XGXS_LANE3_SYNC			0x0008
674 #define	XGXS_LANE2_SYNC			0x0004
675 #define	XGXS_LANE1_SYNC			0x0002
676 #define	XGXS_LANE0_SYNC			0x0001
677 
678 #ifdef	__cplusplus
679 }
680 #endif
681 
682 #endif	/* _SYS_NXGE_NXGE_PHY_HW_H */
683