From 077a8690347d48cf2b54cb4bde7e29a7df3d26f4 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 27 Jan 2025 12:02:24 +0100 Subject: [PATCH 01/15] airoha: an7581: replace eMMC support with upstream version Replace eMMC support with upstream version where we declare dummy clock and dummy regulator instead of a specific compatible. Also drop the downstream patch for it. Signed-off-by: Christian Marangi (cherry picked from commit b7edf88b0fe15b32be802c7de54036ff8e66dcc1) --- target/linux/airoha/an7581/config-6.6 | 2 + target/linux/airoha/dts/an7581-evb-emmc.dts | 3 +- target/linux/airoha/dts/an7581.dtsi | 23 ++- ...k-sd-add-support-for-AN7581-MMC-Host.patch | 136 ------------------ 4 files changed, 24 insertions(+), 140 deletions(-) delete mode 100644 target/linux/airoha/patches-6.6/111-mmc-mtk-sd-add-support-for-AN7581-MMC-Host.patch diff --git a/target/linux/airoha/an7581/config-6.6 b/target/linux/airoha/an7581/config-6.6 index d86aa8bbbb..812dcd76bb 100644 --- a/target/linux/airoha/an7581/config-6.6 +++ b/target/linux/airoha/an7581/config-6.6 @@ -496,6 +496,8 @@ CONFIG_RATIONAL=y CONFIG_RCU_CPU_STALL_TIMEOUT=21 CONFIG_REGMAP=y CONFIG_REGMAP_MMIO=y +CONFIG_REGULATOR=y +CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_RELOCATABLE=y CONFIG_RESET_CONTROLLER=y CONFIG_RFS_ACCEL=y diff --git a/target/linux/airoha/dts/an7581-evb-emmc.dts b/target/linux/airoha/dts/an7581-evb-emmc.dts index 91d7977795..26d446e2a1 100644 --- a/target/linux/airoha/dts/an7581-evb-emmc.dts +++ b/target/linux/airoha/dts/an7581-evb-emmc.dts @@ -100,8 +100,9 @@ }; &mmc0 { - pinctrl-names = "default"; + pinctrl-names = "default", "state_uhs"; pinctrl-0 = <&mmc_pins>; + pinctrl-1 = <&mmc_pins>; status = "okay"; #address-cells = <1>; diff --git a/target/linux/airoha/dts/an7581.dtsi b/target/linux/airoha/dts/an7581.dtsi index 2b4c1b716b..762a6aa1a8 100644 --- a/target/linux/airoha/dts/an7581.dtsi +++ b/target/linux/airoha/dts/an7581.dtsi @@ -332,6 +332,21 @@ }; }; + clk25m: oscillator { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <25000000>; + clock-output-names = "clkxtal"; + }; + + vmmc_3v3: regulator-vmmc-3v3 { + compatible = "regulator-fixed"; + regulator-name = "vmmc"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-always-on; + }; + soc { compatible = "simple-bus"; #address-cells = <2>; @@ -535,13 +550,15 @@ }; mmc0: mmc@1fa0e000 { - compatible = "airoha,an7581-mmc"; + compatible = "mediatek,mt7622-mmc"; reg = <0x0 0x1fa0e000 0x0 0x1000>, <0x0 0x1fa0c000 0x0 0x60>; interrupts = ; - clocks = <&scuclk EN7581_CLK_EMMC>; - clock-names = "source"; bus-width = <4>; + clocks = <&scuclk EN7581_CLK_EMMC>, <&clk25m>; + clock-names = "source", "hclk"; + bus-width = <4>; max-frequency = <52000000>; + vmmc-supply = <&vmmc_3v3>; disable-wp; cap-mmc-highspeed; non-removable; diff --git a/target/linux/airoha/patches-6.6/111-mmc-mtk-sd-add-support-for-AN7581-MMC-Host.patch b/target/linux/airoha/patches-6.6/111-mmc-mtk-sd-add-support-for-AN7581-MMC-Host.patch deleted file mode 100644 index d116bb9ee0..0000000000 --- a/target/linux/airoha/patches-6.6/111-mmc-mtk-sd-add-support-for-AN7581-MMC-Host.patch +++ /dev/null @@ -1,136 +0,0 @@ -From f38f16925e1aa7cc71f63d3d52997b1c98cd7781 Mon Sep 17 00:00:00 2001 -From: Christian Marangi -Date: Wed, 11 Dec 2024 11:27:10 +0100 -Subject: [PATCH 4/4] mmc: mtk-sd: add support for AN7581 MMC Host - -Add support for AN7581 MMC Host. The MMC Host controller is based on -mt7622 with the difference of not having regulator supply and state_uhs -pins and hclk clock. - -Some minor fixes are applied to check if the state_uhs pins are defined -and make hclk optional for the new airoha compatible. - -Signed-off-by: Christian Marangi ---- - drivers/mmc/host/mtk-sd.c | 55 ++++++++++++++++++++++++++++++++------- - 1 file changed, 46 insertions(+), 9 deletions(-) - ---- a/drivers/mmc/host/mtk-sd.c -+++ b/drivers/mmc/host/mtk-sd.c -@@ -615,6 +615,19 @@ static const struct mtk_mmc_compatible m - .stop_clk_fix = true, - }; - -+static const struct mtk_mmc_compatible an7581_compat = { -+ .clk_div_bits = 12, -+ .recheck_sdio_irq = true, -+ .hs400_tune = false, -+ .pad_tune_reg = MSDC_PAD_TUNE0, -+ .async_fifo = true, -+ .data_tune = true, -+ .busy_check = true, -+ .stop_clk_fix = true, -+ .enhance_rx = true, -+ .support_64g = false, -+}; -+ - static const struct of_device_id msdc_of_ids[] = { - { .compatible = "mediatek,mt2701-mmc", .data = &mt2701_compat}, - { .compatible = "mediatek,mt2712-mmc", .data = &mt2712_compat}, -@@ -627,7 +640,7 @@ static const struct of_device_id msdc_of - { .compatible = "mediatek,mt8173-mmc", .data = &mt8173_compat}, - { .compatible = "mediatek,mt8183-mmc", .data = &mt8183_compat}, - { .compatible = "mediatek,mt8516-mmc", .data = &mt8516_compat}, -- -+ { .compatible = "airoha,an7581-mmc", .data = &an7581_compat}, - {} - }; - MODULE_DEVICE_TABLE(of, msdc_of_ids); -@@ -1479,6 +1492,10 @@ static int msdc_ops_switch_volt(struct m - struct msdc_host *host = mmc_priv(mmc); - int ret; - -+ /* Skip setting supply if not supported */ -+ if (!mmc->supply.vqmmc) -+ return 0; -+ - if (!IS_ERR(mmc->supply.vqmmc)) { - if (ios->signal_voltage != MMC_SIGNAL_VOLTAGE_330 && - ios->signal_voltage != MMC_SIGNAL_VOLTAGE_180) { -@@ -1578,7 +1595,9 @@ static void msdc_enable_sdio_irq(struct - dev_dbg(host->dev, "SDIO eint irq: %d!\n", host->eint_irq); - } - -- pinctrl_select_state(host->pinctrl, host->pins_uhs); -+ /* Skip setting uhs pins if not supported */ -+ if (host->pins_uhs) -+ pinctrl_select_state(host->pinctrl, host->pins_uhs); - } else { - dev_pm_clear_wake_irq(host->dev); - } -@@ -1886,6 +1905,10 @@ static void msdc_ops_set_ios(struct mmc_ - - msdc_set_buswidth(host, ios->bus_width); - -+ /* Skip regulator if not supported */ -+ if (!mmc->supply.vmmc) -+ goto skip_regulator; -+ - /* Suspend/Resume will do power off/on */ - switch (ios->power_mode) { - case MMC_POWER_UP: -@@ -1921,6 +1944,7 @@ static void msdc_ops_set_ios(struct mmc_ - break; - } - -+skip_regulator: - if (host->mclk != ios->clock || host->timing != ios->timing) - msdc_set_mclk(host, ios->timing, ios->clock); - } -@@ -2617,9 +2641,12 @@ static int msdc_of_clock_parse(struct pl - if (IS_ERR(host->src_clk)) - return PTR_ERR(host->src_clk); - -- host->h_clk = devm_clk_get(&pdev->dev, "hclk"); -- if (IS_ERR(host->h_clk)) -- return PTR_ERR(host->h_clk); -+ /* AN7581 SoC doesn't have hclk */ -+ if (!device_is_compatible(&pdev->dev, "airoha,an7581-mmc")) { -+ host->h_clk = devm_clk_get(&pdev->dev, "hclk"); -+ if (IS_ERR(host->h_clk)) -+ return PTR_ERR(host->h_clk); -+ } - - host->bus_clk = devm_clk_get_optional(&pdev->dev, "bus_clk"); - if (IS_ERR(host->bus_clk)) -@@ -2731,10 +2758,13 @@ static int msdc_drv_probe(struct platfor - return PTR_ERR(host->pins_default); - } - -- host->pins_uhs = pinctrl_lookup_state(host->pinctrl, "state_uhs"); -- if (IS_ERR(host->pins_uhs)) { -- dev_err(&pdev->dev, "Cannot find pinctrl uhs!\n"); -- return PTR_ERR(host->pins_uhs); -+ /* AN7581 doesn't have state_uhs pins */ -+ if (!device_is_compatible(&pdev->dev, "airoha,an7581-mmc")) { -+ host->pins_uhs = pinctrl_lookup_state(host->pinctrl, "state_uhs"); -+ if (IS_ERR(host->pins_uhs)) { -+ dev_err(&pdev->dev, "Cannot find pinctrl uhs!\n"); -+ return PTR_ERR(host->pins_uhs); -+ } - } - - /* Support for SDIO eint irq ? */ -@@ -2815,6 +2845,12 @@ static int msdc_drv_probe(struct platfor - dev_err(&pdev->dev, "Cannot ungate clocks!\n"); - goto release_clk; - } -+ -+ /* AN7581 without regulator require tune to OCR values */ -+ if (device_is_compatible(&pdev->dev, "airoha,an7581-mmc") && -+ !mmc->ocr_avail) -+ mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; -+ - msdc_init_hw(host); - - if (mmc->caps2 & MMC_CAP2_CQE) { From 2bff6e490a8cb5af1504a8975df5aa1208e7b9f5 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Mon, 27 Jan 2025 12:14:28 +0100 Subject: [PATCH 02/15] airoha: an7581: replace clock patch with upstream version Replace clock patch for eMMC with upstream version to add the tag and flag them as upstreamed. Signed-off-by: Christian Marangi (cherry picked from commit a9b408a97f7bf8b1f98f355fefe3c9bfc959d5a6) --- ...Rework-clock-handling-for-different-clock.patch} | 13 +++++++------ ...s-clock-drop-NUM_CLOCKS-define-for-EN7581.patch} | 7 +++++-- ...bindings-clock-add-ID-for-eMMC-for-EN7581.patch} | 6 ++++-- ...-clk-en7523-Add-clock-for-eMMC-for-EN7581.patch} | 6 ++++-- 4 files changed, 20 insertions(+), 12 deletions(-) rename target/linux/airoha/patches-6.6/{110-01-clk-en7523-Rework-clock-handling-for-different-clock.patch => 041-01-v6.14-clk-en7523-Rework-clock-handling-for-different-clock.patch} (87%) rename target/linux/airoha/patches-6.6/{110-02-dt-bindings-clock-drop-NUM_CLOCKS-define-for-EN7581.patch => 041-02-v6.14-dt-bindings-clock-drop-NUM_CLOCKS-define-for-EN7581.patch} (69%) rename target/linux/airoha/patches-6.6/{110-03-dt-bindings-clock-add-ID-for-eMMC-for-EN7581.patch => 041-03-v6.14-dt-bindings-clock-add-ID-for-eMMC-for-EN7581.patch} (74%) rename target/linux/airoha/patches-6.6/{110-04-clk-en7523-Add-clock-for-eMMC-for-EN7581.patch => 041-04-v6.14-clk-en7523-Add-clock-for-eMMC-for-EN7581.patch} (84%) diff --git a/target/linux/airoha/patches-6.6/110-01-clk-en7523-Rework-clock-handling-for-different-clock.patch b/target/linux/airoha/patches-6.6/041-01-v6.14-clk-en7523-Rework-clock-handling-for-different-clock.patch similarity index 87% rename from target/linux/airoha/patches-6.6/110-01-clk-en7523-Rework-clock-handling-for-different-clock.patch rename to target/linux/airoha/patches-6.6/041-01-v6.14-clk-en7523-Rework-clock-handling-for-different-clock.patch index 187715a5cc..96d2bbf28e 100644 --- a/target/linux/airoha/patches-6.6/110-01-clk-en7523-Rework-clock-handling-for-different-clock.patch +++ b/target/linux/airoha/patches-6.6/041-01-v6.14-clk-en7523-Rework-clock-handling-for-different-clock.patch @@ -1,6 +1,6 @@ -From 04cd09990fdc3106d9fc4c47dda100e521d62a43 Mon Sep 17 00:00:00 2001 +From e4a9748e7103c47e575459db2b6a77d14f34da2b Mon Sep 17 00:00:00 2001 From: Christian Marangi -Date: Wed, 18 Dec 2024 10:03:45 +0100 +Date: Tue, 14 Jan 2025 00:10:02 +0100 Subject: [PATCH 1/4] clk: en7523: Rework clock handling for different clock numbers @@ -12,6 +12,8 @@ clocks number in match_data and alloca clk_data based on the compatible match_data. Signed-off-by: Christian Marangi +Link: https://lore.kernel.org/r/20250113231030.6735-2-ansuelsmth@gmail.com +Signed-off-by: Stephen Boyd --- drivers/clk/clk-en7523.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) @@ -44,7 +46,7 @@ Signed-off-by: Christian Marangi } static int en7523_reset_update(struct reset_controller_dev *rcdev, -@@ -702,21 +699,24 @@ static int en7523_clk_probe(struct platf +@@ -702,13 +699,15 @@ static int en7523_clk_probe(struct platf struct clk_hw_onecell_data *clk_data; int r; @@ -58,12 +60,11 @@ Signed-off-by: Christian Marangi return -ENOMEM; - soc_data = device_get_match_data(&pdev->dev); ++ clk_data->num = soc_data->num_clocks; r = soc_data->hw_init(pdev, clk_data); if (r) return r; - -+ clk_data->num = soc_data->num_clocks; - return of_clk_add_hw_provider(node, of_clk_hw_onecell_get, clk_data); +@@ -717,6 +716,7 @@ static int en7523_clk_probe(struct platf } static const struct en_clk_soc_data en7523_data = { diff --git a/target/linux/airoha/patches-6.6/110-02-dt-bindings-clock-drop-NUM_CLOCKS-define-for-EN7581.patch b/target/linux/airoha/patches-6.6/041-02-v6.14-dt-bindings-clock-drop-NUM_CLOCKS-define-for-EN7581.patch similarity index 69% rename from target/linux/airoha/patches-6.6/110-02-dt-bindings-clock-drop-NUM_CLOCKS-define-for-EN7581.patch rename to target/linux/airoha/patches-6.6/041-02-v6.14-dt-bindings-clock-drop-NUM_CLOCKS-define-for-EN7581.patch index e858d8b77d..5db79a4748 100644 --- a/target/linux/airoha/patches-6.6/110-02-dt-bindings-clock-drop-NUM_CLOCKS-define-for-EN7581.patch +++ b/target/linux/airoha/patches-6.6/041-02-v6.14-dt-bindings-clock-drop-NUM_CLOCKS-define-for-EN7581.patch @@ -1,6 +1,6 @@ -From 8fc9b68ee448d0e687d4dc52ec95bf367eb04caa Mon Sep 17 00:00:00 2001 +From 02d3b7557ce28c373ea1e925ae16ab5988284313 Mon Sep 17 00:00:00 2001 From: Christian Marangi -Date: Thu, 19 Dec 2024 13:13:37 +0100 +Date: Tue, 14 Jan 2025 00:10:03 +0100 Subject: [PATCH 2/4] dt-bindings: clock: drop NUM_CLOCKS define for EN7581 Drop NUM_CLOCKS define for EN7581 include. This is not a binding and @@ -8,6 +8,9 @@ should not be placed here. Value is derived internally in the user driver. Signed-off-by: Christian Marangi +Acked-by: Krzysztof Kozlowski +Link: https://lore.kernel.org/r/20250113231030.6735-3-ansuelsmth@gmail.com +Signed-off-by: Stephen Boyd --- include/dt-bindings/clock/en7523-clk.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/target/linux/airoha/patches-6.6/110-03-dt-bindings-clock-add-ID-for-eMMC-for-EN7581.patch b/target/linux/airoha/patches-6.6/041-03-v6.14-dt-bindings-clock-add-ID-for-eMMC-for-EN7581.patch similarity index 74% rename from target/linux/airoha/patches-6.6/110-03-dt-bindings-clock-add-ID-for-eMMC-for-EN7581.patch rename to target/linux/airoha/patches-6.6/041-03-v6.14-dt-bindings-clock-add-ID-for-eMMC-for-EN7581.patch index 7bc987f420..a3f0c9e6fe 100644 --- a/target/linux/airoha/patches-6.6/110-03-dt-bindings-clock-add-ID-for-eMMC-for-EN7581.patch +++ b/target/linux/airoha/patches-6.6/041-03-v6.14-dt-bindings-clock-add-ID-for-eMMC-for-EN7581.patch @@ -1,6 +1,6 @@ -From 238436f998c551688695d26ecdcd2ea4d51190b1 Mon Sep 17 00:00:00 2001 +From 82108ad3285f58f314ad41398f44017c7dbe44de Mon Sep 17 00:00:00 2001 From: Christian Marangi -Date: Wed, 11 Dec 2024 12:22:37 +0100 +Date: Tue, 14 Jan 2025 00:10:04 +0100 Subject: [PATCH 3/4] dt-bindings: clock: add ID for eMMC for EN7581 Add ID for eMMC for EN7581. This is to control clock selection of eMMC @@ -8,6 +8,8 @@ between 200MHz and 150MHz. Signed-off-by: Christian Marangi Acked-by: Conor Dooley +Link: https://lore.kernel.org/r/20250113231030.6735-4-ansuelsmth@gmail.com +Signed-off-by: Stephen Boyd --- include/dt-bindings/clock/en7523-clk.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/airoha/patches-6.6/110-04-clk-en7523-Add-clock-for-eMMC-for-EN7581.patch b/target/linux/airoha/patches-6.6/041-04-v6.14-clk-en7523-Add-clock-for-eMMC-for-EN7581.patch similarity index 84% rename from target/linux/airoha/patches-6.6/110-04-clk-en7523-Add-clock-for-eMMC-for-EN7581.patch rename to target/linux/airoha/patches-6.6/041-04-v6.14-clk-en7523-Add-clock-for-eMMC-for-EN7581.patch index 64d5339176..6c8a3300be 100644 --- a/target/linux/airoha/patches-6.6/110-04-clk-en7523-Add-clock-for-eMMC-for-EN7581.patch +++ b/target/linux/airoha/patches-6.6/041-04-v6.14-clk-en7523-Add-clock-for-eMMC-for-EN7581.patch @@ -1,12 +1,14 @@ -From 4fc22765b3888cf6575015b904718bfd36d1f49c Mon Sep 17 00:00:00 2001 +From bfe257f9780d8f77045a7da6ec959ee0659d2f98 Mon Sep 17 00:00:00 2001 From: Christian Marangi -Date: Wed, 11 Dec 2024 12:22:38 +0100 +Date: Tue, 14 Jan 2025 00:10:05 +0100 Subject: [PATCH 4/4] clk: en7523: Add clock for eMMC for EN7581 Add clock for eMMC for EN7581. This is used to give info of the current eMMC source clock and to switch it from 200MHz or 150MHz. Signed-off-by: Christian Marangi +Link: https://lore.kernel.org/r/20250113231030.6735-5-ansuelsmth@gmail.com +Signed-off-by: Stephen Boyd --- drivers/clk/clk-en7523.c | 10 ++++++++++ 1 file changed, 10 insertions(+) From a5eb5ee1a633f67ae44e43f211396a9f734268be Mon Sep 17 00:00:00 2001 From: Anders Melchiorsen Date: Wed, 22 Jan 2025 21:54:57 +0100 Subject: [PATCH 03/15] ramips: restore full switch performance for USW-Flex Since commit f1c9afd80138 ("ramips: mt7621-dts: mux phy0/4 to gmac1") the USW-Flex lan1 port has been attached directly to the CPU. This improves routing performance but hinders switching. This is a generally accepted trade-off in that commit but for USW-Flex it is a questionable choice. This switch is designed to deliver PoE to remote places and using it as a router is unlikely. Meanwhile, the lan1 port is also PoE-in and will often be the uplink, carrying most of the traffic. Reverting f1c9afd80138 for USW-Flex restores full 1 Gbps switching performance on all ports. Signed-off-by: Anders Melchiorsen Link: https://github.com/openwrt/openwrt/pull/17703 Signed-off-by: Robert Marko (cherry picked from commit 62872f8bfd5c8bc80bb014417c6ed8057bbeb773) --- .../linux/ramips/dts/mt7621_ubnt_usw-flex.dts | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts b/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts index f2fb48cac2..f548f1f9b7 100644 --- a/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts +++ b/target/linux/ramips/dts/mt7621_ubnt_usw-flex.dts @@ -64,19 +64,6 @@ label = "dsa"; }; -&gmac1 { - status = "okay"; - label = "lan1"; - phy-handle = <ðphy4>; - - nvmem-cells = <&macaddr_eeprom>; - nvmem-cell-names = "mac-address"; -}; - -ðphy4 { - /delete-property/ interrupts; -}; - &switch0 { ports { port@0 { @@ -98,6 +85,11 @@ status = "okay"; label = "lan2"; }; + + port@4 { + status = "okay"; + label = "lan1"; + }; }; }; From d0289daa69fd5063cefc8665b38375040ee69226 Mon Sep 17 00:00:00 2001 From: Thomas Richard Date: Mon, 27 Jan 2025 14:02:28 +0100 Subject: [PATCH 04/15] stm32: enable CONFIG_SMSC_PHY The STM32MP135F-DK board uses the LAN8742 PHY. Enable CONFIG_SMSC_PHY to have full PHY support. Signed-off-by: Thomas Richard Link: https://github.com/openwrt/openwrt/pull/17745 Signed-off-by: Robert Marko (cherry picked from commit d981f28f762a559ae50386fa089b050aaaa78555) --- target/linux/stm32/stm32mp1/config-6.6 | 1 + 1 file changed, 1 insertion(+) diff --git a/target/linux/stm32/stm32mp1/config-6.6 b/target/linux/stm32/stm32mp1/config-6.6 index e19abcc7dc..0428216ecb 100644 --- a/target/linux/stm32/stm32mp1/config-6.6 +++ b/target/linux/stm32/stm32mp1/config-6.6 @@ -423,6 +423,7 @@ CONFIG_SGL_ALLOC=y CONFIG_SG_POOL=y CONFIG_SMP=y CONFIG_SMP_ON_UP=y +CONFIG_SMSC_PHY=y CONFIG_SOCK_RX_QUEUE_MAPPING=y CONFIG_SOC_BUS=y CONFIG_SOFTIRQ_ON_OWN_STACK=y From 4e70887d43dbf6b5e013b6755d61e66e37eba41c Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 10 Nov 2024 15:57:01 +0200 Subject: [PATCH 05/15] wolfssl: Adjust version for apk Adjust wolfssl version for apk by removing the "-stable" from the OpenWrt version, although it is still needed for upstream download archive name. Define PKG_BUILD_DIR accordingly. Utilize new short version to simplify ABI_VERSION calculation. Signed-off-by: Hannu Nyman Link: https://github.com/openwrt/openwrt/pull/16906 Signed-off-by: Christian Marangi (cherry picked from commit be952e98bc1d768a0da5b84e59a6e7c04a1cdab8) --- package/libs/wolfssl/Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index bac4a8ef52..56daacc71b 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,13 +8,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=5.7.2-stable +PKG_VERSION:=5.7.2 +PKG_REAL_VERSION:=$(PKG_VERSION)-stable PKG_RELEASE:=1 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_VERSION) +PKG_SOURCE:=$(PKG_NAME)-$(PKG_REAL_VERSION).tar.gz +PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_REAL_VERSION) PKG_HASH:=0f2ed82e345b833242705bbc4b08a2a2037a33f7bf9c610efae6464f6b10e305 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_REAL_VERSION) + PKG_FIXUP:=libtool libtool-abiver PKG_INSTALL:=1 PKG_BUILD_FLAGS:=no-mips16 lto @@ -40,7 +43,7 @@ PKG_CONFIG_DEPENDS:=\ CONFIG_WOLFSSL_HAS_TLSV13 \ CONFIG_WOLFSSL_HAS_WPAS -PKG_ABI_VERSION:=$(patsubst %-stable,%,$(PKG_VERSION)).$(call version_abbrev,$(call confvar,$(PKG_CONFIG_DEPENDS))) +PKG_ABI_VERSION:=$(PKG_VERSION).$(call version_abbrev,$(call confvar,$(PKG_CONFIG_DEPENDS))) PKG_CONFIG_DEPENDS+=\ CONFIG_PACKAGE_libwolfssl-benchmark \ From 6f7bbd03954e8aa79484b7c5b727dd814bfee78d Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 27 Jan 2025 01:37:39 +0100 Subject: [PATCH 06/15] wolfssl: Update to version 5.7.6 This fixes multiple bugs and also minor security problems. Changelog: https://github.com/wolfSSL/wolfssl/releases/tag/v5.7.4-stable https://github.com/wolfSSL/wolfssl/releases/tag/v5.7.6-stable The package size increases: 525814 bin/packages/mips_24kc/base/libwolfssl5.7.2.e624513f-5.7.2-r1.apk 549408 bin/packages/mips_24kc/base/libwolfssl5.7.6.e624513f-5.7.6-r1.apk Link: https://github.com/openwrt/openwrt/pull/17742 Signed-off-by: Hauke Mehrtens (cherry picked from commit 0a7e92c2442bc09eec3875aae21996d9a5430806) --- package/libs/wolfssl/Makefile | 4 ++-- .../libs/wolfssl/patches/100-disable-hardening-check.patch | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/libs/wolfssl/Makefile b/package/libs/wolfssl/Makefile index 56daacc71b..ee6baefddc 100644 --- a/package/libs/wolfssl/Makefile +++ b/package/libs/wolfssl/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=wolfssl -PKG_VERSION:=5.7.2 +PKG_VERSION:=5.7.6 PKG_REAL_VERSION:=$(PKG_VERSION)-stable PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_REAL_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/wolfSSL/wolfssl/archive/v$(PKG_REAL_VERSION) -PKG_HASH:=0f2ed82e345b833242705bbc4b08a2a2037a33f7bf9c610efae6464f6b10e305 +PKG_HASH:=52b1e439e30d1ed8162a16308a8525a862183b67aa30373b11166ecbab000d63 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_REAL_VERSION) diff --git a/package/libs/wolfssl/patches/100-disable-hardening-check.patch b/package/libs/wolfssl/patches/100-disable-hardening-check.patch index 174e657982..ab695d391d 100644 --- a/package/libs/wolfssl/patches/100-disable-hardening-check.patch +++ b/package/libs/wolfssl/patches/100-disable-hardening-check.patch @@ -1,6 +1,6 @@ --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h -@@ -3046,7 +3046,7 @@ extern void uITRON4_free(void *p) ; +@@ -3722,7 +3722,7 @@ extern void uITRON4_free(void *p) ; /* warning for not using harden build options (default with ./configure) */ /* do not warn if big integer support is disabled */ From 50cb934142e3f6668dc8ebb8a7e54e6b17e14bd1 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 27 Jan 2025 01:09:33 +0100 Subject: [PATCH 07/15] apm821xx: NETGEAR WNDR4700: Fix compat version The definition for the netgear_wndr4700 had two different DEVICE_COMPAT_VERSION definitions. In commit 5815884c3a2 ("apm821xx: migrate to DSA"), an additional DEVICE_COMPAT_VERSION := 3.0 attribute was added to the device definition. The old one with version 2.0 stayed and was defined later overwriting the new one. Replace the old version 2.0 with the new version 3.0 Fixes: 5815884c3a2a ("apm821xx: migrate to DSA") Link: https://forum.openwrt.org/t/openwrt-24-10-0-rc6-sixth-release-candidate/222466/43 Link: https://github.com/openwrt/openwrt/pull/17741 Signed-off-by: Hauke Mehrtens (cherry picked from commit dab52c00d712a421d6e61eebc51359e5d38ad347) --- target/linux/apm821xx/image/nand.mk | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/linux/apm821xx/image/nand.mk b/target/linux/apm821xx/image/nand.mk index 92bdaa87d0..7b3945183e 100644 --- a/target/linux/apm821xx/image/nand.mk +++ b/target/linux/apm821xx/image/nand.mk @@ -89,9 +89,6 @@ endef TARGET_DEVICES += netgear_wndap660 define Device/netgear_wndr4700 - DEVICE_COMPAT_VERSION := 3.0 - DEVICE_COMPAT_MESSAGE := Network swconfig configuration cannot be upgraded to DSA. \ - Upgrade via sysupgrade mechanism is not possible. DEVICE_VENDOR := NETGEAR DEVICE_MODEL := Centria N900 WNDR4700 DEVICE_ALT0_VENDOR := NETGEAR @@ -123,8 +120,9 @@ define Device/netgear_wndr4700 NETGEAR_HW_ID := 29763875+128+256 UBINIZE_OPTS := -E 5 SUPPORTED_DEVICES += wndr4700 - DEVICE_COMPAT_VERSION := 2.0 + DEVICE_COMPAT_VERSION := 3.0 DEVICE_COMPAT_MESSAGE := kernel and ubi partitions had to be resized. \ + Network swconfig configuration cannot be upgraded to DSA. \ Upgrade via sysupgrade mechanism is not possible. endef TARGET_DEVICES += netgear_wndr4700 From daef29c75d284a31ca5d957e64b3bf4629e7d049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Mon, 27 Jan 2025 16:12:23 +0100 Subject: [PATCH 08/15] dnsmasq: add fix related to DNSSEC verification from upstream MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To find the DS record for a given zone the parent zone's nameserver must be queried and not the nameserver for the zone. Otherwise DNSSEC verification for unsigned delegations breaks. Signed-off-by: Uwe Kleine-König Link: https://patchwork.ozlabs.org/project/openwrt/patch/20250127151223.1420006-1-uwe+openwrt@kleine-koenig.org/ Signed-off-by: Hauke Mehrtens (cherry picked from commit 6dc0f0c50cf1072ec3751c0fb1fc152a0a86487d) --- package/network/services/dnsmasq/Makefile | 2 +- ...0003-Handle-DS-queries-to-auth-zones.patch | 98 +++++++++++++++++++ 2 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 package/network/services/dnsmasq/patches/0003-Handle-DS-queries-to-auth-zones.patch diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index 0a597c03ce..47a5ae54ae 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq PKG_UPSTREAM_VERSION:=2.90 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) -PKG_RELEASE:=3 +PKG_RELEASE:=4 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/ diff --git a/package/network/services/dnsmasq/patches/0003-Handle-DS-queries-to-auth-zones.patch b/package/network/services/dnsmasq/patches/0003-Handle-DS-queries-to-auth-zones.patch new file mode 100644 index 0000000000..bd7270c904 --- /dev/null +++ b/package/network/services/dnsmasq/patches/0003-Handle-DS-queries-to-auth-zones.patch @@ -0,0 +1,98 @@ +From 8ce27433f8b2e17c557cb55e4f16941d309deeac Mon Sep 17 00:00:00 2001 +From: Simon Kelley +Date: Fri, 17 Jan 2025 17:49:29 +0000 +Subject: [PATCH] Handle DS queries to auth zones. +Origin: upstream, v2.91test8 + +When dnsmasq is configured to act as an authoritative server and has +an authoritative zone configured, and recieves a query for +that zone _as_forwarder_ it answers the query directly rather +than forwarding it. This doesn't affect the answer, but it +saves dnsmasq forwarding the query to the recusor upstream, +whch then bounces it back to dnsmasq in auth mode. The +exception should be when the query is for the root of zone, for a DS +RR. The answer to that has to come from the parent, via the +recursor, and will typically be a proof-of-nonexistence since +dnsmasq doesn't support signed zones. This patch suppresses +local answers and forces forwarding to the upstream recursor +for such queries. It stops breakage when a DNSSEC validating +client makes queries to dnsmasq acting as forwarder for a zone +for which it is authoritative. + +[ukleinek: drop changes to CHANGELOG to prevent conflicts] +--- + src/forward.c | 52 +++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 38 insertions(+), 14 deletions(-) + +--- a/src/forward.c ++++ b/src/forward.c +@@ -1744,15 +1744,27 @@ void receive_query(struct listener *list + #endif + + #ifdef HAVE_AUTH +- /* find queries for zones we're authoritative for, and answer them directly */ ++ /* Find queries for zones we're authoritative for, and answer them directly. ++ The exception to this is DS queries for the zone route. They ++ have to come from the parent zone. Since dnsmasq's auth server ++ can't do DNSSEC, the zone will be unsigned, and anything using ++ dnsmasq as a forwarder and doing validation will be expecting to ++ see the proof of non-existence from the parent. */ + if (!auth_dns && !option_bool(OPT_LOCALISE)) + for (zone = daemon->auth_zones; zone; zone = zone->next) +- if (in_zone(zone, daemon->namebuff, NULL)) +- { +- auth_dns = 1; +- local_auth = 1; +- break; +- } ++ { ++ char *cut; ++ ++ if (in_zone(zone, daemon->namebuff, &cut)) ++ { ++ if (type != T_DS || cut) ++ { ++ auth_dns = 1; ++ local_auth = 1; ++ } ++ break; ++ } ++ } + #endif + + #ifdef HAVE_LOOP +@@ -2268,15 +2280,27 @@ unsigned char *tcp_request(int confd, ti + &peer_addr, auth_dns ? "auth" : "query", qtype); + + #ifdef HAVE_AUTH +- /* find queries for zones we're authoritative for, and answer them directly */ ++ /* Find queries for zones we're authoritative for, and answer them directly. ++ The exception to this is DS queries for the zone route. They ++ have to come from the parent zone. Since dnsmasq's auth server ++ can't do DNSSEC, the zone will be unsigned, and anything using ++ dnsmasq as a forwarder and doing validation will be expecting to ++ see the proof of non-existence from the parent. */ + if (!auth_dns && !option_bool(OPT_LOCALISE)) + for (zone = daemon->auth_zones; zone; zone = zone->next) +- if (in_zone(zone, daemon->namebuff, NULL)) +- { +- auth_dns = 1; +- local_auth = 1; +- break; +- } ++ { ++ char *cut; ++ ++ if (in_zone(zone, daemon->namebuff, &cut)) ++ { ++ if (qtype != T_DS || cut) ++ { ++ auth_dns = 1; ++ local_auth = 1; ++ } ++ break; ++ } ++ } + #endif + } + } From 6cbfbb18531e9e283ee4e50b14d53a27625fe518 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 28 Jan 2025 00:06:47 +0100 Subject: [PATCH 09/15] OpenWrt v24.10.0-rc7: adjust config defaults Signed-off-by: Hauke Mehrtens --- feeds.conf.default | 8 ++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 + version.date | 1 + 5 files changed, 11 insertions(+), 9 deletions(-) create mode 100644 version create mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index 581de056c4..1fca5eb2e5 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git packages https://git.openwrt.org/feed/packages.git;openwrt-24.10 -src-git luci https://git.openwrt.org/project/luci.git;openwrt-24.10 -src-git routing https://git.openwrt.org/feed/routing.git;openwrt-24.10 -src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-24.10 +src-git packages https://git.openwrt.org/feed/packages.git^cf301cd92c4c501271cf6c1caf19eabef3ce0c09 +src-git luci https://git.openwrt.org/project/luci.git^bdf1db5fb536b155d4b035f3bbf9590782e41cf7 +src-git routing https://git.openwrt.org/feed/routing.git^e87b55c6a642947ad7e24cd5054a637df63d5dbe +src-git telephony https://git.openwrt.org/feed/telephony.git^fd605af7143165a2490681ec1752f259873b9147 diff --git a/include/version.mk b/include/version.mk index a6ebe58779..91fc63dfbd 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10-SNAPSHOT) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.0-rc7) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r28417-daef29c75d) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10-SNAPSHOT) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.0-rc7) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index 80db993d46..ec94880c57 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -190,7 +190,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/24.10-SNAPSHOT" + default "https://downloads.openwrt.org/releases/24.10.0-rc7" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -266,7 +266,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default y + default n help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version new file mode 100644 index 0000000000..058b842db7 --- /dev/null +++ b/version @@ -0,0 +1 @@ +r28417-daef29c75d diff --git a/version.date b/version.date new file mode 100644 index 0000000000..31766eae0c --- /dev/null +++ b/version.date @@ -0,0 +1 @@ +1738018409 From c08ba0f7126b60570a81ef86500d9f83eeb8dc8f Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Tue, 28 Jan 2025 00:06:50 +0100 Subject: [PATCH 10/15] OpenWrt v24.10.0-rc7: revert to branch defaults Signed-off-by: Hauke Mehrtens --- feeds.conf.default | 8 ++++---- include/version.mk | 6 +++--- package/base-files/image-config.in | 4 ++-- version | 1 - version.date | 1 - 5 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 version delete mode 100644 version.date diff --git a/feeds.conf.default b/feeds.conf.default index 1fca5eb2e5..581de056c4 100644 --- a/feeds.conf.default +++ b/feeds.conf.default @@ -1,4 +1,4 @@ -src-git packages https://git.openwrt.org/feed/packages.git^cf301cd92c4c501271cf6c1caf19eabef3ce0c09 -src-git luci https://git.openwrt.org/project/luci.git^bdf1db5fb536b155d4b035f3bbf9590782e41cf7 -src-git routing https://git.openwrt.org/feed/routing.git^e87b55c6a642947ad7e24cd5054a637df63d5dbe -src-git telephony https://git.openwrt.org/feed/telephony.git^fd605af7143165a2490681ec1752f259873b9147 +src-git packages https://git.openwrt.org/feed/packages.git;openwrt-24.10 +src-git luci https://git.openwrt.org/project/luci.git;openwrt-24.10 +src-git routing https://git.openwrt.org/feed/routing.git;openwrt-24.10 +src-git telephony https://git.openwrt.org/feed/telephony.git;openwrt-24.10 diff --git a/include/version.mk b/include/version.mk index 91fc63dfbd..a6ebe58779 100644 --- a/include/version.mk +++ b/include/version.mk @@ -23,13 +23,13 @@ PKG_CONFIG_DEPENDS += \ sanitize = $(call tolower,$(subst _,-,$(subst $(space),-,$(1)))) VERSION_NUMBER:=$(call qstrip,$(CONFIG_VERSION_NUMBER)) -VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10.0-rc7) +VERSION_NUMBER:=$(if $(VERSION_NUMBER),$(VERSION_NUMBER),24.10-SNAPSHOT) VERSION_CODE:=$(call qstrip,$(CONFIG_VERSION_CODE)) -VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),r28417-daef29c75d) +VERSION_CODE:=$(if $(VERSION_CODE),$(VERSION_CODE),$(REVISION)) VERSION_REPO:=$(call qstrip,$(CONFIG_VERSION_REPO)) -VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10.0-rc7) +VERSION_REPO:=$(if $(VERSION_REPO),$(VERSION_REPO),https://downloads.openwrt.org/releases/24.10-SNAPSHOT) VERSION_DIST:=$(call qstrip,$(CONFIG_VERSION_DIST)) VERSION_DIST:=$(if $(VERSION_DIST),$(VERSION_DIST),OpenWrt) diff --git a/package/base-files/image-config.in b/package/base-files/image-config.in index ec94880c57..80db993d46 100644 --- a/package/base-files/image-config.in +++ b/package/base-files/image-config.in @@ -190,7 +190,7 @@ if VERSIONOPT config VERSION_REPO string prompt "Release repository" - default "https://downloads.openwrt.org/releases/24.10.0-rc7" + default "https://downloads.openwrt.org/releases/24.10-SNAPSHOT" help This is the repository address embedded in the image, it defaults to the trunk snapshot repo; the url may contain the following placeholders: @@ -266,7 +266,7 @@ if VERSIONOPT config VERSION_CODE_FILENAMES bool prompt "Revision code in filenames" - default n + default y help Enable this to include the revision identifier or the configured version code into the firmware image, SDK- and Image Builder archive diff --git a/version b/version deleted file mode 100644 index 058b842db7..0000000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -r28417-daef29c75d diff --git a/version.date b/version.date deleted file mode 100644 index 31766eae0c..0000000000 --- a/version.date +++ /dev/null @@ -1 +0,0 @@ -1738018409 From e2c2a6ed7f87f494ba23d130de00638028c0c71c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 28 Jan 2025 08:28:01 +0100 Subject: [PATCH 11/15] bmips: shg2500: add missing led controller cells MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the following DT warnings: ../dts/bcm63168-sercomm-shg2500.dts:76.4-14: Warning (reg_format): /ubus/spi@10001000/led-controller@1/led@1:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1) ../dts/bcm63168-sercomm-shg2500.dts:75.9-78.5: Warning (avoid_default_addr_size): /ubus/spi@10001000/led-controller@1/led@1: Relying on default #address-cells value ../dts/bcm63168-sercomm-shg2500.dts:75.9-78.5: Warning (avoid_default_addr_size): /ubus/spi@10001000/led-controller@1/led@1: Relying on default #size-cells value Signed-off-by: Álvaro Fernández Rojas (cherry picked from commit fbe0bd5f6453a61fab871bee56883afc5c6308cf) --- target/linux/bmips/dts/bcm63168-sercomm-shg2500.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/linux/bmips/dts/bcm63168-sercomm-shg2500.dts b/target/linux/bmips/dts/bcm63168-sercomm-shg2500.dts index 7ea76bebc3..3f9ca000cc 100644 --- a/target/linux/bmips/dts/bcm63168-sercomm-shg2500.dts +++ b/target/linux/bmips/dts/bcm63168-sercomm-shg2500.dts @@ -68,6 +68,8 @@ status = "okay"; led-controller@1 { + #address-cells = <1>; + #size-cells = <0>; compatible = "sercomm,msp430-leds"; reg = <1>; spi-max-frequency = <500000>; From 1a75172721a1c917312105e9e0449fa431c0154c Mon Sep 17 00:00:00 2001 From: Shiji Yang Date: Wed, 1 Jan 2025 16:06:10 +0800 Subject: [PATCH 12/15] ramips: pinctrl: allow mux SDXC pins for mt76x8 The mt76x8 SDXC pin register definition is incompatible with the mtmips generic pinctrl driver structure. This hack allows us to mux the SDXC IO to different pin groups in device tree. Signed-off-by: Shiji Yang Link: https://github.com/openwrt/openwrt/pull/17446 (cherry picked from commit 05ec3b50a8e673786dda0224b23f18b5d96a4a65) Link: https://github.com/openwrt/openwrt/pull/17754 Signed-off-by: Hauke Mehrtens --- ...tmips-allow-mux-SDXC-pins-for-mt76x8.patch | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 target/linux/ramips/patches-6.6/809-pinctrl-mtmips-allow-mux-SDXC-pins-for-mt76x8.patch diff --git a/target/linux/ramips/patches-6.6/809-pinctrl-mtmips-allow-mux-SDXC-pins-for-mt76x8.patch b/target/linux/ramips/patches-6.6/809-pinctrl-mtmips-allow-mux-SDXC-pins-for-mt76x8.patch new file mode 100644 index 0000000000..69dcd7fb2c --- /dev/null +++ b/target/linux/ramips/patches-6.6/809-pinctrl-mtmips-allow-mux-SDXC-pins-for-mt76x8.patch @@ -0,0 +1,105 @@ +From: Shiji Yang +Date: Wed, 1 Jan 2025 13:30:11 +0800 +Subject: [PATCH] pinctrl: mtmips: allow mux SDXC pins for mt76x8 + +This is a hack to supprot two types of mt76x8 SDXC pinmaps: + +a) Use ethernet phy pins as SDXC IO. + +&pinctrl { + ephy-digital; + + sdxc_iot_mode: sdxc_iot_mode { + esd { + groups = "esd"; + function = "iot"; + }; + + sdxc { + groups = "sdmode"; + function = "sdxc"; + }; + }; +}; + +b) Use I2S/I2C/GPIO0/UART1 pins as SDXC IO. + +&pinctrl { + ephy-analog; + + sdxc_router_mode: sdxc_router_mode { + groups = "esd", "gpio", "i2c", "i2s", "sdmode", "uart1"; + function = "gpio"; + }; +}; + +Signed-off-by: Shiji Yang +--- + drivers/pinctrl/mediatek/pinctrl-mt76x8.c | 24 ++++++++++++++++++++++- + 1 file changed, 22 insertions(+), 1 deletion(-) + +--- a/drivers/pinctrl/mediatek/pinctrl-mt76x8.c ++++ b/drivers/pinctrl/mediatek/pinctrl-mt76x8.c +@@ -1,10 +1,13 @@ + // SPDX-License-Identifier: GPL-2.0-only + ++#include + #include + #include + #include + #include "pinctrl-mtmips.h" + ++#define SYSC_REG_AGPIO_CFG 0x3c ++ + #define MT76X8_GPIO_MODE_MASK 0x3 + + #define MT76X8_GPIO_MODE_P4LED_KN 58 +@@ -26,6 +29,7 @@ + #define MT76X8_GPIO_MODE_I2C 20 + #define MT76X8_GPIO_MODE_REFCLK 18 + #define MT76X8_GPIO_MODE_PERST 16 ++#define MT76X8_GPIO_MODE_ESD 15 + #define MT76X8_GPIO_MODE_WDT 14 + #define MT76X8_GPIO_MODE_SPI 12 + #define MT76X8_GPIO_MODE_SDMODE 10 +@@ -74,6 +78,12 @@ static struct mtmips_pmx_func refclk_grp + static struct mtmips_pmx_func perst_grp[] = { FUNC("perst", 0, 36, 1) }; + static struct mtmips_pmx_func wdt_grp[] = { FUNC("wdt", 0, 38, 1) }; + static struct mtmips_pmx_func spi_grp[] = { FUNC("spi", 0, 7, 4) }; ++/* ++ * "esd" (Ethernet SDXC) group supports two mode: ++ * "gpio" - SDXC mux to I2S/I2C/GPIO0/UART1 pins with "gpio" mode ++ * "iot" - SDXC mux to EPHY pins, eth p1-p4 pad must be set to "digital" ++ */ ++static struct mtmips_pmx_func esd_grp[] = { FUNC("iot", 0, 47, 1) }; + + static struct mtmips_pmx_func sd_mode_grp[] = { + FUNC("jtag", 3, 22, 8), +@@ -216,6 +226,7 @@ static struct mtmips_pmx_group mt76x8_pi + GRP("perst", perst_grp, 1, MT76X8_GPIO_MODE_PERST), + GRP("wdt", wdt_grp, 1, MT76X8_GPIO_MODE_WDT), + GRP("spi", spi_grp, 1, MT76X8_GPIO_MODE_SPI), ++ GRP("esd", esd_grp, 1, MT76X8_GPIO_MODE_ESD), + GRP_G("sdmode", sd_mode_grp, MT76X8_GPIO_MODE_MASK, + 1, MT76X8_GPIO_MODE_SDMODE), + GRP_G("uart0", uart0_grp, MT76X8_GPIO_MODE_MASK, +@@ -257,7 +268,18 @@ static struct mtmips_pmx_group mt76x8_pi + + static int mt76x8_pinctrl_probe(struct platform_device *pdev) + { +- return mtmips_pinctrl_init(pdev, mt76x8_pinmux_data); ++ int ret; ++ ++ ret = mtmips_pinctrl_init(pdev, mt76x8_pinmux_data); ++ if (ret) ++ return ret; ++ ++ if (of_property_present(pdev->dev.of_node, "ephy-analog")) ++ rt_sysc_m32(0xf << 17, 0, SYSC_REG_AGPIO_CFG); ++ else if (of_property_present(pdev->dev.of_node, "ephy-digital")) ++ rt_sysc_m32(0xf << 17, 0xf << 17, SYSC_REG_AGPIO_CFG); ++ ++ return ret; + } + + static const struct of_device_id mt76x8_pinctrl_match[] = { From 7a916c75e8f5625f76fd22d41622333b0524b4b8 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Wed, 29 Jan 2025 23:37:34 +0100 Subject: [PATCH 13/15] x86: Add kmod-drm-i915 as default package Add kmod-drm-i915 to the default packages. It was build into the kernel before and is now build as a kernel module. Fixes: 77cfe8fd15d3 ("x86: make i915 as a kmod with required firmware") Link: https://github.com/openwrt/openwrt/pull/17781 Signed-off-by: Robert Marko (cherry picked from commit 8390599c9a29dbb0019447df9086cb8667bfd3d7) Link: https://github.com/openwrt/openwrt/pull/17792 Signed-off-by: Hauke Mehrtens --- target/linux/x86/image/64.mk | 2 +- target/linux/x86/image/generic.mk | 3 ++- target/linux/x86/image/legacy.mk | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/target/linux/x86/image/64.mk b/target/linux/x86/image/64.mk index 7bc79006d3..88c0248b58 100644 --- a/target/linux/x86/image/64.mk +++ b/target/linux/x86/image/64.mk @@ -4,7 +4,7 @@ define Device/generic DEVICE_PACKAGES += \ kmod-amazon-ena kmod-amd-xgbe kmod-bnx2 kmod-dwmac-intel kmod-e1000e kmod-e1000 \ kmod-forcedeth kmod-fs-vfat kmod-igb kmod-igc kmod-ixgbe kmod-r8169 \ - kmod-tg3 + kmod-tg3 kmod-drm-i915 GRUB2_VARIANT := generic endef TARGET_DEVICES += generic diff --git a/target/linux/x86/image/generic.mk b/target/linux/x86/image/generic.mk index e9545fbf31..f8dd15ed36 100644 --- a/target/linux/x86/image/generic.mk +++ b/target/linux/x86/image/generic.mk @@ -3,7 +3,8 @@ define Device/generic DEVICE_MODEL := x86 DEVICE_PACKAGES += kmod-3c59x kmod-8139too kmod-e100 kmod-e1000 kmod-natsemi \ kmod-ne2k-pci kmod-pcnet32 kmod-r8169 kmod-sis900 kmod-tg3 \ - kmod-via-rhine kmod-via-velocity kmod-forcedeth kmod-fs-vfat + kmod-via-rhine kmod-via-velocity kmod-forcedeth kmod-fs-vfat \ + kmod-drm-i915 GRUB2_VARIANT := generic endef TARGET_DEVICES += generic diff --git a/target/linux/x86/image/legacy.mk b/target/linux/x86/image/legacy.mk index 6c0d8e78f9..cf65a542f0 100644 --- a/target/linux/x86/image/legacy.mk +++ b/target/linux/x86/image/legacy.mk @@ -3,7 +3,8 @@ define Device/generic DEVICE_MODEL := x86/legacy DEVICE_PACKAGES += kmod-3c59x kmod-8139too kmod-e100 kmod-e1000 \ kmod-natsemi kmod-ne2k-pci kmod-pcnet32 kmod-r8169 kmod-sis900 \ - kmod-tg3 kmod-via-rhine kmod-via-velocity kmod-forcedeth + kmod-tg3 kmod-via-rhine kmod-via-velocity kmod-forcedeth \ + kmod-drm-i915 GRUB2_VARIANT := legacy endef TARGET_DEVICES += generic From 81db3077483388ec8fa7be441e34756438678f78 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Thu, 30 Jan 2025 05:49:43 +0000 Subject: [PATCH 14/15] generic: net: phy: realtek: work-around hang on SerDes setup On some but not all devices using the RTL8221B 2.5GBit/s PHY the SerDes setup sequence may hang under some circumstances (eg. <2500M link partner present during boot). RTL8221B-VB-CG 2.5Gbps PHY (C45) mdio-bus:01: rtl822xb_config_init failed: -110 Work-around the issue by performing a hardware reset and subsequent retry of the SerDes setup, which seems to always succeed. Doing this requires moving ALDPS setup to config_init (which is anyway the better place for that) as it otherwise doesn't survive the reset. Also disable listening on MDIO address 0 which may be used by other PHYs despite being spec'ed as "broadcast address", as bus activity on address 0 may otherwise confuse the RealTek PHY for good reasons. Tested-by: Luis Mita Signed-off-by: Daniel Golle (cherry picked from commit c87a767801ef375feadb0a5c41d5a674ad3a7d2c) Link: https://github.com/openwrt/openwrt/pull/17790 Signed-off-by: Hauke Mehrtens --- ...ealtek-introduce-rtl822x_aldps_probe.patch | 104 ------------------ .../720-04-net-phy-realtek-setup-aldps.patch | 42 +++++++ ...tek-detect-early-version-of-RTL8221B.patch | 2 +- ...ealtek-support-interrupt-of-RTL8221B.patch | 18 +-- ...ealtek-mark-existing-MMDs-as-present.patch | 2 +- ...hy-realtek-work-around-broken-serdes.patch | 58 ++++++++++ ...t-phy-realtek-disable-MDIO-broadcast.patch | 27 +++++ 7 files changed, 138 insertions(+), 115 deletions(-) delete mode 100644 target/linux/generic/pending-6.6/720-04-net-phy-realtek-introduce-rtl822x_aldps_probe.patch create mode 100644 target/linux/generic/pending-6.6/720-04-net-phy-realtek-setup-aldps.patch create mode 100644 target/linux/generic/pending-6.6/720-08-net-phy-realtek-work-around-broken-serdes.patch create mode 100644 target/linux/generic/pending-6.6/720-09-net-phy-realtek-disable-MDIO-broadcast.patch diff --git a/target/linux/generic/pending-6.6/720-04-net-phy-realtek-introduce-rtl822x_aldps_probe.patch b/target/linux/generic/pending-6.6/720-04-net-phy-realtek-introduce-rtl822x_aldps_probe.patch deleted file mode 100644 index 6610af12c3..0000000000 --- a/target/linux/generic/pending-6.6/720-04-net-phy-realtek-introduce-rtl822x_aldps_probe.patch +++ /dev/null @@ -1,104 +0,0 @@ -From 9155098547fb1172d4fa536f3f6bc9d42f59d08c Mon Sep 17 00:00:00 2001 -From: Daniel Golle -Date: Sat, 22 Apr 2023 03:26:01 +0100 -Subject: [PATCH] net: phy: realtek: setup ALDPS on RTL822x - -Setup Link Down Power Saving Mode according the DTS property -just like for RTL821x 1GE PHYs. - -Signed-off-by: Daniel Golle ---- - drivers/net/phy/realtek/realtek_main.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - ---- a/drivers/net/phy/realtek/realtek_main.c -+++ b/drivers/net/phy/realtek/realtek_main.c -@@ -82,6 +82,10 @@ - - #define RTL822X_VND2_GANLPAR 0xa414 - -+#define RTL8221B_PHYCR1 0xa430 -+#define RTL8221B_PHYCR1_ALDPS_EN BIT(2) -+#define RTL8221B_PHYCR1_ALDPS_XTAL_OFF_EN BIT(12) -+ - #define RTL8366RB_POWER_SAVE 0x15 - #define RTL8366RB_POWER_SAVE_ON BIT(12) - -@@ -1207,6 +1211,25 @@ static int rtl8251b_c45_match_phy_device - return rtlgen_is_c45_match(phydev, RTL_8251B, true); - } - -+static int rtl822x_aldps_probe(struct phy_device *phydev) -+{ -+ struct device *dev = &phydev->mdio.dev; -+ int val; -+ -+ val = phy_read_mmd(phydev, MDIO_MMD_VEND1, RTL8221B_PHYCR1); -+ if (val < 0) -+ return val; -+ -+ if (of_property_read_bool(dev->of_node, "realtek,aldps-enable")) -+ val |= RTL8221B_PHYCR1_ALDPS_EN | RTL8221B_PHYCR1_ALDPS_XTAL_OFF_EN; -+ else -+ val &= ~(RTL8221B_PHYCR1_ALDPS_EN | RTL8221B_PHYCR1_ALDPS_XTAL_OFF_EN); -+ -+ phy_write_mmd(phydev, MDIO_MMD_VEND1, RTL8221B_PHYCR1, val); -+ -+ return rtl822x_probe(phydev); -+} -+ - static int rtlgen_resume(struct phy_device *phydev) - { - int ret = genphy_resume(phydev); -@@ -1478,6 +1501,7 @@ static struct phy_driver realtek_drvs[] - }, { - PHY_ID_MATCH_EXACT(0x001cc838), - .name = "RTL8226-CG 2.5Gbps PHY", -+ .probe = rtl822x_aldps_probe, - .soft_reset = genphy_soft_reset, - .get_features = rtl822x_get_features, - .config_aneg = rtl822x_config_aneg, -@@ -1489,6 +1513,7 @@ static struct phy_driver realtek_drvs[] - }, { - PHY_ID_MATCH_EXACT(0x001cc848), - .name = "RTL8226B-CG_RTL8221B-CG 2.5Gbps PHY", -+ .probe = rtl822x_aldps_probe, - .soft_reset = genphy_soft_reset, - .get_features = rtl822x_get_features, - .config_aneg = rtl822x_config_aneg, -@@ -1503,7 +1528,7 @@ static struct phy_driver realtek_drvs[] - .match_phy_device = rtl8221b_vb_cg_c22_match_phy_device, - .name = "RTL8221B-VB-CG 2.5Gbps PHY (C22)", - .soft_reset = genphy_soft_reset, -- .probe = rtl822x_probe, -+ .probe = rtl822x_aldps_probe, - .get_features = rtl822x_get_features, - .config_aneg = rtl822x_config_aneg, - .config_init = rtl822xb_config_init, -@@ -1517,7 +1542,7 @@ static struct phy_driver realtek_drvs[] - .match_phy_device = rtl8221b_vb_cg_c45_match_phy_device, - .name = "RTL8221B-VB-CG 2.5Gbps PHY (C45)", - .soft_reset = genphy_soft_reset, -- .probe = rtl822x_probe, -+ .probe = rtl822x_aldps_probe, - .config_init = rtl822xb_config_init, - .get_rate_matching = rtl822xb_get_rate_matching, - .get_features = rtl822x_c45_get_features, -@@ -1529,7 +1554,7 @@ static struct phy_driver realtek_drvs[] - .match_phy_device = rtl8221b_vn_cg_c22_match_phy_device, - .name = "RTL8221B-VM-CG 2.5Gbps PHY (C22)", - .soft_reset = genphy_soft_reset, -- .probe = rtl822x_probe, -+ .probe = rtl822x_aldps_probe, - .get_features = rtl822x_get_features, - .config_aneg = rtl822x_config_aneg, - .config_init = rtl822xb_config_init, -@@ -1543,7 +1568,7 @@ static struct phy_driver realtek_drvs[] - .match_phy_device = rtl8221b_vn_cg_c45_match_phy_device, - .name = "RTL8221B-VN-CG 2.5Gbps PHY (C45)", - .soft_reset = genphy_soft_reset, -- .probe = rtl822x_probe, -+ .probe = rtl822x_aldps_probe, - .config_init = rtl822xb_config_init, - .get_rate_matching = rtl822xb_get_rate_matching, - .get_features = rtl822x_c45_get_features, diff --git a/target/linux/generic/pending-6.6/720-04-net-phy-realtek-setup-aldps.patch b/target/linux/generic/pending-6.6/720-04-net-phy-realtek-setup-aldps.patch new file mode 100644 index 0000000000..23b3ca893a --- /dev/null +++ b/target/linux/generic/pending-6.6/720-04-net-phy-realtek-setup-aldps.patch @@ -0,0 +1,42 @@ +From 9155098547fb1172d4fa536f3f6bc9d42f59d08c Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Sat, 22 Apr 2023 03:26:01 +0100 +Subject: [PATCH] net: phy: realtek: setup ALDPS on RTL822x + +Setup Link Down Power Saving Mode according the DTS property +just like for RTL821x 1GE PHYs. + +Signed-off-by: Daniel Golle +--- + drivers/net/phy/realtek/realtek_main.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +--- a/drivers/net/phy/realtek/realtek_main.c ++++ b/drivers/net/phy/realtek/realtek_main.c +@@ -82,6 +82,10 @@ + + #define RTL822X_VND2_GANLPAR 0xa414 + ++#define RTL8221B_PHYCR1 0xa430 ++#define RTL8221B_PHYCR1_ALDPS_EN BIT(2) ++#define RTL8221B_PHYCR1_ALDPS_XTAL_OFF_EN BIT(12) ++ + #define RTL8366RB_POWER_SAVE 0x15 + #define RTL8366RB_POWER_SAVE_ON BIT(12) + +@@ -889,6 +893,15 @@ static int rtl822xb_config_init(struct p + if (ret < 0) + return ret; + ++ if (of_property_read_bool(phydev->mdio.dev.of_node, "realtek,aldps-enable")) ++ ret = phy_set_bits_mmd(phydev, MDIO_MMD_VEND1, RTL8221B_PHYCR1, ++ RTL8221B_PHYCR1_ALDPS_EN | RTL8221B_PHYCR1_ALDPS_XTAL_OFF_EN); ++ else ++ ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1, RTL8221B_PHYCR1, ++ RTL8221B_PHYCR1_ALDPS_EN | RTL8221B_PHYCR1_ALDPS_XTAL_OFF_EN); ++ if (ret < 0) ++ return ret; ++ + /* Disable SGMII AN */ + ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x7588, 0x2); + if (ret < 0) diff --git a/target/linux/generic/pending-6.6/720-05-net-phy-realtek-detect-early-version-of-RTL8221B.patch b/target/linux/generic/pending-6.6/720-05-net-phy-realtek-detect-early-version-of-RTL8221B.patch index 22c271c3eb..d7fbf3a2a6 100644 --- a/target/linux/generic/pending-6.6/720-05-net-phy-realtek-detect-early-version-of-RTL8221B.patch +++ b/target/linux/generic/pending-6.6/720-05-net-phy-realtek-detect-early-version-of-RTL8221B.patch @@ -14,7 +14,7 @@ Signed-off-by: Daniel Golle Signed-off-by: Mieczyslaw Nalewaj --- a/drivers/net/phy/realtek/realtek_main.c +++ b/drivers/net/phy/realtek/realtek_main.c -@@ -1157,10 +1157,32 @@ static int rtl8226_match_phy_device(stru +@@ -1166,10 +1166,32 @@ static int rtl8226_match_phy_device(stru static int rtlgen_is_c45_match(struct phy_device *phydev, unsigned int id, bool is_c45) { diff --git a/target/linux/generic/pending-6.6/720-06-net-phy-realtek-support-interrupt-of-RTL8221B.patch b/target/linux/generic/pending-6.6/720-06-net-phy-realtek-support-interrupt-of-RTL8221B.patch index 3e9b34b8a5..45ca5413f3 100644 --- a/target/linux/generic/pending-6.6/720-06-net-phy-realtek-support-interrupt-of-RTL8221B.patch +++ b/target/linux/generic/pending-6.6/720-06-net-phy-realtek-support-interrupt-of-RTL8221B.patch @@ -12,7 +12,7 @@ Signed-off-by: Jianhui Zhao --- a/drivers/net/phy/realtek/realtek_main.c +++ b/drivers/net/phy/realtek/realtek_main.c -@@ -1387,6 +1387,51 @@ static irqreturn_t rtl9000a_handle_inter +@@ -1377,6 +1377,51 @@ static irqreturn_t rtl9000a_handle_inter return IRQ_HANDLED; } @@ -64,39 +64,39 @@ Signed-off-by: Jianhui Zhao static struct phy_driver realtek_drvs[] = { { PHY_ID_MATCH_EXACT(0x00008201), -@@ -1549,6 +1594,8 @@ static struct phy_driver realtek_drvs[] +@@ -1537,6 +1582,8 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vb_cg_c22_match_phy_device, .name = "RTL8221B-VB-CG 2.5Gbps PHY (C22)", + .config_intr = rtl8221b_config_intr, + .handle_interrupt = rtl8221b_handle_interrupt, .soft_reset = genphy_soft_reset, - .probe = rtl822x_aldps_probe, + .probe = rtl822x_probe, .get_features = rtl822x_get_features, -@@ -1563,6 +1610,8 @@ static struct phy_driver realtek_drvs[] +@@ -1551,6 +1598,8 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vb_cg_c45_match_phy_device, .name = "RTL8221B-VB-CG 2.5Gbps PHY (C45)", + .config_intr = rtl8221b_config_intr, + .handle_interrupt = rtl8221b_handle_interrupt, .soft_reset = genphy_soft_reset, - .probe = rtl822x_aldps_probe, + .probe = rtl822x_probe, .config_init = rtl822xb_config_init, -@@ -1575,6 +1624,8 @@ static struct phy_driver realtek_drvs[] +@@ -1563,6 +1612,8 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vn_cg_c22_match_phy_device, .name = "RTL8221B-VM-CG 2.5Gbps PHY (C22)", + .config_intr = rtl8221b_config_intr, + .handle_interrupt = rtl8221b_handle_interrupt, .soft_reset = genphy_soft_reset, - .probe = rtl822x_aldps_probe, + .probe = rtl822x_probe, .get_features = rtl822x_get_features, -@@ -1589,6 +1640,8 @@ static struct phy_driver realtek_drvs[] +@@ -1577,6 +1628,8 @@ static struct phy_driver realtek_drvs[] }, { .match_phy_device = rtl8221b_vn_cg_c45_match_phy_device, .name = "RTL8221B-VN-CG 2.5Gbps PHY (C45)", + .config_intr = rtl8221b_config_intr, + .handle_interrupt = rtl8221b_handle_interrupt, .soft_reset = genphy_soft_reset, - .probe = rtl822x_aldps_probe, + .probe = rtl822x_probe, .config_init = rtl822xb_config_init, diff --git a/target/linux/generic/pending-6.6/720-07-net-phy-realtek-mark-existing-MMDs-as-present.patch b/target/linux/generic/pending-6.6/720-07-net-phy-realtek-mark-existing-MMDs-as-present.patch index 1ef42e866d..555e5905d3 100644 --- a/target/linux/generic/pending-6.6/720-07-net-phy-realtek-mark-existing-MMDs-as-present.patch +++ b/target/linux/generic/pending-6.6/720-07-net-phy-realtek-mark-existing-MMDs-as-present.patch @@ -15,7 +15,7 @@ Signed-off-by: Daniel Golle --- a/drivers/net/phy/realtek/realtek_main.c +++ b/drivers/net/phy/realtek/realtek_main.c -@@ -1034,6 +1034,9 @@ static int rtl822x_c45_get_features(stru +@@ -1043,6 +1043,9 @@ static int rtl822x_c45_get_features(stru linkmode_set_bit(ETHTOOL_LINK_MODE_TP_BIT, phydev->supported); diff --git a/target/linux/generic/pending-6.6/720-08-net-phy-realtek-work-around-broken-serdes.patch b/target/linux/generic/pending-6.6/720-08-net-phy-realtek-work-around-broken-serdes.patch new file mode 100644 index 0000000000..e356a0a6ee --- /dev/null +++ b/target/linux/generic/pending-6.6/720-08-net-phy-realtek-work-around-broken-serdes.patch @@ -0,0 +1,58 @@ +From: Daniel Golle +Date: Thu, 30 Jan 2025 05:33:12 +0000 +Subject: [PATCH] net: phy: realtek: work around broken SerDes + +For still unknown reasons the SerDes init sequence may sometimes +time out because a self-clearing bit never clears, indicating the +PHY has entered an unrecoverable error state. + +Work-around the issue by triggering a hardware reset and retry the +setup sequence while warning the user that this has happened. +This is really more of a work-around than a fix, and should be +replaced by a better actual fix in future (hopefully). + +Signed-off-by: Daniel Golle +--- +--- a/drivers/net/phy/realtek/realtek_main.c ++++ b/drivers/net/phy/realtek/realtek_main.c +@@ -923,6 +923,22 @@ static int rtl822xb_config_init(struct p + return 0; + } + ++static int rtl822xb_config_init_war(struct phy_device *phydev) ++{ ++ int ret; ++ ++ ret = rtl822xb_config_init(phydev); ++ ++ if (ret == -ETIMEDOUT) { ++ phydev_warn(phydev, "SerDes setup timed out, retrying\n"); ++ phy_device_reset(phydev, 1); ++ phy_device_reset(phydev, 0); ++ ret = rtl822xb_config_init(phydev); ++ } ++ ++ return ret; ++} ++ + static int rtl822xb_get_rate_matching(struct phy_device *phydev, + phy_interface_t iface) + { +@@ -1605,7 +1621,7 @@ static struct phy_driver realtek_drvs[] + .handle_interrupt = rtl8221b_handle_interrupt, + .soft_reset = genphy_soft_reset, + .probe = rtl822x_probe, +- .config_init = rtl822xb_config_init, ++ .config_init = rtl822xb_config_init_war, + .get_rate_matching = rtl822xb_get_rate_matching, + .get_features = rtl822x_c45_get_features, + .config_aneg = rtl822x_c45_config_aneg, +@@ -1635,7 +1651,7 @@ static struct phy_driver realtek_drvs[] + .handle_interrupt = rtl8221b_handle_interrupt, + .soft_reset = genphy_soft_reset, + .probe = rtl822x_probe, +- .config_init = rtl822xb_config_init, ++ .config_init = rtl822xb_config_init_war, + .get_rate_matching = rtl822xb_get_rate_matching, + .get_features = rtl822x_c45_get_features, + .config_aneg = rtl822x_c45_config_aneg, diff --git a/target/linux/generic/pending-6.6/720-09-net-phy-realtek-disable-MDIO-broadcast.patch b/target/linux/generic/pending-6.6/720-09-net-phy-realtek-disable-MDIO-broadcast.patch new file mode 100644 index 0000000000..b2d26a8780 --- /dev/null +++ b/target/linux/generic/pending-6.6/720-09-net-phy-realtek-disable-MDIO-broadcast.patch @@ -0,0 +1,27 @@ +From: Daniel Golle +Date: Thu, 30 Jan 2025 05:38:31 +0000 +Subject: [PATCH] net: phy: realtek: disable MDIO broadcast + +RealTek's PHYs by default also listen on MDIO address 0 which is defined +as broadcast address. This can lead to problems if there is an actual PHY +(such as MT7981 built-in PHY) present at this address, as accessing that +PHY may then confuse the RealTek PHY. + +Disabled listening on the MDIO broadcast address to avoid such problems. + +Signed-off-by: Daniel Golle +--- +--- a/drivers/net/phy/realtek/realtek_main.c ++++ b/drivers/net/phy/realtek/realtek_main.c +@@ -849,6 +849,11 @@ static int rtl822xb_config_init(struct p + phydev->host_interfaces) || + phydev->interface == PHY_INTERFACE_MODE_SGMII; + ++ /* disable listening on MDIO broadcast address (0) */ ++ ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, 0xa430, BIT(13)); ++ if (ret < 0) ++ return ret; ++ + /* fill in possible interfaces */ + __assign_bit(PHY_INTERFACE_MODE_2500BASEX, phydev->possible_interfaces, + has_2500); From c1d5de0c59efd25ecb5922cb11e5d38b072cf993 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sat, 1 Feb 2025 05:03:50 +0000 Subject: [PATCH 15/15] mediatek: mt7622: fix SATA on BPi-R64 Two commits which made their way into Linux stable broke the SATA support on the BPi-R64. Fix this by reverting a node rename which broke DT-overlay application and import a (still pending) patch re-adding the 'syscon' compatible to the pciesys clock-controller which also contains phy-mode bits referenced by the ahci_mtk driver expecting to access them using syscon_regmap_lookup_by_phandle(). Signed-off-by: Daniel Golle (cherry picked from commit 69890e16b37d59b55ba64633522c727f957cb2fd) --- ...m64-dts-mediatek-fix-t-phy-unit-name.patch | 33 +++++++++++++++++++ ...ek-mt7622-readd-syscon-to-pciesys-no.patch | 33 +++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 target/linux/mediatek/patches-6.6/115-Revert-arm64-dts-mediatek-fix-t-phy-unit-name.patch create mode 100644 target/linux/mediatek/patches-6.6/116-arm64-dts-mediatek-mt7622-readd-syscon-to-pciesys-no.patch diff --git a/target/linux/mediatek/patches-6.6/115-Revert-arm64-dts-mediatek-fix-t-phy-unit-name.patch b/target/linux/mediatek/patches-6.6/115-Revert-arm64-dts-mediatek-fix-t-phy-unit-name.patch new file mode 100644 index 0000000000..1d53cefd7f --- /dev/null +++ b/target/linux/mediatek/patches-6.6/115-Revert-arm64-dts-mediatek-fix-t-phy-unit-name.patch @@ -0,0 +1,33 @@ +From 4c4baed29b168e9bf39545a945a9523ea280cb44 Mon Sep 17 00:00:00 2001 +From: Daniel Golle +Date: Sat, 1 Feb 2025 04:24:17 +0000 +Subject: [PATCH 1/2] Revert "arm64: dts: mediatek: fix t-phy unit name" + +This reverts commit 963c3b0c47ec29b4c49c9f45965cd066f419d17f. +--- + arch/arm64/boot/dts/mediatek/mt7622.dtsi | 2 +- + arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi +@@ -908,7 +908,7 @@ + status = "disabled"; + }; + +- sata_phy: t-phy { ++ sata_phy: t-phy@1a243000 { + compatible = "mediatek,mt7622-tphy", + "mediatek,generic-tphy-v1"; + #address-cells = <2>; +--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +@@ -428,7 +428,7 @@ + }; + }; + +- pcie_phy: t-phy { ++ pcie_phy: t-phy@11c00000 { + compatible = "mediatek,mt7986-tphy", + "mediatek,generic-tphy-v2"; + ranges; diff --git a/target/linux/mediatek/patches-6.6/116-arm64-dts-mediatek-mt7622-readd-syscon-to-pciesys-no.patch b/target/linux/mediatek/patches-6.6/116-arm64-dts-mediatek-mt7622-readd-syscon-to-pciesys-no.patch new file mode 100644 index 0000000000..4ae72fd70a --- /dev/null +++ b/target/linux/mediatek/patches-6.6/116-arm64-dts-mediatek-mt7622-readd-syscon-to-pciesys-no.patch @@ -0,0 +1,33 @@ +From 98bc223d174c7f544e8f6c4f0caa8fa144f2f4dc Mon Sep 17 00:00:00 2001 +From: Christian Marangi +Date: Fri, 28 Jun 2024 12:55:40 +0200 +Subject: [PATCH 2/2] arm64: dts: mediatek: mt7622: readd syscon to pciesys + node + +Sata node reference the pciesys with the property mediatek,phy-node +and that is used as a syscon to access the pciesys regs. + +Readd the syscon compatible to pciesys node to restore correct +functionality of the SATA interface. + +Fixes: 3ba5a6159434 ("arm64: dts: mediatek: mt7622: fix clock controllers") +Reported-by: Frank Wunderlich +Co-developed-by: Frank Wunderlich +Signed-off-by: Frank Wunderlich +Signed-off-by: Christian Marangi +Cc: stable@vger.kernel.org +--- + arch/arm64/boot/dts/mediatek/mt7622.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/arm64/boot/dts/mediatek/mt7622.dtsi ++++ b/arch/arm64/boot/dts/mediatek/mt7622.dtsi +@@ -798,7 +798,7 @@ + }; + + pciesys: clock-controller@1a100800 { +- compatible = "mediatek,mt7622-pciesys"; ++ compatible = "mediatek,mt7622-pciesys", "syscon"; + reg = <0 0x1a100800 0 0x1000>; + #clock-cells = <1>; + #reset-cells = <1>;