* [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring
@ 2022-03-20 12:30 Wolfram Sang
2022-03-20 12:30 ` [PATCH 1/6] mmc: renesas_sdhi: remove outdated headers Wolfram Sang
` (6 more replies)
0 siblings, 7 replies; 18+ messages in thread
From: Wolfram Sang @ 2022-03-20 12:30 UTC (permalink / raw)
To: linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang
Shimoda-san's much appreciated refactoring of the quirk handling allows
for further cleanups which you can find in this series plus some other
improvements found on the way. Finally, 'soc_dma_quirks' can be removed
in favor of regular quirks.
The series is based on mmc/next as of today and was tested on Salvator-X
(H3 ES1.0), Salvator XS (H3 ES2.0 as well as M3-N).
Looking forward for tests and comments.
All the best,
Wolfram
Wolfram Sang (6):
mmc: renesas_sdhi: remove outdated headers
mmc: renesas_sdhi: R-Car D3 also has no HS400
mmc: renesas_sdhi: make setup selection more understandable
mmc: renesas_sdhi: remove a stale comment
mmc: renesas_sdhi: make 'fixed_addr_mode' a quirk
mmc: renesas_sdhi: make 'dmac_only_one_rx' a quirk
drivers/mmc/host/renesas_sdhi.h | 2 +
drivers/mmc/host/renesas_sdhi_core.c | 2 -
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 70 ++++++++-----------
3 files changed, 33 insertions(+), 41 deletions(-)
--
2.30.2
^ permalink raw reply [flat|nested] 18+ messages in thread
* [PATCH 1/6] mmc: renesas_sdhi: remove outdated headers
2022-03-20 12:30 [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Wolfram Sang
@ 2022-03-20 12:30 ` Wolfram Sang
2022-04-01 12:48 ` Geert Uytterhoeven
2022-03-20 12:30 ` [PATCH 2/6] mmc: renesas_sdhi: R-Car D3 also has no HS400 Wolfram Sang
` (5 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Wolfram Sang @ 2022-03-20 12:30 UTC (permalink / raw)
To: linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang
We moved quirk handling out of the SDHI core to the individual drivers.
So, no need to include headers needed for soc_device_match et al.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/mmc/host/renesas_sdhi_core.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index 2797a9c0f17d..fe63548d816d 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -27,7 +27,6 @@
#include <linux/mmc/mmc.h>
#include <linux/mmc/slot-gpio.h>
#include <linux/module.h>
-#include <linux/of_device.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/pinctrl-state.h>
#include <linux/platform_device.h>
@@ -36,7 +35,6 @@
#include <linux/reset.h>
#include <linux/sh_dma.h>
#include <linux/slab.h>
-#include <linux/sys_soc.h>
#include "renesas_sdhi.h"
#include "tmio_mmc.h"
--
2.30.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 2/6] mmc: renesas_sdhi: R-Car D3 also has no HS400
2022-03-20 12:30 [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Wolfram Sang
2022-03-20 12:30 ` [PATCH 1/6] mmc: renesas_sdhi: remove outdated headers Wolfram Sang
@ 2022-03-20 12:30 ` Wolfram Sang
2022-04-01 13:01 ` Geert Uytterhoeven
2022-03-20 12:30 ` [PATCH 3/6] mmc: renesas_sdhi: make setup selection more understandable Wolfram Sang
` (4 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Wolfram Sang @ 2022-03-20 12:30 UTC (permalink / raw)
To: linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang
It is not explicitly expressed in the docs, but the needed data strobe
pin is indeed missing for D3. The BSP disables HS400 as well. This means
a little refactoring to reuse an already existing setup.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 1685df00863b..1c9217f99a0b 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -234,11 +234,6 @@ static const struct renesas_sdhi_of_data_with_quirks of_r8a77970_compatible = {
.of_data = &of_data_rcar_gen3_no_fallback,
};
-static const struct renesas_sdhi_of_data_with_quirks of_r8a77980_compatible = {
- .of_data = &of_data_rcar_gen3,
- .quirks = &sdhi_quirks_nohs400,
-};
-
static const struct renesas_sdhi_of_data_with_quirks of_r8a77990_compatible = {
.of_data = &of_data_rcar_gen3,
.quirks = &sdhi_quirks_r8a77990,
@@ -248,6 +243,11 @@ static const struct renesas_sdhi_of_data_with_quirks of_rcar_gen3_compatible = {
.of_data = &of_data_rcar_gen3,
};
+static const struct renesas_sdhi_of_data_with_quirks of_rcar_gen3_nohs400_compatible = {
+ .of_data = &of_data_rcar_gen3,
+ .quirks = &sdhi_quirks_nohs400,
+};
+
static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
{ .compatible = "renesas,sdhi-r7s9210", .data = &of_rza2_compatible, },
{ .compatible = "renesas,sdhi-mmc-r8a77470", .data = &of_rcar_gen3_compatible, },
@@ -256,8 +256,9 @@ static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
{ .compatible = "renesas,sdhi-r8a77961", .data = &of_r8a77961_compatible, },
{ .compatible = "renesas,sdhi-r8a77965", .data = &of_r8a77965_compatible, },
{ .compatible = "renesas,sdhi-r8a77970", .data = &of_r8a77970_compatible, },
- { .compatible = "renesas,sdhi-r8a77980", .data = &of_r8a77980_compatible, },
+ { .compatible = "renesas,sdhi-r8a77980", .data = &of_rcar_gen3_nohs400_compatible, },
{ .compatible = "renesas,sdhi-r8a77990", .data = &of_r8a77990_compatible, },
+ { .compatible = "renesas,sdhi-r8a77995", .data = &of_rcar_gen3_nohs400_compatible, },
{ .compatible = "renesas,rcar-gen3-sdhi", .data = &of_rcar_gen3_compatible, },
{},
};
--
2.30.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 3/6] mmc: renesas_sdhi: make setup selection more understandable
2022-03-20 12:30 [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Wolfram Sang
2022-03-20 12:30 ` [PATCH 1/6] mmc: renesas_sdhi: remove outdated headers Wolfram Sang
2022-03-20 12:30 ` [PATCH 2/6] mmc: renesas_sdhi: R-Car D3 also has no HS400 Wolfram Sang
@ 2022-03-20 12:30 ` Wolfram Sang
2022-04-01 13:02 ` Geert Uytterhoeven
2022-03-20 12:30 ` [PATCH 4/6] mmc: renesas_sdhi: remove a stale comment Wolfram Sang
` (3 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Wolfram Sang @ 2022-03-20 12:30 UTC (permalink / raw)
To: linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang
When I read 'no_fallback', I forgot what fallback even though I was the
author of this change. Name it better to make the code easier to
understand.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 1c9217f99a0b..243174c63772 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -128,7 +128,7 @@ static const struct renesas_sdhi_of_data of_data_rcar_gen3 = {
.sdhi_flags = SDHI_FLAG_NEED_CLKH_FALLBACK,
};
-static const struct renesas_sdhi_of_data of_data_rcar_gen3_no_fallback = {
+static const struct renesas_sdhi_of_data of_data_rcar_gen3_no_sdh_fallback = {
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL |
TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2,
.capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
@@ -231,7 +231,7 @@ static const struct renesas_sdhi_of_data_with_quirks of_r8a77965_compatible = {
};
static const struct renesas_sdhi_of_data_with_quirks of_r8a77970_compatible = {
- .of_data = &of_data_rcar_gen3_no_fallback,
+ .of_data = &of_data_rcar_gen3_no_sdh_fallback,
};
static const struct renesas_sdhi_of_data_with_quirks of_r8a77990_compatible = {
--
2.30.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 4/6] mmc: renesas_sdhi: remove a stale comment
2022-03-20 12:30 [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Wolfram Sang
` (2 preceding siblings ...)
2022-03-20 12:30 ` [PATCH 3/6] mmc: renesas_sdhi: make setup selection more understandable Wolfram Sang
@ 2022-03-20 12:30 ` Wolfram Sang
2022-04-01 13:03 ` Geert Uytterhoeven
2022-03-20 12:30 ` [PATCH 5/6] mmc: renesas_sdhi: make 'fixed_addr_mode' a quirk Wolfram Sang
` (2 subsequent siblings)
6 siblings, 1 reply; 18+ messages in thread
From: Wolfram Sang @ 2022-03-20 12:30 UTC (permalink / raw)
To: linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang
The whitelist has been refactored away with a0fb3fc8af01 ("mmc:
renesas_sdhi: remove whitelist for internal DMAC") so the comment
doesn't make any sense anymore.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 243174c63772..06204ff94b4f 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -521,10 +521,6 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_internal_dmac_dma_ops = {
.end = renesas_sdhi_internal_dmac_end_dma,
};
-/*
- * Whitelist of specific R-Car Gen3 SoC ES versions to use this DMAC
- * implementation as others may use a different implementation.
- */
static const struct soc_device_attribute soc_dma_quirks[] = {
{ .soc_id = "r7s9210",
.data = (void *)BIT(SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY) },
--
2.30.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 5/6] mmc: renesas_sdhi: make 'fixed_addr_mode' a quirk
2022-03-20 12:30 [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Wolfram Sang
` (3 preceding siblings ...)
2022-03-20 12:30 ` [PATCH 4/6] mmc: renesas_sdhi: remove a stale comment Wolfram Sang
@ 2022-03-20 12:30 ` Wolfram Sang
2022-04-01 13:08 ` Geert Uytterhoeven
2022-03-20 12:30 ` [PATCH 6/6] mmc: renesas_sdhi: make 'dmac_only_one_rx' " Wolfram Sang
2022-03-28 14:04 ` [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Ulf Hansson
6 siblings, 1 reply; 18+ messages in thread
From: Wolfram Sang @ 2022-03-20 12:30 UTC (permalink / raw)
To: linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang
After Shimoda-san's much appreciated refactoring of the quirk handling,
we can convert now the 'fixed_addr_mode' from an ugly global flag to a
regular quirk. This makes quirk handling more consistent and easier to
maintain.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/mmc/host/renesas_sdhi.h | 1 +
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 21 ++++++++++---------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 66d308e73e17..e6b1395e99a3 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -41,6 +41,7 @@ struct renesas_sdhi_of_data {
struct renesas_sdhi_quirks {
bool hs400_disabled;
bool hs400_4taps;
+ bool fixed_addr_mode;
u32 hs400_bad_taps;
const u8 (*hs400_calib_table)[SDHI_CALIB_TABLE_MAX];
};
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 06204ff94b4f..4d8df61657cd 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -81,9 +81,6 @@ static unsigned long global_flags;
#define SDHI_INTERNAL_DMAC_ONE_RX_ONLY 0
#define SDHI_INTERNAL_DMAC_RX_IN_USE 1
-/* RZ/A2 does not have the ADRR_MODE bit */
-#define SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY 2
-
/* Definitions for sampling clocks */
static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = {
{
@@ -108,10 +105,6 @@ static const struct renesas_sdhi_of_data of_data_rza2 = {
.max_segs = 1,
};
-static const struct renesas_sdhi_of_data_with_quirks of_rza2_compatible = {
- .of_data = &of_data_rza2,
-};
-
static const struct renesas_sdhi_of_data of_data_rcar_gen3 = {
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL |
TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2,
@@ -178,6 +171,10 @@ static const struct renesas_sdhi_quirks sdhi_quirks_nohs400 = {
.hs400_disabled = true,
};
+static const struct renesas_sdhi_quirks sdhi_quirks_fixed_addr = {
+ .fixed_addr_mode = true,
+};
+
static const struct renesas_sdhi_quirks sdhi_quirks_bad_taps1357 = {
.hs400_bad_taps = BIT(1) | BIT(3) | BIT(5) | BIT(7),
};
@@ -248,6 +245,11 @@ static const struct renesas_sdhi_of_data_with_quirks of_rcar_gen3_nohs400_compat
.quirks = &sdhi_quirks_nohs400,
};
+static const struct renesas_sdhi_of_data_with_quirks of_rza2_compatible = {
+ .of_data = &of_data_rza2,
+ .quirks = &sdhi_quirks_fixed_addr,
+};
+
static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
{ .compatible = "renesas,sdhi-r7s9210", .data = &of_rza2_compatible, },
{ .compatible = "renesas,sdhi-mmc-r8a77470", .data = &of_rcar_gen3_compatible, },
@@ -358,10 +360,11 @@ static void
renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host,
struct mmc_data *data)
{
+ struct renesas_sdhi *priv = host_to_priv(host);
struct scatterlist *sg = host->sg_ptr;
u32 dtran_mode = DTRAN_MODE_BUS_WIDTH;
- if (!test_bit(SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY, &global_flags))
+ if (!priv->quirks->fixed_addr_mode)
dtran_mode |= DTRAN_MODE_ADDR_MODE;
if (!renesas_sdhi_internal_dmac_map(host, data, COOKIE_MAPPED))
@@ -522,8 +525,6 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_internal_dmac_dma_ops = {
};
static const struct soc_device_attribute soc_dma_quirks[] = {
- { .soc_id = "r7s9210",
- .data = (void *)BIT(SDHI_INTERNAL_DMAC_ADDR_MODE_FIXED_ONLY) },
{ .soc_id = "r8a7795", .revision = "ES1.*",
.data = (void *)BIT(SDHI_INTERNAL_DMAC_ONE_RX_ONLY) },
{ .soc_id = "r8a7796", .revision = "ES1.0",
--
2.30.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [PATCH 6/6] mmc: renesas_sdhi: make 'dmac_only_one_rx' a quirk
2022-03-20 12:30 [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Wolfram Sang
` (4 preceding siblings ...)
2022-03-20 12:30 ` [PATCH 5/6] mmc: renesas_sdhi: make 'fixed_addr_mode' a quirk Wolfram Sang
@ 2022-03-20 12:30 ` Wolfram Sang
2022-04-01 14:13 ` Geert Uytterhoeven
2022-03-28 14:04 ` [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Ulf Hansson
6 siblings, 1 reply; 18+ messages in thread
From: Wolfram Sang @ 2022-03-20 12:30 UTC (permalink / raw)
To: linux-mmc; +Cc: linux-renesas-soc, Wolfram Sang
After Shimoda-san's much appreciated refactoring of the quirk handling,
we can convert now 'dmac_only_one_rx' from an ugly global flag to a
regular quirk. This makes quirk handling more consistent and easier to
maintain. After this patch, soc_dma_quirks is completely gone, hooray!
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/mmc/host/renesas_sdhi.h | 1 +
drivers/mmc/host/renesas_sdhi_internal_dmac.c | 28 ++++++++-----------
2 files changed, 12 insertions(+), 17 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index e6b1395e99a3..1a1e3e020a8c 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -42,6 +42,7 @@ struct renesas_sdhi_quirks {
bool hs400_disabled;
bool hs400_4taps;
bool fixed_addr_mode;
+ bool dma_one_rx_only;
u32 hs400_bad_taps;
const u8 (*hs400_calib_table)[SDHI_CALIB_TABLE_MAX];
};
diff --git a/drivers/mmc/host/renesas_sdhi_internal_dmac.c b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
index 4d8df61657cd..1497a46260d4 100644
--- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
@@ -78,8 +78,7 @@ static unsigned long global_flags;
* 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
+#define SDHI_INTERNAL_DMAC_RX_IN_USE 0
/* Definitions for sampling clocks */
static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = {
@@ -162,6 +161,12 @@ static const struct renesas_sdhi_quirks sdhi_quirks_4tap_nohs400 = {
.hs400_4taps = true,
};
+static const struct renesas_sdhi_quirks sdhi_quirks_4tap_nohs400_one_rx = {
+ .hs400_disabled = true,
+ .hs400_4taps = true,
+ .dma_one_rx_only = true,
+};
+
static const struct renesas_sdhi_quirks sdhi_quirks_4tap = {
.hs400_4taps = true,
.hs400_bad_taps = BIT(2) | BIT(3) | BIT(6) | BIT(7),
@@ -205,9 +210,10 @@ static const struct renesas_sdhi_quirks sdhi_quirks_r8a77990 = {
*/
static const struct soc_device_attribute sdhi_quirks_match[] = {
{ .soc_id = "r8a774a1", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
- { .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_4tap_nohs400 },
+ { .soc_id = "r8a7795", .revision = "ES1.*", .data = &sdhi_quirks_4tap_nohs400_one_rx },
{ .soc_id = "r8a7795", .revision = "ES2.0", .data = &sdhi_quirks_4tap },
- { .soc_id = "r8a7796", .revision = "ES1.[012]", .data = &sdhi_quirks_4tap_nohs400 },
+ { .soc_id = "r8a7796", .revision = "ES1.0", .data = &sdhi_quirks_4tap_nohs400_one_rx },
+ { .soc_id = "r8a7796", .revision = "ES1.[12]", .data = &sdhi_quirks_4tap_nohs400 },
{ .soc_id = "r8a7796", .revision = "ES1.*", .data = &sdhi_quirks_r8a7796_es13 },
{ /* Sentinel. */ }
};
@@ -372,7 +378,7 @@ 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) &&
+ if (priv->quirks->dma_one_rx_only &&
test_and_set_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags))
goto force_pio_with_unmap;
} else {
@@ -524,14 +530,6 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_internal_dmac_dma_ops = {
.end = renesas_sdhi_internal_dmac_end_dma,
};
-static const struct soc_device_attribute soc_dma_quirks[] = {
- { .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) },
- { /* sentinel */ }
-};
-
static int renesas_sdhi_internal_dmac_probe(struct platform_device *pdev)
{
const struct soc_device_attribute *attr;
@@ -542,10 +540,6 @@ static int renesas_sdhi_internal_dmac_probe(struct platform_device *pdev)
of_data_quirks = of_device_get_match_data(&pdev->dev);
quirks = of_data_quirks->quirks;
- attr = soc_device_match(soc_dma_quirks);
- if (attr)
- global_flags |= (unsigned long)attr->data;
-
attr = soc_device_match(sdhi_quirks_match);
if (attr)
quirks = attr->data;
--
2.30.2
^ permalink raw reply related [flat|nested] 18+ messages in thread
* Re: [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring
2022-03-20 12:30 [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Wolfram Sang
` (5 preceding siblings ...)
2022-03-20 12:30 ` [PATCH 6/6] mmc: renesas_sdhi: make 'dmac_only_one_rx' " Wolfram Sang
@ 2022-03-28 14:04 ` Ulf Hansson
6 siblings, 0 replies; 18+ messages in thread
From: Ulf Hansson @ 2022-03-28 14:04 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-mmc, linux-renesas-soc
On Sun, 20 Mar 2022 at 13:30, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> Shimoda-san's much appreciated refactoring of the quirk handling allows
> for further cleanups which you can find in this series plus some other
> improvements found on the way. Finally, 'soc_dma_quirks' can be removed
> in favor of regular quirks.
>
> The series is based on mmc/next as of today and was tested on Salvator-X
> (H3 ES1.0), Salvator XS (H3 ES2.0 as well as M3-N).
>
> Looking forward for tests and comments.
>
> All the best,
>
> Wolfram
>
> Wolfram Sang (6):
> mmc: renesas_sdhi: remove outdated headers
> mmc: renesas_sdhi: R-Car D3 also has no HS400
> mmc: renesas_sdhi: make setup selection more understandable
> mmc: renesas_sdhi: remove a stale comment
> mmc: renesas_sdhi: make 'fixed_addr_mode' a quirk
> mmc: renesas_sdhi: make 'dmac_only_one_rx' a quirk
>
> drivers/mmc/host/renesas_sdhi.h | 2 +
> drivers/mmc/host/renesas_sdhi_core.c | 2 -
> drivers/mmc/host/renesas_sdhi_internal_dmac.c | 70 ++++++++-----------
> 3 files changed, 33 insertions(+), 41 deletions(-)
>
Queued up on the "devel" branch for v5.19, thanks!
Kind regards
Uffe
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 1/6] mmc: renesas_sdhi: remove outdated headers
2022-03-20 12:30 ` [PATCH 1/6] mmc: renesas_sdhi: remove outdated headers Wolfram Sang
@ 2022-04-01 12:48 ` Geert Uytterhoeven
0 siblings, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2022-04-01 12:48 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux MMC List, Linux-Renesas
On Mon, Mar 21, 2022 at 4:20 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> We moved quirk handling out of the SDHI core to the individual drivers.
> So, no need to include headers needed for soc_device_match et al.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/6] mmc: renesas_sdhi: R-Car D3 also has no HS400
2022-03-20 12:30 ` [PATCH 2/6] mmc: renesas_sdhi: R-Car D3 also has no HS400 Wolfram Sang
@ 2022-04-01 13:01 ` Geert Uytterhoeven
2022-04-01 14:59 ` Wolfram Sang
0 siblings, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2022-04-01 13:01 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux MMC List, Linux-Renesas
Hi Wolfram,
On Mon, Mar 21, 2022 at 11:50 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> It is not explicitly expressed in the docs, but the needed data strobe
> pin is indeed missing for D3. The BSP disables HS400 as well. This means
> a little refactoring to reuse an already existing setup.
You mean the DS signal? That also doesn't exist on R-Car V3M, so
shouldn't of_r8a77970_compatible.quirks be set to &sdhi_quirks_nohs400,
too?
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 3/6] mmc: renesas_sdhi: make setup selection more understandable
2022-03-20 12:30 ` [PATCH 3/6] mmc: renesas_sdhi: make setup selection more understandable Wolfram Sang
@ 2022-04-01 13:02 ` Geert Uytterhoeven
0 siblings, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2022-04-01 13:02 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux MMC List, Linux-Renesas
On Mon, Mar 21, 2022 at 3:12 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> When I read 'no_fallback', I forgot what fallback even though I was the
> author of this change. Name it better to make the code easier to
> understand.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 4/6] mmc: renesas_sdhi: remove a stale comment
2022-03-20 12:30 ` [PATCH 4/6] mmc: renesas_sdhi: remove a stale comment Wolfram Sang
@ 2022-04-01 13:03 ` Geert Uytterhoeven
0 siblings, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2022-04-01 13:03 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux MMC List, Linux-Renesas
On Tue, Mar 22, 2022 at 12:12 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> The whitelist has been refactored away with a0fb3fc8af01 ("mmc:
> renesas_sdhi: remove whitelist for internal DMAC") so the comment
> doesn't make any sense anymore.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 5/6] mmc: renesas_sdhi: make 'fixed_addr_mode' a quirk
2022-03-20 12:30 ` [PATCH 5/6] mmc: renesas_sdhi: make 'fixed_addr_mode' a quirk Wolfram Sang
@ 2022-04-01 13:08 ` Geert Uytterhoeven
0 siblings, 0 replies; 18+ messages in thread
From: Geert Uytterhoeven @ 2022-04-01 13:08 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux MMC List, Linux-Renesas
On Mon, Mar 21, 2022 at 8:02 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> After Shimoda-san's much appreciated refactoring of the quirk handling,
> we can convert now the 'fixed_addr_mode' from an ugly global flag to a
> regular quirk. This makes quirk handling more consistent and easier to
> maintain.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 6/6] mmc: renesas_sdhi: make 'dmac_only_one_rx' a quirk
2022-03-20 12:30 ` [PATCH 6/6] mmc: renesas_sdhi: make 'dmac_only_one_rx' " Wolfram Sang
@ 2022-04-01 14:13 ` Geert Uytterhoeven
2022-04-01 15:00 ` Wolfram Sang
0 siblings, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2022-04-01 14:13 UTC (permalink / raw)
To: Wolfram Sang; +Cc: Linux MMC List, Linux-Renesas
Hi Wolfram,
On Mon, Mar 21, 2022 at 6:33 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> After Shimoda-san's much appreciated refactoring of the quirk handling,
> we can convert now 'dmac_only_one_rx' from an ugly global flag to a
> regular quirk. This makes quirk handling more consistent and easier to
> maintain. After this patch, soc_dma_quirks is completely gone, hooray!
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Thanks for your patch!
> --- a/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> +++ b/drivers/mmc/host/renesas_sdhi_internal_dmac.c
> @@ -372,7 +378,7 @@ 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) &&
> + if (priv->quirks->dma_one_rx_only &&
If there are no quirks (yes, we do have such systems ;-), this will
crash with a NULL-pointer dereference. Actually patch 5/6 has the
same problem.
As I could reproduce the issue, and Ulf has already applied
this series, I've sent a patch:
https://lore.kernel.org/r/cc3178c2ff60f640f4d5a071d51f6b0b1db37656.1648822020.git.geert+renesas@glider.be
> test_and_set_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags))
> goto force_pio_with_unmap;
> } else {
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/6] mmc: renesas_sdhi: R-Car D3 also has no HS400
2022-04-01 13:01 ` Geert Uytterhoeven
@ 2022-04-01 14:59 ` Wolfram Sang
2022-04-01 15:08 ` Geert Uytterhoeven
0 siblings, 1 reply; 18+ messages in thread
From: Wolfram Sang @ 2022-04-01 14:59 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux MMC List, Linux-Renesas
[-- Attachment #1: Type: text/plain, Size: 345 bytes --]
> You mean the DS signal? That also doesn't exist on R-Car V3M, so
> shouldn't of_r8a77970_compatible.quirks be set to &sdhi_quirks_nohs400,
> too?
Probably. The BSP contains the DTS of a function board addon for the
Eagle board which also enables HS200 only. But I think we should try to
ask the Renesas HW team for confirmation. D'accord?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 6/6] mmc: renesas_sdhi: make 'dmac_only_one_rx' a quirk
2022-04-01 14:13 ` Geert Uytterhoeven
@ 2022-04-01 15:00 ` Wolfram Sang
0 siblings, 0 replies; 18+ messages in thread
From: Wolfram Sang @ 2022-04-01 15:00 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux MMC List, Linux-Renesas
[-- Attachment #1: Type: text/plain, Size: 132 bytes --]
> If there are no quirks (yes, we do have such systems ;-), this will
Wow, seems that slipped my reality :D Thanks for catching!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/6] mmc: renesas_sdhi: R-Car D3 also has no HS400
2022-04-01 14:59 ` Wolfram Sang
@ 2022-04-01 15:08 ` Geert Uytterhoeven
2022-04-01 15:20 ` Wolfram Sang
0 siblings, 1 reply; 18+ messages in thread
From: Geert Uytterhoeven @ 2022-04-01 15:08 UTC (permalink / raw)
To: Wolfram Sang, Linux MMC List, Linux-Renesas
Hi Wolfram,
On Fri, Apr 1, 2022 at 4:59 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> > You mean the DS signal? That also doesn't exist on R-Car V3M, so
> > shouldn't of_r8a77970_compatible.quirks be set to &sdhi_quirks_nohs400,
> > too?
>
> Probably. The BSP contains the DTS of a function board addon for the
> Eagle board which also enables HS200 only. But I think we should try to
> ask the Renesas HW team for confirmation. D'accord?
Sure.
BTW, SDHI0 and SDHI1 don't have the DS signal neither.
Does that mean we never support HS400 on these?
We do have SD0H and SD1H clocks.
Upstream DTS uses at most sd-uhs-sdr104 on SDHI[01].
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 18+ messages in thread
* Re: [PATCH 2/6] mmc: renesas_sdhi: R-Car D3 also has no HS400
2022-04-01 15:08 ` Geert Uytterhoeven
@ 2022-04-01 15:20 ` Wolfram Sang
0 siblings, 0 replies; 18+ messages in thread
From: Wolfram Sang @ 2022-04-01 15:20 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux MMC List, Linux-Renesas
[-- Attachment #1: Type: text/plain, Size: 285 bytes --]
> BTW, SDHI0 and SDHI1 don't have the DS signal neither.
> Does that mean we never support HS400 on these?
Yes, those don't even support eMMC.
> We do have SD0H and SD1H clocks.
> Upstream DTS uses at most sd-uhs-sdr104 on SDHI[01].
Yes, SDnH (and SCC) is also needed for SDR104.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 18+ messages in thread
end of thread, other threads:[~2022-04-01 15:55 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-20 12:30 [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Wolfram Sang
2022-03-20 12:30 ` [PATCH 1/6] mmc: renesas_sdhi: remove outdated headers Wolfram Sang
2022-04-01 12:48 ` Geert Uytterhoeven
2022-03-20 12:30 ` [PATCH 2/6] mmc: renesas_sdhi: R-Car D3 also has no HS400 Wolfram Sang
2022-04-01 13:01 ` Geert Uytterhoeven
2022-04-01 14:59 ` Wolfram Sang
2022-04-01 15:08 ` Geert Uytterhoeven
2022-04-01 15:20 ` Wolfram Sang
2022-03-20 12:30 ` [PATCH 3/6] mmc: renesas_sdhi: make setup selection more understandable Wolfram Sang
2022-04-01 13:02 ` Geert Uytterhoeven
2022-03-20 12:30 ` [PATCH 4/6] mmc: renesas_sdhi: remove a stale comment Wolfram Sang
2022-04-01 13:03 ` Geert Uytterhoeven
2022-03-20 12:30 ` [PATCH 5/6] mmc: renesas_sdhi: make 'fixed_addr_mode' a quirk Wolfram Sang
2022-04-01 13:08 ` Geert Uytterhoeven
2022-03-20 12:30 ` [PATCH 6/6] mmc: renesas_sdhi: make 'dmac_only_one_rx' " Wolfram Sang
2022-04-01 14:13 ` Geert Uytterhoeven
2022-04-01 15:00 ` Wolfram Sang
2022-03-28 14:04 ` [PATCH 0/6] mmc: renesas_sdhi: internal_dmac: updates after refactoring Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox