| .. | .. |
|---|
| 259 | 259 | * |
|---|
| 260 | 260 | * Returns Link state |
|---|
| 261 | 261 | */ |
|---|
| 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) |
|---|
| 263 | 263 | { |
|---|
| 264 | 264 | int interface = cvmx_helper_get_interface_num(ipd_port); |
|---|
| 265 | 265 | union cvmx_gmxx_tx_xaui_ctl gmxx_tx_xaui_ctl; |
|---|
| 266 | 266 | union cvmx_gmxx_rx_xaui_ctl gmxx_rx_xaui_ctl; |
|---|
| 267 | 267 | union cvmx_pcsxx_status1_reg pcsxx_status1_reg; |
|---|
| 268 | | - cvmx_helper_link_info_t result; |
|---|
| 268 | + union cvmx_helper_link_info result; |
|---|
| 269 | 269 | |
|---|
| 270 | 270 | gmxx_tx_xaui_ctl.u64 = cvmx_read_csr(CVMX_GMXX_TX_XAUI_CTL(interface)); |
|---|
| 271 | 271 | gmxx_rx_xaui_ctl.u64 = cvmx_read_csr(CVMX_GMXX_RX_XAUI_CTL(interface)); |
|---|
| .. | .. |
|---|
| 299 | 299 | * |
|---|
| 300 | 300 | * Returns Zero on success, negative on failure |
|---|
| 301 | 301 | */ |
|---|
| 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) |
|---|
| 303 | 303 | { |
|---|
| 304 | 304 | int interface = cvmx_helper_get_interface_num(ipd_port); |
|---|
| 305 | 305 | union cvmx_gmxx_tx_xaui_ctl gmxx_tx_xaui_ctl; |
|---|
| .. | .. |
|---|
| 317 | 317 | return 0; |
|---|
| 318 | 318 | |
|---|
| 319 | 319 | /* 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 */ |
|---|
| 359 | 320 | return __cvmx_helper_xaui_enable(interface); |
|---|
| 360 | 321 | } |
|---|