Skip to content
Snippets Groups Projects
Verified Commit 5291dbd5 authored by Josef Schlehofer's avatar Josef Schlehofer
Browse files

patches/openwrt: drop patch to fix kernel not locate root FS on microSD

This patch was necessary only on OpenWrt 19.07, because the kernel
config CONFIG_OF_DMA_DEFAULT_COHERENT was disabled, but it should be
enabled by default [1] [2].

I can see that in OpenWrt 21.02 and newer versions the config is already
enabled, thus patch is no longer needed:

root@turris:/# zcat /proc/config.gz | grep CONFIG_OF_DMA_DEFAULT_COHERENT
CONFIG_OF_DMA_DEFAULT_COHERENT=y

[1] https://elixir.bootlin.com/linux/v5.18.2/source/drivers/of/address.c#L1055
[2] https://elixir.bootlin.com/linux/v5.18.2/source/arch/powerpc/Kconfig#L261
parent 92af77c1
Branches
Tags
1 merge request!569Turris OS 6.0 (HBK)
Pipeline #102764 passed with stage
in 6 minutes and 5 seconds
From dbff59c613d7e5c1025339284e1a54bd787bd1bb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= <karel.koci@nic.cz>
Date: Tue, 19 Nov 2019 17:48:24 +0100
Subject: [PATCH] target/linux/mpc85xx: revert kernel patch that breaks MMC
access
This patch causes boot to not proceed because kernel won't locate FS on
MMC. MMC it self is correctly detected but it might not be readable by
kernel with this patch. Instead kernel panics.
Second patch causes timeouts on SD card access.
---
...-of-esdhc-set-DMA-snooping-based-on-.patch | 32 +++++++++++++++++++
...i-of-esdhc-fix-P2020-errata-handling.patch | 28 ++++++++++++++++
2 files changed, 60 insertions(+)
create mode 100644 target/linux/mpc85xx/patches-5.4/901-Revert-mmc-sdhci-of-esdhc-set-DMA-snooping-based-on-.patch
create mode 100644 target/linux/mpc85xx/patches-5.4/902-Revert-mmc-sdhci-of-esdhc-fix-P2020-errata-handling.patch
diff --git a/target/linux/mpc85xx/patches-5.4/901-Revert-mmc-sdhci-of-esdhc-set-DMA-snooping-based-on-.patch b/target/linux/mpc85xx/patches-5.4/901-Revert-mmc-sdhci-of-esdhc-set-DMA-snooping-based-on-.patch
new file mode 100644
index 0000000..ca41d11
--- /dev/null
+++ b/target/linux/mpc85xx/patches-5.4/901-Revert-mmc-sdhci-of-esdhc-set-DMA-snooping-based-on-.patch
@@ -0,0 +1,32 @@
+From 429cffc87a35214f415f8f0b37d9933b745fa9cb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= <karel.koci@nic.cz>
+Date: Tue, 19 Nov 2019 16:47:06 +0100
+Subject: [PATCH 2/2] Revert "mmc: sdhci-of-esdhc: set DMA snooping based on
+ DMA coherence"
+
+This reverts commit 6475db6c42a408c5c0a52dbdb8494310c48ed2d3.
+---
+ drivers/mmc/host/sdhci-of-esdhc.c | 7 +------
+ 1 file changed, 1 insertion(+), 6 deletions(-)
+
+diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
+index 176cbc67d08a..bcfa84aa2113 100644
+--- a/drivers/mmc/host/sdhci-of-esdhc.c
++++ b/drivers/mmc/host/sdhci-of-esdhc.c
+@@ -435,12 +435,7 @@ static int esdhc_of_enable_dma(struct sdhci_host *host)
+ dma_set_mask_and_coherent(dev, DMA_BIT_MASK(40));
+
+ value = sdhci_readl(host, ESDHC_DMA_SYSCTL);
+-
+- if (of_dma_is_coherent(dev->of_node))
+- value |= ESDHC_DMA_SNOOP;
+- else
+- value &= ~ESDHC_DMA_SNOOP;
+-
++ value |= ESDHC_DMA_SNOOP;
+ sdhci_writel(host, value, ESDHC_DMA_SYSCTL);
+ return 0;
+ }
+--
+2.24.0
+
diff --git a/target/linux/mpc85xx/patches-5.4/902-Revert-mmc-sdhci-of-esdhc-fix-P2020-errata-handling.patch b/target/linux/mpc85xx/patches-5.4/902-Revert-mmc-sdhci-of-esdhc-fix-P2020-errata-handling.patch
new file mode 100644
index 0000000..6588838
--- /dev/null
+++ b/target/linux/mpc85xx/patches-5.4/902-Revert-mmc-sdhci-of-esdhc-fix-P2020-errata-handling.patch
@@ -0,0 +1,28 @@
+From 3fba5ddea116f401caf88443181a7f640a05655a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= <karel.koci@nic.cz>
+Date: Tue, 14 Jan 2020 10:50:11 +0100
+Subject: [PATCH] Revert "mmc: sdhci-of-esdhc: fix P2020 errata handling"
+
+This reverts commit 5a07ace7375231e6eb79667a2784c0bf023f87da.
+---
+ drivers/mmc/host/sdhci-of-esdhc.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
+index 9a1ab39ee35e..bf8d02a996b6 100644
+--- a/drivers/mmc/host/sdhci-of-esdhc.c
++++ b/drivers/mmc/host/sdhci-of-esdhc.c
+@@ -886,8 +886,8 @@ static int sdhci_esdhc_probe(struct platform_device *pdev)
+ host->quirks &= ~SDHCI_QUIRK_NO_BUSY_IRQ;
+
+ if (of_find_compatible_node(NULL, NULL, "fsl,p2020-esdhc")) {
+- host->quirks |= SDHCI_QUIRK_RESET_AFTER_REQUEST;
+- host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
++ host->quirks2 |= SDHCI_QUIRK_RESET_AFTER_REQUEST;
++ host->quirks2 |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
+ }
+
+ if (of_device_is_compatible(np, "fsl,p5040-esdhc") ||
+--
+2.25.0
+
--
2.25.0
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment