diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-06-14 17:43:50 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-06-14 17:43:50 +0000 |
commit | 4a9d72620058e95350258b4e0b006c8d3943d2ca (patch) | |
tree | 24fe5f4dad3058078322d1f545761a784683000e /target/linux/generic/files | |
parent | b98fb7664639a814f3dba309eaf38b62be137bb8 (diff) | |
download | mtk-20170518-4a9d72620058e95350258b4e0b006c8d3943d2ca.zip mtk-20170518-4a9d72620058e95350258b4e0b006c8d3943d2ca.tar.gz mtk-20170518-4a9d72620058e95350258b4e0b006c8d3943d2ca.tar.bz2 |
ar8216: Fix problem with AR8337 MAC swap handling
AR8337 supports a configuration bit to swap MAC0 and MAC6.
Currently this is set in general if an AR8337 is detected and causes
issues with devices using an AR8334 (internally an AR8337, just
less chip pins).
And it might even cause issues with AR8337-based devices with
different board designs.
Swapping the MAC's however isn't needed for AR8337 in general.
It's just needed in case of certain board designs (affected devices
seem to be based on Atheros reference board AP135/136-010).
Therefore this configuration bit should be moved to platform data.
The patch includes the needed changes to the device initialization
code of affected devices. Hopefully I didn't miss any ..
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
SVN-Revision: 45970
Diffstat (limited to 'target/linux/generic/files')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/ar8327.c | 6 | ||||
-rw-r--r-- | target/linux/generic/files/include/linux/ar8216_platform.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index 07e837e..a6dd7d8 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -124,6 +124,9 @@ ar8327_get_pad_cfg(struct ar8327_pad_cfg *cfg) break; } + if (cfg->mac06_exchange_en) + t |= AR8337_PAD_MAC06_EXCHANGE_EN; + return t; } @@ -508,9 +511,6 @@ ar8327_hw_config_pdata(struct ar8xxx_priv *priv, data->port6_status = ar8327_get_port_init_status(&pdata->port6_cfg); t = ar8327_get_pad_cfg(pdata->pad0_cfg); - if (chip_is_ar8337(priv)) - t |= AR8337_PAD_MAC06_EXCHANGE_EN; - ar8xxx_write(priv, AR8327_REG_PAD0_MODE, t); t = ar8327_get_pad_cfg(pdata->pad5_cfg); ar8xxx_write(priv, AR8327_REG_PAD5_MODE, t); diff --git a/target/linux/generic/files/include/linux/ar8216_platform.h b/target/linux/generic/files/include/linux/ar8216_platform.h index 4935ad3..d70f11a 100644 --- a/target/linux/generic/files/include/linux/ar8216_platform.h +++ b/target/linux/generic/files/include/linux/ar8216_platform.h @@ -47,6 +47,7 @@ struct ar8327_pad_cfg { bool sgmii_delay_en; enum ar8327_clk_delay_sel txclk_delay_sel; enum ar8327_clk_delay_sel rxclk_delay_sel; + bool mac06_exchange_en; }; enum ar8327_port_speed { @@ -128,4 +129,5 @@ struct ar8327_platform_data { const struct ar8327_led_info *leds; }; -#endif /* AR8216_PLATFORM_H */
\ No newline at end of file +#endif /* AR8216_PLATFORM_H */ + |