aboutsummaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen3/recipes-kernel
diff options
context:
space:
mode:
authorKhang Nguyen <khang.nguyen.xv@rvc.renesas.com>2018-06-18 11:06:36 +0700
committerKhang Nguyen <khang.nguyen.xv@rvc.renesas.com>2018-06-18 17:55:58 +0700
commit8b090e008ef2c4cb9a97c20426f1ac03f9f15555 (patch)
tree9a54113e3b737d6d2aa2664bfffca1f28e80aa5d /meta-rcar-gen3/recipes-kernel
parenta1e844b0849b1c47f37f6ae6095b17bff5f79539 (diff)
rcar-gen3: linux-renesas: WORKAROUND for mini SD card issue on M3ULCB
This commit adds a WORKAROUND patch for the issue that mini SD partition information cannot be read correctly. Signed-off-by: Khang Nguyen <khang.nguyen.xv@rvc.renesas.com> Signed-off-by: Takamitsu Honda <takamitsu.honda.pv@renesas.com>
Diffstat (limited to 'meta-rcar-gen3/recipes-kernel')
-rw-r--r--meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch112
-rw-r--r--meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers_4.14.bb5
-rw-r--r--meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch112
-rw-r--r--meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb5
4 files changed, 234 insertions, 0 deletions
diff --git a/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch b/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch
new file mode 100644
index 0000000..1d7fa7a
--- /dev/null
+++ b/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers/0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch
@@ -0,0 +1,112 @@
+From 001e18801fa28bbcd02c86707bc56d87ebabca60 Mon Sep 17 00:00:00 2001
+From: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
+Date: Fri, 15 Jun 2018 17:57:43 +0900
+Subject: [PATCH] Revert "mmc: renesas_sdhi_internal_dmac: limit DMA RX for old
+ SoCs"
+
+This reverts commit fbd708880ca045a4583a4d2ca2f67e8a41ddab62.
+
+It solves the problem that SD card / eMMC partition information can not
+be read correctly on a device operating with force_pio.
+
+This revert is a workaround due to difference effect with upstream code.
+
+Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
+Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
+
+Conflicts:
+ drivers/mmc/host/renesas_sdhi_internal_dmac.c
+---
+ drivers/mmc/host/renesas_sdhi_internal_dmac.c | 32 +------------------
+ 1 file changed, 1 insertion(+), 31 deletions(-)
+
+diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+index 2f24a4890418..ba15ea2c9b9f 100644
+--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
++++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+@@ -9,7 +9,6 @@
+ * published by the Free Software Foundation.
+ */
+
+-#include <linux/bitops.h>
+ #include <linux/device.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/io-64-nonatomic-hi-lo.h>
+@@ -64,17 +63,6 @@
+ * need a custom accessor.
+ */
+
+-static unsigned long global_flags;
+-/*
+- * Workaround for avoiding to use RX DMAC by multiple channels.
+- * On R-Car H3 ES1.* and M3-W ES1.0, when multiple SDHI channels use
+- * RX DMAC simultaneously, sometimes hundreds of bytes data are not
+- * stored into the system memory even if the DMAC interrupt happened.
+- * So, this driver then uses one RX DMAC channel only.
+- */
+-#define SDHI_INTERNAL_DMAC_ONE_RX_ONLY 0
+-#define SDHI_INTERNAL_DMAC_RX_IN_USE 1
+-
+ /* Definitions for sampling clocks */
+ static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = {
+ {
+@@ -150,9 +138,6 @@ renesas_sdhi_internal_dmac_abort_dma(struct tmio_mmc_host *host) {
+ renesas_sdhi_internal_dmac_dm_write(host, DM_CM_RST,
+ RST_RESERVED_BITS | val);
+
+- if (host->data && host->data->flags & MMC_DATA_READ)
+- clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags);
+-
+ renesas_sdhi_internal_dmac_enable_dma(host, true);
+ }
+
+@@ -176,9 +161,6 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
+
+ if (data->flags & MMC_DATA_READ) {
+ dtran_mode |= DTRAN_MODE_CH_NUM_CH1;
+- if (test_bit(SDHI_INTERNAL_DMAC_ONE_RX_ONLY, &global_flags) &&
+- test_and_set_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags))
+- goto force_pio;
+ } else {
+ dtran_mode |= DTRAN_MODE_CH_NUM_CH0;
+ }
+@@ -227,9 +209,6 @@ static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
+ host->data->host_cookie = COOKIE_UNMAPPED;
+ }
+
+- if (host->data->flags & MMC_DATA_READ)
+- clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags);
+-
+ tmio_mmc_do_data_irq(host);
+ out:
+ spin_unlock_irq(&host->lock);
+@@ -298,11 +277,6 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_internal_dmac_dma_ops = {
+ * implementation as others may use a different implementation.
+ */
+ static const struct soc_device_attribute gen3_soc_whitelist[] = {
+- /* specific ones */
+- { .soc_id = "r8a7795", .revision = "ES1.*",
+- .data = (void *)BIT(SDHI_INTERNAL_DMAC_ONE_RX_ONLY) },
+- { .soc_id = "r8a7796", .revision = "ES1.0",
+- .data = (void *)BIT(SDHI_INTERNAL_DMAC_ONE_RX_ONLY) },
+ /* generic ones */
+ { .soc_id = "r8a7795" },
+ { .soc_id = "r8a7796" },
+@@ -314,13 +288,9 @@ static const struct soc_device_attribute gen3_soc_whitelist[] = {
+
+ static int renesas_sdhi_internal_dmac_probe(struct platform_device *pdev)
+ {
+- const struct soc_device_attribute *soc = soc_device_match(gen3_soc_whitelist);
+-
+- if (!soc)
++ if (!soc_device_match(gen3_soc_whitelist))
+ return -ENODEV;
+
+- global_flags |= (unsigned long)soc->data;
+-
+ #ifndef CONFIG_MMC_SDHI_PIO
+ return renesas_sdhi_probe(pdev, &renesas_sdhi_internal_dmac_dma_ops);
+ #else
+--
+2.17.1
+
diff --git a/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers_4.14.bb b/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers_4.14.bb
index 4c659c3..043ba21 100644
--- a/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers_4.14.bb
+++ b/meta-rcar-gen3/recipes-kernel/linux-libc-headers/linux-libc-headers_4.14.bb
@@ -8,6 +8,11 @@ SRCREV = "118adc53e8e9806d76f40859ba96290f289f8839"
SRC_URI = "${RENESAS_BSP_URL};branch=${BRANCH}"
+# Fix micro SD card issue on M3ULCB
+SRC_URI_append = " \
+ file://0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch \
+"
+
# Enable RPMSG_VIRTIO depend on ICCOM
SRC_URI_append = " \
${@base_conditional("USE_ICCOM", "1", " file://0001-rpmsg-Add-message-to-be-able-to-configure-RPMSG_VIRT.patch", "", d)} \
diff --git a/meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch
new file mode 100644
index 0000000..1d7fa7a
--- /dev/null
+++ b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas/0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch
@@ -0,0 +1,112 @@
+From 001e18801fa28bbcd02c86707bc56d87ebabca60 Mon Sep 17 00:00:00 2001
+From: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
+Date: Fri, 15 Jun 2018 17:57:43 +0900
+Subject: [PATCH] Revert "mmc: renesas_sdhi_internal_dmac: limit DMA RX for old
+ SoCs"
+
+This reverts commit fbd708880ca045a4583a4d2ca2f67e8a41ddab62.
+
+It solves the problem that SD card / eMMC partition information can not
+be read correctly on a device operating with force_pio.
+
+This revert is a workaround due to difference effect with upstream code.
+
+Signed-off-by: Masaharu Hayakawa <masaharu.hayakawa.ry@renesas.com>
+Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
+
+Conflicts:
+ drivers/mmc/host/renesas_sdhi_internal_dmac.c
+---
+ drivers/mmc/host/renesas_sdhi_internal_dmac.c | 32 +------------------
+ 1 file changed, 1 insertion(+), 31 deletions(-)
+
+diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+index 2f24a4890418..ba15ea2c9b9f 100644
+--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
++++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+@@ -9,7 +9,6 @@
+ * published by the Free Software Foundation.
+ */
+
+-#include <linux/bitops.h>
+ #include <linux/device.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/io-64-nonatomic-hi-lo.h>
+@@ -64,17 +63,6 @@
+ * need a custom accessor.
+ */
+
+-static unsigned long global_flags;
+-/*
+- * Workaround for avoiding to use RX DMAC by multiple channels.
+- * On R-Car H3 ES1.* and M3-W ES1.0, when multiple SDHI channels use
+- * RX DMAC simultaneously, sometimes hundreds of bytes data are not
+- * stored into the system memory even if the DMAC interrupt happened.
+- * So, this driver then uses one RX DMAC channel only.
+- */
+-#define SDHI_INTERNAL_DMAC_ONE_RX_ONLY 0
+-#define SDHI_INTERNAL_DMAC_RX_IN_USE 1
+-
+ /* Definitions for sampling clocks */
+ static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = {
+ {
+@@ -150,9 +138,6 @@ renesas_sdhi_internal_dmac_abort_dma(struct tmio_mmc_host *host) {
+ renesas_sdhi_internal_dmac_dm_write(host, DM_CM_RST,
+ RST_RESERVED_BITS | val);
+
+- if (host->data && host->data->flags & MMC_DATA_READ)
+- clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags);
+-
+ renesas_sdhi_internal_dmac_enable_dma(host, true);
+ }
+
+@@ -176,9 +161,6 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
+
+ if (data->flags & MMC_DATA_READ) {
+ dtran_mode |= DTRAN_MODE_CH_NUM_CH1;
+- if (test_bit(SDHI_INTERNAL_DMAC_ONE_RX_ONLY, &global_flags) &&
+- test_and_set_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags))
+- goto force_pio;
+ } else {
+ dtran_mode |= DTRAN_MODE_CH_NUM_CH0;
+ }
+@@ -227,9 +209,6 @@ static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg)
+ host->data->host_cookie = COOKIE_UNMAPPED;
+ }
+
+- if (host->data->flags & MMC_DATA_READ)
+- clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags);
+-
+ tmio_mmc_do_data_irq(host);
+ out:
+ spin_unlock_irq(&host->lock);
+@@ -298,11 +277,6 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_internal_dmac_dma_ops = {
+ * implementation as others may use a different implementation.
+ */
+ static const struct soc_device_attribute gen3_soc_whitelist[] = {
+- /* specific ones */
+- { .soc_id = "r8a7795", .revision = "ES1.*",
+- .data = (void *)BIT(SDHI_INTERNAL_DMAC_ONE_RX_ONLY) },
+- { .soc_id = "r8a7796", .revision = "ES1.0",
+- .data = (void *)BIT(SDHI_INTERNAL_DMAC_ONE_RX_ONLY) },
+ /* generic ones */
+ { .soc_id = "r8a7795" },
+ { .soc_id = "r8a7796" },
+@@ -314,13 +288,9 @@ static const struct soc_device_attribute gen3_soc_whitelist[] = {
+
+ static int renesas_sdhi_internal_dmac_probe(struct platform_device *pdev)
+ {
+- const struct soc_device_attribute *soc = soc_device_match(gen3_soc_whitelist);
+-
+- if (!soc)
++ if (!soc_device_match(gen3_soc_whitelist))
+ return -ENODEV;
+
+- global_flags |= (unsigned long)soc->data;
+-
+ #ifndef CONFIG_MMC_SDHI_PIO
+ return renesas_sdhi_probe(pdev, &renesas_sdhi_internal_dmac_dma_ops);
+ #else
+--
+2.17.1
+
diff --git a/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb
index d1eb75b..6f88d52 100644
--- a/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb
+++ b/meta-rcar-gen3/recipes-kernel/linux/linux-renesas_4.14.bb
@@ -14,6 +14,11 @@ SRCREV = "118adc53e8e9806d76f40859ba96290f289f8839"
SRC_URI = "${RENESAS_BSP_URL};protocol=git;nocheckout=1;branch=${BRANCH}"
+# Fix micro SD card issue on M3ULCB
+SRC_URI_append = " \
+ file://0001-Revert-mmc-renesas_sdhi_internal_dmac-limit-DMA-RX-f.patch \
+"
+
LINUX_VERSION ?= "4.14.35"
PV = "${LINUX_VERSION}+git${SRCPV}"
PR = "r1"