diff options
author | David Bauer <mail@david-bauer.net> | 2021-06-04 15:12:14 +0200 |
---|---|---|
committer | David Bauer <mail@david-bauer.net> | 2021-06-08 00:38:28 +0200 |
commit | 15167671b0d7cf0c95568dd6f9620db082df5d96 (patch) | |
tree | 2f282fa98f8329b63d8a63395a5ce18d8038d8b3 /target/linux/generic/pending-5.4 | |
parent | 1412424fc51209480fa4efed9f3f0badc6dcab09 (diff) | |
download | upstream-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/generic/pending-5.4')
-rw-r--r-- | target/linux/generic/pending-5.4/735-net-phy-at803x-fix-at8033-sgmii-mode.patch | 51 | ||||
-rw-r--r-- | target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch | 36 |
2 files changed, 0 insertions, 87 deletions
diff --git a/target/linux/generic/pending-5.4/735-net-phy-at803x-fix-at8033-sgmii-mode.patch b/target/linux/generic/pending-5.4/735-net-phy-at803x-fix-at8033-sgmii-mode.patch deleted file mode 100644 index 795743057a..0000000000 --- a/target/linux/generic/pending-5.4/735-net-phy-at803x-fix-at8033-sgmii-mode.patch +++ /dev/null @@ -1,51 +0,0 @@ -From: Roman Yeryomin <roman@advem.lv> -Subject: kernel: add at803x fix for sgmii mode - -Some (possibly broken) bootloaders incorreclty initialize at8033 -phy. This patch enables sgmii autonegotiation mode. - -[john@phrozen.org: felix added this to his upstream queue] - -Signed-off-by: Roman Yeryomin <roman@advem.lv> ---- - drivers/net/phy/at803x.c | 25 +++++++++++++++++++++++++ - 1 file changed, 25 insertions(+) - ---- a/drivers/net/phy/at803x.c -+++ b/drivers/net/phy/at803x.c -@@ -46,6 +46,7 @@ - #define AT803X_LOC_MAC_ADDR_32_47_OFFSET 0x804A - #define AT803X_REG_CHIP_CONFIG 0x1f - #define AT803X_BT_BX_REG_SEL 0x8000 -+#define AT803X_SGMII_ANEG_EN 0x1000 - - #define AT803X_DEBUG_ADDR 0x1D - #define AT803X_DEBUG_DATA 0x1E -@@ -259,6 +260,27 @@ static int at803x_probe(struct phy_devic - static int at803x_config_init(struct phy_device *phydev) - { - int ret; -+ u32 v; -+ -+ if (phydev->drv->phy_id == ATH8031_PHY_ID && -+ phydev->interface == PHY_INTERFACE_MODE_SGMII) -+ { -+ v = phy_read(phydev, AT803X_REG_CHIP_CONFIG); -+ /* select SGMII/fiber page */ -+ ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG, -+ v & ~AT803X_BT_BX_REG_SEL); -+ if (ret) -+ return ret; -+ /* enable SGMII autonegotiation */ -+ ret = phy_write(phydev, MII_BMCR, AT803X_SGMII_ANEG_EN); -+ if (ret) -+ return ret; -+ /* select copper page */ -+ ret = phy_write(phydev, AT803X_REG_CHIP_CONFIG, -+ v | AT803X_BT_BX_REG_SEL); -+ if (ret) -+ return ret; -+ } - - /* The RX and TX delay default is: - * after HW reset: RX delay enabled and TX delay disabled diff --git a/target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch b/target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch deleted file mode 100644 index aa70f82823..0000000000 --- a/target/linux/generic/pending-5.4/736-net-phy-at803x-add-at8031-features.patch +++ /dev/null @@ -1,36 +0,0 @@ -Add back explicit PHY feature flags for the AR8031 and -AR8033 PHY instead of reading them from the PHY. - -The Botloader for Ubiquiti UniFi AC boards (and possibly more) -leave fiber page selected, thus we will end up reading the PHY -capabilities of the SGMII side (which does not offer 10 Mbit/s). - -We already have a hack in place, which switches back to the copper -page, however this happens after capabilities are read. - -The original conversation about 735-net-phy-at803x-fix-at8033-sgmii-mode -back in 2015 explicitly mention the UniFi AC Lite. The issue however is -not missing autonegotiation on the Fiber side, but the fact the PHY -is never switched to the copper side. So half of this patch is superfluous. - -A fix is currently being upstreamed. Once this is mainlined and available to us, -these patches can be dropped: - -735-net-phy-at803x-fix-at8033-sgmii-mode.patch -736-net-phy-at803x-add-at8031-features.patch - -This was tested on a UniFi AC Lite. - -See https://patchwork.kernel.org/project/netdevbpf/list/?series=467341 - ---- a/drivers/net/phy/at803x.c -+++ b/drivers/net/phy/at803x.c -@@ -490,7 +490,7 @@ static struct phy_driver at803x_driver[] - .get_wol = at803x_get_wol, - .suspend = at803x_suspend, - .resume = at803x_resume, -- /* PHY_GBIT_FEATURES */ -+ .features = PHY_GBIT_FEATURES, - .read_status = at803x_read_status, - .aneg_done = at803x_aneg_done, - .ack_interrupt = &at803x_ack_interrupt, |