Lines Matching +full:3 +full:base +full:- +full:x
1 // SPDX-License-Identifier: GPL-2.0-only
2 /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
50 #define PLL_IPSETI(x) ((x) & 0x3f) argument
52 #define PLL_CPSETI(x) ((x) & 0xff) argument
54 #define PLL_IPSETP(x) ((x) & 0x3f) argument
56 #define PLL_CPSETP(x) ((x) & 0x1f) argument
58 #define PLL_RCTRL(x) (((x) & 0xf) << 4) argument
59 #define PLL_CCTRL(x) ((x) & 0xf) argument
61 #define LANE_MODE(x) ((x) & 0x1f) argument
64 #define SYSCLK_AC_COUPLE BIT(3)
70 #define SYSCLK_SEL_CMOS BIT(3)
77 #define DEC_START1(x) ((x) & 0x7f) argument
80 #define DIV_FRAC_START(x) ((x) & 0x7f) argument
83 #define DIV_FRAC_START3(x) ((x) & 0xf) argument
91 #define TX_EMP_POST1_LVL(x) ((x) & 0x1f) argument
94 #define TX_DRV_LVL(x) ((x) & 0xf) argument
100 #define FIRSTORDER_THRESH(x) (((x) & 0x7) << 3) argument
101 #define SECONDORDERGAIN(x) ((x) & 0x7) argument
103 #define RX_EQ_GAIN2(x) (((x) & 0xf) << 4) argument
104 #define RX_EQ_GAIN1(x) ((x) & 0xf) argument
111 #define CLKBUF_L_EN BIT(3)
116 #define L0_RX_TERM_MODE(x) (((x) & 3) << 4) argument
125 #define L0_DRV_LVL(x) ((x) & 0xf) argument
128 #define CDR_MAX_CNT(x) ((x) & 0xff) argument
130 #define PLLLOCK_CMP(x) ((x) & 0xff) argument
139 static void emac_reg_write_all(void __iomem *base, in emac_reg_write_all() argument
145 writel(itr->val, base + itr->offset); in emac_reg_write_all()
182 DIV_FRAC_START3_MUX | DIV_FRAC_START3(3)},
192 SECONDORDERENABLE | FIRSTORDER_THRESH(3) | SECONDORDERGAIN(2)},
194 SECONDORDERENABLE | FIRSTORDER_THRESH(3) | SECONDORDERGAIN(4)},
209 struct emac_sgmii *phy = &adpt->phy; in emac_sgmii_init_fsm9900()
212 emac_reg_write_all(phy->base, physical_coding_sublayer_programming, in emac_sgmii_init_fsm9900()
214 emac_reg_write_all(phy->base, sysclk_refclk_setting, in emac_sgmii_init_fsm9900()
216 emac_reg_write_all(phy->base, pll_setting, ARRAY_SIZE(pll_setting)); in emac_sgmii_init_fsm9900()
217 emac_reg_write_all(phy->base, cdr_setting, ARRAY_SIZE(cdr_setting)); in emac_sgmii_init_fsm9900()
218 emac_reg_write_all(phy->base, tx_rx_setting, ARRAY_SIZE(tx_rx_setting)); in emac_sgmii_init_fsm9900()
221 writel(SERDES_START, phy->base + EMAC_SGMII_PHY_SERDES_START); in emac_sgmii_init_fsm9900()
224 if (readl(phy->base + EMAC_QSERDES_COM_RESET_SM) & READY) in emac_sgmii_init_fsm9900()
230 netdev_err(adpt->netdev, "error: ser/des failed to start\n"); in emac_sgmii_init_fsm9900()
231 return -EIO; in emac_sgmii_init_fsm9900()
234 writel(0, phy->base + EMAC_SGMII_PHY_INTERRUPT_MASK); in emac_sgmii_init_fsm9900()