summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-03-09 20:13:16 -0700
committerDavid S. Miller <davem@davemloft.net>2020-03-09 20:13:16 -0700
commite442cfc76833e9c97cbc0dd2c6823c09e32cb68e (patch)
tree4db8aadb20e33fa81a0417672d56d7bc458b57f1 /include/linux
parent6c9ee3069380d2dd98fbb410616d776c172ee64f (diff)
parentf213bbe8a9d6ba1d0adf424787c02f361ea78c38 (diff)
Merge branch 'net-Add-support-for-Synopsys-DesignWare-XPCS'
Jose Abreu says: ==================== net: Add support for Synopsys DesignWare XPCS This adds support for Synopsys DesignWare XPCS in net subsystem and integrates it into stmmac. At 1/8, we start by removing the limitation of stmmac selftests that needed a PHY to pass all the tests. Then at 2/8 we use some helpers in stmmac so that some code can be simplified. At 3/8, we fallback to dev_fwnode() so that PCI based setups wich may not have CONFIG_OF can still use FW node. At 4/8, we adapt stmmac to the new PHYLINK changes as suggested by Russell King. We proceed by doing changes in PHYLINK in order to support XPCS: At 5/8 we add some missing speeds that USXGMII supports and at 6/8 we check if Autoneg is supported after initial parameters are validated. Support for XPCS is finally introduced at 7/8, along with the usage of it in stmmac driver at 8/8. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mdio-xpcs.h41
-rw-r--r--include/linux/stmmac.h1
2 files changed, 42 insertions, 0 deletions
diff --git a/include/linux/mdio-xpcs.h b/include/linux/mdio-xpcs.h
new file mode 100644
index 000000000000..9a841aa5982d
--- /dev/null
+++ b/include/linux/mdio-xpcs.h
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (c) 2020 Synopsys, Inc. and/or its affiliates.
+ * Synopsys DesignWare XPCS helpers
+ */
+
+#ifndef __LINUX_MDIO_XPCS_H
+#define __LINUX_MDIO_XPCS_H
+
+#include <linux/phy.h>
+#include <linux/phylink.h>
+
+struct mdio_xpcs_args {
+ __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
+ struct mii_bus *bus;
+ int addr;
+};
+
+struct mdio_xpcs_ops {
+ int (*validate)(struct mdio_xpcs_args *xpcs,
+ unsigned long *supported,
+ struct phylink_link_state *state);
+ int (*config)(struct mdio_xpcs_args *xpcs,
+ const struct phylink_link_state *state);
+ int (*get_state)(struct mdio_xpcs_args *xpcs,
+ struct phylink_link_state *state);
+ int (*link_up)(struct mdio_xpcs_args *xpcs, int speed,
+ phy_interface_t interface);
+ int (*probe)(struct mdio_xpcs_args *xpcs, phy_interface_t interface);
+};
+
+#if IS_ENABLED(CONFIG_MDIO_XPCS)
+struct mdio_xpcs_ops *mdio_xpcs_get_ops(void);
+#else
+static inline struct mdio_xpcs_ops *mdio_xpcs_get_ops(void)
+{
+ return NULL;
+}
+#endif
+
+#endif /* __LINUX_MDIO_XPCS_H */
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 19190c609282..fbafb353e9be 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -80,6 +80,7 @@
struct stmmac_mdio_bus_data {
unsigned int phy_mask;
+ unsigned int has_xpcs;
int *irqs;
int probed_phy_irq;
bool needs_reset;