Commit f7d2bdcb authored by Chris Packham's avatar Chris Packham Committed by Greg Kroah-Hartman

MIPS: octeon: remove typedef declaration for cvmx_helper_link_info

Remove declaration of union cvmx_helper_link_info as typedef and update
uses to use the union.
Signed-off-by: default avatarChris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20200205001116.14096-5-chris.packham@alliedtelesis.co.nzSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f9546de4
...@@ -207,9 +207,9 @@ int cvmx_helper_board_get_mii_address(int ipd_port) ...@@ -207,9 +207,9 @@ int cvmx_helper_board_get_mii_address(int ipd_port)
* Returns The ports link status. If the link isn't fully resolved, this must * Returns The ports link status. If the link isn't fully resolved, this must
* return zero. * return zero.
*/ */
cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port) union cvmx_helper_link_info __cvmx_helper_board_link_get(int ipd_port)
{ {
cvmx_helper_link_info_t result; union cvmx_helper_link_info result;
WARN(!octeon_is_simulation(), WARN(!octeon_is_simulation(),
"Using deprecated link status - please update your DT"); "Using deprecated link status - please update your DT");
......
...@@ -261,7 +261,7 @@ int __cvmx_helper_rgmii_enable(int interface) ...@@ -261,7 +261,7 @@ int __cvmx_helper_rgmii_enable(int interface)
* *
* Returns Link state * Returns Link state
*/ */
cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port) union cvmx_helper_link_info __cvmx_helper_rgmii_link_get(int ipd_port)
{ {
int interface = cvmx_helper_get_interface_num(ipd_port); int interface = cvmx_helper_get_interface_num(ipd_port);
int index = cvmx_helper_get_interface_index_num(ipd_port); int index = cvmx_helper_get_interface_index_num(ipd_port);
...@@ -270,7 +270,7 @@ cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port) ...@@ -270,7 +270,7 @@ cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port)
asxx_prt_loop.u64 = cvmx_read_csr(CVMX_ASXX_PRT_LOOP(interface)); asxx_prt_loop.u64 = cvmx_read_csr(CVMX_ASXX_PRT_LOOP(interface));
if (asxx_prt_loop.s.int_loop & (1 << index)) { if (asxx_prt_loop.s.int_loop & (1 << index)) {
/* Force 1Gbps full duplex on internal loopback */ /* Force 1Gbps full duplex on internal loopback */
cvmx_helper_link_info_t result; union cvmx_helper_link_info result;
result.u64 = 0; result.u64 = 0;
result.s.full_duplex = 1; result.s.full_duplex = 1;
result.s.link_up = 1; result.s.link_up = 1;
...@@ -292,7 +292,7 @@ cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port) ...@@ -292,7 +292,7 @@ cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port)
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
int __cvmx_helper_rgmii_link_set(int ipd_port, int __cvmx_helper_rgmii_link_set(int ipd_port,
cvmx_helper_link_info_t link_info) union cvmx_helper_link_info link_info)
{ {
int result = 0; int result = 0;
int interface = cvmx_helper_get_interface_num(ipd_port); int interface = cvmx_helper_get_interface_num(ipd_port);
......
...@@ -200,7 +200,7 @@ static int __cvmx_helper_sgmii_hardware_init_link(int interface, int index) ...@@ -200,7 +200,7 @@ static int __cvmx_helper_sgmii_hardware_init_link(int interface, int index)
*/ */
static int __cvmx_helper_sgmii_hardware_init_link_speed(int interface, static int __cvmx_helper_sgmii_hardware_init_link_speed(int interface,
int index, int index,
cvmx_helper_link_info_t union cvmx_helper_link_info
link_info) link_info)
{ {
int is_enabled; int is_enabled;
...@@ -394,9 +394,9 @@ int __cvmx_helper_sgmii_enable(int interface) ...@@ -394,9 +394,9 @@ int __cvmx_helper_sgmii_enable(int interface)
* *
* Returns Link state * Returns Link state
*/ */
cvmx_helper_link_info_t __cvmx_helper_sgmii_link_get(int ipd_port) union cvmx_helper_link_info __cvmx_helper_sgmii_link_get(int ipd_port)
{ {
cvmx_helper_link_info_t result; union cvmx_helper_link_info result;
union cvmx_pcsx_miscx_ctl_reg pcs_misc_ctl_reg; union cvmx_pcsx_miscx_ctl_reg pcs_misc_ctl_reg;
int interface = cvmx_helper_get_interface_num(ipd_port); int interface = cvmx_helper_get_interface_num(ipd_port);
int index = cvmx_helper_get_interface_index_num(ipd_port); int index = cvmx_helper_get_interface_index_num(ipd_port);
...@@ -505,7 +505,7 @@ cvmx_helper_link_info_t __cvmx_helper_sgmii_link_get(int ipd_port) ...@@ -505,7 +505,7 @@ cvmx_helper_link_info_t __cvmx_helper_sgmii_link_get(int ipd_port)
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
int __cvmx_helper_sgmii_link_set(int ipd_port, int __cvmx_helper_sgmii_link_set(int ipd_port,
cvmx_helper_link_info_t link_info) union cvmx_helper_link_info link_info)
{ {
int interface = cvmx_helper_get_interface_num(ipd_port); int interface = cvmx_helper_get_interface_num(ipd_port);
int index = cvmx_helper_get_interface_index_num(ipd_port); int index = cvmx_helper_get_interface_index_num(ipd_port);
......
...@@ -140,9 +140,9 @@ int __cvmx_helper_spi_enable(int interface) ...@@ -140,9 +140,9 @@ int __cvmx_helper_spi_enable(int interface)
* *
* Returns Link state * Returns Link state
*/ */
cvmx_helper_link_info_t __cvmx_helper_spi_link_get(int ipd_port) union cvmx_helper_link_info __cvmx_helper_spi_link_get(int ipd_port)
{ {
cvmx_helper_link_info_t result; union cvmx_helper_link_info result;
int interface = cvmx_helper_get_interface_num(ipd_port); int interface = cvmx_helper_get_interface_num(ipd_port);
int index = cvmx_helper_get_interface_index_num(ipd_port); int index = cvmx_helper_get_interface_index_num(ipd_port);
result.u64 = 0; result.u64 = 0;
...@@ -193,7 +193,7 @@ cvmx_helper_link_info_t __cvmx_helper_spi_link_get(int ipd_port) ...@@ -193,7 +193,7 @@ cvmx_helper_link_info_t __cvmx_helper_spi_link_get(int ipd_port)
* *
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
int __cvmx_helper_spi_link_set(int ipd_port, cvmx_helper_link_info_t link_info) int __cvmx_helper_spi_link_set(int ipd_port, union cvmx_helper_link_info link_info)
{ {
/* Nothing to do. If we have a SPI4000 then the setup was already performed /* Nothing to do. If we have a SPI4000 then the setup was already performed
by cvmx_spi4000_check_speed(). If not then there isn't any link by cvmx_spi4000_check_speed(). If not then there isn't any link
......
...@@ -259,13 +259,13 @@ int __cvmx_helper_xaui_enable(int interface) ...@@ -259,13 +259,13 @@ int __cvmx_helper_xaui_enable(int interface)
* *
* Returns Link state * Returns Link state
*/ */
cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port) union cvmx_helper_link_info __cvmx_helper_xaui_link_get(int ipd_port)
{ {
int interface = cvmx_helper_get_interface_num(ipd_port); int interface = cvmx_helper_get_interface_num(ipd_port);
union cvmx_gmxx_tx_xaui_ctl gmxx_tx_xaui_ctl; union cvmx_gmxx_tx_xaui_ctl gmxx_tx_xaui_ctl;
union cvmx_gmxx_rx_xaui_ctl gmxx_rx_xaui_ctl; union cvmx_gmxx_rx_xaui_ctl gmxx_rx_xaui_ctl;
union cvmx_pcsxx_status1_reg pcsxx_status1_reg; union cvmx_pcsxx_status1_reg pcsxx_status1_reg;
cvmx_helper_link_info_t result; union cvmx_helper_link_info result;
gmxx_tx_xaui_ctl.u64 = cvmx_read_csr(CVMX_GMXX_TX_XAUI_CTL(interface)); gmxx_tx_xaui_ctl.u64 = cvmx_read_csr(CVMX_GMXX_TX_XAUI_CTL(interface));
gmxx_rx_xaui_ctl.u64 = cvmx_read_csr(CVMX_GMXX_RX_XAUI_CTL(interface)); gmxx_rx_xaui_ctl.u64 = cvmx_read_csr(CVMX_GMXX_RX_XAUI_CTL(interface));
...@@ -299,7 +299,7 @@ cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port) ...@@ -299,7 +299,7 @@ cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port)
* *
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
int __cvmx_helper_xaui_link_set(int ipd_port, cvmx_helper_link_info_t link_info) int __cvmx_helper_xaui_link_set(int ipd_port, union cvmx_helper_link_info link_info)
{ {
int interface = cvmx_helper_get_interface_num(ipd_port); int interface = cvmx_helper_get_interface_num(ipd_port);
union cvmx_gmxx_tx_xaui_ctl gmxx_tx_xaui_ctl; union cvmx_gmxx_tx_xaui_ctl gmxx_tx_xaui_ctl;
......
...@@ -1075,9 +1075,9 @@ int cvmx_helper_initialize_packet_io_local(void) ...@@ -1075,9 +1075,9 @@ int cvmx_helper_initialize_packet_io_local(void)
* *
* Returns Link state * Returns Link state
*/ */
cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port) union cvmx_helper_link_info cvmx_helper_link_get(int ipd_port)
{ {
cvmx_helper_link_info_t result; union cvmx_helper_link_info result;
int interface = cvmx_helper_get_interface_num(ipd_port); int interface = cvmx_helper_get_interface_num(ipd_port);
int index = cvmx_helper_get_interface_index_num(ipd_port); int index = cvmx_helper_get_interface_index_num(ipd_port);
...@@ -1136,7 +1136,7 @@ EXPORT_SYMBOL_GPL(cvmx_helper_link_get); ...@@ -1136,7 +1136,7 @@ EXPORT_SYMBOL_GPL(cvmx_helper_link_get);
* *
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
int cvmx_helper_link_set(int ipd_port, cvmx_helper_link_info_t link_info) int cvmx_helper_link_set(int ipd_port, union cvmx_helper_link_info link_info)
{ {
int result = -1; int result = -1;
int interface = cvmx_helper_get_interface_num(ipd_port); int interface = cvmx_helper_get_interface_num(ipd_port);
......
...@@ -93,7 +93,7 @@ extern int cvmx_helper_board_get_mii_address(int ipd_port); ...@@ -93,7 +93,7 @@ extern int cvmx_helper_board_get_mii_address(int ipd_port);
* Returns The ports link status. If the link isn't fully resolved, this must * Returns The ports link status. If the link isn't fully resolved, this must
* return zero. * return zero.
*/ */
extern cvmx_helper_link_info_t __cvmx_helper_board_link_get(int ipd_port); extern union cvmx_helper_link_info __cvmx_helper_board_link_get(int ipd_port);
/** /**
* This function is called by cvmx_helper_interface_probe() after it * This function is called by cvmx_helper_interface_probe() after it
......
...@@ -74,7 +74,7 @@ extern int __cvmx_helper_rgmii_enable(int interface); ...@@ -74,7 +74,7 @@ extern int __cvmx_helper_rgmii_enable(int interface);
* *
* Returns Link state * Returns Link state
*/ */
extern cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port); extern union cvmx_helper_link_info __cvmx_helper_rgmii_link_get(int ipd_port);
/** /**
* Configure an IPD/PKO port for the specified link state. This * Configure an IPD/PKO port for the specified link state. This
...@@ -88,6 +88,6 @@ extern cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port); ...@@ -88,6 +88,6 @@ extern cvmx_helper_link_info_t __cvmx_helper_rgmii_link_get(int ipd_port);
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
extern int __cvmx_helper_rgmii_link_set(int ipd_port, extern int __cvmx_helper_rgmii_link_set(int ipd_port,
cvmx_helper_link_info_t link_info); union cvmx_helper_link_info link_info);
#endif #endif
...@@ -68,7 +68,7 @@ extern int __cvmx_helper_sgmii_enable(int interface); ...@@ -68,7 +68,7 @@ extern int __cvmx_helper_sgmii_enable(int interface);
* *
* Returns Link state * Returns Link state
*/ */
extern cvmx_helper_link_info_t __cvmx_helper_sgmii_link_get(int ipd_port); extern union cvmx_helper_link_info __cvmx_helper_sgmii_link_get(int ipd_port);
/** /**
* Configure an IPD/PKO port for the specified link state. This * Configure an IPD/PKO port for the specified link state. This
...@@ -82,6 +82,6 @@ extern cvmx_helper_link_info_t __cvmx_helper_sgmii_link_get(int ipd_port); ...@@ -82,6 +82,6 @@ extern cvmx_helper_link_info_t __cvmx_helper_sgmii_link_get(int ipd_port);
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
extern int __cvmx_helper_sgmii_link_set(int ipd_port, extern int __cvmx_helper_sgmii_link_set(int ipd_port,
cvmx_helper_link_info_t link_info); union cvmx_helper_link_info link_info);
#endif #endif
...@@ -65,7 +65,7 @@ extern int __cvmx_helper_spi_enable(int interface); ...@@ -65,7 +65,7 @@ extern int __cvmx_helper_spi_enable(int interface);
* *
* Returns Link state * Returns Link state
*/ */
extern cvmx_helper_link_info_t __cvmx_helper_spi_link_get(int ipd_port); extern union cvmx_helper_link_info __cvmx_helper_spi_link_get(int ipd_port);
/** /**
* Configure an IPD/PKO port for the specified link state. This * Configure an IPD/PKO port for the specified link state. This
...@@ -79,6 +79,6 @@ extern cvmx_helper_link_info_t __cvmx_helper_spi_link_get(int ipd_port); ...@@ -79,6 +79,6 @@ extern cvmx_helper_link_info_t __cvmx_helper_spi_link_get(int ipd_port);
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
extern int __cvmx_helper_spi_link_set(int ipd_port, extern int __cvmx_helper_spi_link_set(int ipd_port,
cvmx_helper_link_info_t link_info); union cvmx_helper_link_info link_info);
#endif #endif
...@@ -68,7 +68,7 @@ extern int __cvmx_helper_xaui_enable(int interface); ...@@ -68,7 +68,7 @@ extern int __cvmx_helper_xaui_enable(int interface);
* *
* Returns Link state * Returns Link state
*/ */
extern cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port); extern union cvmx_helper_link_info __cvmx_helper_xaui_link_get(int ipd_port);
/** /**
* Configure an IPD/PKO port for the specified link state. This * Configure an IPD/PKO port for the specified link state. This
...@@ -82,6 +82,6 @@ extern cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port); ...@@ -82,6 +82,6 @@ extern cvmx_helper_link_info_t __cvmx_helper_xaui_link_get(int ipd_port);
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
extern int __cvmx_helper_xaui_link_set(int ipd_port, extern int __cvmx_helper_xaui_link_set(int ipd_port,
cvmx_helper_link_info_t link_info); union cvmx_helper_link_info link_info);
#endif #endif
...@@ -51,7 +51,7 @@ typedef enum { ...@@ -51,7 +51,7 @@ typedef enum {
CVMX_HELPER_INTERFACE_MODE_LOOP, CVMX_HELPER_INTERFACE_MODE_LOOP,
} cvmx_helper_interface_mode_t; } cvmx_helper_interface_mode_t;
typedef union { union cvmx_helper_link_info {
uint64_t u64; uint64_t u64;
struct { struct {
uint64_t reserved_20_63:44; uint64_t reserved_20_63:44;
...@@ -59,7 +59,7 @@ typedef union { ...@@ -59,7 +59,7 @@ typedef union {
uint64_t full_duplex:1; /**< 1 if the link is full duplex */ uint64_t full_duplex:1; /**< 1 if the link is full duplex */
uint64_t speed:18; /**< Speed of the link in Mbps */ uint64_t speed:18; /**< Speed of the link in Mbps */
} s; } s;
} cvmx_helper_link_info_t; };
#include <asm/octeon/cvmx-helper-errata.h> #include <asm/octeon/cvmx-helper-errata.h>
#include <asm/octeon/cvmx-helper-loop.h> #include <asm/octeon/cvmx-helper-loop.h>
...@@ -145,7 +145,7 @@ extern cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int ...@@ -145,7 +145,7 @@ extern cvmx_helper_interface_mode_t cvmx_helper_interface_get_mode(int
* *
* Returns Link state * Returns Link state
*/ */
extern cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port); extern union cvmx_helper_link_info cvmx_helper_link_get(int ipd_port);
/** /**
* Configure an IPD/PKO port for the specified link state. This * Configure an IPD/PKO port for the specified link state. This
...@@ -159,7 +159,7 @@ extern cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port); ...@@ -159,7 +159,7 @@ extern cvmx_helper_link_info_t cvmx_helper_link_get(int ipd_port);
* Returns Zero on success, negative on failure * Returns Zero on success, negative on failure
*/ */
extern int cvmx_helper_link_set(int ipd_port, extern int cvmx_helper_link_set(int ipd_port,
cvmx_helper_link_info_t link_info); union cvmx_helper_link_info link_info);
/** /**
* This function probes an interface to determine the actual * This function probes an interface to determine the actual
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment