summaryrefslogtreecommitdiff
path: root/target/linux/generic/files/drivers
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2016-08-18 11:05:12 +0200
committerRafał Miłecki <rafal@milecki.pl>2016-09-08 23:03:46 +0200
commit80722233476224eb695b186c0add6e9b5cf43d11 (patch)
tree4f0efa90f225d438c42c00c20c3b0d8af0955be9 /target/linux/generic/files/drivers
parentdd158ef3462c5bf8366729a97f96fa19fa543699 (diff)
downloadmtk-20170518-80722233476224eb695b186c0add6e9b5cf43d11.zip
mtk-20170518-80722233476224eb695b186c0add6e9b5cf43d11.tar.gz
mtk-20170518-80722233476224eb695b186c0add6e9b5cf43d11.tar.bz2
kernel: b53: force BCM531x5 port 5 link state if enabled
Some devices (e.g. Tenda AC9 based on BCM47189B0) have BCM53125 with port 5 connected to the second Ethernet interface on the SoC. In such case there is no PHY and we need to force link manually. This assumes port 5 can be marked as enabled for such devices. It's not implemented yet unfortunately. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'target/linux/generic/files/drivers')
-rw-r--r--target/linux/generic/files/drivers/net/phy/b53/b53_common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
index d96d8b8..b884010 100644
--- a/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
+++ b/target/linux/generic/files/drivers/net/phy/b53/b53_common.c
@@ -534,6 +534,19 @@ static int b53_switch_reset(struct b53_device *dev)
b53_write8(dev, B53_CTRL_PAGE, B53_PORT_OVERRIDE_CTRL,
mii_port_override | PORT_OVERRIDE_EN |
PORT_OVERRIDE_LINK);
+
+ /* BCM47189 has another interface connected to the port 5 */
+ if (dev->enabled_ports & BIT(5)) {
+ u8 po_reg = B53_GMII_PORT_OVERRIDE_CTRL(5);
+ u8 gmii_po;
+
+ b53_read8(dev, B53_CTRL_PAGE, po_reg, &gmii_po);
+ gmii_po |= GMII_PO_LINK |
+ GMII_PO_RX_FLOW |
+ GMII_PO_TX_FLOW |
+ GMII_PO_EN;
+ b53_write8(dev, B53_CTRL_PAGE, po_reg, gmii_po);
+ }
} else if (is5301x(dev)) {
if (cpu_port == 8) {
u8 mii_port_override;