aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2021-06-04 15:12:14 +0200
committerDavid Bauer <mail@david-bauer.net>2021-06-08 00:38:28 +0200
commit15167671b0d7cf0c95568dd6f9620db082df5d96 (patch)
tree2f282fa98f8329b63d8a63395a5ce18d8038d8b3 /target/linux/ramips
parent1412424fc51209480fa4efed9f3f0badc6dcab09 (diff)
downloadupstream-15167671b0d7cf0c95568dd6f9620db082df5d96.tar.gz
upstream-15167671b0d7cf0c95568dd6f9620db082df5d96.tar.bz2
upstream-15167671b0d7cf0c95568dd6f9620db082df5d96.zip
generic: backport at803x fixes
As patches for the AR8031/AR8033 copper page selection were merged upstream, we can backport these patches. This also fixes a PHY capabilities detection issue on the Ubiquiti ER-X-SFP. Signed-off-by: David Bauer <mail@david-bauer.net>
Diffstat (limited to 'target/linux/ramips')
-rw-r--r--target/linux/ramips/patches-5.10/710-at803x.patch17
-rw-r--r--target/linux/ramips/patches-5.4/991-at803x.patch17
2 files changed, 19 insertions, 15 deletions
diff --git a/target/linux/ramips/patches-5.10/710-at803x.patch b/target/linux/ramips/patches-5.10/710-at803x.patch
index dab62b7607..d15dd92965 100644
--- a/target/linux/ramips/patches-5.10/710-at803x.patch
+++ b/target/linux/ramips/patches-5.10/710-at803x.patch
@@ -23,7 +23,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
#define AT803X_SPECIFIC_FUNCTION_CONTROL 0x10
#define AT803X_SFC_ASSERT_CRS BIT(11)
-@@ -83,9 +85,18 @@
+@@ -82,9 +84,18 @@
#define AT803X_MODE_CFG_MASK 0x0F
#define AT803X_MODE_CFG_SGMII 0x01
@@ -42,7 +42,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
#define AT803X_DEBUG_REG_0 0x00
#define AT803X_DEBUG_RX_CLK_DLY_EN BIT(15)
-@@ -505,10 +516,72 @@ static int at803x_parse_dt(struct phy_de
+@@ -532,12 +543,75 @@ static int at803x_parse_dt(struct phy_de
return 0;
}
@@ -101,21 +101,24 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
+ .module_insert = at803x_sfp_insert,
+};
+
++
static int at803x_probe(struct phy_device *phydev)
{
struct device *dev = &phydev->mdio.dev;
struct at803x_priv *priv;
-+ int ret;
+ int ret;
+
+
+ if (at803x_mode(phydev) == AT803X_MODE_FIBER) {
+ ret = phy_sfp_probe(phydev, &at803x_sfp_ops);
+ if (ret < 0)
+ return ret;
+ }
-
++
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
-@@ -709,6 +782,10 @@ static int at803x_read_status(struct phy
+ return -ENOMEM;
+@@ -744,6 +818,10 @@ static int at803x_read_status(struct phy
{
int ss, err, old_link = phydev->link;
@@ -126,7 +129,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
/* Update the link, but return if there was an error */
err = genphy_update_link(phydev);
if (err)
-@@ -809,6 +886,12 @@ static int at803x_config_aneg(struct phy
+@@ -844,6 +922,12 @@ static int at803x_config_aneg(struct phy
{
int ret;
@@ -139,7 +142,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
ret = at803x_config_mdix(phydev, phydev->mdix_ctrl);
if (ret < 0)
return ret;
-@@ -1110,6 +1193,7 @@ static struct phy_driver at803x_driver[]
+@@ -1145,6 +1229,7 @@ static struct phy_driver at803x_driver[]
/* Qualcomm Atheros AR8031/AR8033 */
PHY_ID_MATCH_EXACT(ATH8031_PHY_ID),
.name = "Qualcomm Atheros AR8031/AR8033",
diff --git a/target/linux/ramips/patches-5.4/991-at803x.patch b/target/linux/ramips/patches-5.4/991-at803x.patch
index 95411211b2..29e79e65d7 100644
--- a/target/linux/ramips/patches-5.4/991-at803x.patch
+++ b/target/linux/ramips/patches-5.4/991-at803x.patch
@@ -23,7 +23,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
#define AT803X_SPECIFIC_STATUS 0x11
#define AT803X_SS_SPEED_MASK (3 << 14)
-@@ -53,9 +55,18 @@
+@@ -52,9 +54,18 @@
#define AT803X_MODE_CFG_MASK 0x0F
#define AT803X_MODE_CFG_SGMII 0x01
@@ -42,7 +42,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
#define AT803X_DEBUG_REG_0 0x00
#define AT803X_DEBUG_RX_CLK_DLY_EN BIT(15)
-@@ -243,10 +254,72 @@ static int at803x_resume(struct phy_devi
+@@ -274,12 +285,73 @@ static int at803x_resume(struct phy_devi
return phy_modify(phydev, MII_BMCR, BMCR_PDOWN | BMCR_ISOLATE, 0);
}
@@ -105,17 +105,18 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
{
struct device *dev = &phydev->mdio.dev;
struct at803x_priv *priv;
-+ int ret;
-+
+ int ret;
+
+ if (at803x_mode(phydev) == AT803X_MODE_FIBER) {
+ ret = phy_sfp_probe(phydev, &at803x_sfp_ops);
+ if (ret < 0)
+ return ret;
+ }
-
++
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
-@@ -394,6 +467,10 @@ static int at803x_read_status(struct phy
+ return -ENOMEM;
+@@ -415,6 +487,10 @@ static int at803x_read_status(struct phy
{
int ss, err, old_link = phydev->link;
@@ -126,7 +127,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
/* Update the link, but return if there was an error */
err = genphy_update_link(phydev);
if (err)
-@@ -448,6 +525,19 @@ static int at803x_read_status(struct phy
+@@ -469,6 +545,19 @@ static int at803x_read_status(struct phy
return 0;
}
@@ -146,7 +147,7 @@ Signed-off-by: René van Dorst <opensource@vdorst.com>
static struct phy_driver at803x_driver[] = {
{
/* ATHEROS 8035 */
-@@ -461,6 +551,7 @@ static struct phy_driver at803x_driver[]
+@@ -482,6 +571,7 @@ static struct phy_driver at803x_driver[]
.suspend = at803x_suspend,
.resume = at803x_resume,
/* PHY_GBIT_FEATURES */