From 7ddd3abd278e6105fb00794fe0d3b2c25f969c49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Wed, 3 Jan 2024 07:54:46 +0000 Subject: [PATCH 01/10] ipq807x: cax1800: fix blsp1_spi1 status with okay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `ok` status is obsolete and thus `okay` should be used instead: spi@78b9000: status:0: 'ok' is not one of ['okay', 'disabled', 'reserved'] Signed-off-by: Petr Štetiar --- .../files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts index 622b8662fa..0ca2edcb2c 100644 --- a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts +++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8070-cax1800.dts @@ -123,7 +123,7 @@ pinctrl-0 = <&spi_0_pins>; pinctrl-names = "default"; cs-select = <0>; - status = "ok"; + status = "okay"; m25p80@0 { #address-cells = <1>; From 0f1b3d5c02cc249437192d48be69f6628d7de4f4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 4 Jan 2024 12:30:19 +0100 Subject: [PATCH 02/10] netifd: update to Git HEAD (2024-01-04) 4219e99eeec7 system-linux: fix race condition in netlink socket error handing f01345ec13b9 device: restore cleared flags on device down Signed-off-by: Felix Fietkau --- package/network/config/netifd/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile index 790bcfec63..558463e8ea 100644 --- a/package/network/config/netifd/Makefile +++ b/package/network/config/netifd/Makefile @@ -5,9 +5,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/netifd.git -PKG_SOURCE_DATE:=2023-12-19 -PKG_SOURCE_VERSION:=a2d32f0dcf16880226680d07b07b249f77a3af58 -PKG_MIRROR_HASH:=765f51335ffa0a143421efbe129d484a90d7c4a0f3e08cb7840cc85408f3e60c +PKG_SOURCE_DATE:=2024-01-04 +PKG_SOURCE_VERSION:=f01345ec13b9b27ffd314d8689fb2d3f9c81a47d +PKG_MIRROR_HASH:=58e92e9ce1a2c8ccb487e95dadf806f38b38abbe7cb3cde61ff880de5eb85c2f PKG_MAINTAINER:=Felix Fietkau PKG_LICENSE:=GPL-2.0 From 08ad3c963377ee853f87935929d33f19e5e34ef9 Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 4 Jan 2024 00:30:57 +0100 Subject: [PATCH 03/10] libxml2: update to 2.12.3 Release Notes: - https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.2 - https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.12.3 Signed-off-by: Nick Hainke --- package/libs/libxml2/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/libxml2/Makefile b/package/libs/libxml2/Makefile index d65085c9c1..9e70a0bd0a 100644 --- a/package/libs/libxml2/Makefile +++ b/package/libs/libxml2/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libxml2 -PKG_VERSION:=2.12.1 +PKG_VERSION:=2.12.3 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNOME/libxml2/$(basename $(PKG_VERSION)) -PKG_HASH:=8982b9ccdf7f456e30d8f7012d50858c6623e495333b6191def455c7e95427eb +PKG_HASH:=8c8f1092340a89ff32bc44ad5c9693aff9bc8a7a3e161bb239666e5d15ac9aaa PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING From adf91335472f786c9d49911865a2a2bdfd523e7b Mon Sep 17 00:00:00 2001 From: Nick Hainke Date: Thu, 4 Jan 2024 00:44:45 +0100 Subject: [PATCH 04/10] libnl: update to 3.9.0 Changes: bdf83151 libnl-3.9.0 release aa7353fd include/linux-private: import 'seg6 local' headers from kernel tree 9466f680 lib: remove unused assignment in nl_addr_parse() acd05d6e route/tc: avoid integer overflow in rtnl_tc_calc_cell_log() daa8efcb xfrm: return -NLE_MISSING_ATTR from xfrmnl_sa_get_auth_params() d8a1ff30 xfrm: fix leaking usertemplate in xfrmnl_sp_parse() 4fcb0757 socket: workaround coverity warning about time_t handling f743c62f github: update Fedora image and version for clang-format f33e8cd6 clang-format: rework container script aea3f9f2 lib: fix signed overflow warning in nl_object_diff() 57e01706 socket: explicitly cast time() to uint32_t 46e8739e src: fix leak in "nl-cls-add" a06c8f76 route/cls: add get/take wrappers for rtnl_act_append() 7912b4f9 route/cls: fix leak in error handling of rtnl_flower_append_action() efd65feb route: fix just introduced use-after-free in rtnl_act_parse() 105a6be1 route: use cleanup macro in rtnl_act_parse() 78246da7 nl-aux-route: add cleanup macro for rtnl_act_put_all() 72762b20 base: add _NL_AUTO_DEFINE_FCN_INDIRECT0() macro a70f789a route: fix memleak in rtnl_act_parse() 65ab16f2 base: don't use static array indices for buffer argument of _nl_inet_ntop() 444e2c04 route/can: implement can_device_stats a4718e67 github: build with "-fexceptions" CFLAGS 2f485cc7 xfrm: refactor error handling in XFRM parsing 01bd8fb0 include: add "nl-aux-xfrm" helpers 49c20efa xfrm: fix crashes in case of ENOMEM 9e7b5c86 xfrm: refactor nl_addr_build() calls in XFRM code dbfd87b1 xfrm: use cleanup attribute for nl_addr in XFRM parsing db424835 xfrm: fix error code for NLE_ENOMEM in xfrmnl_ae_parse() 9c97deff xfrm: fix parsing address in xfrmnl_ae_parse() 8b6dc834 nl-aux-core: add _nl_addr_build() helper 057aac13 nl-base-utils: add _nl_addr_family_to_size() helper 664f8f1b xfrm: clear XFRM_SP_ATTR_TMPL when removing the last template from a policy c4c22d26 xfrm/sp: fix reference counters of sa selector/tmpl addresses 5979fcb0 route/link: add bonding interface options set rtnl apis a735989c build: fix declaring special targets as ".PHONY" 052a97cb Makefile.am: avoid use of non-portable echo arguments 9aab12df python: Use correct decorator syntax in HTBQdisc Signed-off-by: Nick Hainke --- package/libs/libnl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/libs/libnl/Makefile b/package/libs/libnl/Makefile index 56f2c2825d..93817e5f40 100644 --- a/package/libs/libnl/Makefile +++ b/package/libs/libnl/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libnl -PKG_VERSION:=3.8.0 +PKG_VERSION:=3.9.0 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/thom311/libnl/releases/download/libnl$(subst .,_,$(PKG_VERSION)) -PKG_HASH:=bb726c6d7a08b121978d73ff98425bf313fa26a27a331d465e4f1d7ec5b838c6 +PKG_HASH:=aed507004d728a5cf11eab48ca4bf9e6e1874444e33939b9d3dfed25018ee9bb PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:=COPYING From 438a97fab69b41387e25cbec45271e7fe159a330 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 3 Jan 2024 15:13:32 +0100 Subject: [PATCH 05/10] mac80211: fix a race condition related to enabling fast-xmit fast-xmit must only be enabled after the sta has been uploaded to the driver, otherwise it could end up passing the not-yet-uploaded sta via drv_tx calls to the driver, leading to potential crashes because of uninitialized drv_priv data. Add a missing sta->uploaded check and re-check fast xmit after inserting a sta. Signed-off-by: Felix Fietkau --- ...x-race-condition-on-enabling-fast-xm.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/314-wifi-mac80211-fix-race-condition-on-enabling-fast-xm.patch diff --git a/package/kernel/mac80211/patches/subsys/314-wifi-mac80211-fix-race-condition-on-enabling-fast-xm.patch b/package/kernel/mac80211/patches/subsys/314-wifi-mac80211-fix-race-condition-on-enabling-fast-xm.patch new file mode 100644 index 0000000000..191eb67e8e --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/314-wifi-mac80211-fix-race-condition-on-enabling-fast-xm.patch @@ -0,0 +1,34 @@ +From: Felix Fietkau +Date: Wed, 3 Jan 2024 15:10:18 +0100 +Subject: [PATCH] wifi: mac80211: fix race condition on enabling fast-xmit + +fast-xmit must only be enabled after the sta has been uploaded to the driver, +otherwise it could end up passing the not-yet-uploaded sta via drv_tx calls +to the driver, leading to potential crashes because of uninitialized drv_priv +data. +Add a missing sta->uploaded check and re-check fast xmit after inserting a sta. + +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/sta_info.c ++++ b/net/mac80211/sta_info.c +@@ -911,6 +911,7 @@ static int sta_info_insert_finish(struct + + if (ieee80211_vif_is_mesh(&sdata->vif)) + mesh_accept_plinks_update(sdata); ++ ieee80211_check_fast_xmit(sta); + + return 0; + out_remove: +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3033,7 +3033,7 @@ void ieee80211_check_fast_xmit(struct st + sdata->vif.type == NL80211_IFTYPE_STATION) + goto out; + +- if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED)) ++ if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED) || !sta->uploaded) + goto out; + + if (test_sta_flag(sta, WLAN_STA_PS_STA) || From 3645ac8a10d9abb1451343beaf7d65b53eeecffd Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Mon, 25 Dec 2023 11:23:58 +0800 Subject: [PATCH 06/10] rockchip: configure eth pad driver strength for orangepi r1 plus lts The default strength is not enough to provide stable connection under 3.3v LDO voltage. Fixes: 32d5921b8b55 ("rockchip: add Orange Pi R1 Plus LTS support") Fixes: #13117 Fixes: #13759 Signed-off-by: Tianling Shen --- ...m-Add-pad-drive-strength-cfg-support.patch | 170 ++++++++++++++++++ ...m-Add-pad-drive-strength-cfg-support.patch | 170 ++++++++++++++++++ ...nfigure-eth-pad-driver-strength-for-.patch | 33 ++++ 3 files changed, 373 insertions(+) create mode 100644 target/linux/generic/backport-5.15/791-v6.6-11-net-phy-motorcomm-Add-pad-drive-strength-cfg-support.patch create mode 100644 target/linux/generic/backport-6.1/791-v6.6-11-net-phy-motorcomm-Add-pad-drive-strength-cfg-support.patch create mode 100644 target/linux/rockchip/patches-6.1/015-v6.8-arm64-dts-rockchip-configure-eth-pad-driver-strength-for-.patch diff --git a/target/linux/generic/backport-5.15/791-v6.6-11-net-phy-motorcomm-Add-pad-drive-strength-cfg-support.patch b/target/linux/generic/backport-5.15/791-v6.6-11-net-phy-motorcomm-Add-pad-drive-strength-cfg-support.patch new file mode 100644 index 0000000000..010ca9b68a --- /dev/null +++ b/target/linux/generic/backport-5.15/791-v6.6-11-net-phy-motorcomm-Add-pad-drive-strength-cfg-support.patch @@ -0,0 +1,170 @@ +From 7a561e9351ae7e3fb1f08584d40b49c1e55dde60 Mon Sep 17 00:00:00 2001 +From: Samin Guo +Date: Thu, 20 Jul 2023 19:15:09 +0800 +Subject: [PATCH] net: phy: motorcomm: Add pad drive strength cfg support + +The motorcomm phy (YT8531) supports the ability to adjust the drive +strength of the rx_clk/rx_data, and the default strength may not be +suitable for all boards. So add configurable options to better match +the boards.(e.g. StarFive VisionFive 2) + +When we configure the drive strength, we need to read the current +LDO voltage value to ensure that it is a legal value at that LDO +voltage. + +Reviewed-by: Hal Feng +Signed-off-by: Samin Guo +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/phy/motorcomm.c | 118 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 118 insertions(+) + +--- a/drivers/net/phy/motorcomm.c ++++ b/drivers/net/phy/motorcomm.c +@@ -163,6 +163,10 @@ + + #define YT8521_CHIP_CONFIG_REG 0xA001 + #define YT8521_CCR_SW_RST BIT(15) ++#define YT8531_RGMII_LDO_VOL_MASK GENMASK(5, 4) ++#define YT8531_LDO_VOL_3V3 0x0 ++#define YT8531_LDO_VOL_1V8 0x2 ++ + /* 1b0 disable 1.9ns rxc clock delay *default* + * 1b1 enable 1.9ns rxc clock delay + */ +@@ -236,6 +240,12 @@ + */ + #define YTPHY_WCR_TYPE_PULSE BIT(0) + ++#define YTPHY_PAD_DRIVE_STRENGTH_REG 0xA010 ++#define YT8531_RGMII_RXC_DS_MASK GENMASK(15, 13) ++#define YT8531_RGMII_RXD_DS_HI_MASK BIT(12) /* Bit 2 of rxd_ds */ ++#define YT8531_RGMII_RXD_DS_LOW_MASK GENMASK(5, 4) /* Bit 1/0 of rxd_ds */ ++#define YT8531_RGMII_RX_DS_DEFAULT 0x3 ++ + #define YTPHY_SYNCE_CFG_REG 0xA012 + #define YT8521_SCR_SYNCE_ENABLE BIT(5) + /* 1b0 output 25m clock +@@ -835,6 +845,110 @@ static int ytphy_rgmii_clk_delay_config_ + } + + /** ++ * struct ytphy_ldo_vol_map - map a current value to a register value ++ * @vol: ldo voltage ++ * @ds: value in the register ++ * @cur: value in device configuration ++ */ ++struct ytphy_ldo_vol_map { ++ u32 vol; ++ u32 ds; ++ u32 cur; ++}; ++ ++static const struct ytphy_ldo_vol_map yt8531_ldo_vol[] = { ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 0, .cur = 1200}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 1, .cur = 2100}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 2, .cur = 2700}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 3, .cur = 2910}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 4, .cur = 3110}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 5, .cur = 3600}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 6, .cur = 3970}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 7, .cur = 4350}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 0, .cur = 3070}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 1, .cur = 4080}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 2, .cur = 4370}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 3, .cur = 4680}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 4, .cur = 5020}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 5, .cur = 5450}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 6, .cur = 5740}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 7, .cur = 6140}, ++}; ++ ++static u32 yt8531_get_ldo_vol(struct phy_device *phydev) ++{ ++ u32 val; ++ ++ val = ytphy_read_ext_with_lock(phydev, YT8521_CHIP_CONFIG_REG); ++ val = FIELD_GET(YT8531_RGMII_LDO_VOL_MASK, val); ++ ++ return val <= YT8531_LDO_VOL_1V8 ? val : YT8531_LDO_VOL_1V8; ++} ++ ++static int yt8531_get_ds_map(struct phy_device *phydev, u32 cur) ++{ ++ u32 vol; ++ int i; ++ ++ vol = yt8531_get_ldo_vol(phydev); ++ for (i = 0; i < ARRAY_SIZE(yt8531_ldo_vol); i++) { ++ if (yt8531_ldo_vol[i].vol == vol && yt8531_ldo_vol[i].cur == cur) ++ return yt8531_ldo_vol[i].ds; ++ } ++ ++ return -EINVAL; ++} ++ ++static int yt8531_set_ds(struct phy_device *phydev) ++{ ++ struct device_node *node = phydev->mdio.dev.of_node; ++ u32 ds_field_low, ds_field_hi, val; ++ int ret, ds; ++ ++ /* set rgmii rx clk driver strength */ ++ if (!of_property_read_u32(node, "motorcomm,rx-clk-drv-microamp", &val)) { ++ ds = yt8531_get_ds_map(phydev, val); ++ if (ds < 0) ++ return dev_err_probe(&phydev->mdio.dev, ds, ++ "No matching current value was found.\n"); ++ } else { ++ ds = YT8531_RGMII_RX_DS_DEFAULT; ++ } ++ ++ ret = ytphy_modify_ext_with_lock(phydev, ++ YTPHY_PAD_DRIVE_STRENGTH_REG, ++ YT8531_RGMII_RXC_DS_MASK, ++ FIELD_PREP(YT8531_RGMII_RXC_DS_MASK, ds)); ++ if (ret < 0) ++ return ret; ++ ++ /* set rgmii rx data driver strength */ ++ if (!of_property_read_u32(node, "motorcomm,rx-data-drv-microamp", &val)) { ++ ds = yt8531_get_ds_map(phydev, val); ++ if (ds < 0) ++ return dev_err_probe(&phydev->mdio.dev, ds, ++ "No matching current value was found.\n"); ++ } else { ++ ds = YT8531_RGMII_RX_DS_DEFAULT; ++ } ++ ++ ds_field_hi = FIELD_GET(BIT(2), ds); ++ ds_field_hi = FIELD_PREP(YT8531_RGMII_RXD_DS_HI_MASK, ds_field_hi); ++ ++ ds_field_low = FIELD_GET(GENMASK(1, 0), ds); ++ ds_field_low = FIELD_PREP(YT8531_RGMII_RXD_DS_LOW_MASK, ds_field_low); ++ ++ ret = ytphy_modify_ext_with_lock(phydev, ++ YTPHY_PAD_DRIVE_STRENGTH_REG, ++ YT8531_RGMII_RXD_DS_LOW_MASK | YT8531_RGMII_RXD_DS_HI_MASK, ++ ds_field_low | ds_field_hi); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++/** + * yt8521_probe() - read chip config then set suitable polling_mode + * @phydev: a pointer to a &struct phy_device + * +@@ -1518,6 +1632,10 @@ static int yt8531_config_init(struct phy + return ret; + } + ++ ret = yt8531_set_ds(phydev); ++ if (ret < 0) ++ return ret; ++ + return 0; + } + diff --git a/target/linux/generic/backport-6.1/791-v6.6-11-net-phy-motorcomm-Add-pad-drive-strength-cfg-support.patch b/target/linux/generic/backport-6.1/791-v6.6-11-net-phy-motorcomm-Add-pad-drive-strength-cfg-support.patch new file mode 100644 index 0000000000..010ca9b68a --- /dev/null +++ b/target/linux/generic/backport-6.1/791-v6.6-11-net-phy-motorcomm-Add-pad-drive-strength-cfg-support.patch @@ -0,0 +1,170 @@ +From 7a561e9351ae7e3fb1f08584d40b49c1e55dde60 Mon Sep 17 00:00:00 2001 +From: Samin Guo +Date: Thu, 20 Jul 2023 19:15:09 +0800 +Subject: [PATCH] net: phy: motorcomm: Add pad drive strength cfg support + +The motorcomm phy (YT8531) supports the ability to adjust the drive +strength of the rx_clk/rx_data, and the default strength may not be +suitable for all boards. So add configurable options to better match +the boards.(e.g. StarFive VisionFive 2) + +When we configure the drive strength, we need to read the current +LDO voltage value to ensure that it is a legal value at that LDO +voltage. + +Reviewed-by: Hal Feng +Signed-off-by: Samin Guo +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +--- + drivers/net/phy/motorcomm.c | 118 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 118 insertions(+) + +--- a/drivers/net/phy/motorcomm.c ++++ b/drivers/net/phy/motorcomm.c +@@ -163,6 +163,10 @@ + + #define YT8521_CHIP_CONFIG_REG 0xA001 + #define YT8521_CCR_SW_RST BIT(15) ++#define YT8531_RGMII_LDO_VOL_MASK GENMASK(5, 4) ++#define YT8531_LDO_VOL_3V3 0x0 ++#define YT8531_LDO_VOL_1V8 0x2 ++ + /* 1b0 disable 1.9ns rxc clock delay *default* + * 1b1 enable 1.9ns rxc clock delay + */ +@@ -236,6 +240,12 @@ + */ + #define YTPHY_WCR_TYPE_PULSE BIT(0) + ++#define YTPHY_PAD_DRIVE_STRENGTH_REG 0xA010 ++#define YT8531_RGMII_RXC_DS_MASK GENMASK(15, 13) ++#define YT8531_RGMII_RXD_DS_HI_MASK BIT(12) /* Bit 2 of rxd_ds */ ++#define YT8531_RGMII_RXD_DS_LOW_MASK GENMASK(5, 4) /* Bit 1/0 of rxd_ds */ ++#define YT8531_RGMII_RX_DS_DEFAULT 0x3 ++ + #define YTPHY_SYNCE_CFG_REG 0xA012 + #define YT8521_SCR_SYNCE_ENABLE BIT(5) + /* 1b0 output 25m clock +@@ -835,6 +845,110 @@ static int ytphy_rgmii_clk_delay_config_ + } + + /** ++ * struct ytphy_ldo_vol_map - map a current value to a register value ++ * @vol: ldo voltage ++ * @ds: value in the register ++ * @cur: value in device configuration ++ */ ++struct ytphy_ldo_vol_map { ++ u32 vol; ++ u32 ds; ++ u32 cur; ++}; ++ ++static const struct ytphy_ldo_vol_map yt8531_ldo_vol[] = { ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 0, .cur = 1200}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 1, .cur = 2100}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 2, .cur = 2700}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 3, .cur = 2910}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 4, .cur = 3110}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 5, .cur = 3600}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 6, .cur = 3970}, ++ {.vol = YT8531_LDO_VOL_1V8, .ds = 7, .cur = 4350}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 0, .cur = 3070}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 1, .cur = 4080}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 2, .cur = 4370}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 3, .cur = 4680}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 4, .cur = 5020}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 5, .cur = 5450}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 6, .cur = 5740}, ++ {.vol = YT8531_LDO_VOL_3V3, .ds = 7, .cur = 6140}, ++}; ++ ++static u32 yt8531_get_ldo_vol(struct phy_device *phydev) ++{ ++ u32 val; ++ ++ val = ytphy_read_ext_with_lock(phydev, YT8521_CHIP_CONFIG_REG); ++ val = FIELD_GET(YT8531_RGMII_LDO_VOL_MASK, val); ++ ++ return val <= YT8531_LDO_VOL_1V8 ? val : YT8531_LDO_VOL_1V8; ++} ++ ++static int yt8531_get_ds_map(struct phy_device *phydev, u32 cur) ++{ ++ u32 vol; ++ int i; ++ ++ vol = yt8531_get_ldo_vol(phydev); ++ for (i = 0; i < ARRAY_SIZE(yt8531_ldo_vol); i++) { ++ if (yt8531_ldo_vol[i].vol == vol && yt8531_ldo_vol[i].cur == cur) ++ return yt8531_ldo_vol[i].ds; ++ } ++ ++ return -EINVAL; ++} ++ ++static int yt8531_set_ds(struct phy_device *phydev) ++{ ++ struct device_node *node = phydev->mdio.dev.of_node; ++ u32 ds_field_low, ds_field_hi, val; ++ int ret, ds; ++ ++ /* set rgmii rx clk driver strength */ ++ if (!of_property_read_u32(node, "motorcomm,rx-clk-drv-microamp", &val)) { ++ ds = yt8531_get_ds_map(phydev, val); ++ if (ds < 0) ++ return dev_err_probe(&phydev->mdio.dev, ds, ++ "No matching current value was found.\n"); ++ } else { ++ ds = YT8531_RGMII_RX_DS_DEFAULT; ++ } ++ ++ ret = ytphy_modify_ext_with_lock(phydev, ++ YTPHY_PAD_DRIVE_STRENGTH_REG, ++ YT8531_RGMII_RXC_DS_MASK, ++ FIELD_PREP(YT8531_RGMII_RXC_DS_MASK, ds)); ++ if (ret < 0) ++ return ret; ++ ++ /* set rgmii rx data driver strength */ ++ if (!of_property_read_u32(node, "motorcomm,rx-data-drv-microamp", &val)) { ++ ds = yt8531_get_ds_map(phydev, val); ++ if (ds < 0) ++ return dev_err_probe(&phydev->mdio.dev, ds, ++ "No matching current value was found.\n"); ++ } else { ++ ds = YT8531_RGMII_RX_DS_DEFAULT; ++ } ++ ++ ds_field_hi = FIELD_GET(BIT(2), ds); ++ ds_field_hi = FIELD_PREP(YT8531_RGMII_RXD_DS_HI_MASK, ds_field_hi); ++ ++ ds_field_low = FIELD_GET(GENMASK(1, 0), ds); ++ ds_field_low = FIELD_PREP(YT8531_RGMII_RXD_DS_LOW_MASK, ds_field_low); ++ ++ ret = ytphy_modify_ext_with_lock(phydev, ++ YTPHY_PAD_DRIVE_STRENGTH_REG, ++ YT8531_RGMII_RXD_DS_LOW_MASK | YT8531_RGMII_RXD_DS_HI_MASK, ++ ds_field_low | ds_field_hi); ++ if (ret < 0) ++ return ret; ++ ++ return 0; ++} ++ ++/** + * yt8521_probe() - read chip config then set suitable polling_mode + * @phydev: a pointer to a &struct phy_device + * +@@ -1518,6 +1632,10 @@ static int yt8531_config_init(struct phy + return ret; + } + ++ ret = yt8531_set_ds(phydev); ++ if (ret < 0) ++ return ret; ++ + return 0; + } + diff --git a/target/linux/rockchip/patches-6.1/015-v6.8-arm64-dts-rockchip-configure-eth-pad-driver-strength-for-.patch b/target/linux/rockchip/patches-6.1/015-v6.8-arm64-dts-rockchip-configure-eth-pad-driver-strength-for-.patch new file mode 100644 index 0000000000..01efaa3a9d --- /dev/null +++ b/target/linux/rockchip/patches-6.1/015-v6.8-arm64-dts-rockchip-configure-eth-pad-driver-strength-for-.patch @@ -0,0 +1,33 @@ +From fc5a80a432607d05e85bba37971712405f75c546 Mon Sep 17 00:00:00 2001 +From: Tianling Shen +Date: Sat, 16 Dec 2023 12:07:23 +0800 +Subject: [PATCH] arm64: dts: rockchip: configure eth pad driver strength + for orangepi r1 plus lts + +The default strength is not enough to provide stable connection +under 3.3v LDO voltage. + +Fixes: 387b3bbac5ea ("arm64: dts: rockchip: Add Xunlong OrangePi R1 Plus LTS") +Cc: stable@vger.kernel.org # 6.6+ +Signed-off-by: Tianling Shen +Link: https://lore.kernel.org/r/20231216040723.17864-1-cnsztl@gmail.com +Signed-off-by: Heiko Stuebner +--- + arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts ++++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts +@@ -26,9 +26,11 @@ + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <0>; + ++ motorcomm,auto-sleep-disabled; + motorcomm,clk-out-frequency-hz = <125000000>; + motorcomm,keep-pll-enabled; +- motorcomm,auto-sleep-disabled; ++ motorcomm,rx-clk-drv-microamp = <5020>; ++ motorcomm,rx-data-drv-microamp = <5020>; + + pinctrl-0 = <ð_phy_reset_pin>; + pinctrl-names = "default"; From 5067863d67e4585f166133e1b9d6e482fde4c80f Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 27 Dec 2023 04:49:23 -0500 Subject: [PATCH 07/10] linux/modules: remove deprecated module Remove upstream deprecated module from our build, see[1] 1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?h=v5.15.145&id=6cd90c01b032f335d18966b2d979eef43eb2cfc1 Suggested-by: Shiji Yang Signed-off-by: John Audia --- package/kernel/linux/modules/fs.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/fs.mk b/package/kernel/linux/modules/fs.mk index f2acaa7439..58af180c28 100644 --- a/package/kernel/linux/modules/fs.mk +++ b/package/kernel/linux/modules/fs.mk @@ -359,8 +359,7 @@ define KernelPackage/fs-ksmbd DEPENDS:= \ +kmod-nls-base \ +kmod-nls-utf8 \ - +kmod-crypto-md4 \ - +kmod-crypto-md5 \ + +kmod-crypto-md5 \ +kmod-crypto-hmac \ +kmod-crypto-ecb \ +kmod-crypto-des \ From 500931c0ce016f73f2c4408ae33a2b07d266aaf9 Mon Sep 17 00:00:00 2001 From: John Audia Date: Wed, 27 Dec 2023 04:42:41 -0500 Subject: [PATCH 08/10] kernel/ksmbd: fix build for 5.15.145 Include a patch[1] under review to fix the modpost error due to upstream changes: ... ERROR: modpost: "cifs_arc4_crypt" [fs/ksmbd/ksmbd.ko] undefined! ERROR: modpost: "cifs_arc4_setkey" [fs/ksmbd/ksmbd.ko] undefined! scripts/Makefile.modpost:133: recipe for target 'modules-only.symvers' failed 1. https://lore.kernel.org/all/20231227102605.4766-2-linkinjeon@kernel.org/ Signed-off-by: John Audia --- ...ksmbd-have-a-dependency-on-cifs-arc4.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 target/linux/generic/hack-5.15/940-ksmbd-have-a-dependency-on-cifs-arc4.patch diff --git a/target/linux/generic/hack-5.15/940-ksmbd-have-a-dependency-on-cifs-arc4.patch b/target/linux/generic/hack-5.15/940-ksmbd-have-a-dependency-on-cifs-arc4.patch new file mode 100644 index 0000000000..4cf420a859 --- /dev/null +++ b/target/linux/generic/hack-5.15/940-ksmbd-have-a-dependency-on-cifs-arc4.patch @@ -0,0 +1,31 @@ +From: Namjae Jeon +To: sashal@kernel.org, gregkh@linuxfoundation.org, stable@vger.kernel.org +Cc: smfrench@gmail.com, Namjae Jeon +Subject: [PATCH v2 5.15.y 1/8] ksmbd: have a dependency on cifs ARC4 +Date: Wed, 27 Dec 2023 19:25:58 +0900 [thread overview] +Message-ID: <20231227102605.4766-2-linkinjeon@kernel.org> (raw) +In-Reply-To: <20231227102605.4766-1-linkinjeon@kernel.org> + +Omitted the change that has a dependency on cifs ARC4 from backporting +commit f9929ef6a2a5("ksmbd: add support for key exchange"). +This patch make ksmbd have a dependeny on cifs ARC4. + +Fixes: c5049d2d73b2 ("ksmbd: add support for key exchange") +Signed-off-by: Namjae Jeon +--- + fs/Kconfig | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/Kconfig ++++ b/fs/Kconfig +@@ -369,8 +369,8 @@ source "fs/ksmbd/Kconfig" + + config SMBFS_COMMON + tristate +- default y if CIFS=y +- default m if CIFS=m ++ default y if CIFS=y || SMB_SERVER=y ++ default m if CIFS=m || SMB_SERVER=m + + source "fs/coda/Kconfig" + source "fs/afs/Kconfig" From 309c2cd4fbd2876a144bb4423428363f36c67a3f Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 10 Dec 2023 00:04:49 +0200 Subject: [PATCH 09/10] mpfr: import from packages feed Import mpfr from the packages feed to the main OpenWrt repo, as gdb 14 requires mpfr. Signed-off-by: Hannu Nyman --- package/libs/mpfr/Makefile | 64 ++++++++++++++++++++ package/libs/mpfr/patches/001-only-src.patch | 22 +++++++ 2 files changed, 86 insertions(+) create mode 100644 package/libs/mpfr/Makefile create mode 100644 package/libs/mpfr/patches/001-only-src.patch diff --git a/package/libs/mpfr/Makefile b/package/libs/mpfr/Makefile new file mode 100644 index 0000000000..39d6a035ab --- /dev/null +++ b/package/libs/mpfr/Makefile @@ -0,0 +1,64 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mpfr +PKG_VERSION:=4.2.1 +PKG_RELEASE:=1 + +PKG_SOURCE_URL:=@GNU/mpfr http://www.mpfr.org/mpfr-$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_HASH:=277807353a6726978996945af13e52829e3abd7a9a5b7fb2793894e18f1fcbb2 + +PKG_LICENSE:=LGPL-3.0-or-later +PKG_LICENSE_FILES:=COPYING.LESSER +PKG_MAINTAINER:=Jeffery To +PKG_CPE_ID:=cpe:/a:mpfr:gnu_mpfr + +PKG_BUILD_PARALLEL:=1 +PKG_FIXUP:=autoreconf +PKG_INSTALL:=1 + +include $(INCLUDE_DIR)/package.mk + +define Package/libmpfr + SECTION:=libs + CATEGORY:=Libraries + TITLE:=GNU MPFR library + URL:=https://www.mpfr.org/ + DEPENDS:=+libgmp + ABI_VERSION:=6 +endef + +define Package/libmpfr/description +MPFR is a portable library written in C for arbitrary precision +arithmetic on floating-point numbers. It is based on the GNU MP library. +It aims to provide a class of floating-point numbers with precise +semantics. +endef + +CONFIGURE_ARGS += \ + --enable-thread-safe + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/mpf* $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpfr.{a,so*} $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/mpfr.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libmpfr/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmpfr.so.* $(1)/usr/lib/ +endef + +$(eval $(call BuildPackage,libmpfr)) diff --git a/package/libs/mpfr/patches/001-only-src.patch b/package/libs/mpfr/patches/001-only-src.patch new file mode 100644 index 0000000000..bd9e38aefb --- /dev/null +++ b/package/libs/mpfr/patches/001-only-src.patch @@ -0,0 +1,22 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -38,7 +38,7 @@ AUTOMAKE_OPTIONS = gnu + # old Automake version. + ACLOCAL_AMFLAGS = -I m4 + +-SUBDIRS = doc src tests tune tools/bench ++SUBDIRS = src + + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = mpfr.pc +--- a/Makefile.in ++++ b/Makefile.in +@@ -401,7 +401,7 @@ AUTOMAKE_OPTIONS = gnu + # libtoolize and in case some developer needs to switch back to an + # old Automake version. + ACLOCAL_AMFLAGS = -I m4 +-SUBDIRS = doc src tests tune tools/bench ++SUBDIRS = src + pkgconfigdir = $(libdir)/pkgconfig + pkgconfig_DATA = mpfr.pc + nobase_dist_doc_DATA = AUTHORS BUGS COPYING COPYING.LESSER NEWS TODO \ From 4a5d1d0e95d6ec6ac9c9418af9d93a0ad2e7c100 Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 10 Dec 2023 00:08:15 +0200 Subject: [PATCH 10/10] devel/gdb: Update to 14.1 Update the gdb package to 14.1 * mpfr is now required, remove the 'without' and add dependency * remove mpc 'without' that is parsed wrongly, causing "-Lno/lib" * refresh patches Signed-off-by: Hannu Nyman --- package/devel/gdb/Makefile | 10 ++++------ package/devel/gdb/patches/110-shared_libgcc.patch | 12 ++++++------ package/devel/gdb/patches/130-gdb-ctrl-c.patch | 2 +- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/package/devel/gdb/Makefile b/package/devel/gdb/Makefile index 3efbce28f4..cf897b79f2 100644 --- a/package/devel/gdb/Makefile +++ b/package/devel/gdb/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=gdb -PKG_VERSION:=13.2 -PKG_RELEASE:=2 +PKG_VERSION:=14.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@GNU/gdb -PKG_HASH:=fd5bebb7be1833abdb6e023c2f498a354498281df9d05523d8915babeb893f0a +PKG_HASH:=d66df51276143451fcbff464cc8723d68f1e9df45a6a2d5635a54e71643edb80 PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 @@ -33,7 +33,7 @@ endef define Package/gdb $(call Package/gdb/Default) TITLE:=GNU Debugger - DEPENDS+=+libreadline +libncurses +zlib +libgmp + DEPENDS+=+libreadline +libncurses +zlib +libgmp +libmpfr endef define Package/gdb/description @@ -64,8 +64,6 @@ CONFIGURE_ARGS+= \ --disable-sim \ --disable-werror \ --disable-source-highlight \ - --without-mpc \ - --without-mpfr \ --without-isl \ --without-xxhash \ --with-libgmp-prefix=$(STAGING_DIR)/usr diff --git a/package/devel/gdb/patches/110-shared_libgcc.patch b/package/devel/gdb/patches/110-shared_libgcc.patch index 44d4ffa77f..1a02ad1160 100644 --- a/package/devel/gdb/patches/110-shared_libgcc.patch +++ b/package/devel/gdb/patches/110-shared_libgcc.patch @@ -1,6 +1,6 @@ --- a/configure.ac +++ b/configure.ac -@@ -1435,13 +1435,13 @@ if test -z "$LD"; then +@@ -1400,13 +1400,13 @@ if test -z "$LD"; then fi fi @@ -17,7 +17,7 @@ AC_LANG_PUSH(C++) AC_LINK_IFELSE([AC_LANG_SOURCE([ #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) -@@ -1838,7 +1838,7 @@ AC_ARG_WITH(stage1-ldflags, +@@ -1836,7 +1836,7 @@ AC_ARG_WITH(stage1-ldflags, # trust that they are doing what they want. if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \ -a "$have_static_libs" = yes; then @@ -26,7 +26,7 @@ fi]) AC_SUBST(stage1_ldflags) -@@ -1867,7 +1867,7 @@ AC_ARG_WITH(boot-ldflags, +@@ -1865,7 +1865,7 @@ AC_ARG_WITH(boot-ldflags, # statically. But if the user explicitly specified the libraries to # use, trust that they are doing what they want. if test "$poststage1_libs" = ""; then @@ -37,7 +37,7 @@ --- a/configure +++ b/configure -@@ -5442,14 +5442,14 @@ if test -z "$LD"; then +@@ -5413,14 +5413,14 @@ if test -z "$LD"; then fi fi @@ -56,7 +56,7 @@ ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -@@ -8440,7 +8440,7 @@ else +@@ -8464,7 +8464,7 @@ else # trust that they are doing what they want. if test "$with_static_standard_libraries" = yes -a "$stage1_libs" = "" \ -a "$have_static_libs" = yes; then @@ -65,7 +65,7 @@ fi fi -@@ -8476,7 +8476,7 @@ else +@@ -8500,7 +8500,7 @@ else # statically. But if the user explicitly specified the libraries to # use, trust that they are doing what they want. if test "$poststage1_libs" = ""; then diff --git a/package/devel/gdb/patches/130-gdb-ctrl-c.patch b/package/devel/gdb/patches/130-gdb-ctrl-c.patch index 8650ce844c..5272b7e969 100644 --- a/package/devel/gdb/patches/130-gdb-ctrl-c.patch +++ b/package/devel/gdb/patches/130-gdb-ctrl-c.patch @@ -24,7 +24,7 @@ Signed-off-by: Khem Raj --- a/gdbserver/linux-low.cc +++ b/gdbserver/linux-low.cc -@@ -5467,7 +5467,7 @@ linux_process_target::request_interrupt +@@ -5481,7 +5481,7 @@ linux_process_target::request_interrupt { /* Send a SIGINT to the process group. This acts just like the user typed a ^C on the controlling terminal. */