Lines Matching refs:err
246 int err; in ice_read_cgu_reg_e82x() local
248 err = ice_sbq_rw_reg(hw, &cgu_msg, ICE_AQ_FLAG_RD); in ice_read_cgu_reg_e82x()
249 if (err) { in ice_read_cgu_reg_e82x()
251 addr, err); in ice_read_cgu_reg_e82x()
252 return err; in ice_read_cgu_reg_e82x()
279 int err; in ice_write_cgu_reg_e82x() local
281 err = ice_sbq_rw_reg(hw, &cgu_msg, ICE_AQ_FLAG_RD); in ice_write_cgu_reg_e82x()
282 if (err) { in ice_write_cgu_reg_e82x()
284 addr, err); in ice_write_cgu_reg_e82x()
285 return err; in ice_write_cgu_reg_e82x()
288 return err; in ice_write_cgu_reg_e82x()
359 int err; in ice_cfg_cgu_pll_e82x() local
380 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD9, &dw9.val); in ice_cfg_cgu_pll_e82x()
381 if (err) in ice_cfg_cgu_pll_e82x()
382 return err; in ice_cfg_cgu_pll_e82x()
384 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD24, &dw24.val); in ice_cfg_cgu_pll_e82x()
385 if (err) in ice_cfg_cgu_pll_e82x()
386 return err; in ice_cfg_cgu_pll_e82x()
388 err = ice_read_cgu_reg_e82x(hw, TSPLL_RO_BWM_LF, &bwm_lf.val); in ice_cfg_cgu_pll_e82x()
389 if (err) in ice_cfg_cgu_pll_e82x()
390 return err; in ice_cfg_cgu_pll_e82x()
403 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD24, dw24.val); in ice_cfg_cgu_pll_e82x()
404 if (err) in ice_cfg_cgu_pll_e82x()
405 return err; in ice_cfg_cgu_pll_e82x()
410 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD9, dw9.val); in ice_cfg_cgu_pll_e82x()
411 if (err) in ice_cfg_cgu_pll_e82x()
412 return err; in ice_cfg_cgu_pll_e82x()
415 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD19, &dw19.val); in ice_cfg_cgu_pll_e82x()
416 if (err) in ice_cfg_cgu_pll_e82x()
417 return err; in ice_cfg_cgu_pll_e82x()
422 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD19, dw19.val); in ice_cfg_cgu_pll_e82x()
423 if (err) in ice_cfg_cgu_pll_e82x()
424 return err; in ice_cfg_cgu_pll_e82x()
427 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD22, &dw22.val); in ice_cfg_cgu_pll_e82x()
428 if (err) in ice_cfg_cgu_pll_e82x()
429 return err; in ice_cfg_cgu_pll_e82x()
434 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD22, dw22.val); in ice_cfg_cgu_pll_e82x()
435 if (err) in ice_cfg_cgu_pll_e82x()
436 return err; in ice_cfg_cgu_pll_e82x()
439 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD24, &dw24.val); in ice_cfg_cgu_pll_e82x()
440 if (err) in ice_cfg_cgu_pll_e82x()
441 return err; in ice_cfg_cgu_pll_e82x()
447 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD24, dw24.val); in ice_cfg_cgu_pll_e82x()
448 if (err) in ice_cfg_cgu_pll_e82x()
449 return err; in ice_cfg_cgu_pll_e82x()
454 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD24, dw24.val); in ice_cfg_cgu_pll_e82x()
455 if (err) in ice_cfg_cgu_pll_e82x()
456 return err; in ice_cfg_cgu_pll_e82x()
461 err = ice_read_cgu_reg_e82x(hw, TSPLL_RO_BWM_LF, &bwm_lf.val); in ice_cfg_cgu_pll_e82x()
462 if (err) in ice_cfg_cgu_pll_e82x()
463 return err; in ice_cfg_cgu_pll_e82x()
506 int err; in ice_cfg_cgu_pll_e825c() local
527 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD9, &dw9.val); in ice_cfg_cgu_pll_e825c()
528 if (err) in ice_cfg_cgu_pll_e825c()
529 return err; in ice_cfg_cgu_pll_e825c()
531 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD24, &dw24.val); in ice_cfg_cgu_pll_e825c()
532 if (err) in ice_cfg_cgu_pll_e825c()
533 return err; in ice_cfg_cgu_pll_e825c()
535 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD16_E825C, &dw16.val); in ice_cfg_cgu_pll_e825c()
536 if (err) in ice_cfg_cgu_pll_e825c()
537 return err; in ice_cfg_cgu_pll_e825c()
539 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, &dw23.val); in ice_cfg_cgu_pll_e825c()
540 if (err) in ice_cfg_cgu_pll_e825c()
541 return err; in ice_cfg_cgu_pll_e825c()
543 err = ice_read_cgu_reg_e82x(hw, TSPLL_RO_LOCK_E825C, &ro_lock.val); in ice_cfg_cgu_pll_e825c()
544 if (err) in ice_cfg_cgu_pll_e825c()
545 return err; in ice_cfg_cgu_pll_e825c()
558 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, in ice_cfg_cgu_pll_e825c()
560 if (err) in ice_cfg_cgu_pll_e825c()
561 return err; in ice_cfg_cgu_pll_e825c()
575 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD9, dw9.val); in ice_cfg_cgu_pll_e825c()
576 if (err) in ice_cfg_cgu_pll_e825c()
577 return err; in ice_cfg_cgu_pll_e825c()
582 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD16_E825C, dw16.val); in ice_cfg_cgu_pll_e825c()
583 if (err) in ice_cfg_cgu_pll_e825c()
584 return err; in ice_cfg_cgu_pll_e825c()
587 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD19, &dw19.val); in ice_cfg_cgu_pll_e825c()
588 if (err) in ice_cfg_cgu_pll_e825c()
589 return err; in ice_cfg_cgu_pll_e825c()
596 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD19, dw19.val); in ice_cfg_cgu_pll_e825c()
597 if (err) in ice_cfg_cgu_pll_e825c()
598 return err; in ice_cfg_cgu_pll_e825c()
601 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD22, &dw22.val); in ice_cfg_cgu_pll_e825c()
602 if (err) in ice_cfg_cgu_pll_e825c()
603 return err; in ice_cfg_cgu_pll_e825c()
609 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD22, dw22.val); in ice_cfg_cgu_pll_e825c()
610 if (err) in ice_cfg_cgu_pll_e825c()
611 return err; in ice_cfg_cgu_pll_e825c()
614 err = ice_read_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, &dw23.val); in ice_cfg_cgu_pll_e825c()
615 if (err) in ice_cfg_cgu_pll_e825c()
616 return err; in ice_cfg_cgu_pll_e825c()
622 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, dw23.val); in ice_cfg_cgu_pll_e825c()
623 if (err) in ice_cfg_cgu_pll_e825c()
624 return err; in ice_cfg_cgu_pll_e825c()
629 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD24, dw24.val); in ice_cfg_cgu_pll_e825c()
630 if (err) in ice_cfg_cgu_pll_e825c()
631 return err; in ice_cfg_cgu_pll_e825c()
636 err = ice_write_cgu_reg_e82x(hw, NAC_CGU_DWORD23_E825C, dw23.val); in ice_cfg_cgu_pll_e825c()
637 if (err) in ice_cfg_cgu_pll_e825c()
638 return err; in ice_cfg_cgu_pll_e825c()
643 err = ice_read_cgu_reg_e82x(hw, TSPLL_RO_LOCK_E825C, &ro_lock.val); in ice_cfg_cgu_pll_e825c()
644 if (err) in ice_cfg_cgu_pll_e825c()
645 return err; in ice_cfg_cgu_pll_e825c()
674 int err; in ice_cfg_cgu_pll_dis_sticky_bits_e82x() local
676 err = ice_read_cgu_reg_e82x(hw, TSPLL_CNTR_BIST_SETTINGS, in ice_cfg_cgu_pll_dis_sticky_bits_e82x()
678 if (err) in ice_cfg_cgu_pll_dis_sticky_bits_e82x()
679 return err; in ice_cfg_cgu_pll_dis_sticky_bits_e82x()
701 int err; in ice_cfg_cgu_pll_dis_sticky_bits_e825c() local
703 err = ice_read_cgu_reg_e82x(hw, TSPLL_BW_TDC_E825C, &bw_tdc.val); in ice_cfg_cgu_pll_dis_sticky_bits_e825c()
704 if (err) in ice_cfg_cgu_pll_dis_sticky_bits_e825c()
705 return err; in ice_cfg_cgu_pll_dis_sticky_bits_e825c()
723 int err; in ice_init_cgu_e82x() local
727 err = ice_cfg_cgu_pll_dis_sticky_bits_e825c(hw); in ice_init_cgu_e82x()
729 err = ice_cfg_cgu_pll_dis_sticky_bits_e82x(hw); in ice_init_cgu_e82x()
730 if (err) in ice_init_cgu_e82x()
731 return err; in ice_init_cgu_e82x()
737 err = ice_cfg_cgu_pll_e825c(hw, ts_info->time_ref, in ice_init_cgu_e82x()
740 err = ice_cfg_cgu_pll_e82x(hw, ts_info->time_ref, in ice_init_cgu_e82x()
743 return err; in ice_init_cgu_e82x()
893 int err; in ice_write_phy_eth56g() local
903 err = ice_sbq_rw_reg(hw, &phy_msg, ICE_AQ_FLAG_RD); in ice_write_phy_eth56g()
905 if (err) in ice_write_phy_eth56g()
907 err); in ice_write_phy_eth56g()
909 return err; in ice_write_phy_eth56g()
925 int err; in ice_read_phy_eth56g() local
935 err = ice_sbq_rw_reg(hw, &phy_msg, ICE_AQ_FLAG_RD); in ice_read_phy_eth56g()
936 if (err) { in ice_read_phy_eth56g()
938 err); in ice_read_phy_eth56g()
939 return err; in ice_read_phy_eth56g()
991 int err; in ice_write_port_eth56g() local
996 err = ice_phy_res_address_eth56g(phy_port, res_type, offset, &addr); in ice_write_port_eth56g()
997 if (err) in ice_write_port_eth56g()
998 return err; in ice_write_port_eth56g()
1022 int err; in ice_read_port_eth56g() local
1027 err = ice_phy_res_address_eth56g(phy_port, res_type, offset, &addr); in ice_read_port_eth56g()
1028 if (err) in ice_read_port_eth56g()
1029 return err; in ice_read_port_eth56g()
1269 int err; in ice_read_64b_phy_reg_eth56g() local
1274 err = ice_read_port_eth56g(hw, port, low_addr, &lo, res_type); in ice_read_64b_phy_reg_eth56g()
1275 if (err) { in ice_read_64b_phy_reg_eth56g()
1277 low_addr, err); in ice_read_64b_phy_reg_eth56g()
1278 return err; in ice_read_64b_phy_reg_eth56g()
1281 err = ice_read_port_eth56g(hw, port, high_addr, &hi, res_type); in ice_read_64b_phy_reg_eth56g()
1282 if (err) { in ice_read_64b_phy_reg_eth56g()
1284 high_addr, err); in ice_read_64b_phy_reg_eth56g()
1285 return err; in ice_read_64b_phy_reg_eth56g()
1339 int err; in ice_write_40b_phy_reg_eth56g() local
1347 err = ice_write_port_eth56g(hw, port, low_addr, lo, res_type); in ice_write_40b_phy_reg_eth56g()
1348 if (err) { in ice_write_40b_phy_reg_eth56g()
1350 low_addr, err); in ice_write_40b_phy_reg_eth56g()
1351 return err; in ice_write_40b_phy_reg_eth56g()
1354 err = ice_write_port_eth56g(hw, port, high_addr, hi, res_type); in ice_write_40b_phy_reg_eth56g()
1355 if (err) { in ice_write_40b_phy_reg_eth56g()
1357 high_addr, err); in ice_write_40b_phy_reg_eth56g()
1358 return err; in ice_write_40b_phy_reg_eth56g()
1409 int err; in ice_write_64b_phy_reg_eth56g() local
1417 err = ice_write_port_eth56g(hw, port, low_addr, lo, res_type); in ice_write_64b_phy_reg_eth56g()
1418 if (err) { in ice_write_64b_phy_reg_eth56g()
1420 low_addr, err); in ice_write_64b_phy_reg_eth56g()
1421 return err; in ice_write_64b_phy_reg_eth56g()
1424 err = ice_write_port_eth56g(hw, port, high_addr, hi, res_type); in ice_write_64b_phy_reg_eth56g()
1425 if (err) { in ice_write_64b_phy_reg_eth56g()
1427 high_addr, err); in ice_write_64b_phy_reg_eth56g()
1428 return err; in ice_write_64b_phy_reg_eth56g()
1475 int err; in ice_read_ptp_tstamp_eth56g() local
1480 err = ice_read_port_mem_eth56g(hw, port, lo_addr, &lo); in ice_read_ptp_tstamp_eth56g()
1481 if (err) { in ice_read_ptp_tstamp_eth56g()
1483 err); in ice_read_ptp_tstamp_eth56g()
1484 return err; in ice_read_ptp_tstamp_eth56g()
1487 err = ice_read_port_mem_eth56g(hw, port, hi_addr, &hi); in ice_read_ptp_tstamp_eth56g()
1488 if (err) { in ice_read_ptp_tstamp_eth56g()
1490 err); in ice_read_ptp_tstamp_eth56g()
1491 return err; in ice_read_ptp_tstamp_eth56g()
1528 int err; in ice_clear_ptp_tstamp_eth56g() local
1533 err = ice_read_ptp_tstamp_eth56g(hw, port, idx, &unused_tstamp); in ice_clear_ptp_tstamp_eth56g()
1534 if (err) { in ice_clear_ptp_tstamp_eth56g()
1536 port, idx, err); in ice_clear_ptp_tstamp_eth56g()
1541 err = ice_write_port_mem_eth56g(hw, port, lo_addr, 0); in ice_clear_ptp_tstamp_eth56g()
1542 if (err) { in ice_clear_ptp_tstamp_eth56g()
1544 port, idx, err); in ice_clear_ptp_tstamp_eth56g()
1545 return err; in ice_clear_ptp_tstamp_eth56g()
1582 int err; in ice_ptp_prep_port_time_eth56g() local
1585 err = ice_write_64b_ptp_reg_eth56g(hw, port, PHY_REG_TX_TIMER_INC_PRE_L, in ice_ptp_prep_port_time_eth56g()
1587 if (err) in ice_ptp_prep_port_time_eth56g()
1588 return err; in ice_ptp_prep_port_time_eth56g()
1620 int err; in ice_ptp_prep_phy_time_eth56g() local
1622 err = ice_ptp_prep_port_time_eth56g(hw, port, phy_time); in ice_ptp_prep_phy_time_eth56g()
1623 if (err) { in ice_ptp_prep_phy_time_eth56g()
1625 port, err); in ice_ptp_prep_phy_time_eth56g()
1626 return err; in ice_ptp_prep_phy_time_eth56g()
1655 int err; in ice_ptp_prep_port_adj_eth56g() local
1661 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_TIMER_INC_PRE_L, in ice_ptp_prep_port_adj_eth56g()
1663 if (err) in ice_ptp_prep_port_adj_eth56g()
1666 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_TIMER_INC_PRE_U, in ice_ptp_prep_port_adj_eth56g()
1668 if (err) in ice_ptp_prep_port_adj_eth56g()
1672 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_RX_TIMER_INC_PRE_L, in ice_ptp_prep_port_adj_eth56g()
1674 if (err) in ice_ptp_prep_port_adj_eth56g()
1677 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_RX_TIMER_INC_PRE_U, in ice_ptp_prep_port_adj_eth56g()
1679 if (err) in ice_ptp_prep_port_adj_eth56g()
1686 port, err); in ice_ptp_prep_port_adj_eth56g()
1687 return err; in ice_ptp_prep_port_adj_eth56g()
1716 int err; in ice_ptp_prep_phy_adj_eth56g() local
1718 err = ice_ptp_prep_port_adj_eth56g(hw, port, cycles); in ice_ptp_prep_phy_adj_eth56g()
1719 if (err) in ice_ptp_prep_phy_adj_eth56g()
1720 return err; in ice_ptp_prep_phy_adj_eth56g()
1744 int err; in ice_ptp_prep_phy_incval_eth56g() local
1746 err = ice_write_40b_ptp_reg_eth56g(hw, port, PHY_REG_TIMETUS_L, in ice_ptp_prep_phy_incval_eth56g()
1748 if (err) { in ice_ptp_prep_phy_incval_eth56g()
1750 port, err); in ice_ptp_prep_phy_incval_eth56g()
1751 return err; in ice_ptp_prep_phy_incval_eth56g()
1774 int err; in ice_ptp_read_port_capture_eth56g() local
1777 err = ice_read_64b_ptp_reg_eth56g(hw, port, PHY_REG_TX_CAPTURE_L, in ice_ptp_read_port_capture_eth56g()
1779 if (err) { in ice_ptp_read_port_capture_eth56g()
1781 err); in ice_ptp_read_port_capture_eth56g()
1782 return err; in ice_ptp_read_port_capture_eth56g()
1788 err = ice_read_64b_ptp_reg_eth56g(hw, port, PHY_REG_RX_CAPTURE_L, in ice_ptp_read_port_capture_eth56g()
1790 if (err) { in ice_ptp_read_port_capture_eth56g()
1792 err); in ice_ptp_read_port_capture_eth56g()
1793 return err; in ice_ptp_read_port_capture_eth56g()
1817 int err; in ice_ptp_write_port_cmd_eth56g() local
1820 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_TMR_CMD, val); in ice_ptp_write_port_cmd_eth56g()
1821 if (err) { in ice_ptp_write_port_cmd_eth56g()
1823 err); in ice_ptp_write_port_cmd_eth56g()
1824 return err; in ice_ptp_write_port_cmd_eth56g()
1828 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_RX_TMR_CMD, val); in ice_ptp_write_port_cmd_eth56g()
1829 if (err) { in ice_ptp_write_port_cmd_eth56g()
1831 err); in ice_ptp_write_port_cmd_eth56g()
1832 return err; in ice_ptp_write_port_cmd_eth56g()
1900 int err; in ice_phy_cfg_parpcs_eth56g() local
1902 err = ice_write_xpcs_reg_eth56g(hw, port, PHY_VENDOR_TXLANE_THRESH, in ice_phy_cfg_parpcs_eth56g()
1904 if (err) { in ice_phy_cfg_parpcs_eth56g()
1906 err); in ice_phy_cfg_parpcs_eth56g()
1907 return err; in ice_phy_cfg_parpcs_eth56g()
1913 err = ice_read_ptp_reg_eth56g(hw, port_blk, in ice_phy_cfg_parpcs_eth56g()
1915 if (err) { in ice_phy_cfg_parpcs_eth56g()
1917 err); in ice_phy_cfg_parpcs_eth56g()
1918 return err; in ice_phy_cfg_parpcs_eth56g()
1925 err = ice_write_ptp_reg_eth56g(hw, port_blk, in ice_phy_cfg_parpcs_eth56g()
1927 if (err) { in ice_phy_cfg_parpcs_eth56g()
1929 err); in ice_phy_cfg_parpcs_eth56g()
1930 return err; in ice_phy_cfg_parpcs_eth56g()
1937 err = ice_write_40b_ptp_reg_eth56g(hw, port, PHY_PCS_REF_TUS_L, in ice_phy_cfg_parpcs_eth56g()
1939 if (err) { in ice_phy_cfg_parpcs_eth56g()
1941 err); in ice_phy_cfg_parpcs_eth56g()
1942 return err; in ice_phy_cfg_parpcs_eth56g()
1945 err = ice_write_40b_ptp_reg_eth56g(hw, port, PHY_PCS_REF_INC_L, in ice_phy_cfg_parpcs_eth56g()
1947 if (err) { in ice_phy_cfg_parpcs_eth56g()
1949 err); in ice_phy_cfg_parpcs_eth56g()
1950 return err; in ice_phy_cfg_parpcs_eth56g()
1971 int err; in ice_phy_cfg_ptp_1step_eth56g() local
1978 err = ice_read_ptp_reg_eth56g(hw, port_blk, PHY_PTP_1STEP_CONFIG, &val); in ice_phy_cfg_ptp_1step_eth56g()
1979 if (err) in ice_phy_cfg_ptp_1step_eth56g()
1980 return err; in ice_phy_cfg_ptp_1step_eth56g()
1989 err = ice_write_ptp_reg_eth56g(hw, port_blk, PHY_PTP_1STEP_CONFIG, val); in ice_phy_cfg_ptp_1step_eth56g()
1990 if (err) in ice_phy_cfg_ptp_1step_eth56g()
1991 return err; in ice_phy_cfg_ptp_1step_eth56g()
1998 err = ice_write_ptp_reg_eth56g(hw, port_blk, in ice_phy_cfg_ptp_1step_eth56g()
2000 if (err) in ice_phy_cfg_ptp_1step_eth56g()
2001 return err; in ice_phy_cfg_ptp_1step_eth56g()
2004 err = ice_write_ptp_reg_eth56g(hw, port_blk, in ice_phy_cfg_ptp_1step_eth56g()
2006 if (err) in ice_phy_cfg_ptp_1step_eth56g()
2007 return err; in ice_phy_cfg_ptp_1step_eth56g()
2010 err = ice_read_mac_reg_eth56g(hw, port, PHY_MAC_XIF_MODE, &val); in ice_phy_cfg_ptp_1step_eth56g()
2011 if (err) in ice_phy_cfg_ptp_1step_eth56g()
2012 return err; in ice_phy_cfg_ptp_1step_eth56g()
2075 int err; in ice_ptp_calc_bitslip_eth56g() local
2081 err = ice_read_gpcs_reg_eth56g(hw, port, PHY_GPCS_BITSLIP, in ice_ptp_calc_bitslip_eth56g()
2084 err = ice_read_ptp_reg_eth56g(hw, port_blk, in ice_ptp_calc_bitslip_eth56g()
2087 if (err) in ice_ptp_calc_bitslip_eth56g()
2121 int err; in ice_ptp_calc_deskew_eth56g() local
2126 read_poll_timeout(ice_read_ptp_reg_eth56g, err, in ice_ptp_calc_deskew_eth56g()
2130 if (err) in ice_ptp_calc_deskew_eth56g()
2131 return err; in ice_ptp_calc_deskew_eth56g()
2223 int err; in ice_phy_cfg_mac_eth56g() local
2238 err = ice_write_mac_reg_eth56g(hw, port, PHY_MAC_RX_MODULO, 0); in ice_phy_cfg_mac_eth56g()
2239 if (err) in ice_phy_cfg_mac_eth56g()
2240 return err; in ice_phy_cfg_mac_eth56g()
2242 err = ice_write_mac_reg_eth56g(hw, port, PHY_MAC_TX_MODULO, 0); in ice_phy_cfg_mac_eth56g()
2243 if (err) in ice_phy_cfg_mac_eth56g()
2244 return err; in ice_phy_cfg_mac_eth56g()
2259 err = ice_write_mac_reg_eth56g(hw, port, PHY_MAC_TSU_CONFIG, val); in ice_phy_cfg_mac_eth56g()
2260 if (err) in ice_phy_cfg_mac_eth56g()
2261 return err; in ice_phy_cfg_mac_eth56g()
2263 err = ice_write_mac_reg_eth56g(hw, port, PHY_MAC_BLOCKTIME, in ice_phy_cfg_mac_eth56g()
2265 if (err) in ice_phy_cfg_mac_eth56g()
2266 return err; in ice_phy_cfg_mac_eth56g()
2268 err = ice_phy_set_offsets_eth56g(hw, port, spd, cfg, fc, rs); in ice_phy_cfg_mac_eth56g()
2269 if (err) in ice_phy_cfg_mac_eth56g()
2270 return err; in ice_phy_cfg_mac_eth56g()
2295 int err; in ice_phy_cfg_intr_eth56g() local
2298 err = ice_read_ptp_reg_eth56g(hw, port, PHY_REG_TS_INT_CONFIG, &val); in ice_phy_cfg_intr_eth56g()
2299 if (err) in ice_phy_cfg_intr_eth56g()
2300 return err; in ice_phy_cfg_intr_eth56g()
2333 int err; in ice_read_phy_and_phc_time_eth56g() local
2341 err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_READ_TIME); in ice_read_phy_and_phc_time_eth56g()
2342 if (err) in ice_read_phy_and_phc_time_eth56g()
2343 return err; in ice_read_phy_and_phc_time_eth56g()
2354 err = ice_ptp_read_port_capture_eth56g(hw, port, &tx_time, &rx_time); in ice_read_phy_and_phc_time_eth56g()
2355 if (err) in ice_read_phy_and_phc_time_eth56g()
2356 return err; in ice_read_phy_and_phc_time_eth56g()
2391 int err; in ice_sync_phy_timer_eth56g() local
2398 err = ice_read_phy_and_phc_time_eth56g(hw, port, &phy_time, &phc_time); in ice_sync_phy_timer_eth56g()
2399 if (err) in ice_sync_phy_timer_eth56g()
2414 err = ice_ptp_prep_port_adj_eth56g(hw, port, (s64)difference); in ice_sync_phy_timer_eth56g()
2415 if (err) in ice_sync_phy_timer_eth56g()
2418 err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_ADJ_TIME); in ice_sync_phy_timer_eth56g()
2419 if (err) in ice_sync_phy_timer_eth56g()
2428 err = ice_read_phy_and_phc_time_eth56g(hw, port, &phy_time, &phc_time); in ice_sync_phy_timer_eth56g()
2429 if (err) in ice_sync_phy_timer_eth56g()
2438 return err; in ice_sync_phy_timer_eth56g()
2457 int err; in ice_stop_phy_timer_eth56g() local
2459 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_OFFSET_READY, 0); in ice_stop_phy_timer_eth56g()
2460 if (err) in ice_stop_phy_timer_eth56g()
2461 return err; in ice_stop_phy_timer_eth56g()
2463 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_RX_OFFSET_READY, 0); in ice_stop_phy_timer_eth56g()
2464 if (err) in ice_stop_phy_timer_eth56g()
2465 return err; in ice_stop_phy_timer_eth56g()
2490 int err; in ice_start_phy_timer_eth56g() local
2494 err = ice_stop_phy_timer_eth56g(hw, port, false); in ice_start_phy_timer_eth56g()
2495 if (err) in ice_start_phy_timer_eth56g()
2496 return err; in ice_start_phy_timer_eth56g()
2500 err = ice_phy_cfg_parpcs_eth56g(hw, port); in ice_start_phy_timer_eth56g()
2501 if (err) in ice_start_phy_timer_eth56g()
2502 return err; in ice_start_phy_timer_eth56g()
2504 err = ice_phy_cfg_ptp_1step_eth56g(hw, port); in ice_start_phy_timer_eth56g()
2505 if (err) in ice_start_phy_timer_eth56g()
2506 return err; in ice_start_phy_timer_eth56g()
2508 err = ice_phy_cfg_mac_eth56g(hw, port); in ice_start_phy_timer_eth56g()
2509 if (err) in ice_start_phy_timer_eth56g()
2510 return err; in ice_start_phy_timer_eth56g()
2516 err = ice_write_40b_ptp_reg_eth56g(hw, port, PHY_REG_TIMETUS_L, incval); in ice_start_phy_timer_eth56g()
2517 if (err) in ice_start_phy_timer_eth56g()
2518 return err; in ice_start_phy_timer_eth56g()
2520 err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_INIT_INCVAL); in ice_start_phy_timer_eth56g()
2521 if (err) in ice_start_phy_timer_eth56g()
2522 return err; in ice_start_phy_timer_eth56g()
2526 err = ice_sync_phy_timer_eth56g(hw, port); in ice_start_phy_timer_eth56g()
2527 if (err) in ice_start_phy_timer_eth56g()
2528 return err; in ice_start_phy_timer_eth56g()
2530 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_TX_OFFSET_READY, 1); in ice_start_phy_timer_eth56g()
2531 if (err) in ice_start_phy_timer_eth56g()
2532 return err; in ice_start_phy_timer_eth56g()
2534 err = ice_write_ptp_reg_eth56g(hw, port, PHY_REG_RX_OFFSET_READY, 1); in ice_start_phy_timer_eth56g()
2535 if (err) in ice_start_phy_timer_eth56g()
2536 return err; in ice_start_phy_timer_eth56g()
2601 int err; in ice_ptp_read_tx_hwtstamp_status_eth56g() local
2603 err = ice_read_phy_eth56g(hw, phy, PHY_PTP_INT_STATUS, &status); in ice_ptp_read_tx_hwtstamp_status_eth56g()
2604 if (err) in ice_ptp_read_tx_hwtstamp_status_eth56g()
2605 return err; in ice_ptp_read_tx_hwtstamp_status_eth56g()
2632 int err; in ice_get_phy_tx_tstamp_ready_eth56g() local
2634 err = ice_read_64b_ptp_reg_eth56g(hw, port, PHY_REG_TX_MEMORY_STATUS_L, in ice_get_phy_tx_tstamp_ready_eth56g()
2636 if (err) { in ice_get_phy_tx_tstamp_ready_eth56g()
2638 port, err); in ice_get_phy_tx_tstamp_ready_eth56g()
2639 return err; in ice_get_phy_tx_tstamp_ready_eth56g()
2689 int err; in ice_ptp_init_phy_e825c() local
2691 err = ice_read_phy_eth56g(hw, phy, PHY_REG_REVISION, &phy_rev); in ice_ptp_init_phy_e825c()
2692 if (err || phy_rev != PHY_REVISION_ETH56G) { in ice_ptp_init_phy_e825c()
2851 int err; in ice_read_phy_reg_e82x() local
2856 err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); in ice_read_phy_reg_e82x()
2857 if (err) { in ice_read_phy_reg_e82x()
2859 err); in ice_read_phy_reg_e82x()
2860 return err; in ice_read_phy_reg_e82x()
2885 int err; in ice_read_64b_phy_reg_e82x() local
2896 err = ice_read_phy_reg_e82x(hw, port, low_addr, &low); in ice_read_64b_phy_reg_e82x()
2897 if (err) { in ice_read_64b_phy_reg_e82x()
2899 low_addr, err); in ice_read_64b_phy_reg_e82x()
2900 return err; in ice_read_64b_phy_reg_e82x()
2903 err = ice_read_phy_reg_e82x(hw, port, high_addr, &high); in ice_read_64b_phy_reg_e82x()
2904 if (err) { in ice_read_64b_phy_reg_e82x()
2906 high_addr, err); in ice_read_64b_phy_reg_e82x()
2907 return err; in ice_read_64b_phy_reg_e82x()
2928 int err; in ice_write_phy_reg_e82x() local
2934 err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); in ice_write_phy_reg_e82x()
2935 if (err) { in ice_write_phy_reg_e82x()
2937 err); in ice_write_phy_reg_e82x()
2938 return err; in ice_write_phy_reg_e82x()
2959 int err; in ice_write_40b_phy_reg_e82x() local
2972 err = ice_write_phy_reg_e82x(hw, port, low_addr, low); in ice_write_40b_phy_reg_e82x()
2973 if (err) { in ice_write_40b_phy_reg_e82x()
2975 low_addr, err); in ice_write_40b_phy_reg_e82x()
2976 return err; in ice_write_40b_phy_reg_e82x()
2979 err = ice_write_phy_reg_e82x(hw, port, high_addr, high); in ice_write_40b_phy_reg_e82x()
2980 if (err) { in ice_write_40b_phy_reg_e82x()
2982 high_addr, err); in ice_write_40b_phy_reg_e82x()
2983 return err; in ice_write_40b_phy_reg_e82x()
3006 int err; in ice_write_64b_phy_reg_e82x() local
3020 err = ice_write_phy_reg_e82x(hw, port, low_addr, low); in ice_write_64b_phy_reg_e82x()
3021 if (err) { in ice_write_64b_phy_reg_e82x()
3023 low_addr, err); in ice_write_64b_phy_reg_e82x()
3024 return err; in ice_write_64b_phy_reg_e82x()
3027 err = ice_write_phy_reg_e82x(hw, port, high_addr, high); in ice_write_64b_phy_reg_e82x()
3028 if (err) { in ice_write_64b_phy_reg_e82x()
3030 high_addr, err); in ice_write_64b_phy_reg_e82x()
3031 return err; in ice_write_64b_phy_reg_e82x()
3087 int err; in ice_read_quad_reg_e82x() local
3089 err = ice_fill_quad_msg_e82x(hw, &msg, quad, offset); in ice_read_quad_reg_e82x()
3090 if (err) in ice_read_quad_reg_e82x()
3091 return err; in ice_read_quad_reg_e82x()
3095 err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); in ice_read_quad_reg_e82x()
3096 if (err) { in ice_read_quad_reg_e82x()
3098 err); in ice_read_quad_reg_e82x()
3099 return err; in ice_read_quad_reg_e82x()
3121 int err; in ice_write_quad_reg_e82x() local
3123 err = ice_fill_quad_msg_e82x(hw, &msg, quad, offset); in ice_write_quad_reg_e82x()
3124 if (err) in ice_write_quad_reg_e82x()
3125 return err; in ice_write_quad_reg_e82x()
3130 err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); in ice_write_quad_reg_e82x()
3131 if (err) { in ice_write_quad_reg_e82x()
3133 err); in ice_write_quad_reg_e82x()
3134 return err; in ice_write_quad_reg_e82x()
3156 int err; in ice_read_phy_tstamp_e82x() local
3161 err = ice_read_quad_reg_e82x(hw, quad, lo_addr, &lo); in ice_read_phy_tstamp_e82x()
3162 if (err) { in ice_read_phy_tstamp_e82x()
3164 err); in ice_read_phy_tstamp_e82x()
3165 return err; in ice_read_phy_tstamp_e82x()
3168 err = ice_read_quad_reg_e82x(hw, quad, hi_addr, &hi); in ice_read_phy_tstamp_e82x()
3169 if (err) { in ice_read_phy_tstamp_e82x()
3171 err); in ice_read_phy_tstamp_e82x()
3172 return err; in ice_read_phy_tstamp_e82x()
3210 int err; in ice_clear_phy_tstamp_e82x() local
3212 err = ice_read_phy_tstamp_e82x(hw, quad, idx, &unused_tstamp); in ice_clear_phy_tstamp_e82x()
3213 if (err) { in ice_clear_phy_tstamp_e82x()
3215 quad, idx, err); in ice_clear_phy_tstamp_e82x()
3216 return err; in ice_clear_phy_tstamp_e82x()
3259 int err; in ice_ptp_set_vernier_wl() local
3261 err = ice_write_phy_reg_e82x(hw, port, P_REG_WL, in ice_ptp_set_vernier_wl()
3263 if (err) { in ice_ptp_set_vernier_wl()
3265 port, err); in ice_ptp_set_vernier_wl()
3266 return err; in ice_ptp_set_vernier_wl()
3281 int err; in ice_ptp_init_phc_e82x() local
3292 err = ice_init_cgu_e82x(hw); in ice_ptp_init_phc_e82x()
3293 if (err) in ice_ptp_init_phc_e82x()
3294 return err; in ice_ptp_init_phc_e82x()
3315 int err; in ice_ptp_prep_phy_time_e82x() local
3324 err = ice_write_64b_phy_reg_e82x(hw, port, in ice_ptp_prep_phy_time_e82x()
3327 if (err) in ice_ptp_prep_phy_time_e82x()
3331 err = ice_write_64b_phy_reg_e82x(hw, port, in ice_ptp_prep_phy_time_e82x()
3334 if (err) in ice_ptp_prep_phy_time_e82x()
3342 port, err); in ice_ptp_prep_phy_time_e82x()
3344 return err; in ice_ptp_prep_phy_time_e82x()
3366 int err; in ice_ptp_prep_port_adj_e82x() local
3372 err = ice_write_phy_reg_e82x(hw, port, P_REG_TX_TIMER_INC_PRE_L, in ice_ptp_prep_port_adj_e82x()
3374 if (err) in ice_ptp_prep_port_adj_e82x()
3377 err = ice_write_phy_reg_e82x(hw, port, P_REG_TX_TIMER_INC_PRE_U, in ice_ptp_prep_port_adj_e82x()
3379 if (err) in ice_ptp_prep_port_adj_e82x()
3383 err = ice_write_phy_reg_e82x(hw, port, P_REG_RX_TIMER_INC_PRE_L, in ice_ptp_prep_port_adj_e82x()
3385 if (err) in ice_ptp_prep_port_adj_e82x()
3388 err = ice_write_phy_reg_e82x(hw, port, P_REG_RX_TIMER_INC_PRE_U, in ice_ptp_prep_port_adj_e82x()
3390 if (err) in ice_ptp_prep_port_adj_e82x()
3397 port, err); in ice_ptp_prep_port_adj_e82x()
3398 return err; in ice_ptp_prep_port_adj_e82x()
3426 int err; in ice_ptp_prep_phy_adj_e82x() local
3428 err = ice_ptp_prep_port_adj_e82x(hw, port, cycles); in ice_ptp_prep_phy_adj_e82x()
3429 if (err) in ice_ptp_prep_phy_adj_e82x()
3430 return err; in ice_ptp_prep_phy_adj_e82x()
3448 int err; in ice_ptp_prep_phy_incval_e82x() local
3452 err = ice_write_40b_phy_reg_e82x(hw, port, P_REG_TIMETUS_L, in ice_ptp_prep_phy_incval_e82x()
3454 if (err) in ice_ptp_prep_phy_incval_e82x()
3462 port, err); in ice_ptp_prep_phy_incval_e82x()
3464 return err; in ice_ptp_prep_phy_incval_e82x()
3481 int err; in ice_ptp_read_port_capture() local
3484 err = ice_read_64b_phy_reg_e82x(hw, port, P_REG_TX_CAPTURE_L, tx_ts); in ice_ptp_read_port_capture()
3485 if (err) { in ice_ptp_read_port_capture()
3487 err); in ice_ptp_read_port_capture()
3488 return err; in ice_ptp_read_port_capture()
3495 err = ice_read_64b_phy_reg_e82x(hw, port, P_REG_RX_CAPTURE_L, rx_ts); in ice_ptp_read_port_capture()
3496 if (err) { in ice_ptp_read_port_capture()
3498 err); in ice_ptp_read_port_capture()
3499 return err; in ice_ptp_read_port_capture()
3527 int err; in ice_ptp_write_port_cmd_e82x() local
3530 err = ice_write_phy_reg_e82x(hw, port, P_REG_TX_TMR_CMD, val); in ice_ptp_write_port_cmd_e82x()
3531 if (err) { in ice_ptp_write_port_cmd_e82x()
3533 err); in ice_ptp_write_port_cmd_e82x()
3534 return err; in ice_ptp_write_port_cmd_e82x()
3538 err = ice_write_phy_reg_e82x(hw, port, P_REG_RX_TMR_CMD, in ice_ptp_write_port_cmd_e82x()
3540 if (err) { in ice_ptp_write_port_cmd_e82x()
3542 err); in ice_ptp_write_port_cmd_e82x()
3543 return err; in ice_ptp_write_port_cmd_e82x()
3574 int err; in ice_phy_get_speed_and_fec_e82x() local
3576 err = ice_read_phy_reg_e82x(hw, port, P_REG_LINK_SPEED, &serdes); in ice_phy_get_speed_and_fec_e82x()
3577 if (err) { in ice_phy_get_speed_and_fec_e82x()
3579 return err; in ice_phy_get_speed_and_fec_e82x()
3640 int err; in ice_phy_cfg_lane_e82x() local
3644 err = ice_phy_get_speed_and_fec_e82x(hw, port, &link_spd, NULL); in ice_phy_cfg_lane_e82x()
3645 if (err) { in ice_phy_cfg_lane_e82x()
3647 err); in ice_phy_cfg_lane_e82x()
3653 err = ice_read_quad_reg_e82x(hw, quad, Q_REG_TX_MEM_GBL_CFG, &val); in ice_phy_cfg_lane_e82x()
3654 if (err) { in ice_phy_cfg_lane_e82x()
3656 err); in ice_phy_cfg_lane_e82x()
3665 err = ice_write_quad_reg_e82x(hw, quad, Q_REG_TX_MEM_GBL_CFG, val); in ice_phy_cfg_lane_e82x()
3666 if (err) { in ice_phy_cfg_lane_e82x()
3668 err); in ice_phy_cfg_lane_e82x()
3722 int err; in ice_phy_cfg_uix_e82x() local
3736 err = ice_write_64b_phy_reg_e82x(hw, port, P_REG_UIX66_10G_40G_L, in ice_phy_cfg_uix_e82x()
3738 if (err) { in ice_phy_cfg_uix_e82x()
3740 err); in ice_phy_cfg_uix_e82x()
3741 return err; in ice_phy_cfg_uix_e82x()
3747 err = ice_write_64b_phy_reg_e82x(hw, port, P_REG_UIX66_25G_100G_L, in ice_phy_cfg_uix_e82x()
3749 if (err) { in ice_phy_cfg_uix_e82x()
3751 err); in ice_phy_cfg_uix_e82x()
3752 return err; in ice_phy_cfg_uix_e82x()
3806 int err; in ice_phy_cfg_parpcs_e82x() local
3808 err = ice_phy_get_speed_and_fec_e82x(hw, port, &link_spd, &fec_mode); in ice_phy_cfg_parpcs_e82x()
3809 if (err) in ice_phy_cfg_parpcs_e82x()
3810 return err; in ice_phy_cfg_parpcs_e82x()
3832 err = ice_write_40b_phy_reg_e82x(hw, port, P_REG_PAR_TX_TUS_L, in ice_phy_cfg_parpcs_e82x()
3834 if (err) in ice_phy_cfg_parpcs_e82x()
3835 return err; in ice_phy_cfg_parpcs_e82x()
3844 err = ice_write_40b_phy_reg_e82x(hw, port, P_REG_PAR_RX_TUS_L, in ice_phy_cfg_parpcs_e82x()
3846 if (err) in ice_phy_cfg_parpcs_e82x()
3847 return err; in ice_phy_cfg_parpcs_e82x()
3856 err = ice_write_40b_phy_reg_e82x(hw, port, P_REG_PCS_TX_TUS_L, in ice_phy_cfg_parpcs_e82x()
3858 if (err) in ice_phy_cfg_parpcs_e82x()
3859 return err; in ice_phy_cfg_parpcs_e82x()
3868 err = ice_write_40b_phy_reg_e82x(hw, port, P_REG_PCS_RX_TUS_L, in ice_phy_cfg_parpcs_e82x()
3870 if (err) in ice_phy_cfg_parpcs_e82x()
3871 return err; in ice_phy_cfg_parpcs_e82x()
3880 err = ice_write_40b_phy_reg_e82x(hw, port, P_REG_DESK_PAR_TX_TUS_L, in ice_phy_cfg_parpcs_e82x()
3882 if (err) in ice_phy_cfg_parpcs_e82x()
3883 return err; in ice_phy_cfg_parpcs_e82x()
3892 err = ice_write_40b_phy_reg_e82x(hw, port, P_REG_DESK_PAR_RX_TUS_L, in ice_phy_cfg_parpcs_e82x()
3894 if (err) in ice_phy_cfg_parpcs_e82x()
3895 return err; in ice_phy_cfg_parpcs_e82x()
3904 err = ice_write_40b_phy_reg_e82x(hw, port, P_REG_DESK_PCS_TX_TUS_L, in ice_phy_cfg_parpcs_e82x()
3906 if (err) in ice_phy_cfg_parpcs_e82x()
3907 return err; in ice_phy_cfg_parpcs_e82x()
3979 int err; in ice_phy_cfg_tx_offset_e82x() local
3983 err = ice_read_phy_reg_e82x(hw, port, P_REG_TX_OR, ®); in ice_phy_cfg_tx_offset_e82x()
3984 if (err) { in ice_phy_cfg_tx_offset_e82x()
3986 port, err); in ice_phy_cfg_tx_offset_e82x()
3987 return err; in ice_phy_cfg_tx_offset_e82x()
3993 err = ice_read_phy_reg_e82x(hw, port, P_REG_TX_OV_STATUS, ®); in ice_phy_cfg_tx_offset_e82x()
3994 if (err) { in ice_phy_cfg_tx_offset_e82x()
3996 port, err); in ice_phy_cfg_tx_offset_e82x()
3997 return err; in ice_phy_cfg_tx_offset_e82x()
4003 err = ice_phy_get_speed_and_fec_e82x(hw, port, &link_spd, &fec_mode); in ice_phy_cfg_tx_offset_e82x()
4004 if (err) in ice_phy_cfg_tx_offset_e82x()
4005 return err; in ice_phy_cfg_tx_offset_e82x()
4018 err = ice_read_64b_phy_reg_e82x(hw, port, in ice_phy_cfg_tx_offset_e82x()
4021 if (err) in ice_phy_cfg_tx_offset_e82x()
4022 return err; in ice_phy_cfg_tx_offset_e82x()
4033 err = ice_read_64b_phy_reg_e82x(hw, port, in ice_phy_cfg_tx_offset_e82x()
4036 if (err) in ice_phy_cfg_tx_offset_e82x()
4037 return err; in ice_phy_cfg_tx_offset_e82x()
4046 err = ice_write_64b_phy_reg_e82x(hw, port, P_REG_TOTAL_TX_OFFSET_L, in ice_phy_cfg_tx_offset_e82x()
4048 if (err) in ice_phy_cfg_tx_offset_e82x()
4049 return err; in ice_phy_cfg_tx_offset_e82x()
4051 err = ice_write_phy_reg_e82x(hw, port, P_REG_TX_OR, 1); in ice_phy_cfg_tx_offset_e82x()
4052 if (err) in ice_phy_cfg_tx_offset_e82x()
4053 return err; in ice_phy_cfg_tx_offset_e82x()
4081 int err; in ice_phy_calc_pmd_adj_e82x() local
4083 err = ice_read_phy_reg_e82x(hw, port, P_REG_PMD_ALIGNMENT, &val); in ice_phy_calc_pmd_adj_e82x()
4084 if (err) { in ice_phy_calc_pmd_adj_e82x()
4086 err); in ice_phy_calc_pmd_adj_e82x()
4087 return err; in ice_phy_calc_pmd_adj_e82x()
4171 err = ice_read_phy_reg_e82x(hw, port, P_REG_RX_40_TO_160_CNT, in ice_phy_calc_pmd_adj_e82x()
4173 if (err) { in ice_phy_calc_pmd_adj_e82x()
4175 err); in ice_phy_calc_pmd_adj_e82x()
4176 return err; in ice_phy_calc_pmd_adj_e82x()
4193 err = ice_read_phy_reg_e82x(hw, port, P_REG_RX_80_TO_160_CNT, in ice_phy_calc_pmd_adj_e82x()
4195 if (err) { in ice_phy_calc_pmd_adj_e82x()
4197 err); in ice_phy_calc_pmd_adj_e82x()
4198 return err; in ice_phy_calc_pmd_adj_e82x()
4282 int err; in ice_phy_cfg_rx_offset_e82x() local
4286 err = ice_read_phy_reg_e82x(hw, port, P_REG_RX_OR, ®); in ice_phy_cfg_rx_offset_e82x()
4287 if (err) { in ice_phy_cfg_rx_offset_e82x()
4289 port, err); in ice_phy_cfg_rx_offset_e82x()
4290 return err; in ice_phy_cfg_rx_offset_e82x()
4296 err = ice_read_phy_reg_e82x(hw, port, P_REG_RX_OV_STATUS, ®); in ice_phy_cfg_rx_offset_e82x()
4297 if (err) { in ice_phy_cfg_rx_offset_e82x()
4299 port, err); in ice_phy_cfg_rx_offset_e82x()
4300 return err; in ice_phy_cfg_rx_offset_e82x()
4306 err = ice_phy_get_speed_and_fec_e82x(hw, port, &link_spd, &fec_mode); in ice_phy_cfg_rx_offset_e82x()
4307 if (err) in ice_phy_cfg_rx_offset_e82x()
4308 return err; in ice_phy_cfg_rx_offset_e82x()
4315 err = ice_read_64b_phy_reg_e82x(hw, port, in ice_phy_cfg_rx_offset_e82x()
4318 if (err) in ice_phy_cfg_rx_offset_e82x()
4319 return err; in ice_phy_cfg_rx_offset_e82x()
4330 err = ice_read_64b_phy_reg_e82x(hw, port, in ice_phy_cfg_rx_offset_e82x()
4333 if (err) in ice_phy_cfg_rx_offset_e82x()
4334 return err; in ice_phy_cfg_rx_offset_e82x()
4340 err = ice_phy_calc_pmd_adj_e82x(hw, port, link_spd, fec_mode, &pmd); in ice_phy_cfg_rx_offset_e82x()
4341 if (err) in ice_phy_cfg_rx_offset_e82x()
4342 return err; in ice_phy_cfg_rx_offset_e82x()
4356 err = ice_write_64b_phy_reg_e82x(hw, port, P_REG_TOTAL_RX_OFFSET_L, in ice_phy_cfg_rx_offset_e82x()
4358 if (err) in ice_phy_cfg_rx_offset_e82x()
4359 return err; in ice_phy_cfg_rx_offset_e82x()
4361 err = ice_write_phy_reg_e82x(hw, port, P_REG_RX_OR, 1); in ice_phy_cfg_rx_offset_e82x()
4362 if (err) in ice_phy_cfg_rx_offset_e82x()
4363 return err; in ice_phy_cfg_rx_offset_e82x()
4385 int err; in ice_ptp_clear_phy_offset_ready_e82x() local
4387 err = ice_write_phy_reg_e82x(hw, port, P_REG_TX_OR, 0); in ice_ptp_clear_phy_offset_ready_e82x()
4388 if (err) { in ice_ptp_clear_phy_offset_ready_e82x()
4391 return err; in ice_ptp_clear_phy_offset_ready_e82x()
4394 err = ice_write_phy_reg_e82x(hw, port, P_REG_RX_OR, 0); in ice_ptp_clear_phy_offset_ready_e82x()
4395 if (err) { in ice_ptp_clear_phy_offset_ready_e82x()
4398 return err; in ice_ptp_clear_phy_offset_ready_e82x()
4422 int err; in ice_read_phy_and_phc_time_e82x() local
4430 err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_READ_TIME); in ice_read_phy_and_phc_time_e82x()
4431 if (err) in ice_read_phy_and_phc_time_e82x()
4432 return err; in ice_read_phy_and_phc_time_e82x()
4443 err = ice_ptp_read_port_capture(hw, port, &tx_time, &rx_time); in ice_read_phy_and_phc_time_e82x()
4444 if (err) in ice_read_phy_and_phc_time_e82x()
4445 return err; in ice_read_phy_and_phc_time_e82x()
4477 int err; in ice_sync_phy_timer_e82x() local
4484 err = ice_read_phy_and_phc_time_e82x(hw, port, &phy_time, &phc_time); in ice_sync_phy_timer_e82x()
4485 if (err) in ice_sync_phy_timer_e82x()
4498 err = ice_ptp_prep_port_adj_e82x(hw, port, (s64)difference); in ice_sync_phy_timer_e82x()
4499 if (err) in ice_sync_phy_timer_e82x()
4502 err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_ADJ_TIME); in ice_sync_phy_timer_e82x()
4503 if (err) in ice_sync_phy_timer_e82x()
4515 err = ice_read_phy_and_phc_time_e82x(hw, port, &phy_time, &phc_time); in ice_sync_phy_timer_e82x()
4516 if (err) in ice_sync_phy_timer_e82x()
4530 return err; in ice_sync_phy_timer_e82x()
4546 int err; in ice_stop_phy_timer_e82x() local
4549 err = ice_write_phy_reg_e82x(hw, port, P_REG_TX_OR, 0); in ice_stop_phy_timer_e82x()
4550 if (err) in ice_stop_phy_timer_e82x()
4551 return err; in ice_stop_phy_timer_e82x()
4553 err = ice_write_phy_reg_e82x(hw, port, P_REG_RX_OR, 0); in ice_stop_phy_timer_e82x()
4554 if (err) in ice_stop_phy_timer_e82x()
4555 return err; in ice_stop_phy_timer_e82x()
4557 err = ice_read_phy_reg_e82x(hw, port, P_REG_PS, &val); in ice_stop_phy_timer_e82x()
4558 if (err) in ice_stop_phy_timer_e82x()
4559 return err; in ice_stop_phy_timer_e82x()
4562 err = ice_write_phy_reg_e82x(hw, port, P_REG_PS, val); in ice_stop_phy_timer_e82x()
4563 if (err) in ice_stop_phy_timer_e82x()
4564 return err; in ice_stop_phy_timer_e82x()
4567 err = ice_write_phy_reg_e82x(hw, port, P_REG_PS, val); in ice_stop_phy_timer_e82x()
4568 if (err) in ice_stop_phy_timer_e82x()
4569 return err; in ice_stop_phy_timer_e82x()
4573 err = ice_write_phy_reg_e82x(hw, port, P_REG_PS, val); in ice_stop_phy_timer_e82x()
4574 if (err) in ice_stop_phy_timer_e82x()
4575 return err; in ice_stop_phy_timer_e82x()
4599 int err; in ice_start_phy_timer_e82x() local
4603 err = ice_stop_phy_timer_e82x(hw, port, false); in ice_start_phy_timer_e82x()
4604 if (err) in ice_start_phy_timer_e82x()
4605 return err; in ice_start_phy_timer_e82x()
4609 err = ice_phy_cfg_uix_e82x(hw, port); in ice_start_phy_timer_e82x()
4610 if (err) in ice_start_phy_timer_e82x()
4611 return err; in ice_start_phy_timer_e82x()
4613 err = ice_phy_cfg_parpcs_e82x(hw, port); in ice_start_phy_timer_e82x()
4614 if (err) in ice_start_phy_timer_e82x()
4615 return err; in ice_start_phy_timer_e82x()
4621 err = ice_write_40b_phy_reg_e82x(hw, port, P_REG_TIMETUS_L, incval); in ice_start_phy_timer_e82x()
4622 if (err) in ice_start_phy_timer_e82x()
4623 return err; in ice_start_phy_timer_e82x()
4625 err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_INIT_INCVAL); in ice_start_phy_timer_e82x()
4626 if (err) in ice_start_phy_timer_e82x()
4627 return err; in ice_start_phy_timer_e82x()
4634 err = ice_read_phy_reg_e82x(hw, port, P_REG_PS, &val); in ice_start_phy_timer_e82x()
4635 if (err) in ice_start_phy_timer_e82x()
4636 return err; in ice_start_phy_timer_e82x()
4639 err = ice_write_phy_reg_e82x(hw, port, P_REG_PS, val); in ice_start_phy_timer_e82x()
4640 if (err) in ice_start_phy_timer_e82x()
4641 return err; in ice_start_phy_timer_e82x()
4644 err = ice_write_phy_reg_e82x(hw, port, P_REG_PS, val); in ice_start_phy_timer_e82x()
4645 if (err) in ice_start_phy_timer_e82x()
4646 return err; in ice_start_phy_timer_e82x()
4649 err = ice_write_phy_reg_e82x(hw, port, P_REG_PS, val); in ice_start_phy_timer_e82x()
4650 if (err) in ice_start_phy_timer_e82x()
4651 return err; in ice_start_phy_timer_e82x()
4653 err = ice_ptp_one_port_cmd(hw, port, ICE_PTP_INIT_INCVAL); in ice_start_phy_timer_e82x()
4654 if (err) in ice_start_phy_timer_e82x()
4655 return err; in ice_start_phy_timer_e82x()
4660 err = ice_write_phy_reg_e82x(hw, port, P_REG_PS, val); in ice_start_phy_timer_e82x()
4661 if (err) in ice_start_phy_timer_e82x()
4662 return err; in ice_start_phy_timer_e82x()
4665 err = ice_write_phy_reg_e82x(hw, port, P_REG_PS, val); in ice_start_phy_timer_e82x()
4666 if (err) in ice_start_phy_timer_e82x()
4667 return err; in ice_start_phy_timer_e82x()
4671 err = ice_sync_phy_timer_e82x(hw, port); in ice_start_phy_timer_e82x()
4672 if (err) in ice_start_phy_timer_e82x()
4673 return err; in ice_start_phy_timer_e82x()
4694 int err; in ice_get_phy_tx_tstamp_ready_e82x() local
4696 err = ice_read_quad_reg_e82x(hw, quad, Q_REG_TX_MEMORY_STATUS_U, &hi); in ice_get_phy_tx_tstamp_ready_e82x()
4697 if (err) { in ice_get_phy_tx_tstamp_ready_e82x()
4699 quad, err); in ice_get_phy_tx_tstamp_ready_e82x()
4700 return err; in ice_get_phy_tx_tstamp_ready_e82x()
4703 err = ice_read_quad_reg_e82x(hw, quad, Q_REG_TX_MEMORY_STATUS_L, &lo); in ice_get_phy_tx_tstamp_ready_e82x()
4704 if (err) { in ice_get_phy_tx_tstamp_ready_e82x()
4706 quad, err); in ice_get_phy_tx_tstamp_ready_e82x()
4707 return err; in ice_get_phy_tx_tstamp_ready_e82x()
4729 int err; in ice_phy_cfg_intr_e82x() local
4732 err = ice_read_quad_reg_e82x(hw, quad, Q_REG_TX_MEM_GBL_CFG, &val); in ice_phy_cfg_intr_e82x()
4733 if (err) in ice_phy_cfg_intr_e82x()
4734 return err; in ice_phy_cfg_intr_e82x()
4774 int err; in ice_read_phy_reg_e810() local
4781 err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); in ice_read_phy_reg_e810()
4782 if (err) { in ice_read_phy_reg_e810()
4784 err); in ice_read_phy_reg_e810()
4785 return err; in ice_read_phy_reg_e810()
4804 int err; in ice_write_phy_reg_e810() local
4812 err = ice_sbq_rw_reg(hw, &msg, ICE_AQ_FLAG_RD); in ice_write_phy_reg_e810()
4813 if (err) { in ice_write_phy_reg_e810()
4815 err); in ice_write_phy_reg_e810()
4816 return err; in ice_write_phy_reg_e810()
4883 int err; in ice_read_phy_tstamp_sbq_e810() local
4885 err = ice_read_phy_reg_e810(hw, lo_addr, &lo_val); in ice_read_phy_tstamp_sbq_e810()
4886 if (err) { in ice_read_phy_tstamp_sbq_e810()
4888 err); in ice_read_phy_tstamp_sbq_e810()
4889 return err; in ice_read_phy_tstamp_sbq_e810()
4892 err = ice_read_phy_reg_e810(hw, hi_addr, &hi_val); in ice_read_phy_tstamp_sbq_e810()
4893 if (err) { in ice_read_phy_tstamp_sbq_e810()
4895 err); in ice_read_phy_tstamp_sbq_e810()
4896 return err; in ice_read_phy_tstamp_sbq_e810()
4920 int err; in ice_read_phy_tstamp_e810() local
4923 err = ice_read_phy_tstamp_ll_e810(hw, idx, &hi, &lo); in ice_read_phy_tstamp_e810()
4925 err = ice_read_phy_tstamp_sbq_e810(hw, lport, idx, &hi, &lo); in ice_read_phy_tstamp_e810()
4927 if (err) in ice_read_phy_tstamp_e810()
4928 return err; in ice_read_phy_tstamp_e810()
4954 int err; in ice_clear_phy_tstamp_e810() local
4956 err = ice_read_phy_tstamp_e810(hw, lport, idx, &unused_tstamp); in ice_clear_phy_tstamp_e810()
4957 if (err) { in ice_clear_phy_tstamp_e810()
4959 lport, idx, err); in ice_clear_phy_tstamp_e810()
4960 return err; in ice_clear_phy_tstamp_e810()
4966 err = ice_write_phy_reg_e810(hw, lo_addr, 0); in ice_clear_phy_tstamp_e810()
4967 if (err) { in ice_clear_phy_tstamp_e810()
4969 lport, idx, err); in ice_clear_phy_tstamp_e810()
4970 return err; in ice_clear_phy_tstamp_e810()
4973 err = ice_write_phy_reg_e810(hw, hi_addr, 0); in ice_clear_phy_tstamp_e810()
4974 if (err) { in ice_clear_phy_tstamp_e810()
4976 lport, idx, err); in ice_clear_phy_tstamp_e810()
4977 return err; in ice_clear_phy_tstamp_e810()
4994 int err; in ice_ptp_init_phc_e810() local
5000 err = ice_write_phy_reg_e810(hw, ETH_GLTSYN_ENA(tmr_idx), in ice_ptp_init_phc_e810()
5002 if (err) in ice_ptp_init_phc_e810()
5004 err); in ice_ptp_init_phc_e810()
5006 return err; in ice_ptp_init_phc_e810()
5024 int err; in ice_ptp_prep_phy_time_e810() local
5027 err = ice_write_phy_reg_e810(hw, ETH_GLTSYN_SHTIME_0(tmr_idx), 0); in ice_ptp_prep_phy_time_e810()
5028 if (err) { in ice_ptp_prep_phy_time_e810()
5030 err); in ice_ptp_prep_phy_time_e810()
5031 return err; in ice_ptp_prep_phy_time_e810()
5034 err = ice_write_phy_reg_e810(hw, ETH_GLTSYN_SHTIME_L(tmr_idx), time); in ice_ptp_prep_phy_time_e810()
5035 if (err) { in ice_ptp_prep_phy_time_e810()
5037 err); in ice_ptp_prep_phy_time_e810()
5038 return err; in ice_ptp_prep_phy_time_e810()
5060 int err; in ice_ptp_prep_phy_adj_e810() local
5067 err = ice_write_phy_reg_e810(hw, ETH_GLTSYN_SHADJ_L(tmr_idx), 0); in ice_ptp_prep_phy_adj_e810()
5068 if (err) { in ice_ptp_prep_phy_adj_e810()
5070 err); in ice_ptp_prep_phy_adj_e810()
5071 return err; in ice_ptp_prep_phy_adj_e810()
5074 err = ice_write_phy_reg_e810(hw, ETH_GLTSYN_SHADJ_H(tmr_idx), adj); in ice_ptp_prep_phy_adj_e810()
5075 if (err) { in ice_ptp_prep_phy_adj_e810()
5077 err); in ice_ptp_prep_phy_adj_e810()
5078 return err; in ice_ptp_prep_phy_adj_e810()
5097 int err; in ice_ptp_prep_phy_incval_e810() local
5103 err = ice_write_phy_reg_e810(hw, ETH_GLTSYN_SHADJ_L(tmr_idx), low); in ice_ptp_prep_phy_incval_e810()
5104 if (err) { in ice_ptp_prep_phy_incval_e810()
5106 err); in ice_ptp_prep_phy_incval_e810()
5107 return err; in ice_ptp_prep_phy_incval_e810()
5110 err = ice_write_phy_reg_e810(hw, ETH_GLTSYN_SHADJ_H(tmr_idx), high); in ice_ptp_prep_phy_incval_e810()
5111 if (err) { in ice_ptp_prep_phy_incval_e810()
5113 err); in ice_ptp_prep_phy_incval_e810()
5114 return err; in ice_ptp_prep_phy_incval_e810()
5296 int err; in ice_read_pca9575_reg_e810t() local
5300 err = ice_get_pca9575_handle(hw, &handle); in ice_read_pca9575_reg_e810t()
5301 if (err) in ice_read_pca9575_reg_e810t()
5302 return err; in ice_read_pca9575_reg_e810t()
5450 int err; in ice_ptp_one_port_cmd() local
5456 err = ice_ptp_write_port_cmd(hw, port, configured_cmd); in ice_ptp_one_port_cmd()
5458 err = ice_ptp_write_port_cmd(hw, port, ICE_PTP_NOP); in ice_ptp_one_port_cmd()
5460 if (err) in ice_ptp_one_port_cmd()
5461 return err; in ice_ptp_one_port_cmd()
5494 int err; in ice_ptp_port_cmd() local
5496 err = ice_ptp_write_port_cmd(hw, port, cmd); in ice_ptp_port_cmd()
5497 if (err) in ice_ptp_port_cmd()
5498 return err; in ice_ptp_port_cmd()
5516 int err; in ice_ptp_tmr_cmd() local
5522 err = ice_ptp_port_cmd(hw, cmd); in ice_ptp_tmr_cmd()
5523 if (err) { in ice_ptp_tmr_cmd()
5525 cmd, err); in ice_ptp_tmr_cmd()
5526 return err; in ice_ptp_tmr_cmd()
5553 int err; in ice_ptp_init_time() local
5566 err = ice_ptp_prep_phy_time_eth56g(hw, in ice_ptp_init_time()
5570 err = ice_ptp_prep_phy_time_e810(hw, time & 0xFFFFFFFF); in ice_ptp_init_time()
5573 err = ice_ptp_prep_phy_time_e82x(hw, time & 0xFFFFFFFF); in ice_ptp_init_time()
5576 err = -EOPNOTSUPP; in ice_ptp_init_time()
5579 if (err) in ice_ptp_init_time()
5580 return err; in ice_ptp_init_time()
5602 int err; in ice_ptp_write_incval() local
5612 err = ice_ptp_prep_phy_incval_eth56g(hw, incval); in ice_ptp_write_incval()
5615 err = ice_ptp_prep_phy_incval_e810(hw, incval); in ice_ptp_write_incval()
5618 err = ice_ptp_prep_phy_incval_e82x(hw, incval); in ice_ptp_write_incval()
5621 err = -EOPNOTSUPP; in ice_ptp_write_incval()
5624 if (err) in ice_ptp_write_incval()
5625 return err; in ice_ptp_write_incval()
5639 int err; in ice_ptp_write_incval_locked() local
5644 err = ice_ptp_write_incval(hw, incval); in ice_ptp_write_incval_locked()
5648 return err; in ice_ptp_write_incval_locked()
5667 int err; in ice_ptp_adj_clock() local
5681 err = ice_ptp_prep_phy_adj_eth56g(hw, adj); in ice_ptp_adj_clock()
5684 err = ice_ptp_prep_phy_adj_e810(hw, adj); in ice_ptp_adj_clock()
5687 err = ice_ptp_prep_phy_adj_e82x(hw, adj); in ice_ptp_adj_clock()
5690 err = -EOPNOTSUPP; in ice_ptp_adj_clock()
5693 if (err) in ice_ptp_adj_clock()
5694 return err; in ice_ptp_adj_clock()