MIPS: OCTEON: delete unused loopback configuration functions
authorAaro Koskinen <aaro.koskinen@iki.fi>
Wed, 21 Nov 2018 22:37:27 +0000 (00:37 +0200)
committerPaul Burton <paul.burton@mips.com>
Wed, 21 Nov 2018 23:36:41 +0000 (15:36 -0800)
Delete unused loopback configuration functions.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/21205/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
arch/mips/cavium-octeon/executive/cvmx-helper-rgmii.c
arch/mips/cavium-octeon/executive/cvmx-helper-sgmii.c
arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c
arch/mips/cavium-octeon/executive/cvmx-helper.c
arch/mips/include/asm/octeon/cvmx-gmxx-defs.h
arch/mips/include/asm/octeon/cvmx-helper-rgmii.h
arch/mips/include/asm/octeon/cvmx-helper-sgmii.h
arch/mips/include/asm/octeon/cvmx-helper-xaui.h
arch/mips/include/asm/octeon/cvmx-helper.h

index b8898e2b8a6fad2e7c6b58b6e2aeec3d26d7423a..e812ed9a03bbd9ba1d25c38e54817933b6e0ff35 100644 (file)
@@ -449,71 +449,3 @@ int __cvmx_helper_rgmii_link_set(int ipd_port,
 
        return result;
 }
-
-/**
- * Configure a port for internal and/or external loopback. Internal loopback
- * causes packets sent by the port to be received by Octeon. External loopback
- * causes packets received from the wire to sent out again.
- *
- * @ipd_port: IPD/PKO port to loopback.
- * @enable_internal:
- *                Non zero if you want internal loopback
- * @enable_external:
- *                Non zero if you want external loopback
- *
- * Returns Zero on success, negative on failure.
- */
-int __cvmx_helper_rgmii_configure_loopback(int ipd_port, int enable_internal,
-                                          int enable_external)
-{
-       int interface = cvmx_helper_get_interface_num(ipd_port);
-       int index = cvmx_helper_get_interface_index_num(ipd_port);
-       int original_enable;
-       union cvmx_gmxx_prtx_cfg gmx_cfg;
-       union cvmx_asxx_prt_loop asxx_prt_loop;
-
-       /* Read the current enable state and save it */
-       gmx_cfg.u64 = cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface));
-       original_enable = gmx_cfg.s.en;
-       /* Force port to be disabled */
-       gmx_cfg.s.en = 0;
-       if (enable_internal) {
-               /* Force speed if we're doing internal loopback */
-               gmx_cfg.s.duplex = 1;
-               gmx_cfg.s.slottime = 1;
-               gmx_cfg.s.speed = 1;
-               cvmx_write_csr(CVMX_GMXX_TXX_CLK(index, interface), 1);
-               cvmx_write_csr(CVMX_GMXX_TXX_SLOT(index, interface), 0x200);
-               cvmx_write_csr(CVMX_GMXX_TXX_BURST(index, interface), 0x2000);
-       }
-       cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64);
-
-       /* Set the loopback bits */
-       asxx_prt_loop.u64 = cvmx_read_csr(CVMX_ASXX_PRT_LOOP(interface));
-       if (enable_internal)
-               asxx_prt_loop.s.int_loop |= 1 << index;
-       else
-               asxx_prt_loop.s.int_loop &= ~(1 << index);
-       if (enable_external)
-               asxx_prt_loop.s.ext_loop |= 1 << index;
-       else
-               asxx_prt_loop.s.ext_loop &= ~(1 << index);
-       cvmx_write_csr(CVMX_ASXX_PRT_LOOP(interface), asxx_prt_loop.u64);
-
-       /* Force enables in internal loopback */
-       if (enable_internal) {
-               uint64_t tmp;
-               tmp = cvmx_read_csr(CVMX_ASXX_TX_PRT_EN(interface));
-               cvmx_write_csr(CVMX_ASXX_TX_PRT_EN(interface),
-                              (1 << index) | tmp);
-               tmp = cvmx_read_csr(CVMX_ASXX_RX_PRT_EN(interface));
-               cvmx_write_csr(CVMX_ASXX_RX_PRT_EN(interface),
-                              (1 << index) | tmp);
-               original_enable = 1;
-       }
-
-       /* Restore the enable state */
-       gmx_cfg.s.en = original_enable;
-       cvmx_write_csr(CVMX_GMXX_PRTX_CFG(index, interface), gmx_cfg.u64);
-       return 0;
-}
index a176358c5a21527f6c9f679f1c359a7624c804bb..f6ebf63dc84c2128a0dc81502fd45b9c5e331843 100644 (file)
@@ -513,41 +513,3 @@ int __cvmx_helper_sgmii_link_set(int ipd_port,
        return __cvmx_helper_sgmii_hardware_init_link_speed(interface, index,
                                                            link_info);
 }
-
-/**
- * Configure a port for internal and/or external loopback. Internal
- * loopback causes packets sent by the port to be received by
- * Octeon. External loopback causes packets received from the wire to
- * sent out again.
- *
- * @ipd_port: IPD/PKO port to loopback.
- * @enable_internal:
- *                Non zero if you want internal loopback
- * @enable_external:
- *                Non zero if you want external loopback
- *
- * Returns Zero on success, negative on failure.
- */
-int __cvmx_helper_sgmii_configure_loopback(int ipd_port, int enable_internal,
-                                          int enable_external)
-{
-       int interface = cvmx_helper_get_interface_num(ipd_port);
-       int index = cvmx_helper_get_interface_index_num(ipd_port);
-       union cvmx_pcsx_mrx_control_reg pcsx_mrx_control_reg;
-       union cvmx_pcsx_miscx_ctl_reg pcsx_miscx_ctl_reg;
-
-       pcsx_mrx_control_reg.u64 =
-           cvmx_read_csr(CVMX_PCSX_MRX_CONTROL_REG(index, interface));
-       pcsx_mrx_control_reg.s.loopbck1 = enable_internal;
-       cvmx_write_csr(CVMX_PCSX_MRX_CONTROL_REG(index, interface),
-                      pcsx_mrx_control_reg.u64);
-
-       pcsx_miscx_ctl_reg.u64 =
-           cvmx_read_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface));
-       pcsx_miscx_ctl_reg.s.loopbck2 = enable_external;
-       cvmx_write_csr(CVMX_PCSX_MISCX_CTL_REG(index, interface),
-                      pcsx_miscx_ctl_reg.u64);
-
-       __cvmx_helper_sgmii_hardware_init_link(interface, index);
-       return 0;
-}
index 2bb6912a580def2ab9007b741dbc44bbb0c209e2..93a498d051849dca80bb64112b9e9c8b547067e9 100644 (file)
@@ -319,42 +319,3 @@ int __cvmx_helper_xaui_link_set(int ipd_port, cvmx_helper_link_info_t link_info)
        /* Bring the link up */
        return __cvmx_helper_xaui_enable(interface);
 }
-
-/**
- * Configure a port for internal and/or external loopback. Internal loopback
- * causes packets sent by the port to be received by Octeon. External loopback
- * causes packets received from the wire to sent out again.
- *
- * @ipd_port: IPD/PKO port to loopback.
- * @enable_internal:
- *                Non zero if you want internal loopback
- * @enable_external:
- *                Non zero if you want external loopback
- *
- * Returns Zero on success, negative on failure.
- */
-extern int __cvmx_helper_xaui_configure_loopback(int ipd_port,
-                                                int enable_internal,
-                                                int enable_external)
-{
-       int interface = cvmx_helper_get_interface_num(ipd_port);
-       union cvmx_pcsxx_control1_reg pcsxx_control1_reg;
-       union cvmx_gmxx_xaui_ext_loopback gmxx_xaui_ext_loopback;
-
-       /* Set the internal loop */
-       pcsxx_control1_reg.u64 =
-           cvmx_read_csr(CVMX_PCSXX_CONTROL1_REG(interface));
-       pcsxx_control1_reg.s.loopbck1 = enable_internal;
-       cvmx_write_csr(CVMX_PCSXX_CONTROL1_REG(interface),
-                      pcsxx_control1_reg.u64);
-
-       /* Set the external loop */
-       gmxx_xaui_ext_loopback.u64 =
-           cvmx_read_csr(CVMX_GMXX_XAUI_EXT_LOOPBACK(interface));
-       gmxx_xaui_ext_loopback.s.en = enable_external;
-       cvmx_write_csr(CVMX_GMXX_XAUI_EXT_LOOPBACK(interface),
-                      gmxx_xaui_ext_loopback.u64);
-
-       /* Take the link through a reset */
-       return __cvmx_helper_xaui_enable(interface);
-}
index 24d13e1845bbd5c1876e041a11a14a1bdd636060..30202ae4e044fe73db75b996602db68f3c80d926 100644 (file)
@@ -1239,57 +1239,3 @@ int cvmx_helper_link_set(int ipd_port, cvmx_helper_link_info_t link_info)
        return result;
 }
 EXPORT_SYMBOL_GPL(cvmx_helper_link_set);
