forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-16 50a212ec906f7524620675f0c57357691c26c81f
kernel/arch/mips/cavium-octeon/executive/cvmx-helper-xaui.c
....@@ -259,13 +259,13 @@
259259 *
260260 * Returns Link state
261261 */
262
-cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port)
262
+union cvmx_helper_link_info __cvmx_helper_xaui_link_get(int ipd_port)
263263 {
264264 int interface = cvmx_helper_get_interface_num(ipd_port);
265265 union cvmx_gmxx_tx_xaui_ctl gmxx_tx_xaui_ctl;
266266 union cvmx_gmxx_rx_xaui_ctl gmxx_rx_xaui_ctl;
267267 union cvmx_pcsxx_status1_reg pcsxx_status1_reg;
268
- cvmx_helper_link_info_t result;
268
+ union cvmx_helper_link_info result;
269269
270270 gmxx_tx_xaui_ctl.u64 = cvmx_read_csr(CVMX_GMXX_TX_XAUI_CTL(interface));
271271 gmxx_rx_xaui_ctl.u64 = cvmx_read_csr(CVMX_GMXX_RX_XAUI_CTL(interface));
....@@ -299,7 +299,7 @@
299299 *
300300 * Returns Zero on success, negative on failure
301301 */
302
-int __cvmx_helper_xaui_link_set(int ipd_port, cvmx_helper_link_info_t link_info)
302
+int __cvmx_helper_xaui_link_set(int ipd_port, union cvmx_helper_link_info link_info)
303303 {
304304 int interface = cvmx_helper_get_interface_num(ipd_port);
305305 union cvmx_gmxx_tx_xaui_ctl gmxx_tx_xaui_ctl;
....@@ -317,44 +317,5 @@
317317 return 0;
318318
319319 /* Bring the link up */
320
- return __cvmx_helper_xaui_enable(interface);
321
-}
322
-
323
-/**
324
- * Configure a port for internal and/or external loopback. Internal loopback
325
- * causes packets sent by the port to be received by Octeon. External loopback
326
- * causes packets received from the wire to sent out again.
327
- *
328
- * @ipd_port: IPD/PKO port to loopback.
329
- * @enable_internal:
330
- * Non zero if you want internal loopback
331
- * @enable_external:
332
- * Non zero if you want external loopback
333
- *
334
- * Returns Zero on success, negative on failure.
335
- */
336
-extern int __cvmx_helper_xaui_configure_loopback(int ipd_port,
337
- int enable_internal,
338
- int enable_external)
339
-{
340
- int interface = cvmx_helper_get_interface_num(ipd_port);
341
- union cvmx_pcsxx_control1_reg pcsxx_control1_reg;
342
- union cvmx_gmxx_xaui_ext_loopback gmxx_xaui_ext_loopback;
343
-
344
- /* Set the internal loop */
345
- pcsxx_control1_reg.u64 =
346
- cvmx_read_csr(CVMX_PCSXX_CONTROL1_REG(interface));
347
- pcsxx_control1_reg.s.loopbck1 = enable_internal;
348
- cvmx_write_csr(CVMX_PCSXX_CONTROL1_REG(interface),
349
- pcsxx_control1_reg.u64);
350
-
351
- /* Set the external loop */
352
- gmxx_xaui_ext_loopback.u64 =
353
- cvmx_read_csr(CVMX_GMXX_XAUI_EXT_LOOPBACK(interface));
354
- gmxx_xaui_ext_loopback.s.en = enable_external;
355
- cvmx_write_csr(CVMX_GMXX_XAUI_EXT_LOOPBACK(interface),
356
- gmxx_xaui_ext_loopback.u64);
357
-
358
- /* Take the link through a reset */
359320 return __cvmx_helper_xaui_enable(interface);
360321 }