From 80007df604f993046f6f74bcbf736ae85146af82 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 21 Feb 2023 15:47:40 +0800 Subject: [PATCH] rockchip: refresh Motorcomm patches Fixed a typo error when updating dts files. While at it, backported a trivial fix, also made the LED blinking again. Signed-off-by: Tianling Shen --- ...support-for-Motorcomm-yt8521-gigabit.patch | 2 +- ...or-Motorcomm-yt8531-gigabit-ethernet.patch | 2 +- ...motorcomm-uninitialized-variables-in.patch | 34 +++++++++++++++++++ ...omm-add-LED-configuration-for-yt8521.patch | 16 +++++++++ 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 target/linux/rockchip/patches-5.15/011-11-v6.3-net-phy-motorcomm-uninitialized-variables-in.patch create mode 100644 target/linux/rockchip/patches-5.15/109-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch diff --git a/target/linux/rockchip/patches-5.15/011-08-v6.3-net-phy-Add-dts-support-for-Motorcomm-yt8521-gigabit.patch b/target/linux/rockchip/patches-5.15/011-08-v6.3-net-phy-Add-dts-support-for-Motorcomm-yt8521-gigabit.patch index 85166126ec..6d89fae84c 100644 --- a/target/linux/rockchip/patches-5.15/011-08-v6.3-net-phy-Add-dts-support-for-Motorcomm-yt8521-gigabit.patch +++ b/target/linux/rockchip/patches-5.15/011-08-v6.3-net-phy-Add-dts-support-for-Motorcomm-yt8521-gigabit.patch @@ -221,7 +221,7 @@ Signed-off-by: David S. Miller } - return 0; -+ if (of_property_read_u32(node, "motorcomm,clk-out-frequency-hz-hz", &freq)) ++ if (of_property_read_u32(node, "motorcomm,clk-out-frequency-hz", &freq)) + freq = YTPHY_DTS_OUTPUT_CLK_DIS; + + if (phydev->drv->phy_id == PHY_ID_YT8521) { diff --git a/target/linux/rockchip/patches-5.15/011-10-v6.3-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch b/target/linux/rockchip/patches-5.15/011-10-v6.3-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch index 24605b85d6..4efcf784c4 100644 --- a/target/linux/rockchip/patches-5.15/011-10-v6.3-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch +++ b/target/linux/rockchip/patches-5.15/011-10-v6.3-net-phy-Add-driver-for-Motorcomm-yt8531-gigabit-ethernet.patch @@ -136,7 +136,7 @@ Signed-off-by: David S. Miller + u16 mask, val; + u32 freq; + -+ if (of_property_read_u32(node, "motorcomm,clk-out-frequency-hz-hz", &freq)) ++ if (of_property_read_u32(node, "motorcomm,clk-out-frequency-hz", &freq)) + freq = YTPHY_DTS_OUTPUT_CLK_DIS; + + switch (freq) { diff --git a/target/linux/rockchip/patches-5.15/011-11-v6.3-net-phy-motorcomm-uninitialized-variables-in.patch b/target/linux/rockchip/patches-5.15/011-11-v6.3-net-phy-motorcomm-uninitialized-variables-in.patch new file mode 100644 index 0000000000..29ae86dbbc --- /dev/null +++ b/target/linux/rockchip/patches-5.15/011-11-v6.3-net-phy-motorcomm-uninitialized-variables-in.patch @@ -0,0 +1,34 @@ +From 9753613f7399601f9bae6ee81e9d4274246c98ab Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 15 Feb 2023 07:21:47 +0300 +Subject: [PATCH] net: phy: motorcomm: uninitialized variables in + yt8531_link_change_notify() + +These booleans are never set to false, but are just used without being +initialized. + +Fixes: 4ac94f728a58 ("net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phy") +Signed-off-by: Dan Carpenter +Reviewed-by: Frank Sae +Link: https://lore.kernel.org/r/Y+xd2yJet2ImHLoQ@kili +Signed-off-by: Jakub Kicinski +--- + drivers/net/phy/motorcomm.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/net/phy/motorcomm.c ++++ b/drivers/net/phy/motorcomm.c +@@ -1533,10 +1533,10 @@ static int yt8531_config_init(struct phy + static void yt8531_link_change_notify(struct phy_device *phydev) + { + struct device_node *node = phydev->mdio.dev.of_node; ++ bool tx_clk_1000_inverted = false; ++ bool tx_clk_100_inverted = false; ++ bool tx_clk_10_inverted = false; + bool tx_clk_adj_enabled = false; +- bool tx_clk_1000_inverted; +- bool tx_clk_100_inverted; +- bool tx_clk_10_inverted; + u16 val = 0; + int ret; + diff --git a/target/linux/rockchip/patches-5.15/109-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch b/target/linux/rockchip/patches-5.15/109-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch new file mode 100644 index 0000000000..2e16482c0d --- /dev/null +++ b/target/linux/rockchip/patches-5.15/109-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch @@ -0,0 +1,16 @@ +--- a/drivers/net/phy/motorcomm.c ++++ b/drivers/net/phy/motorcomm.c +@@ -1487,6 +1487,13 @@ static int yt8521_config_init(struct phy + if (ret < 0) + goto err_restore_page; + } ++ ++ /* LED0: Unused/Off, LED1: Link, LED2: Activity, 8Hz */ ++ ytphy_write_ext(phydev, 0xa00b, 0xe004); ++ ytphy_write_ext(phydev, 0xa00c, 0); ++ ytphy_write_ext(phydev, 0xa00d, 0x2600); ++ ytphy_write_ext(phydev, 0xa00e, 0x0070); ++ ytphy_write_ext(phydev, 0xa00f, 0x000a); + err_restore_page: + return phy_restore_page(phydev, old_page, ret); + }