diff --git a/target/linux/generic/config-5.15 b/target/linux/generic/config-5.15 index 2f201a578b4e34..fc2ab2e24536e5 100644 --- a/target/linux/generic/config-5.15 +++ b/target/linux/generic/config-5.15 @@ -18,6 +18,7 @@ CONFIG_64BIT_TIME=y # CONFIG_ACORN_PARTITION is not set # CONFIG_ACPI_ALS is not set # CONFIG_ACPI_APEI is not set +# CONFIG_ACPI_APEI_PCIEAER is not set # CONFIG_ACPI_BUTTON is not set # CONFIG_ACPI_CONFIGFS is not set # CONFIG_ACPI_CUSTOM_METHOD is not set @@ -5066,6 +5067,7 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_MAX6900 is not set # CONFIG_RTC_DRV_MAX6902 is not set # CONFIG_RTC_DRV_MAX6916 is not set +# CONFIG_RTC_DRV_MAX77686 is not set # CONFIG_RTC_DRV_MCP795 is not set # CONFIG_RTC_DRV_MOXART is not set # CONFIG_RTC_DRV_MPC5121 is not set @@ -5103,6 +5105,7 @@ CONFIG_RTC_DRV_CMOS=y # CONFIG_RTC_DRV_SNVS is not set # CONFIG_RTC_DRV_STK17TA8 is not set # CONFIG_RTC_DRV_SUN6I is not set +# CONFIG_RTC_DRV_TEGRA is not set # CONFIG_RTC_DRV_TEST is not set # CONFIG_RTC_DRV_V3020 is not set # CONFIG_RTC_DRV_X1205 is not set @@ -5896,7 +5899,9 @@ CONFIG_SND_PROC_FS=y # CONFIG_SND_SOC_FSL_AUD2HTX is not set # CONFIG_SND_SOC_FSL_AUDMIX is not set # CONFIG_SND_SOC_FSL_ESAI is not set +# CONFIG_SND_SOC_IMX_RPMSG is not set # CONFIG_SND_SOC_FSL_MICFIL is not set +# CONFIG_SND_SOC_FSL_RPMSG is not set # CONFIG_SND_SOC_FSL_SAI is not set # CONFIG_SND_SOC_FSL_SPDIF is not set # CONFIG_SND_SOC_FSL_SSI is not set @@ -7385,6 +7390,7 @@ CONFIG_WLAN=y CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y # CONFIG_WQ_WATCHDOG is not set # CONFIG_WWAN is not set +# CONFIG_WWAN_HWSIM is not set # CONFIG_WW_MUTEX_SELFTEST is not set # CONFIG_X25 is not set # CONFIG_X509_CERTIFICATE_PARSER is not set diff --git a/target/linux/ramips/files/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c b/target/linux/ramips/files/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c index 7a0595251c0bc1..0df81699d07efb 100644 --- a/target/linux/ramips/files/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c +++ b/target/linux/ramips/files/drivers/net/phy/mtk/mt753x/mt753x_swconfig.c @@ -273,17 +273,63 @@ static int mt753x_get_port_link(struct switch_dev *dev, int port, return 0; } -static int mt753x_set_port_link(struct switch_dev *dev, int port, +static int mt753x_set_port_link(struct switch_dev *sw_dev, int port, struct switch_port_link *link) { -#ifndef MODULE - if (port >= MT753X_NUM_PHYS) + if (port < 0 || port >= MT753X_NUM_PHYS) return -EINVAL; - return switch_generic_set_link(dev, port, link); -#else - return -ENOTSUPP; -#endif + /* Setup autoneg advertise here */ + if (link->aneg) { + u16 bmsr, adv, gctrl; + bool ercap; + + sw_dev->ops->phy_read16(sw_dev, port, MII_BMSR, &bmsr); + /* ERCAP means we have MII_CTRL1000 register */ + ercap = !!(bmsr | BMSR_ERCAP); + + adv = ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; + gctrl = CTL1000_ENABLE_MASTER; + + switch (link->speed) { + case SWITCH_PORT_SPEED_10: + if (link->duplex) + adv |= ADVERTISE_10FULL; + else + adv |= ADVERTISE_10HALF; + break; + case SWITCH_PORT_SPEED_100: + if (link->duplex) + adv |= ADVERTISE_100FULL; + else + adv |= ADVERTISE_100HALF; + break; + case SWITCH_PORT_SPEED_1000: + if (!ercap || !link->duplex) + return -ENOTSUPP; + /* PHY only supports 1000FULL */ + gctrl |= ADVERTISE_1000FULL; + break; + default: + /* For unknown input speed just enable all speed grades */ + if (link->duplex) { + adv |= ADVERTISE_FULL; + gctrl |= ADVERTISE_1000FULL; + } else { + adv |= ADVERTISE_10HALF | ADVERTISE_100HALF; + gctrl = 0x0; + } + break; + } + + sw_dev->ops->phy_write16(sw_dev, port, MII_ADVERTISE, adv); + if (ercap) + sw_dev->ops->phy_write16(sw_dev, port, MII_CTRL1000, gctrl); + /* Autoneg restart will be triggered in switch_generic_set_link */ + } + + /* Let switch_generic_set_link handle not autoneg case */ + return switch_generic_set_link(sw_dev, port, link); } static u64 get_mib_counter(struct gsw_mt753x *gsw, int i, int port)