-
-/**
- * Configure a port for internal and/or external loopback. Internal loopback
- * causes packets sent by the port to be received by Octeon. External loopback
- * causes packets received from the wire to sent out again.
- *
- * @ipd_port: IPD/PKO port to loopback.
- * @enable_internal:
- *                Non zero if you want internal loopback
- * @enable_external:
- *                Non zero if you want external loopback
- *
- * Returns Zero on success, negative on failure.
- */
-int cvmx_helper_configure_loopback(int ipd_port, int enable_internal,
-                                  int enable_external)
-{
-       int result = -1;
-       int interface = cvmx_helper_get_interface_num(ipd_port);
-       int index = cvmx_helper_get_interface_index_num(ipd_port);
-
-       if (index >= cvmx_helper_ports_on_interface(interface))
-               return -1;
-
-       switch (cvmx_helper_interface_get_mode(interface)) {
-       case CVMX_HELPER_INTERFACE_MODE_DISABLED:
-       case CVMX_HELPER_INTERFACE_MODE_PCIE:
-       case CVMX_HELPER_INTERFACE_MODE_SPI:
-       case CVMX_HELPER_INTERFACE_MODE_NPI:
-       case CVMX_HELPER_INTERFACE_MODE_LOOP:
-               break;
-       case CVMX_HELPER_INTERFACE_MODE_XAUI:
-               result =
-                   __cvmx_helper_xaui_configure_loopback(ipd_port,
-                                                         enable_internal,
-                                                         enable_external);
-               break;
-       case CVMX_HELPER_INTERFACE_MODE_RGMII:
-       case CVMX_HELPER_INTERFACE_MODE_GMII:
-               result =
-                   __cvmx_helper_rgmii_configure_loopback(ipd_port,
-                                                          enable_internal,
-                                                          enable_external);
-               break;
-       case CVMX_HELPER_INTERFACE_MODE_SGMII:
-       case CVMX_HELPER_INTERFACE_MODE_PICMG:
-               result =
-                   __cvmx_helper_sgmii_configure_loopback(ipd_port,
-                                                          enable_internal,
-                                                          enable_external);
-               break;
-       }
-       return result;
-}
index 80e4f8358b81f34b5ec76432f4fb1f8874d707e9..1c1eb7e4489bffa63e1a75716dfa56488a07ab57 100644 (file)
@@ -6902,30 +6902,4 @@ union cvmx_gmxx_tx_xaui_ctl {
        struct cvmx_gmxx_tx_xaui_ctl_s cnf71xx;
 };
 
-union cvmx_gmxx_xaui_ext_loopback {
-       uint64_t u64;
-       struct cvmx_gmxx_xaui_ext_loopback_s {
-#ifdef __BIG_ENDIAN_BITFIELD
-               uint64_t reserved_5_63:59;
-               uint64_t en:1;
-               uint64_t thresh:4;
-#else
-               uint64_t thresh:4;
-               uint64_t en:1;
-               uint64_t reserved_5_63:59;
-#endif
-       } s;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn52xx;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn52xxp1;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn56xx;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn56xxp1;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn61xx;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn63xx;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn63xxp1;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn66xx;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn68xx;
-       struct cvmx_gmxx_xaui_ext_loopback_s cn68xxp1;
-       struct cvmx_gmxx_xaui_ext_loopback_s cnf71xx;
-};
-
 #endif
