Lines Matching +full:if +full:- +full:mode +full:- +full:en
7 * Copyright (C) 2003-2018 Cavium, Inc.
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
35 #include <asm/octeon/cvmx-config.h>
37 #include <asm/octeon/cvmx-helper.h>
38 #include <asm/octeon/cvmx-helper-board.h>
40 #include <asm/octeon/cvmx-gmxx-defs.h>
41 #include <asm/octeon/cvmx-pcsx-defs.h>
42 #include <asm/octeon/cvmx-pcsxx-defs.h>
54 const uint64_t clock_mhz = cvmx_sysinfo_get()->cpu_clock_hz / 1000000; in __cvmx_helper_sgmii_hardware_init_one_time()
61 gmxx_prtx_cfg.s.en = 0; in __cvmx_helper_sgmii_hardware_init_one_time()
66 * appropriate value. 1000BASE-X specifies a 10ms in __cvmx_helper_sgmii_hardware_init_one_time()
73 if (pcs_misc_ctl_reg.s.mode) { in __cvmx_helper_sgmii_hardware_init_one_time()
74 /* 1000BASE-X */ in __cvmx_helper_sgmii_hardware_init_one_time()
88 * 1000BASE-X mode, tx_Config_Reg<D15:D0> is PCS*_AN*_ADV_REG. in __cvmx_helper_sgmii_hardware_init_one_time()
89 * In SGMII PHY mode, tx_Config_Reg<D15:D0> is in __cvmx_helper_sgmii_hardware_init_one_time()
90 * PCS*_SGM*_AN_ADV_REG. In SGMII MAC mode, in __cvmx_helper_sgmii_hardware_init_one_time()
94 if (pcs_misc_ctl_reg.s.mode) { in __cvmx_helper_sgmii_hardware_init_one_time()
95 /* 1000BASE-X */ in __cvmx_helper_sgmii_hardware_init_one_time()
109 if (pcsx_miscx_ctl_reg.s.mac_phy) { in __cvmx_helper_sgmii_hardware_init_one_time()
110 /* PHY Mode */ in __cvmx_helper_sgmii_hardware_init_one_time()
122 /* MAC Mode - Nothing to do */ in __cvmx_helper_sgmii_hardware_init_one_time()
151 if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) { in __cvmx_helper_sgmii_hardware_init_link()
155 if (CVMX_WAIT_FOR_FIELD64 in __cvmx_helper_sgmii_hardware_init_link()
161 return -1; in __cvmx_helper_sgmii_hardware_init_link()
177 * that sgmii autonegotiation is complete. In MAC mode this in __cvmx_helper_sgmii_hardware_init_link()
181 if ((cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) && in __cvmx_helper_sgmii_hardware_init_link()
186 return -1; in __cvmx_helper_sgmii_hardware_init_link()
212 is_enabled = gmxx_prtx_cfg.s.en; in __cvmx_helper_sgmii_hardware_init_link_speed()
213 gmxx_prtx_cfg.s.en = 0; in __cvmx_helper_sgmii_hardware_init_link_speed()
217 if (CVMX_WAIT_FOR_FIELD64 in __cvmx_helper_sgmii_hardware_init_link_speed()
226 return -1; in __cvmx_helper_sgmii_hardware_init_link_speed()
240 * Use GMXENO to force the link down if the status we get says in __cvmx_helper_sgmii_hardware_init_link_speed()
245 /* Only change the duplex setting if the link is up */ in __cvmx_helper_sgmii_hardware_init_link_speed()
246 if (link_info.s.link_up) in __cvmx_helper_sgmii_hardware_init_link_speed()
255 /* Setting from GMX-603 */ in __cvmx_helper_sgmii_hardware_init_link_speed()
291 gmxx_prtx_cfg.s.en = is_enabled; in __cvmx_helper_sgmii_hardware_init_link_speed()
321 if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM) in __cvmx_helper_sgmii_hardware_init()
344 union cvmx_gmxx_inf_mode mode; in __cvmx_helper_sgmii_probe() local
347 * Due to errata GMX-700 on CN56XXp1.x and CN52XXp1.x, the in __cvmx_helper_sgmii_probe()
351 mode.u64 = cvmx_read_csr(CVMX_GMXX_INF_MODE(interface)); in __cvmx_helper_sgmii_probe()
352 mode.s.en = 1; in __cvmx_helper_sgmii_probe()
353 cvmx_write_csr(CVMX_GMXX_INF_MODE(interface), mode.u64); in __cvmx_helper_sgmii_probe()
377 gmxx_prtx_cfg.s.en = 1; in __cvmx_helper_sgmii_enable()
390 * Octeon's link config if auto negotiation has changed since
407 if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM) { in __cvmx_helper_sgmii_link_get()
417 if (pcsx_mrx_control_reg.s.loopbck1) { in __cvmx_helper_sgmii_link_get()
427 if (pcs_misc_ctl_reg.s.mode) { in __cvmx_helper_sgmii_link_get()
428 /* 1000BASE-X */ in __cvmx_helper_sgmii_link_get()
434 if (pcsx_miscx_ctl_reg.s.mac_phy) { in __cvmx_helper_sgmii_link_get()
435 /* PHY Mode */ in __cvmx_helper_sgmii_link_get()
440 * Don't bother continuing if the SERTES low in __cvmx_helper_sgmii_link_get()
446 if (pcsx_mrx_status_reg.s.lnk_st == 0) { in __cvmx_helper_sgmii_link_get()
447 if (__cvmx_helper_sgmii_hardware_init_link in __cvmx_helper_sgmii_link_get()
456 if (pcsx_anx_results_reg.s.an_cpt) { in __cvmx_helper_sgmii_link_get()
488 } else { /* MAC Mode */ in __cvmx_helper_sgmii_link_get()