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.
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.
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]
22 * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
25 #ifndef _SYS_NXGE_NXGE_N2_ESR_HW_H
26 #define _SYS_NXGE_NXGE_N2_ESR_HW_H
32 #define ESR_N2_DEV_ADDR 0x1E
33 #define ESR_N2_BASE 0x8000
36 * Definitions for TI WIZ6C2xxN2x0 Macro Family.
39 /* Register Blocks base address */
41 #define ESR_N2_PLL_REG_OFFSET 0
42 #define ESR_N2_TEST_REG_OFFSET 0x004
43 #define ESR_N2_TX_REG_OFFSET 0x100
44 #define ESR_N2_TX_0_REG_OFFSET 0x100
45 #define ESR_N2_TX_1_REG_OFFSET 0x104
46 #define ESR_N2_TX_2_REG_OFFSET 0x108
47 #define ESR_N2_TX_3_REG_OFFSET 0x10c
48 #define ESR_N2_TX_4_REG_OFFSET 0x110
49 #define ESR_N2_TX_5_REG_OFFSET 0x114
50 #define ESR_N2_TX_6_REG_OFFSET 0x118
51 #define ESR_N2_TX_7_REG_OFFSET 0x11c
52 #define ESR_N2_RX_REG_OFFSET 0x120
53 #define ESR_N2_RX_0_REG_OFFSET 0x120
54 #define ESR_N2_RX_1_REG_OFFSET 0x124
55 #define ESR_N2_RX_2_REG_OFFSET 0x128
56 #define ESR_N2_RX_3_REG_OFFSET 0x12c
57 #define ESR_N2_RX_4_REG_OFFSET 0x130
58 #define ESR_N2_RX_5_REG_OFFSET 0x134
59 #define ESR_N2_RX_6_REG_OFFSET 0x138
60 #define ESR_N2_RX_7_REG_OFFSET 0x13c
61 #define ESR_N2_P1_REG_OFFSET 0x400
63 /* Register address */
65 #define ESR_N2_PLL_CFG_REG ESR_N2_BASE + ESR_N2_PLL_REG_OFFSET
66 #define ESR_N2_PLL_CFG_L_REG ESR_N2_BASE + ESR_N2_PLL_REG_OFFSET
67 #define ESR_N2_PLL_CFG_H_REG ESR_N2_BASE + ESR_N2_PLL_REG_OFFSET + 1
68 #define ESR_N2_PLL_STS_REG ESR_N2_BASE + ESR_N2_PLL_REG_OFFSET + 2
69 #define ESR_N2_PLL_STS_L_REG ESR_N2_BASE + ESR_N2_PLL_REG_OFFSET + 2
70 #define ESR_N2_PLL_STS_H_REG ESR_N2_BASE + ESR_N2_PLL_REG_OFFSET + 3
71 #define ESR_N2_TEST_CFG_REG ESR_N2_BASE + ESR_N2_TEST_REG_OFFSET
72 #define ESR_N2_TEST_CFG_L_REG ESR_N2_BASE + ESR_N2_TEST_REG_OFFSET
73 #define ESR_N2_TEST_CFG_H_REG ESR_N2_BASE + ESR_N2_TEST_REG_OFFSET + 1
75 #define ESR_N2_TX_CFG_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_TX_REG_OFFSET +\
77 #define ESR_N2_TX_CFG_L_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_TX_REG_OFFSET +\
79 #define ESR_N2_TX_CFG_H_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_TX_REG_OFFSET +\
81 #define ESR_N2_TX_STS_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_TX_REG_OFFSET +\
83 #define ESR_N2_TX_STS_L_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_TX_REG_OFFSET +\
85 #define ESR_N2_TX_STS_H_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_TX_REG_OFFSET +\
87 #define ESR_N2_RX_CFG_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_RX_REG_OFFSET +\
89 #define ESR_N2_RX_CFG_L_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_RX_REG_OFFSET +\
91 #define ESR_N2_RX_CFG_H_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_RX_REG_OFFSET +\
93 #define ESR_N2_RX_STS_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_RX_REG_OFFSET +\
95 #define ESR_N2_RX_STS_L_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_RX_REG_OFFSET +\
97 #define ESR_N2_RX_STS_H_REG_ADDR(chan) (ESR_N2_BASE + ESR_N2_RX_REG_OFFSET +\
100 /* PLL Configuration Low 16-bit word */
101 typedef union _esr_ti_cfgpll_l
{
105 #if defined(_BIT_FIELDS_HTOL)
111 #elif defined(_BIT_FIELDS_LTOH)
121 /* PLL Configurations */
122 #define CFGPLL_LB_FREQ_DEP_BANDWIDTH 0
123 #define CFGPLL_LB_LOW_BANDWIDTH 0x2
124 #define CFGPLL_LB_HIGH_BANDWIDTH 0x3
125 #define CFGPLL_MPY_4X 0
126 #define CFGPLL_MPY_5X 0x1
127 #define CFGPLL_MPY_6X 0x2
128 #define CFGPLL_MPY_8X 0x4
129 #define CFGPLL_MPY_10X 0x5
130 #define CFGPLL_MPY_12X 0x6
131 #define CFGPLL_MPY_12P5X 0x7
133 /* Rx Configuration Low 16-bit word */
135 typedef union _esr_ti_cfgrx_l
{
139 #if defined(_BIT_FIELDS_HTOL)
144 uint16_t invpair
: 1;
146 uint16_t buswidth
: 3;
149 #elif defined(_BIT_FIELDS_LTOH)
152 uint16_t buswidth
: 3;
154 uint16_t invpair
: 1;
163 /* Rx Configuration High 16-bit word */
165 typedef union _esr_ti_cfgrx_h
{
169 #if defined(_BIT_FIELDS_HTOL)
171 uint16_t bsinrxn
: 1;
172 uint16_t bsinrxp
: 1;
176 #elif defined(_BIT_FIELDS_LTOH)
180 uint16_t bsinrxp
: 1;
181 uint16_t bsinrxn
: 1;
187 /* Receive Configurations */
188 #define CFGRX_BUSWIDTH_10BIT 0
189 #define CFGRX_BUSWIDTH_8BIT 1
190 #define CFGRX_RATE_FULL 0
191 #define CFGRX_RATE_HALF 1
192 #define CFGRX_RATE_QUAD 2
193 #define CFGRX_TERM_VDDT 0
194 #define CFGRX_TERM_0P8VDDT 1
195 #define CFGRX_TERM_FLOAT 3
196 #define CFGRX_ALIGN_DIS 0
197 #define CFGRX_ALIGN_EN 1
198 #define CFGRX_ALIGN_JOG 2
199 #define CFGRX_LOS_DIS 0
200 #define CFGRX_LOS_HITHRES 1
201 #define CFGRX_LOS_LOTHRES 2
202 #define CFGRX_CDR_1ST_ORDER 0
203 #define CFGRX_CDR_2ND_ORDER_HP 1
204 #define CFGRX_CDR_2ND_ORDER_MP 2
205 #define CFGRX_CDR_2ND_ORDER_LP 3
206 #define CFGRX_CDR_1ST_ORDER_FAST_LOCK 4
207 #define CFGRX_CDR_2ND_ORDER_HP_FAST_LOCK 5
208 #define CFGRX_CDR_2ND_ORDER_MP_FAST_LOCK 6
209 #define CFGRX_CDR_2ND_ORDER_LP_FAST_LOCK 7
210 #define CFGRX_EQ_MAX_LF 0
211 #define CFGRX_EQ_ADAPTIVE_LP_ADAPTIVE_ZF 0x1
212 #define CFGRX_EQ_ADAPTIVE_LF_1084MHZ_ZF 0x8
213 #define CFGRX_EQ_ADAPTIVE_LF_805MHZ_ZF 0x9
214 #define CFGRX_EQ_ADAPTIVE_LP_573MHZ_ZF 0xA
215 #define CFGRX_EQ_ADAPTIVE_LP_402MHZ_ZF 0xB
216 #define CFGRX_EQ_ADAPTIVE_LP_304MHZ_ZF 0xC
217 #define CFGRX_EQ_ADAPTIVE_LP_216MHZ_ZF 0xD
218 #define CFGRX_EQ_ADAPTIVE_LP_156MHZ_ZF 0xE
219 #define CFGRX_EQ_ADAPTIVE_LP_135HZ_ZF 0xF
221 /* Rx Status Low 16-bit word */
223 typedef union _esr_ti_stsrx_l
{
227 #if defined(_BIT_FIELDS_HTOL)
231 uint16_t losdtct
: 1;
234 uint16_t testfail
: 1;
235 #elif defined(_BIT_FIELDS_LTOH)
236 uint16_t testfail
: 1;
239 uint16_t losdtct
: 1;
247 /* Tx Configuration Low 16-bit word */
249 typedef union _esr_ti_cfgtx_l
{
253 #if defined(_BIT_FIELDS_HTOL)
257 uint16_t invpair
: 1;
259 uint16_t buswwidth
: 3;
262 #elif defined(_BIT_FIELDS_LTOH)
265 uint16_t buswwidth
: 3;
267 uint16_t invpair
: 1;
275 /* Tx Configuration High 16-bit word */
277 typedef union _esr_ti_cfgtx_h
{
281 #if defined(_BIT_FIELDS_HTOL)
285 #elif defined(_BIT_FIELDS_LTOH)
293 /* Transmit Configurations */
294 #define CFGTX_BUSWIDTH_10BIT 0
295 #define CFGTX_BUSWIDTH_8BIT 1
296 #define CFGTX_RATE_FULL 0
297 #define CFGTX_RATE_HALF 1
298 #define CFGTX_RATE_QUAD 2
299 #define CFGTX_SWING_125MV 0
300 #define CFGTX_SWING_250MV 1
301 #define CFGTX_SWING_500MV 2
302 #define CFGTX_SWING_625MV 3
303 #define CFGTX_SWING_750MV 4
304 #define CFGTX_SWING_1000MV 5
305 #define CFGTX_SWING_1250MV 6
306 #define CFGTX_SWING_1375MV 7
308 #define CFGTX_DE_4P76 1
309 #define CFGTX_DE_9P52 2
310 #define CFGTX_DE_14P28 3
311 #define CFGTX_DE_19P04 4
312 #define CFGTX_DE_23P8 5
313 #define CFGTX_DE_28P56 6
314 #define CFGTX_DE_33P32 7
316 /* Test Configuration */
318 typedef union _esr_ti_testcfg
{
322 #if defined(_BIT_FIELDS_HTOL)
327 uint16_t enbspls
: 1;
330 uint16_t loopback
: 2;
332 uint16_t enrxpatt
: 1;
333 uint16_t entxpatt
: 1;
334 uint16_t testpatt
: 2;
335 #elif defined(_BIT_FIELDS_LTOH)
336 uint16_t testpatt
: 2;
337 uint16_t entxpatt
: 1;
338 uint16_t enrxpatt
: 1;
340 uint16_t loopback
: 2;
343 uint16_t enbspls
: 1;
352 #define TESTCFG_PAD_LOOPBACK 0x1
353 #define TESTCFG_INNER_CML_DIS_LOOPBACK 0x2
354 #define TESTCFG_INNER_CML_EN_LOOOPBACK 0x3
357 * Definitions for TI WIZ7c2xxn5x1 Macro Family (KT/NIU).
360 /* PLL_CFG: PLL Configuration Low 16-bit word */
361 typedef union _k_esr_ti_cfgpll_l
{
365 #if defined(_BIT_FIELDS_HTOL)
371 uint16_t divclken
: 1;
374 #elif defined(_BIT_FIELDS_LTOH)
377 uint16_t divclken
: 1;
385 } k_esr_ti_cfgpll_l_t
;
387 /* PLL Configurations */
388 #define K_CFGPLL_ENABLE_PLL 1
389 #define K_CFGPLL_MPY_4X 0x10
390 #define K_CFGPLL_MPY_5X 0x14
391 #define K_CFGPLL_MPY_6X 0x18
392 #define K_CFGPLL_MPY_8X 0x20
393 #define K_CFGPLL_MPY_8P25X 0x21
394 #define K_CFGPLL_MPY_10X 0x28
395 #define K_CFGPLL_MPY_12X 0x30
396 #define K_CFGPLL_MPY_12P5X 0x32
397 #define K_CFGPLL_MPY_15X 0x3c
398 #define K_CFGPLL_MPY_16X 0x40
399 #define K_CFGPLL_MPY_16P5X 0x42
400 #define K_CFGPLL_MPY_20X 0x50
401 #define K_CFGPLL_MPY_22X 0x58
402 #define K_CFGPLL_MPY_25X 0x64
403 #define K_CFGPLL_ENABLE_DIVCLKEN 0x100
406 typedef union _k_esr_ti_pll_sts
{
410 #if defined(_BIT_FIELDS_HTOL)
415 #elif defined(_BIT_FIELDS_LTOH)
422 } k_esr_ti_pll_sts_t
;
425 typedef union _kt_esr_ti_testcfg
{
429 #if defined(_BIT_FIELDS_HTOL)
431 uint16_t testpatt2
: 3;
432 uint16_t testpatt1
: 3;
436 #elif defined(_BIT_FIELDS_LTOH)
440 uint16_t testpatt1
: 3;
441 uint16_t testpatt2
: 3;
445 } k_esr_ti_testcfg_t
;
447 #define K_TESTCFG_ENBSTX 0x1
448 #define K_TESTCFG_ENBSRX 0x2
449 #define K_TESTCFG_ENBSPT 0x4
451 /* TX_CFG: Tx Configuration Low 16-bit word */
453 typedef union _k_esr_ti_cfgtx_l
{
457 #if defined(_BIT_FIELDS_HTOL)
461 uint16_t invpair
: 1;
463 uint16_t buswwidth
: 4;
465 #elif defined(_BIT_FIELDS_LTOH)
467 uint16_t buswwidth
: 4;
469 uint16_t invpair
: 1;
475 } k_esr_ti_cfgtx_l_t
;
477 /* Tx Configuration High 16-bit word */
479 typedef union _k_esr_ti_cfgtx_h
{
483 #if defined(_BIT_FIELDS_HTOL)
487 uint16_t loopback
: 2;
494 #elif defined(_BIT_FIELDS_LTOH)
501 uint16_t loopback
: 2;
507 } k_esr_ti_cfgtx_h_t
;
509 /* Transmit Configurations (TBD) */
510 #define K_CFGTX_ENABLE_TX 0x1
511 #define K_CFGTX_ENABLE_MSYNC 0x1
513 #define K_CFGTX_BUSWIDTH_10BIT 0
514 #define K_CFGTX_BUSWIDTH_8BIT 1
515 #define K_CFGTX_RATE_FULL 0
516 #define K_CFGTX_RATE_HALF 0x1
517 #define K_CFGTX_RATE_QUAD 2
518 #define K_CFGTX_SWING_125MV 0
519 #define K_CFGTX_SWING_250MV 1
520 #define K_CFGTX_SWING_500MV 2
521 #define K_CFGTX_SWING_625MV 3
522 #define K_CFGTX_SWING_750MV 4
523 #define K_CFGTX_SWING_1000MV 5
524 #define K_CFGTX_SWING_1250MV 6
525 #define K_CFGTX_SWING_1375MV 7
526 #define K_CFGTX_SWING_2000MV 0xf
527 #define K_CFGTX_DE_0 0
528 #define K_CFGTX_DE_4P76 1
529 #define K_CFGTX_DE_9P52 2
530 #define K_CFGTX_DE_14P28 3
531 #define K_CFGTX_DE_19P04 4
532 #define K_CFGTX_DE_23P8 5
533 #define K_CFGTX_DE_28P56 6
534 #define K_CFGTX_DE_33P32 7
535 #define K_CFGTX_DIS_LOOPBACK 0x0
536 #define K_CFGTX_BUMP_PAD_LOOPBACK 0x1
537 #define K_CFGTX_INNER_CML_DIS_LOOPBACK 0x2
538 #define K_CFGTX_INNER_CML_ENA_LOOPBACK 0x3
541 typedef union _k_esr_ti_tx_sts
{
545 #if defined(_BIT_FIELDS_HTOL)
547 uint16_t rdtctip
: 1;
548 uint16_t testfail
: 1;
549 #elif defined(_BIT_FIELDS_LTOH)
550 uint16_t testfail
: 1;
551 uint16_t rdtctip
: 1;
557 /* Rx Configuration Low 16-bit word */
559 typedef union _k_esr_ti_cfgrx_l
{
563 #if defined(_BIT_FIELDS_HTOL)
567 uint16_t invpair
: 1;
569 uint16_t buswidth
: 4;
571 #elif defined(_BIT_FIELDS_LTOH)
573 uint16_t buswidth
: 4;
575 uint16_t invpair
: 1;
581 } k_esr_ti_cfgrx_l_t
;
583 /* Rx Configuration High 16-bit word */
585 typedef union _k_esr_ti_cfgrx_h
{
589 #if defined(_BIT_FIELDS_HTOL)
591 uint16_t bsinrxn
: 1;
592 uint16_t bsinrxp
: 1;
593 uint16_t loopback
: 2;
598 #elif defined(_BIT_FIELDS_LTOH)
603 uint16_t loopback
: 2;
604 uint16_t bsinrxp
: 1;
605 uint16_t bsinrxn
: 1;
609 } k_esr_ti_cfgrx_h_t
;
611 /* Receive Configurations (TBD) */
612 #define K_CFGRX_ENABLE_RX 0x1
614 #define K_CFGRX_BUSWIDTH_10BIT 0
615 #define K_CFGRX_BUSWIDTH_8BIT 1
616 #define K_CFGRX_RATE_FULL 0
617 #define K_CFGRX_RATE_HALF 1
618 #define K_CFGRX_RATE_QUAD 2
619 #define K_CFGRX_TERM_VDDT 0
620 #define K_CFGRX_TERM_0P8VDDT 1
621 #define K_CFGRX_TERM_FLOAT 3
622 #define K_CFGRX_ALIGN_DIS 0x0
623 #define K_CFGRX_ALIGN_EN 0x1
624 #define K_CFGRX_ALIGN_JOG 0x2
625 #define K_CFGRX_LOS_DIS 0x0
626 #define K_CFGRX_LOS_ENABLE 0x2
627 #define K_CFGRX_CDR_1ST_ORDER 0
628 #define K_CFGRX_CDR_2ND_ORDER_HP 1
629 #define K_CFGRX_CDR_2ND_ORDER_MP 2
630 #define K_CFGRX_CDR_2ND_ORDER_LP 3
631 #define K_CFGRX_CDR_1ST_ORDER_FAST_LOCK 4
632 #define K_CFGRX_CDR_2ND_ORDER_HP_FAST_LOCK 5
633 #define K_CFGRX_CDR_2ND_ORDER_MP_FAST_LOCK 6
634 #define K_CFGRX_CDR_2ND_ORDER_LP_FAST_LOCK 7
635 #define K_CFGRX_EQ_MAX_LF_ZF 0
636 #define K_CFGRX_EQ_ADAPTIVE 0x1
637 #define K_CFGRX_EQ_ADAPTIVE_LF_365MHZ_ZF 0x8
638 #define K_CFGRX_EQ_ADAPTIVE_LF_275MHZ_ZF 0x9
639 #define K_CFGRX_EQ_ADAPTIVE_LP_195MHZ_ZF 0xa
640 #define K_CFGRX_EQ_ADAPTIVE_LP_140MHZ_ZF 0xb
641 #define K_CFGRX_EQ_ADAPTIVE_LP_105MHZ_ZF 0xc
642 #define K_CFGRX_EQ_ADAPTIVE_LP_75MHZ_ZF 0xd
643 #define K_CFGRX_EQ_ADAPTIVE_LP_55MHZ_ZF 0xe
644 #define K_CFGRX_EQ_ADAPTIVE_LP_50HZ_ZF 0xf
646 /* Rx Status Low 16-bit word */
648 typedef union _k_esr_ti_stsrx_l
{
652 #if defined(_BIT_FIELDS_HTOL)
656 uint16_t losdtct
: 1;
659 uint16_t testfail
: 1;
660 #elif defined(_BIT_FIELDS_LTOH)
661 uint16_t testfail
: 1;
664 uint16_t losdtct
: 1;
670 } k_esr_ti_stsrx_l_t
;
672 #define K_TESTCFG_INNER_CML_EN_LOOOPBACK 0x3
675 * struct for Serdes properties
677 typedef struct _nxge_serdes_prop_t
{
684 } nxge_serdes_prop_t
, *p_nxge_serdes_prop_t
;
686 /* Bit array with 1 bit for every serdes property set */
687 #define NXGE_SRDS_TXCFGL 0x1
688 #define NXGE_SRDS_TXCFGH 0x2
689 #define NXGE_SRDS_RXCFGL 0x4
690 #define NXGE_SRDS_RXCFGH 0x8
691 #define NXGE_SRDS_PLLCFGL 0x10
697 #endif /* _SYS_NXGE_NXGE_N2_ESR_HW_H */