Message ID | 553FE953.6090707@gmail.com |
---|---|
State | Not Applicable |
Headers | show |
Am 28.04.2015 um 22:10 schrieb Heiner Kallweit: > It was easier than I thought, here comes the related patch. > > Known limitations: > 1. The patch supports configuration of this bit for platform-data-configured > platforms only. DT-based platforms would need a similar extension. > 2. For now it's for WPJ344 only. Every other AR8334-based device would need the same > extension to the platform data. > > Rgds, Heiner Hi Heiner, this explicit way to talk to the driver is working! Thank you for your effort! Tested-By: Christian Mehlis <christian@m3hlis.de> ########################################################## Perhaps you know the answer to my last problem with this hardware too: On plug/unplug I get those events: [ 25.120000] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:00: Port 2 is up [ 37.130000] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:00: Port 2 is down but the linux network stack is keeping the interface UP. config interface 'wan' option ifname 'eth0.2' option proto 'dhcp' config switch option name 'switch0' option reset '1' option enable_vlan '1' config switch_vlan option device 'switch0' option vlan '1' option ports '0t 3' config switch_vlan option device 'switch0' option vlan '2' option ports '0t 2' I have never had this behaviour on other platforms...do you think the compex-344 specific initialization is done wrong? ######################################################### Best Christian
On Wed, Apr 29, 2015 at 11:26 AM, Christian Mehlis <christian@m3hlis.de> wrote: > On plug/unplug I get those events: > > [ 25.120000] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:00: Port 2 is up > [ 37.130000] Atheros AR8216/AR8236/AR8316 ag71xx-mdio.0:00: Port 2 is down > > but the linux network stack is keeping the interface UP. IMHO that's no contradiction. If the port is disconnected the interface should no longer be LOWER_UP. UP just means it's enabled, not necessarily connected. Rgds, Heiner
Am 28.04.2015 um 22:10 schrieb Heiner Kallweit:
> It was easier than I thought, here comes the related patch.
do you plan to send this as a patch to make the change available for
everyone, or should I?
Best
Christian
I still have to adjust it to make handling of the new platform parameter more consistent with general handling of platform data. Most likely I can submit the final patch by today. Rgds, Heiner On Wed, Apr 29, 2015 at 4:16 PM, Christian Mehlis <christian@m3hlis.de> wrote: > Am 28.04.2015 um 22:10 schrieb Heiner Kallweit: >> >> It was easier than I thought, here comes the related patch. > > > do you plan to send this as a patch to make the change available for > everyone, or should I? > > Best > Christian
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj344.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj344.c index fd718bd..590778e 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj344.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-wpj344.c @@ -98,6 +98,7 @@ static struct ar8327_pad_cfg wpj344_ar8327_pad0_cfg = { .rxclk_delay_en = true, .txclk_delay_sel = AR8327_CLK_DELAY_SEL1, .rxclk_delay_sel = AR8327_CLK_DELAY_SEL2, + .mac06_exchange_en = -1, }; static struct ar8327_led_cfg wpj344_ar8327_led_cfg = { diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c index 07e837e..772d03f 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 == 1) + t |= AR8337_PAD_MAC06_EXCHANGE_EN; + return t; } @@ -508,7 +511,7 @@ 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)) + if (chip_is_ar8337(priv) && pdata->pad0_cfg->mac06_exchange_en == 0) t |= AR8337_PAD_MAC06_EXCHANGE_EN; ar8xxx_write(priv, AR8327_REG_PAD0_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..821ff27 100644 --- a/target/linux/generic/files/include/linux/ar8216_platform.h +++ b/target/linux/generic/files/include/linux/ar8216_platform.h @@ -47,6 +47,8 @@ struct ar8327_pad_cfg { bool sgmii_delay_en; enum ar8327_clk_delay_sel txclk_delay_sel; enum ar8327_clk_delay_sel rxclk_delay_sel; + /* 0 = use driver default -1 = disable 1 = enable */ + int mac06_exchange_en; }; enum ar8327_port_speed { @@ -128,4 +130,4 @@ struct ar8327_platform_data { const struct ar8327_led_info *leds; }; -#endif /* AR8216_PLATFORM_H */ \ No newline at end of file +#endif /* AR8216_PLATFORM_H */