diff options
author | Felix Fietkau <nbd@openwrt.org> | 2015-12-20 14:25:45 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2015-12-20 14:25:45 +0000 |
commit | f12a8e1a9f0ef7ffdc1f2301c4a0fd7f0f2924ed (patch) | |
tree | 23b1b15751c761073d5c428627e062f08b602332 /target/linux/generic/files | |
parent | d2bb86beb5ce9ab69e834abe11a5383e5c3d11cf (diff) | |
download | master-187ad058-f12a8e1a9f0ef7ffdc1f2301c4a0fd7f0f2924ed.tar.gz master-187ad058-f12a8e1a9f0ef7ffdc1f2301c4a0fd7f0f2924ed.tar.bz2 master-187ad058-f12a8e1a9f0ef7ffdc1f2301c4a0fd7f0f2924ed.zip |
ar8216: rework/fix AR8337 MAC swap handling
In r45970 the MAC swap handling was made opt-in, however some boards
have been forgotten during the conversion. Since the reference design
uses this MAC swapping, and pretty much all known boards using this chip
seem to do so too, enabling the swapping is a more reasonable default
than leaving it disabled.
Change the code to still allow boards to opt-out of this.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@47956 3c298f89-4303-0410-b956-a3cf2f4a3e73
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 | 2 |
2 files changed, 4 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 1802b9ead7..90ee4115c0 100644 --- a/target/linux/generic/files/drivers/net/phy/ar8327.c +++ b/target/linux/generic/files/drivers/net/phy/ar8327.c @@ -124,9 +124,6 @@ ar8327_get_pad_cfg(struct ar8327_pad_cfg *cfg) break; } - if (cfg->mac06_exchange_en) - t |= AR8337_PAD_MAC06_EXCHANGE_EN; - return t; } @@ -511,7 +508,10 @@ 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) && !pdata->pad0_cfg->mac06_exchange_dis) + 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); t = ar8327_get_pad_cfg(pdata->pad6_cfg); diff --git a/target/linux/generic/files/include/linux/ar8216_platform.h b/target/linux/generic/files/include/linux/ar8216_platform.h index d70f11a843..24bc442a26 100644 --- a/target/linux/generic/files/include/linux/ar8216_platform.h +++ b/target/linux/generic/files/include/linux/ar8216_platform.h @@ -47,7 +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; + bool mac06_exchange_dis; }; enum ar8327_port_speed { |