From 902af10d67520bf5535b660bff2b28a98c194022 Mon Sep 17 00:00:00 2001 From: Hiroyuki Yokoyama Date: Sat, 7 Mar 2020 17:32:59 +0100 Subject: mmc: tmio: sdhi: Add DMA transfer address alignment check at writing In R-Car Gen 3, there is a DMA controller restriction of SDHI. When the transfer exceeding the 4 kByte boundary is performed while the DRAM address is not 128 byte aligned, the bus is occupied. This patch avoids this. Signed-off-by: Hiroyuki Yokoyama Signed-off-by: Marek Vasut Cc: Masahiro Yamada --- drivers/mmc/tmio-common.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/mmc/tmio-common.c b/drivers/mmc/tmio-common.c index faf1819..1dc13db 100644 --- a/drivers/mmc/tmio-common.c +++ b/drivers/mmc/tmio-common.c @@ -358,14 +358,16 @@ static int tmio_sd_dma_xfer(struct udevice *dev, struct mmc_data *data) } /* check if the address is DMA'able */ -static bool tmio_sd_addr_is_dmaable(const char *src) +static bool tmio_sd_addr_is_dmaable(struct mmc_data *data) { - uintptr_t addr = (uintptr_t)src; + uintptr_t addr = (uintptr_t)data->src; if (!IS_ALIGNED(addr, TMIO_SD_DMA_MINALIGN)) return false; #if defined(CONFIG_RCAR_GEN3) + if (!(data->flags & MMC_DATA_READ) && !IS_ALIGNED(addr, 128)) + return false; /* Gen3 DMA has 32bit limit */ if (addr >> 32) return false; @@ -480,7 +482,7 @@ int tmio_sd_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, if (data) { /* use DMA if the HW supports it and the buffer is aligned */ if (priv->caps & TMIO_SD_CAP_DMA_INTERNAL && - tmio_sd_addr_is_dmaable(data->src)) + tmio_sd_addr_is_dmaable(data)) ret = tmio_sd_dma_xfer(dev, data); else ret = tmio_sd_pio_xfer(dev, cmd, data); -- cgit v1.1 From 1601ea212623c9bdb479636bec9e7299b0cb14dd Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 30 Mar 2020 07:24:17 +0200 Subject: mmc: export mmc_send_ext_csd() Export function mmc_send_ext_csd() for reading the extended CSD register. Signed-off-by: Heinrich Schuchardt --- drivers/mmc/mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 3e36566..bfcdaa6 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -718,7 +718,7 @@ static int mmc_complete_op_cond(struct mmc *mmc) } -static int mmc_send_ext_csd(struct mmc *mmc, u8 *ext_csd) +int mmc_send_ext_csd(struct mmc *mmc, u8 *ext_csd) { struct mmc_cmd cmd; struct mmc_data data; -- cgit v1.1 From 0469d846364ae54fc380a813cc4c3e9e19bdc99a Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Mon, 30 Mar 2020 07:24:19 +0200 Subject: cmd: mmc: provide boot area protection command Provide command 'mmc wp' to power on write protect boot areas on eMMC devices. The B_PWR_WP_EN bit in the extended CSD register BOOT_WP is set. The boot area are write protected until the next power cycle occurs. Signed-off-by: Heinrich Schuchardt --- drivers/mmc/mmc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers') diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index bfcdaa6..fc3123c 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -810,6 +810,11 @@ int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value) return __mmc_switch(mmc, set, index, value, true); } +int mmc_boot_wp(struct mmc *mmc) +{ + return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_WP, 1); +} + #if !CONFIG_IS_ENABLED(MMC_TINY) static int mmc_set_card_speed(struct mmc *mmc, enum bus_mode mode, bool hsdowngrade) -- cgit v1.1 From d5b8500f033fd14c3ab6e66417ce8c819f7889db Mon Sep 17 00:00:00 2001 From: Bharat Kumar Reddy Gooty Date: Tue, 31 Mar 2020 11:04:03 +0530 Subject: drivers: mmc: iproc_sdhci: fix possible memory leak Free the pointer variable 'iproc_sdhci' upon failure to fix possible memory leak. Signed-off-by: Bharat Kumar Reddy Gooty Signed-off-by: Rayagonda Kokatanur --- drivers/mmc/iproc_sdhci.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/mmc/iproc_sdhci.c b/drivers/mmc/iproc_sdhci.c index 831dd32..36ecdba 100644 --- a/drivers/mmc/iproc_sdhci.c +++ b/drivers/mmc/iproc_sdhci.c @@ -176,8 +176,7 @@ static int iproc_sdhci_probe(struct udevice *dev) u32 f_min_max[2]; int ret; - iproc_host = (struct sdhci_iproc_host *) - malloc(sizeof(struct sdhci_iproc_host)); + iproc_host = malloc(sizeof(struct sdhci_iproc_host)); if (!iproc_host) { printf("%s: sdhci host malloc fail!\n", __func__); return -ENOMEM; @@ -198,6 +197,7 @@ static int iproc_sdhci_probe(struct udevice *dev) "clock-freq-min-max", f_min_max, 2); if (ret) { printf("sdhci: clock-freq-min-max not found\n"); + free(iproc_host); return ret; } host->max_clk = f_min_max[1]; @@ -212,8 +212,10 @@ static int iproc_sdhci_probe(struct udevice *dev) ret = sdhci_setup_cfg(&plat->cfg, &iproc_host->host, f_min_max[1], f_min_max[0]); - if (ret) + if (ret) { + free(iproc_host); return ret; + } iproc_host->host.mmc = &plat->mmc; iproc_host->host.mmc->dev = dev; -- cgit v1.1 From 2bb02b1a81d4168ebd254928d1f4720197e264c1 Mon Sep 17 00:00:00 2001 From: Bharat Kumar Reddy Gooty Date: Tue, 31 Mar 2020 11:04:04 +0530 Subject: drivers: mmc: iproc_sdhci: enable broken R1B response quirk Enable SDHCI_QUIRK_BROKEN_R1B quirk. Signed-off-by: Bharat Kumar Reddy Gooty Signed-off-by: Rayagonda Kokatanur --- drivers/mmc/iproc_sdhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mmc/iproc_sdhci.c b/drivers/mmc/iproc_sdhci.c index 36ecdba..f65a1e5 100644 --- a/drivers/mmc/iproc_sdhci.c +++ b/drivers/mmc/iproc_sdhci.c @@ -188,7 +188,7 @@ static int iproc_sdhci_probe(struct udevice *dev) host->ioaddr = (void *)devfdt_get_addr(dev); host->voltages = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34; - host->quirks = SDHCI_QUIRK_BROKEN_VOLTAGE; + host->quirks = SDHCI_QUIRK_BROKEN_VOLTAGE | SDHCI_QUIRK_BROKEN_R1B; host->host_caps = MMC_MODE_DDR_52MHz; host->index = fdtdec_get_uint(gd->fdt_blob, node, "index", 0); host->ops = &sdhci_platform_ops; -- cgit v1.1 From 7a65b8b6bb9992e3d07ca9aa44ee3a941fd67d0d Mon Sep 17 00:00:00 2001 From: Rayagonda Kokatanur Date: Tue, 31 Mar 2020 11:04:05 +0530 Subject: drivers: mmc: iproc_sdhci: fix compilation warning set_ios_post return type changed from void to int, correcting the same to fix compilation warning. Signed-off-by: Rayagonda Kokatanur Signed-off-by: Bharat Kumar Reddy Gooty --- drivers/mmc/iproc_sdhci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mmc/iproc_sdhci.c b/drivers/mmc/iproc_sdhci.c index f65a1e5..0f4d608 100644 --- a/drivers/mmc/iproc_sdhci.c +++ b/drivers/mmc/iproc_sdhci.c @@ -136,7 +136,7 @@ static void sdhci_iproc_writeb(struct sdhci_host *host, u8 val, int reg) } #endif -static void sdhci_iproc_set_ios_post(struct sdhci_host *host) +static int sdhci_iproc_set_ios_post(struct sdhci_host *host) { u32 ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); @@ -147,6 +147,8 @@ static void sdhci_iproc_set_ios_post(struct sdhci_host *host) ctrl |= UHS_DDR50_BUS_SPEED; sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); + + return 0; } static struct sdhci_ops sdhci_platform_ops = { -- cgit v1.1 From 29617ca39a087a3c78a2ea2515090b4aa24ad014 Mon Sep 17 00:00:00 2001 From: Rayagonda Kokatanur Date: Tue, 31 Mar 2020 11:04:06 +0530 Subject: drivers: mmc: iproc_sdhci: move host.mmc init before sdhci_setup_cfg move host.mmc before sdhci_setup_cfg Signed-off-by: Rayagonda Kokatanur Signed-off-by: Bharat Kumar Reddy Gooty --- drivers/mmc/iproc_sdhci.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/mmc/iproc_sdhci.c b/drivers/mmc/iproc_sdhci.c index 0f4d608..c2319b4 100644 --- a/drivers/mmc/iproc_sdhci.c +++ b/drivers/mmc/iproc_sdhci.c @@ -212,6 +212,11 @@ static int iproc_sdhci_probe(struct udevice *dev) memcpy(&iproc_host->host, host, sizeof(struct sdhci_host)); + iproc_host->host.mmc = &plat->mmc; + iproc_host->host.mmc->dev = dev; + iproc_host->host.mmc->priv = &iproc_host->host; + upriv->mmc = iproc_host->host.mmc; + ret = sdhci_setup_cfg(&plat->cfg, &iproc_host->host, f_min_max[1], f_min_max[0]); if (ret) { @@ -219,11 +224,6 @@ static int iproc_sdhci_probe(struct udevice *dev) return ret; } - iproc_host->host.mmc = &plat->mmc; - iproc_host->host.mmc->dev = dev; - iproc_host->host.mmc->priv = &iproc_host->host; - upriv->mmc = iproc_host->host.mmc; - return sdhci_probe(dev); } -- cgit v1.1 From d2661d8e9f9e83cb15ab981cb42e84c51bd85c2d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 4 Apr 2020 12:45:04 +0200 Subject: mmc: tmio: sdhi: Use bounce buffer to avoid DMA limitations The R-Car SDHI DMA controller has various restrictions. To work around those restrictions without falling back to PIO, implement bounce buffer with custom alignment check function which tests for those limitations. Signed-off-by: Marek Vasut Cc: Daniel Schwierzeck Cc: Masahiro Yamada Cc: Peng Fan Cc: Simon Glass Cc: Tom Rini --- drivers/mmc/Kconfig | 1 + drivers/mmc/renesas-sdhi.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) (limited to 'drivers') diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig index bb38787..8f0df56 100644 --- a/drivers/mmc/Kconfig +++ b/drivers/mmc/Kconfig @@ -358,6 +358,7 @@ config RENESAS_SDHI depends on ARCH_RMOBILE depends on BLK && DM_MMC depends on OF_CONTROL + select BOUNCE_BUFFER help This selects support for the Matsushita SD/MMC Host Controller on Renesas R-Car SoCs. diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c index c3b1313..231a781 100644 --- a/drivers/mmc/renesas-sdhi.c +++ b/drivers/mmc/renesas-sdhi.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -689,12 +690,88 @@ static int renesas_sdhi_wait_dat0(struct udevice *dev, int state, } #endif +#define RENESAS_SDHI_DMA_ALIGNMENT 128 + +static int renesas_sdhi_addr_aligned(struct bounce_buffer *state) +{ + uintptr_t ubuf = (uintptr_t)state->user_buffer; + + /* Check if start is aligned */ + if (!IS_ALIGNED(ubuf, RENESAS_SDHI_DMA_ALIGNMENT)) { + debug("Unaligned buffer address %p\n", state->user_buffer); + return 0; + } + + /* Check if length is aligned */ + if (state->len != state->len_aligned) { + debug("Unaligned buffer length %zu\n", state->len); + return 0; + } + +#ifdef CONFIG_PHYS_64BIT + /* Check if below 32bit boundary */ + if ((ubuf >> 32) || (ubuf + state->len_aligned) >> 32) { + debug("Buffer above 32bit boundary %p-%p\n", + state->user_buffer, + state->user_buffer + state->len_aligned); + return 0; + } +#endif + + /* Aligned */ + return 1; +} + static int renesas_sdhi_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, struct mmc_data *data) { + struct bounce_buffer bbstate; + unsigned int bbflags; + bool bbok = false; + size_t len; + void *buf; int ret; + if (data) { + if (data->flags & MMC_DATA_READ) { + buf = data->dest; + bbflags = GEN_BB_WRITE; + } else { + buf = (void *)data->src; + bbflags = GEN_BB_READ; + } + len = data->blocks * data->blocksize; + + ret = bounce_buffer_start_extalign(&bbstate, buf, len, bbflags, + RENESAS_SDHI_DMA_ALIGNMENT, + renesas_sdhi_addr_aligned); + /* + * If the amount of data to transfer is too large, we can get + * -ENOMEM when starting the bounce buffer. If that happens, + * fall back to PIO as it was before, otherwise use the BB. + */ + if (!ret) { + bbok = true; + if (data->flags & MMC_DATA_READ) + data->dest = bbstate.bounce_buffer; + else + data->src = bbstate.bounce_buffer; + } + } + ret = tmio_sd_send_cmd(dev, cmd, data); + + if (data && bbok) { + buf = bbstate.user_buffer; + + bounce_buffer_stop(&bbstate); + + if (data->flags & MMC_DATA_READ) + data->dest = buf; + else + data->src = buf; + } + if (ret) return ret; -- cgit v1.1 From 145429aac05b399c3543ebb86799f4ed753328c4 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 4 Apr 2020 12:45:05 +0200 Subject: mmc: Add option to adjust b_max before long read Add getter function which permits adjusting the maximum number of blocks that could be read in a single sustained read transfer based on the location of the source/target buffer and length, before such transfer starts. This is mainly useful on systems which have various DMA restrictions for different memory locations, e.g. DMA limited to 32bit addresses, and where a bounce buffer is used to work around such restrictions. Since the U-Boot bounce buffer is mallocated, it's size is limited by the malloc area size, and the read transfer to such a buffer must also be limited. However, as not all areas are limited equally, the b_max should be adjusted accordinly as needed to avoid degrading performance unnecessarily. Signed-off-by: Marek Vasut Cc: Daniel Schwierzeck Cc: Masahiro Yamada Cc: Peng Fan Cc: Simon Glass Cc: Tom Rini --- drivers/mmc/mmc-uclass.c | 16 ++++++++++++++++ drivers/mmc/mmc.c | 16 ++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c index c75892a..cb26d84 100644 --- a/drivers/mmc/mmc-uclass.c +++ b/drivers/mmc/mmc-uclass.c @@ -13,6 +13,22 @@ #include #include "mmc_private.h" +int dm_mmc_get_b_max(struct udevice *dev, void *dst, lbaint_t blkcnt) +{ + struct dm_mmc_ops *ops = mmc_get_ops(dev); + struct mmc *mmc = mmc_get_mmc_dev(dev); + + if (ops->get_b_max) + return ops->get_b_max(dev, dst, blkcnt); + else + return mmc->cfg->b_max; +} + +int mmc_get_b_max(struct mmc *mmc, void *dst, lbaint_t blkcnt) +{ + return dm_mmc_get_b_max(mmc->dev, dst, blkcnt); +} + int dm_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, struct mmc_data *data) { diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index fc3123c..523c055 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -409,6 +409,16 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start, return blkcnt; } +#if !CONFIG_IS_ENABLED(DM_MMC) +static int mmc_get_b_max(struct mmc *mmc, void *dst, lbaint_t blkcnt) +{ + if (mmc->cfg->ops->get_b_max) + return mmc->cfg->ops->get_b_max(mmc, dst, blkcnt); + else + return mmc->cfg->b_max; +} +#endif + #if CONFIG_IS_ENABLED(BLK) ulong mmc_bread(struct udevice *dev, lbaint_t start, lbaint_t blkcnt, void *dst) #else @@ -422,6 +432,7 @@ ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, int dev_num = block_dev->devnum; int err; lbaint_t cur, blocks_todo = blkcnt; + uint b_max; if (blkcnt == 0) return 0; @@ -451,9 +462,10 @@ ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt, return 0; } + b_max = mmc_get_b_max(mmc, dst, blkcnt); + do { - cur = (blocks_todo > mmc->cfg->b_max) ? - mmc->cfg->b_max : blocks_todo; + cur = (blocks_todo > b_max) ? b_max : blocks_todo; if (mmc_read_blocks(mmc, dst, start, cur) != cur) { pr_debug("%s: Failed to read blocks\n", __func__); return 0; -- cgit v1.1 From 4a66d4ee336048b51bf5701a2abfac9a79c5a860 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sat, 4 Apr 2020 12:45:06 +0200 Subject: mmc: tmio: sdhi: Implement get_b_max function Implement get_b_max() for the Renesas R-Car SDHI controller driver, limit the b_max per hardware capabilities such that select Gen2 controllers have 16bit block transfer limit, the rest has 32bit block transfer limit and on Gen3, the block transfer limit on addresses above the 32bit boundary is set to 1/4 of the malloc area. Originally, on Gen3, the block transfers above the 32bit area were limited to PIO only, which resulted in (R8A7795 Salvator-X , HS200 eMMC): => time mmc read 0x0000000700000000 0 0x10000 time: 0.151 seconds => time mmc read 0x0000000700000000 0 0x100000 time: 11.090 seconds with bounce buffer in place and b_max adjustment in place: => time mmc read 0x0000000700000000 0 0x10000 time: 0.156 seconds => time mmc read 0x0000000700000000 0 0x100000 time: 2.349 seconds Note that the bounce buffer does mallocate and free the bounce buffer for every transfer. Experiment which removes this results in further increase of read speed, from 2.349s to 2.156s per 512 MiB of data, which is not such a significant improvement anymore. It might however be interesting to have bounce buffer directly in the MMC core or even block core. Signed-off-by: Marek Vasut Cc: Daniel Schwierzeck Cc: Masahiro Yamada Cc: Peng Fan Cc: Simon Glass Cc: Tom Rini --- drivers/mmc/renesas-sdhi.c | 46 ++++++++++++++++++++++++++++++++++++---------- drivers/mmc/tmio-common.h | 1 + 2 files changed, 37 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/mmc/renesas-sdhi.c b/drivers/mmc/renesas-sdhi.c index 231a781..88a7160 100644 --- a/drivers/mmc/renesas-sdhi.c +++ b/drivers/mmc/renesas-sdhi.c @@ -692,28 +692,26 @@ static int renesas_sdhi_wait_dat0(struct udevice *dev, int state, #define RENESAS_SDHI_DMA_ALIGNMENT 128 -static int renesas_sdhi_addr_aligned(struct bounce_buffer *state) +static int renesas_sdhi_addr_aligned_gen(uintptr_t ubuf, + size_t len, size_t len_aligned) { - uintptr_t ubuf = (uintptr_t)state->user_buffer; - /* Check if start is aligned */ if (!IS_ALIGNED(ubuf, RENESAS_SDHI_DMA_ALIGNMENT)) { - debug("Unaligned buffer address %p\n", state->user_buffer); + debug("Unaligned buffer address %lx\n", ubuf); return 0; } /* Check if length is aligned */ - if (state->len != state->len_aligned) { - debug("Unaligned buffer length %zu\n", state->len); + if (len != len_aligned) { + debug("Unaligned buffer length %zu\n", len); return 0; } #ifdef CONFIG_PHYS_64BIT /* Check if below 32bit boundary */ - if ((ubuf >> 32) || (ubuf + state->len_aligned) >> 32) { - debug("Buffer above 32bit boundary %p-%p\n", - state->user_buffer, - state->user_buffer + state->len_aligned); + if ((ubuf >> 32) || (ubuf + len_aligned) >> 32) { + debug("Buffer above 32bit boundary %lx-%lx\n", + ubuf, ubuf + len_aligned); return 0; } #endif @@ -722,6 +720,14 @@ static int renesas_sdhi_addr_aligned(struct bounce_buffer *state) return 1; } +static int renesas_sdhi_addr_aligned(struct bounce_buffer *state) +{ + uintptr_t ubuf = (uintptr_t)state->user_buffer; + + return renesas_sdhi_addr_aligned_gen(ubuf, state->len, + state->len_aligned); +} + static int renesas_sdhi_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, struct mmc_data *data) { @@ -789,6 +795,24 @@ static int renesas_sdhi_send_cmd(struct udevice *dev, struct mmc_cmd *cmd, return 0; } +int renesas_sdhi_get_b_max(struct udevice *dev, void *dst, lbaint_t blkcnt) +{ + struct tmio_sd_priv *priv = dev_get_priv(dev); + struct mmc_uclass_priv *upriv = dev_get_uclass_priv(dev); + struct mmc *mmc = upriv->mmc; + size_t len = blkcnt * mmc->read_bl_len; + size_t len_align = roundup(len, RENESAS_SDHI_DMA_ALIGNMENT); + + if (renesas_sdhi_addr_aligned_gen((uintptr_t)dst, len, len_align)) { + if (priv->quirks & TMIO_SD_CAP_16BIT) + return U16_MAX; + else + return U32_MAX; + } else { + return (CONFIG_SYS_MALLOC_LEN / 4) / mmc->read_bl_len; + } +} + static const struct dm_mmc_ops renesas_sdhi_ops = { .send_cmd = renesas_sdhi_send_cmd, .set_ios = renesas_sdhi_set_ios, @@ -801,6 +825,7 @@ static const struct dm_mmc_ops renesas_sdhi_ops = { #if CONFIG_IS_ENABLED(MMC_UHS_SUPPORT) .wait_dat0 = renesas_sdhi_wait_dat0, #endif + .get_b_max = renesas_sdhi_get_b_max, }; #define RENESAS_GEN2_QUIRKS TMIO_SD_CAP_RCAR_GEN2 @@ -966,6 +991,7 @@ static int renesas_sdhi_probe(struct udevice *dev) return ret; } + priv->quirks = quirks; ret = tmio_sd_probe(dev, quirks); renesas_sdhi_filter_caps(dev); diff --git a/drivers/mmc/tmio-common.h b/drivers/mmc/tmio-common.h index 0474588..2f671df 100644 --- a/drivers/mmc/tmio-common.h +++ b/drivers/mmc/tmio-common.h @@ -147,6 +147,7 @@ struct tmio_sd_priv { u8 adjust_hs400_calibrate; u8 hs400_bad_tap; const u8 *adjust_hs400_calib_table; + u32 quirks; #endif ulong (*clk_get_rate)(struct tmio_sd_priv *); }; -- cgit v1.1 From 2448c34f9fc26d3c459e6e7b28c6357656bfa287 Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Wed, 15 Apr 2020 18:28:09 +0200 Subject: drivers: mmc: rpmb: do not build for SPL RPMB support is used by the 'mmc rpmb' command and by the OP-TEE support. We do not need it in SPL. Signed-off-by: Heinrich Schuchardt Reviewed-by: Peng Fan Reviewed-by: Tom Rini --- drivers/mmc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile index 615b724..e84c792 100644 --- a/drivers/mmc/Makefile +++ b/drivers/mmc/Makefile @@ -38,7 +38,7 @@ obj-$(CONFIG_MMC_MXC) += mxcmmc.o obj-$(CONFIG_MMC_MXS) += mxsmmc.o obj-$(CONFIG_MMC_PCI) += pci_mmc.o obj-$(CONFIG_PXA_MMC_GENERIC) += pxa_mmc_gen.o -obj-$(CONFIG_SUPPORT_EMMC_RPMB) += rpmb.o +obj-$(CONFIG_$(SPL_TPL_)SUPPORT_EMMC_RPMB) += rpmb.o obj-$(CONFIG_MMC_SANDBOX) += sandbox_mmc.o obj-$(CONFIG_SH_MMCIF) += sh_mmcif.o obj-$(CONFIG_SH_SDHI) += sh_sdhi.o -- cgit v1.1