xref: /linux/include/soc/mscc/ocelot_dev.h (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1964ee5c8SVladimir Oltean /* SPDX-License-Identifier: (GPL-2.0 OR MIT) */
2964ee5c8SVladimir Oltean /*
3964ee5c8SVladimir Oltean  * Microsemi Ocelot Switch driver
4964ee5c8SVladimir Oltean  *
5964ee5c8SVladimir Oltean  * Copyright (c) 2017 Microsemi Corporation
6964ee5c8SVladimir Oltean  */
7964ee5c8SVladimir Oltean 
8964ee5c8SVladimir Oltean #ifndef _MSCC_OCELOT_DEV_H_
9964ee5c8SVladimir Oltean #define _MSCC_OCELOT_DEV_H_
10964ee5c8SVladimir Oltean 
11964ee5c8SVladimir Oltean #define DEV_CLOCK_CFG_MAC_TX_RST                          BIT(7)
12964ee5c8SVladimir Oltean #define DEV_CLOCK_CFG_MAC_RX_RST                          BIT(6)
13964ee5c8SVladimir Oltean #define DEV_CLOCK_CFG_PCS_TX_RST                          BIT(5)
14964ee5c8SVladimir Oltean #define DEV_CLOCK_CFG_PCS_RX_RST                          BIT(4)
15964ee5c8SVladimir Oltean #define DEV_CLOCK_CFG_PORT_RST                            BIT(3)
16964ee5c8SVladimir Oltean #define DEV_CLOCK_CFG_PHY_RST                             BIT(2)
17964ee5c8SVladimir Oltean #define DEV_CLOCK_CFG_LINK_SPEED(x)                       ((x) & GENMASK(1, 0))
18964ee5c8SVladimir Oltean #define DEV_CLOCK_CFG_LINK_SPEED_M                        GENMASK(1, 0)
19964ee5c8SVladimir Oltean 
20964ee5c8SVladimir Oltean #define DEV_PORT_MISC_FWD_ERROR_ENA                       BIT(4)
21964ee5c8SVladimir Oltean #define DEV_PORT_MISC_FWD_PAUSE_ENA                       BIT(3)
22964ee5c8SVladimir Oltean #define DEV_PORT_MISC_FWD_CTRL_ENA                        BIT(2)
23964ee5c8SVladimir Oltean #define DEV_PORT_MISC_DEV_LOOP_ENA                        BIT(1)
24964ee5c8SVladimir Oltean #define DEV_PORT_MISC_HDX_FAST_DIS                        BIT(0)
25964ee5c8SVladimir Oltean 
26964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_ENA                               BIT(22)
27964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_TIMER_AGE(x)                      (((x) << 15) & GENMASK(21, 15))
28964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_TIMER_AGE_M                       GENMASK(21, 15)
29964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_TIMER_AGE_X(x)                    (((x) & GENMASK(21, 15)) >> 15)
30964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_TIMER_WAKEUP(x)                   (((x) << 8) & GENMASK(14, 8))
31964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_TIMER_WAKEUP_M                    GENMASK(14, 8)
32964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_TIMER_WAKEUP_X(x)                 (((x) & GENMASK(14, 8)) >> 8)
33964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_TIMER_HOLDOFF(x)                  (((x) << 1) & GENMASK(7, 1))
34964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_TIMER_HOLDOFF_M                   GENMASK(7, 1)
35964ee5c8SVladimir Oltean #define DEV_EEE_CFG_EEE_TIMER_HOLDOFF_X(x)                (((x) & GENMASK(7, 1)) >> 1)
36964ee5c8SVladimir Oltean #define DEV_EEE_CFG_PORT_LPI                              BIT(0)
37964ee5c8SVladimir Oltean 
38964ee5c8SVladimir Oltean #define DEV_PTP_PREDICT_CFG_PTP_PHY_PREDICT_CFG(x)        (((x) << 4) & GENMASK(11, 4))
39964ee5c8SVladimir Oltean #define DEV_PTP_PREDICT_CFG_PTP_PHY_PREDICT_CFG_M         GENMASK(11, 4)
40964ee5c8SVladimir Oltean #define DEV_PTP_PREDICT_CFG_PTP_PHY_PREDICT_CFG_X(x)      (((x) & GENMASK(11, 4)) >> 4)
41964ee5c8SVladimir Oltean #define DEV_PTP_PREDICT_CFG_PTP_PHASE_PREDICT_CFG(x)      ((x) & GENMASK(3, 0))
42964ee5c8SVladimir Oltean #define DEV_PTP_PREDICT_CFG_PTP_PHASE_PREDICT_CFG_M       GENMASK(3, 0)
43964ee5c8SVladimir Oltean 
44964ee5c8SVladimir Oltean #define DEV_MAC_ENA_CFG_RX_ENA                            BIT(4)
45964ee5c8SVladimir Oltean #define DEV_MAC_ENA_CFG_TX_ENA                            BIT(0)
46964ee5c8SVladimir Oltean 
47964ee5c8SVladimir Oltean #define DEV_MAC_MODE_CFG_FC_WORD_SYNC_ENA                 BIT(8)
48964ee5c8SVladimir Oltean #define DEV_MAC_MODE_CFG_GIGA_MODE_ENA                    BIT(4)
49964ee5c8SVladimir Oltean #define DEV_MAC_MODE_CFG_FDX_ENA                          BIT(0)
50964ee5c8SVladimir Oltean 
51964ee5c8SVladimir Oltean #define DEV_MAC_TAGS_CFG_TAG_ID(x)                        (((x) << 16) & GENMASK(31, 16))
52964ee5c8SVladimir Oltean #define DEV_MAC_TAGS_CFG_TAG_ID_M                         GENMASK(31, 16)
53964ee5c8SVladimir Oltean #define DEV_MAC_TAGS_CFG_TAG_ID_X(x)                      (((x) & GENMASK(31, 16)) >> 16)
54964ee5c8SVladimir Oltean #define DEV_MAC_TAGS_CFG_VLAN_LEN_AWR_ENA                 BIT(2)
55a8015dedSVladimir Oltean #define DEV_MAC_TAGS_CFG_VLAN_DBL_AWR_ENA                 BIT(1)
56964ee5c8SVladimir Oltean #define DEV_MAC_TAGS_CFG_VLAN_AWR_ENA                     BIT(0)
57964ee5c8SVladimir Oltean 
58964ee5c8SVladimir Oltean #define DEV_MAC_ADV_CHK_CFG_LEN_DROP_ENA                  BIT(0)
59964ee5c8SVladimir Oltean 
60964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_RESTORE_OLD_IPG_CHECK             BIT(17)
61964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_REDUCED_TX_IFG                    BIT(16)
62964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_TX_IFG(x)                         (((x) << 8) & GENMASK(12, 8))
63964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_TX_IFG_M                          GENMASK(12, 8)
64964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_TX_IFG_X(x)                       (((x) & GENMASK(12, 8)) >> 8)
65964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_RX_IFG2(x)                        (((x) << 4) & GENMASK(7, 4))
66964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_RX_IFG2_M                         GENMASK(7, 4)
67964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_RX_IFG2_X(x)                      (((x) & GENMASK(7, 4)) >> 4)
68964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_RX_IFG1(x)                        ((x) & GENMASK(3, 0))
69964ee5c8SVladimir Oltean #define DEV_MAC_IFG_CFG_RX_IFG1_M                         GENMASK(3, 0)
70964ee5c8SVladimir Oltean 
71964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_BYPASS_COL_SYNC                   BIT(26)
72964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_OB_ENA                            BIT(25)
73964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_WEXC_DIS                          BIT(24)
74964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_SEED(x)                           (((x) << 16) & GENMASK(23, 16))
75964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_SEED_M                            GENMASK(23, 16)
76964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_SEED_X(x)                         (((x) & GENMASK(23, 16)) >> 16)
77964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_SEED_LOAD                         BIT(12)
78964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_RETRY_AFTER_EXC_COL_ENA           BIT(8)
79964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_LATE_COL_POS(x)                   ((x) & GENMASK(6, 0))
80964ee5c8SVladimir Oltean #define DEV_MAC_HDX_CFG_LATE_COL_POS_M                    GENMASK(6, 0)
81964ee5c8SVladimir Oltean 
82964ee5c8SVladimir Oltean #define DEV_MAC_DBG_CFG_TBI_MODE                          BIT(4)
83964ee5c8SVladimir Oltean #define DEV_MAC_DBG_CFG_IFG_CRS_EXT_CHK_ENA               BIT(0)
84964ee5c8SVladimir Oltean 
85964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_RX_IPG_SHRINK_STICKY               BIT(9)
86964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_RX_PREAM_SHRINK_STICKY             BIT(8)
87964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_RX_CARRIER_EXT_STICKY              BIT(7)
88964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_RX_CARRIER_EXT_ERR_STICKY          BIT(6)
89964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_RX_JUNK_STICKY                     BIT(5)
90964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_TX_RETRANSMIT_STICKY               BIT(4)
91964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_TX_JAM_STICKY                      BIT(3)
92964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_TX_FIFO_OFLW_STICKY                BIT(2)
93964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_TX_FRM_LEN_OVR_STICKY              BIT(1)
94964ee5c8SVladimir Oltean #define DEV_MAC_STICKY_TX_ABORT_STICKY                    BIT(0)
95964ee5c8SVladimir Oltean 
96*6505b680SVladimir Oltean #define DEV_MM_CONFIG_ENABLE_CONFIG_MM_RX_ENA             BIT(0)
97*6505b680SVladimir Oltean #define DEV_MM_CONFIG_ENABLE_CONFIG_MM_TX_ENA             BIT(4)
98*6505b680SVladimir Oltean #define DEV_MM_CONFIG_ENABLE_CONFIG_KEEP_S_AFTER_D        BIT(8)
99*6505b680SVladimir Oltean 
100*6505b680SVladimir Oltean #define DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_DIS         BIT(0)
101*6505b680SVladimir Oltean #define DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_TIME(x)     (((x) << 4) & GENMASK(11, 4))
102*6505b680SVladimir Oltean #define DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_TIME_M      GENMASK(11, 4)
103*6505b680SVladimir Oltean #define DEV_MM_CONFIG_VERIF_CONFIG_PRM_VERIFY_TIME_X(x)   (((x) & GENMASK(11, 4)) >> 4)
104*6505b680SVladimir Oltean #define DEV_MM_CONFIG_VERIF_CONFIG_VERIF_TIMER_UNITS(x)   (((x) << 12) & GENMASK(13, 12))
105*6505b680SVladimir Oltean #define DEV_MM_CONFIG_VERIF_CONFIG_VERIF_TIMER_UNITS_M    GENMASK(13, 12)
106*6505b680SVladimir Oltean #define DEV_MM_CONFIG_VERIF_CONFIG_VERIF_TIMER_UNITS_X(x) (((x) & GENMASK(13, 12)) >> 12)
107*6505b680SVladimir Oltean 
108*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_PRMPT_ACTIVE_STATUS         BIT(0)
109*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_PRMPT_ACTIVE_STICKY         BIT(4)
110*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_PRMPT_VERIFY_STATE(x)       (((x) << 8) & GENMASK(10, 8))
111*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_PRMPT_VERIFY_STATE_M        GENMASK(10, 8)
112*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_PRMPT_VERIFY_STATE_X(x)     (((x) & GENMASK(10, 8)) >> 8)
113*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_UNEXP_RX_PFRM_STICKY        BIT(12)
114*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_UNEXP_TX_PFRM_STICKY        BIT(16)
115*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_MM_RX_FRAME_STATUS          BIT(20)
116*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_MM_TX_FRAME_STATUS          BIT(24)
117*6505b680SVladimir Oltean #define DEV_MM_STAT_MM_STATUS_MM_TX_PRMPT_STATUS          BIT(28)
118*6505b680SVladimir Oltean 
119964ee5c8SVladimir Oltean #define PCS1G_CFG_LINK_STATUS_TYPE                        BIT(4)
120964ee5c8SVladimir Oltean #define PCS1G_CFG_AN_LINK_CTRL_ENA                        BIT(1)
121964ee5c8SVladimir Oltean #define PCS1G_CFG_PCS_ENA                                 BIT(0)
122964ee5c8SVladimir Oltean 
123964ee5c8SVladimir Oltean #define PCS1G_MODE_CFG_UNIDIR_MODE_ENA                    BIT(4)
124964ee5c8SVladimir Oltean #define PCS1G_MODE_CFG_SGMII_MODE_ENA                     BIT(0)
125964ee5c8SVladimir Oltean 
126964ee5c8SVladimir Oltean #define PCS1G_SD_CFG_SD_SEL                               BIT(8)
127964ee5c8SVladimir Oltean #define PCS1G_SD_CFG_SD_POL                               BIT(4)
128964ee5c8SVladimir Oltean #define PCS1G_SD_CFG_SD_ENA                               BIT(0)
129964ee5c8SVladimir Oltean 
130964ee5c8SVladimir Oltean #define PCS1G_ANEG_CFG_ADV_ABILITY(x)                     (((x) << 16) & GENMASK(31, 16))
131964ee5c8SVladimir Oltean #define PCS1G_ANEG_CFG_ADV_ABILITY_M                      GENMASK(31, 16)
132964ee5c8SVladimir Oltean #define PCS1G_ANEG_CFG_ADV_ABILITY_X(x)                   (((x) & GENMASK(31, 16)) >> 16)
133964ee5c8SVladimir Oltean #define PCS1G_ANEG_CFG_SW_RESOLVE_ENA                     BIT(8)
134964ee5c8SVladimir Oltean #define PCS1G_ANEG_CFG_ANEG_RESTART_ONE_SHOT              BIT(1)
135964ee5c8SVladimir Oltean #define PCS1G_ANEG_CFG_ANEG_ENA                           BIT(0)
136964ee5c8SVladimir Oltean 
137964ee5c8SVladimir Oltean #define PCS1G_ANEG_NP_CFG_NP_TX(x)                        (((x) << 16) & GENMASK(31, 16))
138964ee5c8SVladimir Oltean #define PCS1G_ANEG_NP_CFG_NP_TX_M                         GENMASK(31, 16)
139964ee5c8SVladimir Oltean #define PCS1G_ANEG_NP_CFG_NP_TX_X(x)                      (((x) & GENMASK(31, 16)) >> 16)
140964ee5c8SVladimir Oltean #define PCS1G_ANEG_NP_CFG_NP_LOADED_ONE_SHOT              BIT(0)
141964ee5c8SVladimir Oltean 
142964ee5c8SVladimir Oltean #define PCS1G_LB_CFG_RA_ENA                               BIT(4)
143964ee5c8SVladimir Oltean #define PCS1G_LB_CFG_GMII_PHY_LB_ENA                      BIT(1)
144964ee5c8SVladimir Oltean #define PCS1G_LB_CFG_TBI_HOST_LB_ENA                      BIT(0)
145964ee5c8SVladimir Oltean 
146964ee5c8SVladimir Oltean #define PCS1G_DBG_CFG_UDLT                                BIT(0)
147964ee5c8SVladimir Oltean 
148964ee5c8SVladimir Oltean #define PCS1G_CDET_CFG_CDET_ENA                           BIT(0)
149964ee5c8SVladimir Oltean 
150964ee5c8SVladimir Oltean #define PCS1G_ANEG_STATUS_LP_ADV_ABILITY(x)               (((x) << 16) & GENMASK(31, 16))
151964ee5c8SVladimir Oltean #define PCS1G_ANEG_STATUS_LP_ADV_ABILITY_M                GENMASK(31, 16)
152964ee5c8SVladimir Oltean #define PCS1G_ANEG_STATUS_LP_ADV_ABILITY_X(x)             (((x) & GENMASK(31, 16)) >> 16)
153964ee5c8SVladimir Oltean #define PCS1G_ANEG_STATUS_PR                              BIT(4)
154964ee5c8SVladimir Oltean #define PCS1G_ANEG_STATUS_PAGE_RX_STICKY                  BIT(3)
155964ee5c8SVladimir Oltean #define PCS1G_ANEG_STATUS_ANEG_COMPLETE                   BIT(0)
156964ee5c8SVladimir Oltean 
157964ee5c8SVladimir Oltean #define PCS1G_LINK_STATUS_DELAY_VAR(x)                    (((x) << 12) & GENMASK(15, 12))
158964ee5c8SVladimir Oltean #define PCS1G_LINK_STATUS_DELAY_VAR_M                     GENMASK(15, 12)
159964ee5c8SVladimir Oltean #define PCS1G_LINK_STATUS_DELAY_VAR_X(x)                  (((x) & GENMASK(15, 12)) >> 12)
160964ee5c8SVladimir Oltean #define PCS1G_LINK_STATUS_SIGNAL_DETECT                   BIT(8)
161964ee5c8SVladimir Oltean #define PCS1G_LINK_STATUS_LINK_STATUS                     BIT(4)
162964ee5c8SVladimir Oltean #define PCS1G_LINK_STATUS_SYNC_STATUS                     BIT(0)
163964ee5c8SVladimir Oltean 
164964ee5c8SVladimir Oltean #define PCS1G_STICKY_LINK_DOWN_STICKY                     BIT(4)
165964ee5c8SVladimir Oltean #define PCS1G_STICKY_OUT_OF_SYNC_STICKY                   BIT(0)
166964ee5c8SVladimir Oltean 
167964ee5c8SVladimir Oltean #define PCS1G_LPI_CFG_QSGMII_MS_SEL                       BIT(20)
168964ee5c8SVladimir Oltean #define PCS1G_LPI_CFG_RX_LPI_OUT_DIS                      BIT(17)
169964ee5c8SVladimir Oltean #define PCS1G_LPI_CFG_LPI_TESTMODE                        BIT(16)
170964ee5c8SVladimir Oltean #define PCS1G_LPI_CFG_LPI_RX_WTIM(x)                      (((x) << 4) & GENMASK(5, 4))
171964ee5c8SVladimir Oltean #define PCS1G_LPI_CFG_LPI_RX_WTIM_M                       GENMASK(5, 4)
172964ee5c8SVladimir Oltean #define PCS1G_LPI_CFG_LPI_RX_WTIM_X(x)                    (((x) & GENMASK(5, 4)) >> 4)
173964ee5c8SVladimir Oltean #define PCS1G_LPI_CFG_TX_ASSERT_LPIDLE                    BIT(0)
174964ee5c8SVladimir Oltean 
175964ee5c8SVladimir Oltean #define PCS1G_LPI_STATUS_RX_LPI_FAIL                      BIT(16)
176964ee5c8SVladimir Oltean #define PCS1G_LPI_STATUS_RX_LPI_EVENT_STICKY              BIT(12)
177964ee5c8SVladimir Oltean #define PCS1G_LPI_STATUS_RX_QUIET                         BIT(9)
178964ee5c8SVladimir Oltean #define PCS1G_LPI_STATUS_RX_LPI_MODE                      BIT(8)
179964ee5c8SVladimir Oltean #define PCS1G_LPI_STATUS_TX_LPI_EVENT_STICKY              BIT(4)
180964ee5c8SVladimir Oltean #define PCS1G_LPI_STATUS_TX_QUIET                         BIT(1)
181964ee5c8SVladimir Oltean #define PCS1G_LPI_STATUS_TX_LPI_MODE                      BIT(0)
182964ee5c8SVladimir Oltean 
183964ee5c8SVladimir Oltean #define PCS1G_TSTPAT_STATUS_JTP_ERR_CNT(x)                (((x) << 8) & GENMASK(15, 8))
184964ee5c8SVladimir Oltean #define PCS1G_TSTPAT_STATUS_JTP_ERR_CNT_M                 GENMASK(15, 8)
185964ee5c8SVladimir Oltean #define PCS1G_TSTPAT_STATUS_JTP_ERR_CNT_X(x)              (((x) & GENMASK(15, 8)) >> 8)
186964ee5c8SVladimir Oltean #define PCS1G_TSTPAT_STATUS_JTP_ERR                       BIT(4)
187964ee5c8SVladimir Oltean #define PCS1G_TSTPAT_STATUS_JTP_LOCK                      BIT(0)
188964ee5c8SVladimir Oltean 
189964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_SD_SEL                          BIT(26)
190964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_SD_POL                          BIT(25)
191964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_SD_ENA                          BIT(24)
192964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_LOOPBACK_ENA                    BIT(20)
193964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_SWAP_MII_ENA                    BIT(16)
194964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_RXBITSEL(x)                     (((x) << 12) & GENMASK(15, 12))
195964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_RXBITSEL_M                      GENMASK(15, 12)
196964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_RXBITSEL_X(x)                   (((x) & GENMASK(15, 12)) >> 12)
197964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_SIGDET_CFG(x)                   (((x) << 9) & GENMASK(10, 9))
198964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_SIGDET_CFG_M                    GENMASK(10, 9)
199964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_SIGDET_CFG_X(x)                 (((x) & GENMASK(10, 9)) >> 9)
200964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_LINKHYST_TM_ENA                 BIT(8)
201964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_LINKHYSTTIMER(x)                (((x) << 4) & GENMASK(7, 4))
202964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_LINKHYSTTIMER_M                 GENMASK(7, 4)
203964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_LINKHYSTTIMER_X(x)              (((x) & GENMASK(7, 4)) >> 4)
204964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_UNIDIR_MODE_ENA                 BIT(3)
205964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_FEFCHK_ENA                      BIT(2)
206964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_FEFGEN_ENA                      BIT(1)
207964ee5c8SVladimir Oltean #define DEV_PCS_FX100_CFG_PCS_ENA                         BIT(0)
208964ee5c8SVladimir Oltean 
209964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_EDGE_POS_PTP(x)              (((x) << 8) & GENMASK(11, 8))
210964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_EDGE_POS_PTP_M               GENMASK(11, 8)
211964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_EDGE_POS_PTP_X(x)            (((x) & GENMASK(11, 8)) >> 8)
212964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_PCS_ERROR_STICKY             BIT(7)
213964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_FEF_FOUND_STICKY             BIT(6)
214964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_SSD_ERROR_STICKY             BIT(5)
215964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_SYNC_LOST_STICKY             BIT(4)
216964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_FEF_STATUS                   BIT(2)
217964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_SIGNAL_DETECT                BIT(1)
218964ee5c8SVladimir Oltean #define DEV_PCS_FX100_STATUS_SYNC_STATUS                  BIT(0)
219964ee5c8SVladimir Oltean 
220964ee5c8SVladimir Oltean #endif
221