Skip to content

Commit b7e09dd

Browse files
DanielmachonPaolo Abeni
authored andcommitted
net: sparx5: ops out function for setting the port mux
Port muxing is configured based on the supported port modes. As these modes can differ on Sparx5 and lan969x we ops out the port muxing function. Reviewed-by: Steen Hegelund <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Signed-off-by: Daniel Machon <[email protected]> Signed-off-by: Paolo Abeni <[email protected]>
1 parent beb36b5 commit b7e09dd

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ static const struct sparx5_ops sparx5_ops = {
992992
.get_port_dev_bit = &sparx5_port_dev_mapping,
993993
.get_hsch_max_group_rate = &sparx5_get_hsch_max_group_rate,
994994
.get_sdlb_group = &sparx5_get_sdlb_group,
995+
.set_port_mux = &sparx5_port_mux_set,
995996
};
996997

997998
static const struct sparx5_match_data sparx5_desc = {

drivers/net/ethernet/microchip/sparx5/sparx5_main.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ struct sparx5_ops {
267267
u32 (*get_port_dev_bit)(struct sparx5 *sparx5, int port);
268268
u32 (*get_hsch_max_group_rate)(int grp);
269269
struct sparx5_sdlb_group *(*get_sdlb_group)(int idx);
270+
int (*set_port_mux)(struct sparx5 *sparx5, struct sparx5_port *port,
271+
struct sparx5_port_config *conf);
270272
};
271273

272274
struct sparx5_main_io_resource {
@@ -485,6 +487,10 @@ int sparx5_pool_get(struct sparx5_pool_entry *pool, int size, u32 *id);
485487
int sparx5_pool_get_with_idx(struct sparx5_pool_entry *pool, int size, u32 idx,
486488
u32 *id);
487489

490+
/* sparx5_port.c */
491+
int sparx5_port_mux_set(struct sparx5 *sparx5, struct sparx5_port *port,
492+
struct sparx5_port_config *conf);
493+
488494
/* sparx5_sdlb.c */
489495
#define SPX5_SDLB_PUP_TOKEN_DISABLE 0x1FFF
490496
#define SPX5_SDLB_PUP_TOKEN_MAX (SPX5_SDLB_PUP_TOKEN_DISABLE - 1)

drivers/net/ethernet/microchip/sparx5/sparx5_port.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,9 +516,8 @@ static int sparx5_port_fifo_sz(struct sparx5 *sparx5,
516516
/* Configure port muxing:
517517
* QSGMII: 4x2G5 devices
518518
*/
519-
static int sparx5_port_mux_set(struct sparx5 *sparx5,
520-
struct sparx5_port *port,
521-
struct sparx5_port_config *conf)
519+
int sparx5_port_mux_set(struct sparx5 *sparx5, struct sparx5_port *port,
520+
struct sparx5_port_config *conf)
522521
{
523522
u32 portno = port->portno;
524523
u32 inst;
@@ -1039,7 +1038,7 @@ int sparx5_port_init(struct sparx5 *sparx5,
10391038
pcsinst = spx5_inst_get(sparx5, pcs, pix);
10401039

10411040
/* Set the mux port mode */
1042-
err = sparx5_port_mux_set(sparx5, port, conf);
1041+
err = ops->set_port_mux(sparx5, port, conf);
10431042
if (err)
10441043
return err;
10451044

0 commit comments

Comments
 (0)