Skip to content

Commit 627151b

Browse files
Wolfram Sanggeertu
authored andcommitted
mmc: renesas_sdhi: Flag non-standard SDnH handling for V3M
V3M handles SDnH differently than other Gen3 SoCs, so let's add a separate entry for that. This will allow better SDnH handling in the future. Signed-off-by: Wolfram Sang <[email protected]> Acked-by: Ulf Hansson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 63494b6 commit 627151b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

drivers/mmc/host/renesas_sdhi.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ struct renesas_sdhi_scc {
1818
u32 tap_hs400_4tap; /* sampling clock position for HS400 (4 TAP) */
1919
};
2020

21+
#define SDHI_FLAG_NEED_CLKH_FALLBACK BIT(0)
22+
2123
struct renesas_sdhi_of_data {
2224
unsigned long tmio_flags;
2325
u32 tmio_ocr_mask;
@@ -31,6 +33,7 @@ struct renesas_sdhi_of_data {
3133
int taps_num;
3234
unsigned int max_blk_count;
3335
unsigned short max_segs;
36+
unsigned long sdhi_flags;
3437
};
3538

3639
#define SDHI_CALIB_TABLE_MAX 32

drivers/mmc/host/renesas_sdhi_internal_dmac.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,22 @@ static const struct renesas_sdhi_of_data of_data_rcar_gen3 = {
125125
/* DMAC can handle 32bit blk count but only 1 segment */
126126
.max_blk_count = UINT_MAX / TMIO_MAX_BLK_SIZE,
127127
.max_segs = 1,
128+
.sdhi_flags = SDHI_FLAG_NEED_CLKH_FALLBACK,
129+
};
130+
131+
static const struct renesas_sdhi_of_data of_data_rcar_gen3_no_fallback = {
132+
.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_CLK_ACTUAL |
133+
TMIO_MMC_HAVE_CBSY | TMIO_MMC_MIN_RCAR2,
134+
.capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |
135+
MMC_CAP_CMD23 | MMC_CAP_WAIT_WHILE_BUSY,
136+
.capabilities2 = MMC_CAP2_NO_WRITE_PROTECT | MMC_CAP2_MERGE_CAPABLE,
137+
.bus_shift = 2,
138+
.scc_offset = 0x1000,
139+
.taps = rcar_gen3_scc_taps,
140+
.taps_num = ARRAY_SIZE(rcar_gen3_scc_taps),
141+
/* DMAC can handle 32bit blk count but only 1 segment */
142+
.max_blk_count = UINT_MAX / TMIO_MAX_BLK_SIZE,
143+
.max_segs = 1,
128144
};
129145

130146
static const u8 r8a7796_es13_calib_table[2][SDHI_CALIB_TABLE_MAX] = {
@@ -214,6 +230,10 @@ static const struct renesas_sdhi_of_data_with_quirks of_r8a77965_compatible = {
214230
.quirks = &sdhi_quirks_r8a77965,
215231
};
216232

233+
static const struct renesas_sdhi_of_data_with_quirks of_r8a77970_compatible = {
234+
.of_data = &of_data_rcar_gen3_no_fallback,
235+
};
236+
217237
static const struct renesas_sdhi_of_data_with_quirks of_r8a77980_compatible = {
218238
.of_data = &of_data_rcar_gen3,
219239
.quirks = &sdhi_quirks_nohs400,
@@ -235,6 +255,7 @@ static const struct of_device_id renesas_sdhi_internal_dmac_of_match[] = {
235255
{ .compatible = "renesas,sdhi-r8a7796", .data = &of_rcar_gen3_compatible, },
236256
{ .compatible = "renesas,sdhi-r8a77961", .data = &of_r8a77961_compatible, },
237257
{ .compatible = "renesas,sdhi-r8a77965", .data = &of_r8a77965_compatible, },
258+
{ .compatible = "renesas,sdhi-r8a77970", .data = &of_r8a77970_compatible, },
238259
{ .compatible = "renesas,sdhi-r8a77980", .data = &of_r8a77980_compatible, },
239260
{ .compatible = "renesas,sdhi-r8a77990", .data = &of_r8a77990_compatible, },
240261
{ .compatible = "renesas,rcar-gen3-sdhi", .data = &of_rcar_gen3_compatible, },

0 commit comments

Comments
 (0)