aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/dsa/microchip/ksz_common.h
diff options
context:
space:
mode:
authorArun Ramadoss <arun.ramadoss@microchip.com>2022-07-24 14:58:19 +0530
committerDavid S. Miller <davem@davemloft.net>2022-07-27 09:39:17 +0100
commitdc1c596edba5e656256c2d6e6922246c7803f2de (patch)
treed84b2d1e49286f9c41a99293ddcc46dd167e5ef8 /drivers/net/dsa/microchip/ksz_common.h
parentnet: dsa: microchip: add support for common phylink mac link up (diff)
downloadlinux-dev-dc1c596edba5e656256c2d6e6922246c7803f2de.tar.xz
linux-dev-dc1c596edba5e656256c2d6e6922246c7803f2de.zip
net: dsa: microchip: lan937x: add support for configuing xMII register
This patch add the common ksz_set_xmii function for ksz series switch and update the lan937x code phylink mac config. The register address for the ksz8795 is Port 5 Interface control 6 and for all other switch is xMII Control 1. The bit value for selecting the interface is same for KSZ8795 and KSZ9893 are same. The bit values for KSZ9477 and lan973x are same. So, this patch add the bit value for each switches in ksz_chip_data and configure the registers based on the chip id. Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz_common.h')
-rw-r--r--drivers/net/dsa/microchip/ksz_common.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/dsa/microchip/ksz_common.h b/drivers/net/dsa/microchip/ksz_common.h
index 71a344afbf1f..24044fc873fd 100644
--- a/drivers/net/dsa/microchip/ksz_common.h
+++ b/drivers/net/dsa/microchip/ksz_common.h
@@ -222,6 +222,10 @@ enum ksz_xmii_ctrl0 {
};
enum ksz_xmii_ctrl1 {
+ P_RGMII_SEL,
+ P_RMII_SEL,
+ P_GMII_SEL,
+ P_MII_SEL,
P_GMII_1GBIT,
P_GMII_NOT_1GBIT,
};
@@ -313,6 +317,7 @@ void ksz_r_mib_stats64(struct ksz_device *dev, int port);
void ksz_port_stp_state_set(struct dsa_switch *ds, int port, u8 state);
bool ksz_get_gbit(struct ksz_device *dev, int port);
void ksz_set_gbit(struct ksz_device *dev, int port, bool gbit);
+void ksz_set_xmii(struct ksz_device *dev, int port, phy_interface_t interface);
extern const struct ksz_chip_data ksz_switch_chips[];
/* Common register access functions */
@@ -489,6 +494,9 @@ static inline int is_lan937x(struct ksz_device *dev)
#define P_MII_100MBIT_M BIT(4)
#define P_GMII_1GBIT_M BIT(6)
+#define P_RGMII_ID_IG_ENABLE BIT(4)
+#define P_RGMII_ID_EG_ENABLE BIT(3)
+#define P_MII_SEL_M 0x3
/* Regmap tables generation */
#define KSZ_SPI_OP_RD 3