index f7a95d7de1409b0995f2d4624e9f5ec80abbdd6f..ac42b5066bd996fb7217c9a66f62343e67556494 100644 (file)
@@ -90,21 +90,4 @@ extern cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port);
 extern int __cvmx_helper_rgmii_link_set(int ipd_port,
                                        cvmx_helper_link_info_t link_info);
 
-/**
- * Configure a port for internal and/or external loopback. Internal loopback
- * causes packets sent by the port to be received by Octeon. External loopback
- * causes packets received from the wire to sent out again.
- *
- * @ipd_port: IPD/PKO port to loopback.
- * @enable_internal:
- *                Non zero if you want internal loopback
- * @enable_external:
- *                Non zero if you want external loopback
- *
- * Returns Zero on success, negative on failure.
- */
-extern int __cvmx_helper_rgmii_configure_loopback(int ipd_port,
-                                                 int enable_internal,
-                                                 int enable_external);
-
 #endif
index 63fd21335e4b0bc716c9a50bb7cf84111f2340f2..3a54dea58c0a07a3126174114269c53bf921f8dd 100644 (file)
@@ -84,21 +84,4 @@ extern cvmx_helper_link_info_t __cvmx_helper_sgmii_link_get(int ipd_port);
 extern int __cvmx_helper_sgmii_link_set(int ipd_port,
                                        cvmx_helper_link_info_t link_info);
 
-/**
- * Configure a port for internal and/or external loopback. Internal loopback
- * causes packets sent by the port to be received by Octeon. External loopback
- * causes packets received from the wire to sent out again.
- *
- * @ipd_port: IPD/PKO port to loopback.
- * @enable_internal:
- *                Non zero if you want internal loopback
- * @enable_external:
- *                Non zero if you want external loopback
- *
- * Returns Zero on success, negative on failure.
- */
-extern int __cvmx_helper_sgmii_configure_loopback(int ipd_port,
-                                                 int enable_internal,
-                                                 int enable_external);
-
 #endif
index f8ce53f6f28ff7f4c07baca1bf8a28489ae5e5c1..51f45b4956807d2aea9d0cc52c71792bc2df57c7 100644 (file)
@@ -84,20 +84,4 @@ extern cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port);
 extern int __cvmx_helper_xaui_link_set(int ipd_port,
                                       cvmx_helper_link_info_t link_info);
 
-/**
- * Configure a port for internal and/or external loopback. Internal loopback
- * causes packets sent by the port to be received by Octeon. External loopback
- * causes packets received from the wire to sent out again.
- *
- * @ipd_port: IPD/PKO port to loopback.
- * @enable_internal:
- *                Non zero if you want internal loopback
- * @enable_external:
- *                Non zero if you want external loopback
- *
- * Returns Zero on success, negative on failure.
- */
-extern int __cvmx_helper_xaui_configure_loopback(int ipd_port,
-                                                int enable_internal,
-                                                int enable_external);
 #endif
index 0ed87cb67e7fba6a9291811b367ee3e86890a4b8..f77d946d482e08afe383878d69f5927c71dfd13c 100644 (file)
@@ -195,20 +195,4 @@ extern int cvmx_helper_link_set(int ipd_port,
 extern int cvmx_helper_interface_probe(int interface);
 extern int cvmx_helper_interface_enumerate(int interface);
 
-/**
- * Configure a port for internal and/or external loopback. Internal loopback
- * causes packets sent by the port to be received by Octeon. External loopback
- * causes packets received from the wire to sent out again.
- *
- * @ipd_port: IPD/PKO port to loopback.
- * @enable_internal:
- *                Non zero if you want internal loopback
- * @enable_external:
- *                Non zero if you want external loopback
- *
- * Returns Zero on success, negative on failure.
- */
-extern int cvmx_helper_configure_loopback(int ipd_port, int enable_internal,
-                                         int enable_external);
-
 #endif /* __CVMX_HELPER_H__ */