generic: ar8216: set delay values for SGMII mode on AR8327
authorGabor Juhos <juhosg@openwrt.org>
Fri, 23 Nov 2012 20:55:26 +0000 (20:55 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Fri, 23 Nov 2012 20:55:26 +0000 (20:55 +0000)
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 34315

target/linux/generic/files/drivers/net/phy/ar8216.c

index 8f3aded48fe361372533ba993f5f49055de18d3a..9cbe3a838cedfcad7275303ae62f2c0090f2f9a2 100644 (file)
@@ -903,6 +903,20 @@ ar8327_get_pad_cfg(struct ar8327_pad_cfg *cfg)
 
        case AR8327_PAD_MAC_SGMII:
                t = AR8327_PAD_SGMII_EN;
+
+               /*
+                * WAR for the QUalcomm Atheros AP136 board.
+                * It seems that RGMII TX/RX delay settings needs to be
+                * applied for SGMII mode as well, The ethernet is not
+                * reliable without this.
+                */
+               t |= cfg->txclk_delay_sel << AR8327_PAD_RGMII_TXCLK_DELAY_SEL_S;
+               t |= cfg->rxclk_delay_sel << AR8327_PAD_RGMII_RXCLK_DELAY_SEL_S;
+               if (cfg->rxclk_delay_en)
+                       t |= AR8327_PAD_RGMII_RXCLK_DELAY_EN;
+               if (cfg->txclk_delay_en)
+                       t |= AR8327_PAD_RGMII_TXCLK_DELAY_EN;
+
                break;
 
        case AR8327_PAD_MAC2PHY_MII: