From 97550efd03a69a69f8122c2adcf588ee805cbbaa Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Tue, 27 Feb 2024 18:59:49 +0800 Subject: [PATCH] rockchip: backport mmc fixes from newer kernel Refreshed patches while at it. Signed-off-by: Tianling Shen --- ...-use-3.0-clock-when-operating-in-2.0.patch | 2 +- ...ckchip-Refactor-IOMMU-initialisation.patch | 2 +- ...enable-host-V4-support-for-BlueField.patch | 32 +++++++++++++++++++ ...Update-DLL-and-pre-change-delay-for.patch} | 0 ...add-the-missing-device-table-IDs-for.patch | 27 ++++++++++++++++ ...shc-properly-determine-max-clock-on.patch} | 0 ...-initial-signal-voltage-on-power-off.patch | 2 +- ...-r8169-add-LED-configuration-from-OF.patch | 6 ++-- ...69-add-devname-configuration-from-OF.patch | 4 +-- ...ac-add-devname-configuration-from-OF.patch | 4 +-- ...dts-rockchip-add-rng-node-for-rk3399.patch | 2 +- .../993-rockchip-rk3566-unlock-2.0-GHz.patch | 16 ++++++++++ .../993-rockchip-rk356x-unlock-2.0-GHz.patch | 14 -------- 13 files changed, 86 insertions(+), 25 deletions(-) create mode 100644 target/linux/rockchip/patches-5.15/025-02-v6.3-mmc-sdhci-of-dwcmshc-enable-host-V4-support-for-BlueField.patch rename target/linux/rockchip/patches-5.15/{025-02-v6.3-mmc-sdhci-of-dwcmshc-Update-DLL-and-pre-change-delay-for.patch => 025-03-v6.3-mmc-sdhci-of-dwcmshc-Update-DLL-and-pre-change-delay-for.patch} (100%) create mode 100644 target/linux/rockchip/patches-5.15/025-04-v6.3-mmc-sdhci-of-dwcmshc-add-the-missing-device-table-IDs-for.patch rename target/linux/rockchip/patches-5.15/{025-03-v6.4-mmc-sdhci-of-dwcmshc-properly-determine-max-clock-on.patch => 025-05-v6.4-mmc-sdhci-of-dwcmshc-properly-determine-max-clock-on.patch} (100%) create mode 100644 target/linux/rockchip/patches-5.15/993-rockchip-rk3566-unlock-2.0-GHz.patch delete mode 100644 target/linux/rockchip/patches-5.15/993-rockchip-rk356x-unlock-2.0-GHz.patch diff --git a/target/linux/rockchip/patches-5.15/008-0017-v5.18-usb-dwc3-core-do-not-use-3.0-clock-when-operating-in-2.0.patch b/target/linux/rockchip/patches-5.15/008-0017-v5.18-usb-dwc3-core-do-not-use-3.0-clock-when-operating-in-2.0.patch index 2c6cbb16fa..66b9a33e14 100644 --- a/target/linux/rockchip/patches-5.15/008-0017-v5.18-usb-dwc3-core-do-not-use-3.0-clock-when-operating-in-2.0.patch +++ b/target/linux/rockchip/patches-5.15/008-0017-v5.18-usb-dwc3-core-do-not-use-3.0-clock-when-operating-in-2.0.patch @@ -22,7 +22,7 @@ Signed-off-by: Greg Kroah-Hartman --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c -@@ -1127,6 +1127,11 @@ static int dwc3_core_init(struct dwc3 *d +@@ -1090,6 +1090,11 @@ static int dwc3_core_init(struct dwc3 *d if (dwc->parkmode_disable_ss_quirk) reg |= DWC3_GUCTL1_PARKMODE_DISABLE_SS; diff --git a/target/linux/rockchip/patches-5.15/008-0027-v5.19-drm-rockchip-Refactor-IOMMU-initialisation.patch b/target/linux/rockchip/patches-5.15/008-0027-v5.19-drm-rockchip-Refactor-IOMMU-initialisation.patch index e0cccd2a19..6a3668ae43 100644 --- a/target/linux/rockchip/patches-5.15/008-0027-v5.19-drm-rockchip-Refactor-IOMMU-initialisation.patch +++ b/target/linux/rockchip/patches-5.15/008-0027-v5.19-drm-rockchip-Refactor-IOMMU-initialisation.patch @@ -192,7 +192,7 @@ Link: https://patchwork.freedesktop.org/patch/msgid/94eee7ab434fe11eb0787f691e9f int rockchip_drm_endpoint_is_subdriver(struct device_node *ep); --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -2181,6 +2181,8 @@ static int vop_bind(struct device *dev, +@@ -2189,6 +2189,8 @@ static int vop_bind(struct device *dev, } } diff --git a/target/linux/rockchip/patches-5.15/025-02-v6.3-mmc-sdhci-of-dwcmshc-enable-host-V4-support-for-BlueField.patch b/target/linux/rockchip/patches-5.15/025-02-v6.3-mmc-sdhci-of-dwcmshc-enable-host-V4-support-for-BlueField.patch new file mode 100644 index 0000000000..6a92a66433 --- /dev/null +++ b/target/linux/rockchip/patches-5.15/025-02-v6.3-mmc-sdhci-of-dwcmshc-enable-host-V4-support-for-BlueField.patch @@ -0,0 +1,32 @@ +From 95921151e04335e9e2ddf4f294405e64be4ea947 Mon Sep 17 00:00:00 2001 +From: Liming Sun +Date: Wed, 11 Jan 2023 13:14:58 -0500 +Subject: [PATCH] mmc: sdhci-of-dwcmshc: enable host V4 support for BlueField-3 + SoC + +This commit enables SDHCI Host V4 support on Bluefield-3 SoC to be +consistent with the default setting in firmware(UEFI). + +Reviewed-by: David Woods +Signed-off-by: Liming Sun +Acked-by: Adrian Hunter +Link: https://lore.kernel.org/r/990885f566c32ac8e6888ad6b434fb70d1a5d7af.1673460632.git.limings@nvidia.com +Signed-off-by: Ulf Hansson +--- + drivers/mmc/host/sdhci-of-dwcmshc.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/mmc/host/sdhci-of-dwcmshc.c ++++ b/drivers/mmc/host/sdhci-of-dwcmshc.c +@@ -528,6 +528,11 @@ static int dwcmshc_probe(struct platform + goto err_clk; + } + ++#ifdef CONFIG_ACPI ++ if (pltfm_data == &sdhci_dwcmshc_bf3_pdata) ++ sdhci_enable_v4_mode(host); ++#endif ++ + host->mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; + + err = sdhci_setup_host(host); diff --git a/target/linux/rockchip/patches-5.15/025-02-v6.3-mmc-sdhci-of-dwcmshc-Update-DLL-and-pre-change-delay-for.patch b/target/linux/rockchip/patches-5.15/025-03-v6.3-mmc-sdhci-of-dwcmshc-Update-DLL-and-pre-change-delay-for.patch similarity index 100% rename from target/linux/rockchip/patches-5.15/025-02-v6.3-mmc-sdhci-of-dwcmshc-Update-DLL-and-pre-change-delay-for.patch rename to target/linux/rockchip/patches-5.15/025-03-v6.3-mmc-sdhci-of-dwcmshc-Update-DLL-and-pre-change-delay-for.patch diff --git a/target/linux/rockchip/patches-5.15/025-04-v6.3-mmc-sdhci-of-dwcmshc-add-the-missing-device-table-IDs-for.patch b/target/linux/rockchip/patches-5.15/025-04-v6.3-mmc-sdhci-of-dwcmshc-add-the-missing-device-table-IDs-for.patch new file mode 100644 index 0000000000..06d5ba9204 --- /dev/null +++ b/target/linux/rockchip/patches-5.15/025-04-v6.3-mmc-sdhci-of-dwcmshc-add-the-missing-device-table-IDs-for.patch @@ -0,0 +1,27 @@ +From cfd4ea4815d16f7426723a5cb80ee5db811ea1f2 Mon Sep 17 00:00:00 2001 +From: Liming Sun +Date: Thu, 2 Feb 2023 10:29:15 -0500 +Subject: [PATCH] mmc: sdhci-of-dwcmshc: add the missing device table IDs for + acpi + +This commit adds the missing MODULE_DEVICE_TABLE for acpi, or else +it won't be loaded automatically when compiled as a kernel module. + +Reviewed-by: David Thompson +Signed-off-by: Liming Sun +Link: https://lore.kernel.org/r/f57ad0f8fdf663465bca74467c344dfa305a3199.1675305696.git.limings@nvidia.com +Signed-off-by: Ulf Hansson +--- + drivers/mmc/host/sdhci-of-dwcmshc.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/mmc/host/sdhci-of-dwcmshc.c ++++ b/drivers/mmc/host/sdhci-of-dwcmshc.c +@@ -451,6 +451,7 @@ static const struct acpi_device_id sdhci + }, + {} + }; ++MODULE_DEVICE_TABLE(acpi, sdhci_dwcmshc_acpi_ids); + #endif + + static int dwcmshc_probe(struct platform_device *pdev) diff --git a/target/linux/rockchip/patches-5.15/025-03-v6.4-mmc-sdhci-of-dwcmshc-properly-determine-max-clock-on.patch b/target/linux/rockchip/patches-5.15/025-05-v6.4-mmc-sdhci-of-dwcmshc-properly-determine-max-clock-on.patch similarity index 100% rename from target/linux/rockchip/patches-5.15/025-03-v6.4-mmc-sdhci-of-dwcmshc-properly-determine-max-clock-on.patch rename to target/linux/rockchip/patches-5.15/025-05-v6.4-mmc-sdhci-of-dwcmshc-properly-determine-max-clock-on.patch diff --git a/target/linux/rockchip/patches-5.15/107-mmc-core-set-initial-signal-voltage-on-power-off.patch b/target/linux/rockchip/patches-5.15/107-mmc-core-set-initial-signal-voltage-on-power-off.patch index 136afaf881..aac8b7a6de 100644 --- a/target/linux/rockchip/patches-5.15/107-mmc-core-set-initial-signal-voltage-on-power-off.patch +++ b/target/linux/rockchip/patches-5.15/107-mmc-core-set-initial-signal-voltage-on-power-off.patch @@ -24,7 +24,7 @@ Signed-off-by: Jonas Karlman --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c -@@ -1364,6 +1364,8 @@ void mmc_power_off(struct mmc_host *host +@@ -1369,6 +1369,8 @@ void mmc_power_off(struct mmc_host *host mmc_pwrseq_power_off(host); diff --git a/target/linux/rockchip/patches-5.15/600-net-ethernet-r8169-add-LED-configuration-from-OF.patch b/target/linux/rockchip/patches-5.15/600-net-ethernet-r8169-add-LED-configuration-from-OF.patch index b48a40970f..d4d78ab4fc 100644 --- a/target/linux/rockchip/patches-5.15/600-net-ethernet-r8169-add-LED-configuration-from-OF.patch +++ b/target/linux/rockchip/patches-5.15/600-net-ethernet-r8169-add-LED-configuration-from-OF.patch @@ -16,7 +16,7 @@ TxDescStartAddrLow = 0x20, TxDescStartAddrHigh = 0x24, TxHDescStartAddrLow = 0x28, -@@ -2140,6 +2142,22 @@ void r8169_apply_firmware(struct rtl8169 +@@ -2143,6 +2145,22 @@ void r8169_apply_firmware(struct rtl8169 } } @@ -39,7 +39,7 @@ static void rtl8168_config_eee_mac(struct rtl8169_private *tp) { /* Adjust EEE LED frequency */ -@@ -3247,6 +3265,8 @@ static void rtl_hw_start_8168h_1(struct +@@ -3252,6 +3270,8 @@ static void rtl_hw_start_8168h_1(struct r8168_mac_ocp_write(tp, 0xc094, 0x0000); r8168_mac_ocp_write(tp, 0xc09e, 0x0000); @@ -48,7 +48,7 @@ rtl_hw_aspm_clkreq_enable(tp, true); } -@@ -3699,6 +3719,8 @@ static void rtl_hw_start_8125b(struct rt +@@ -3704,6 +3724,8 @@ static void rtl_hw_start_8125b(struct rt rtl_ephy_init(tp, e_info_8125b); rtl_hw_start_8125_common(tp); diff --git a/target/linux/rockchip/patches-5.15/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch b/target/linux/rockchip/patches-5.15/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch index b7771260fb..3231ad7822 100644 --- a/target/linux/rockchip/patches-5.15/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch +++ b/target/linux/rockchip/patches-5.15/602-net-ethernet-r8169-add-devname-configuration-from-OF.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c -@@ -2142,6 +2142,22 @@ void r8169_apply_firmware(struct rtl8169 +@@ -2145,6 +2145,22 @@ void r8169_apply_firmware(struct rtl8169 } } @@ -23,7 +23,7 @@ static int rtl8169_led_configuration(struct rtl8169_private *tp) { u32 led_data; -@@ -3719,6 +3735,7 @@ static void rtl_hw_start_8125b(struct rt +@@ -3724,6 +3740,7 @@ static void rtl_hw_start_8125b(struct rt rtl_ephy_init(tp, e_info_8125b); rtl_hw_start_8125_common(tp); diff --git a/target/linux/rockchip/patches-5.15/603-net-ethernet-stmmac-add-devname-configuration-from-OF.patch b/target/linux/rockchip/patches-5.15/603-net-ethernet-stmmac-add-devname-configuration-from-OF.patch index e6ce533e64..6582a3863a 100644 --- a/target/linux/rockchip/patches-5.15/603-net-ethernet-stmmac-add-devname-configuration-from-OF.patch +++ b/target/linux/rockchip/patches-5.15/603-net-ethernet-stmmac-add-devname-configuration-from-OF.patch @@ -1,6 +1,6 @@ --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -7149,6 +7149,7 @@ int stmmac_dvr_probe(struct device *devi +@@ -7152,6 +7152,7 @@ int stmmac_dvr_probe(struct device *devi { struct net_device *ndev = NULL; struct stmmac_priv *priv; @@ -8,7 +8,7 @@ u32 rxq; int i, ret = 0; -@@ -7157,6 +7158,9 @@ int stmmac_dvr_probe(struct device *devi +@@ -7160,6 +7161,9 @@ int stmmac_dvr_probe(struct device *devi if (!ndev) return -ENOMEM; diff --git a/target/linux/rockchip/patches-5.15/801-03-arm64-dts-rockchip-add-rng-node-for-rk3399.patch b/target/linux/rockchip/patches-5.15/801-03-arm64-dts-rockchip-add-rng-node-for-rk3399.patch index 13b0338965..2a61f72ca4 100644 --- a/target/linux/rockchip/patches-5.15/801-03-arm64-dts-rockchip-add-rng-node-for-rk3399.patch +++ b/target/linux/rockchip/patches-5.15/801-03-arm64-dts-rockchip-add-rng-node-for-rk3399.patch @@ -13,7 +13,7 @@ Signed-off-by: Lin Jinhan --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -1937,6 +1937,16 @@ +@@ -1939,6 +1939,16 @@ }; }; diff --git a/target/linux/rockchip/patches-5.15/993-rockchip-rk3566-unlock-2.0-GHz.patch b/target/linux/rockchip/patches-5.15/993-rockchip-rk3566-unlock-2.0-GHz.patch new file mode 100644 index 0000000000..2cbdef9372 --- /dev/null +++ b/target/linux/rockchip/patches-5.15/993-rockchip-rk3566-unlock-2.0-GHz.patch @@ -0,0 +1,16 @@ +--- a/arch/arm64/boot/dts/rockchip/rk3566.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3566.dtsi +@@ -6,6 +6,13 @@ + compatible = "rockchip,rk3566"; + }; + ++&cpu0_opp_table { ++ opp-1992000000 { ++ opp-hz = /bits/ 64 <1992000000>; ++ opp-microvolt = <1150000 1150000 1150000>; ++ }; ++}; ++ + &pipegrf { + compatible = "rockchip,rk3566-pipe-grf", "syscon"; + }; diff --git a/target/linux/rockchip/patches-5.15/993-rockchip-rk356x-unlock-2.0-GHz.patch b/target/linux/rockchip/patches-5.15/993-rockchip-rk356x-unlock-2.0-GHz.patch deleted file mode 100644 index 3da2e8610e..0000000000 --- a/target/linux/rockchip/patches-5.15/993-rockchip-rk356x-unlock-2.0-GHz.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- a/arch/arm64/boot/dts/rockchip/rk356x.dtsi -+++ b/arch/arm64/boot/dts/rockchip/rk356x.dtsi -@@ -127,6 +127,11 @@ - opp-hz = /bits/ 64 <1800000000>; - opp-microvolt = <1050000 1050000 1150000>; - }; -+ -+ opp-1992000000 { -+ opp-hz = /bits/ 64 <1992000000>; -+ opp-microvolt = <1150000 1150000 1150000>; -+ }; - }; - - display_subsystem: display-subsystem {