mmc: tmio: fixup patches
Subsystems (8)
A message that is not in the archive (sent off-list or not yet received): d3d6aa34548248768494ad88056cf4bd@SINPR06MB105.apcprd06.prod.outlook.com
A message that is not in the archive (sent off-list or not yet received): 87simtenpi.wl%[email protected]
A message that is not in the archive (sent off-list or not yet received): cb608c5e763f47b597936724ec05b615@SINPR06MB105.apcprd06.prod.outlook.com
A message that is not in the archive (sent off-list or not yet received): 87pphxe2q0.wl%[email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
cover mmc: tmio: fixup patches
Hi Chris, Simon
These are fixup patches for mmc tmio/shmobile. I tesed these patches on my environment.
I'm very happy if someone test these patches.
These patches modify TMIO driver,
but, basically it has no effect to non-Renesas chip. I CC:ed Ian who created original TMIO driver.
Kuninori Morimoto (3):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
Shinobu Uehara (6):
mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
mmc: block: add block number limitation flag for multiple block read
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: check ILL_FUNC instead of CBSY
mmc: tmio: add actual clock support as option
arch/arm/mach-shmobile/board-koelsch.c | 6 ++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 ++++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 27 +++++++++++++++++++--- drivers/mmc/host/tmio_mmc_dma.c | 8 +++---- drivers/mmc/host/tmio_mmc_pio.c | 39 +++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++ include/linux/mmc/host.h | 3 +++ 8 files changed, 110 insertions(+), 18 deletions(-)
PATCH 1/10 mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
From: Shinobu Uehara <[email protected]>
--- drivers/mmc/host/sh_mobile_sdhi.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/sh_mobile_sdhi.c +1 -0
@@ -126,6 +126,7 @@ static int sh_mobile_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)case CTL_SD_MEM_CARD_OPT :case CTL_TRANSACTION_CTL :case CTL_DMA_ENABLE : +case EXT_ACC :return sh_mobile_sdhi_wait_idle (host); }
Signature · 1 line
1.7.9.5
Re: [PATCH 01/10] mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
Hello.
Quoted 3 lines · Kuninori Morimoto
From: Shinobu Uehara <[email protected]>
Signed-off-by Shinobu Uehara <[email protected]>
Morimoto-san, when the patches pass thru you, you need to sign off on them.
WBR, Sergei
Re: [PATCH 01/10] mmc: sh_mobile_sdhi: Add EXT_ACC register busy check
Hi Sergei
Quoted 5 lines
Quoted 3 lines
From: Shinobu Uehara <[email protected]>
Signed-off-by Shinobu Uehara <[email protected]>Morimoto-san, when the patches pass thru you, you need to sign off on them.
Ahh... yes indeed.
Thank you for pointing it.
Will fix in v2
Best regards
---
Kuninori Morimoto
PATCH 2/10 mmc: block: add block number limitation flag for multiple block read
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
In some controllers, when performing a multiple block read of one or two blocks, depending on the timing with which the response register is read, the response value may not be read properly.MMC_CAP2_NO_MULTI_READ flags disable all multiple block read, but, it is over-kill for this issue.
This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read when it was two blocks.
This is additional option of MMC_CAP2_NO_MULTI_READ
[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
--- arch/arm/mach-shmobile/board-koelsch.c | 6 +++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 2 +- include/linux/mmc/host.h | 3 +++ 5 files changed, 26 insertions(+), 8 deletions(-)
arch/arm/mach-shmobile/board-koelsch.c +3 -3
@@ -333,7 +333,7 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT , };
@@ -346,7 +346,7 @@ static struct resource sdhi0_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi1_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT , };
@@ -359,7 +359,7 @@ static struct resource sdhi1_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi2_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };
arch/arm/mach-shmobile/board-lager.c +2 -2
@@ -634,7 +634,7 @@ static void __init lager_add_rsnd_device(void)static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };
@@ -648,7 +648,7 @@ static struct resource sdhi0_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi2_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };
drivers/mmc/card/block.c +17 -2
@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,/* Some controllers can't do multiblock reads due to hw bugs */ if (card->host->caps2 &MMC_CAP2_NO_MULTI_READ && -rq_data_dir (req) =READ ) - brq->data.blocks =1 ; +rq_data_dir (req) =READ ) { + +if (card->host->caps2 &MMC_CAP2_2BLKS_LIMIT ) { +/* +* In some controllers, when performing a +* multiple block read of one or two blocks, +* depending on the timing with which the +* response register is read, the response +* value may not be read properly. +* Use single block read for this HW bug +*/ +if (brq->data.blocks =2 ) + brq->data.blocks =1 ; + }else { + brq->data.blocks =1 ; + } + } }if (brq->data.blocks >1 || do_rel_wr) {
drivers/mmc/host/sh_mobile_sdhi.c +1 -1
@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , - .capabilities2 =MMC_CAP2_NO_MULTI_READ , + .capabilities2 =MMC_CAP2_NO_2BLKS_READ , };static const struct of_device_id sh_mobile_sdhi_of_match[] = {
include/linux/mmc/host.h +3 -0
@@ -266,6 +266,9 @@ struct mmc_host {#define MMC_CAP2_BOOTPART_NOACC (1 << 0)/* Boot partition no access */ #define MMC_CAP2_FULL_PWR_CYCLE (1 << 2)/* Can do full power cycle */ #define MMC_CAP2_NO_MULTI_READ (1 << 3)/* Multiblock reads don't work */ +#define MMC_CAP2_2BLKS_LIMIT (1 << 4)/* 2 blocks limit for multi read */ +#define MMC_CAP2_NO_2BLKS_READ (MMC_CAP2_NO_MULTI_READ | \ + MMC_CAP2_2BLKS_LIMIT)#define MMC_CAP2_HS200_1_8V_SDR (1 << 5)/* can support */ #define MMC_CAP2_HS200_1_2V_SDR (1 << 6)/* can support */ #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \
Signature · 1 line
1.7.9.5
PATCH 3/10 mmc: tmio: care about DMA tx/rx addr offset
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Basically, SD_BUF0 Tx/Rx addresses are same in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)
This patch adds new .dma_rx_offset and cares it
--- drivers/mmc/host/sh_mobile_sdhi.c | 3 +++ drivers/mmc/host/tmio_mmc_dma.c | 2 +- include/linux/mfd/tmio.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/sh_mobile_sdhi.c +3 -0
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {unsigned long tmio_flags;unsigned long capabilities;unsigned long capabilities2; +dma_addr_t dma_rx_offset; };static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, .capabilities2 = MMC_CAP2_NO_2BLKS_READ, + .dma_rx_offset = 0x2000, };static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -229,6 +231,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) mmc_data->flags |= of_data->tmio_flags; mmc_data->capabilities |= of_data->capabilities; mmc_data->capabilities2 |= of_data->capabilities2; + dma_priv->dma_rx_offset = of_data->dma_rx_offset; }/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
drivers/mmc/host/tmio_mmc_dma.c +1 -1
@@ -311,7 +311,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdatif (pdata->dma->chan_priv_rx) cfg.slave_id = pdata->dma->slave_id_rx; cfg.direction =DMA_DEV_TO_MEM ; - cfg.src_addr = cfg.dst_addr; + cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset; cfg.dst_addr =0 ; ret =dmaengine_slave_config (host->chan_rx, &cfg);if (ret <0 )
include/linux/mfd/tmio.h +1 -0
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {int slave_id_tx;int slave_id_rx;int alignment_shift; +dma_addr_t dma_rx_offset;bool (*filter)(struct dma_chan *chan,void *arg); };
Signature · 1 line
1.7.9.5
PATCH 4/10 mmc: tmio: clear error IRQ status
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Next card access will be always
error if it didn't clear error status
--- drivers/mmc/host/tmio_mmc_pio.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mmc/host/tmio_mmc_pio.c +3 -0
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,pr_debug_status (*status);pr_debug_status (*ireg); + +/* Clear the status except the interrupt status */ +sd_ctrl_write32 (host,CTL_STATUS ,TMIO_MASK_IRQ ); } static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
Signature · 1 line
1.7.9.5
PATCH 5/10 mmc: tmio: control multiple block transfer mode
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Renesas SDHI has "Multiple Block Transfer Mode" settings on SD_CMD register which controls CMD12 automatically.
This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)
[Kuninori Morimoto: tidyuped for upstreaming
enabled this flags for all SH-Mobile/R-Car]
--- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_pio.c | 10 ++++++++++ include/linux/mfd/tmio.h | 6 ++++++ 3 files changed, 21 insertions(+)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -226,6 +226,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_SDIO_IRQ ; +/* +* All SDHI have CMD12 controll bit +*/ + mmc_data->flags |=TMIO_MMC_HAVE_CMD12_CTRL ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_pio.c +10 -0
@@ -44,6 +44,7 @@#include <linux/pm_qos.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include <linux/mmc/sdio.h> #include <linux/scatterlist.h> #include <linux/spinlock.h> #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)#define TRANSFER_READ 0x1000#define TRANSFER_MULTI 0x2000#define SECURITY_CMD 0x4000 +#define NO_CMD12_ISSUE 0x4000/* TMIO_MMC_HAVE_CMD12_CTRL */ static int tmio_mmc_start_command (struct tmio_mmc_host *host,struct mmc_command *cmd) {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_commandif (data->blocks >1 ) {sd_ctrl_write16 (host,CTL_STOP_INTERNAL_ACTION ,0x100 ); c |=TRANSFER_MULTI ; + +/* +* Disable auto CMD12 at IO_RW_EXTENDED when +* multiple block transfer +*/ +if ((host->pdata->flags &TMIO_MMC_HAVE_CMD12_CTRL ) && + (cmd->opcode ==SD_IO_RW_EXTENDED )) + c |=NO_CMD12_ISSUE ; }if (data->flags &MMC_DATA_READ ) c |=TRANSFER_READ ;
include/linux/mfd/tmio.h +6 -0
@@ -83,6 +83,12 @@*/ #define TMIO_MMC_HAVE_HIGH_REG (1 << 6) +/* +* Some controllers have CMD12 automatically +* issue/non-issue register +*/ +#define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH 6/10 mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Renesas R-Car SDHI should set reserved bits on CTL_SDIO_STATUS register when writing. This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags for this purpose
[Kuninori Morimoto: tidyuped for upstreaming
enabled this flags for all SH-Mobile/R-Car]
--- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_pio.c | 7 ++++++- include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -231,6 +231,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_HAVE_CMD12_CTRL ; +/* +* All SDHI need SDIO_INFO1 reserved bit +*/ + mmc_data->flags |=TMIO_MMC_SDIO_STATUS_QUIRK ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_pio.c +6 -1
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)struct mmc_host *mmc = host->mmc;struct tmio_mmc_data *pdata = host->pdata;unsigned int ireg, status; +unsigned int sdio_status;if (!(pdata->flags &TMIO_MMC_SDIO_IRQ ))return IRQ_HANDLED ;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid) status =sd_ctrl_read16 (host,CTL_SDIO_STATUS ); ireg = status &TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask; -sd_ctrl_write16 (host,CTL_SDIO_STATUS , status & ~TMIO_SDIO_MASK_ALL ); + sdio_status = status & ~TMIO_SDIO_MASK_ALL ; +if (pdata->flags &TMIO_MMC_SDIO_STATUS_QUIRK ) + sdio_status |=6 ; + +sd_ctrl_write16 (host,CTL_SDIO_STATUS , sdio_status);if (mmc->caps &MMC_CAP_SDIO_IRQ && ireg &TMIO_SDIO_STAT_IOIRQ )mmc_signal_sdio_irq (mmc);
include/linux/mfd/tmio.h +5 -0
@@ -89,6 +89,11 @@*/ #define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) +/* +* Some controllers needs to set 1 on SDIO status reserved bits +*/ +#define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH 7/10 mmc: tmio: check ILL_FUNC instead of CBSY
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Some controllers need to check SD bus status when writing data. Then, it checks ILL_FUNC bit on SD_INFO2 register, and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags. Same method is required on tmio_mmc_data_irq() which will be called after writing data.
Current driver is checking CBSY bit for this purpose, but, some controllers doesn't have CBSY bit. This patch checks ILL_FUNC bit instead of CBSY bit if it has TMIO_MMC_HAS_IDLE_WAIT flags
[Kuninori Morimoto: tidyuped for upstreaming]
--- drivers/mmc/host/tmio_mmc_pio.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/mmc/host/tmio_mmc_pio.c +12 -1
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host) goto out;if (host->chan_tx && (data->flags &MMC_DATA_WRITE ) && !host->force_pio) { +u32 status =sd_ctrl_read32 (host,CTL_STATUS ); +bool done = false; +/* * Has all data been written out yet? Testing on SuperH showed, * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)* DATAEND interrupt with the BUSY bit set, in this cases * waiting for one more interrupt fixes the problem. */ -if (!(sd_ctrl_read32 (host,CTL_STATUS ) &TMIO_STAT_CMD_BUSY )) { +if (host->pdata->flags &TMIO_MMC_HAS_IDLE_WAIT ) { +if (status &TMIO_STAT_ILL_FUNC ) + done = true; + }else { +if (!(status &TMIO_STAT_CMD_BUSY )) + done = true; + } + +if (done) {tmio_mmc_disable_mmc_irqs (host,TMIO_STAT_DATAEND );tasklet_schedule (&host->dma_complete); }
Signature · 1 line
1.7.9.5
PATCH 8/10 mmc: tmio: remove Renesas specific #ifdef
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag, and remove Renesas specific #ifdef from tmio driver
--- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_dma.c | 6 ++---- include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 12 insertions(+), 4 deletions(-)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -236,6 +236,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_SDIO_STATUS_QUIRK ; +/* +* All SDHI have DMA control register +*/ + mmc_data->flags |=TMIO_MMC_HAVE_CTL_DMA_REG ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_dma.c +2 -4
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)if (!host->chan_tx || !host->chan_rx)return ; -#if defined(CONFIG_SUPERH ) || defined(CONFIG_ARCH_SHMOBILE ) -/* Switch DMA mode on or off - SuperH specific? */ -sd_ctrl_write16 (host,CTL_DMA_ENABLE , enable ?2 :0 ); -#endif +if (host->pdata->flags &TMIO_MMC_HAVE_CTL_DMA_REG ) +sd_ctrl_write16 (host,CTL_DMA_ENABLE , enable ?2 :0 ); }void tmio_mmc_abort_dma (struct tmio_mmc_host *host)
include/linux/mfd/tmio.h +5 -0
@@ -94,6 +94,11 @@*/ #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) +/* +* Some controllers have DMA enable/disable register +*/ +#define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH 9/10 mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(), and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.
--- drivers/mmc/host/tmio_mmc_pio.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/host/tmio_mmc_pio.c +0 -1
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)for (clock = host->mmc->f_min, clk =0x80000080 ; new_clock >= (clock<<1 ); clk >>=1 ) clock <<=1 ; - clk |=0x100 ; }if (host->set_clk_div)
Signature · 1 line
1.7.9.5
PATCH 10/10 mmc: tmio: add actual clock support as option
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Some controller is supporting actual clock on SD_CLK_CTRL :: DIV[7:0]. Renesas SH-Mobile SDHI doesn't support,
but, Renesas R-Car SDHI supports it.
This patch adds new TMIO_MMC_CLK_ACTUAL flag for it.
[Kuninori Morimoto: tidyuped for upstreaming]
--- drivers/mmc/host/sh_mobile_sdhi.c | 6 ++++-- drivers/mmc/host/tmio_mmc_pio.c | 5 +++++ include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-)
drivers/mmc/host/sh_mobile_sdhi.c +4 -2
@@ -49,12 +49,14 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = { };static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = { - .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , + .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE | +TMIO_MMC_CLK_ACTUAL , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , };static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { - .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , + .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE | +TMIO_MMC_CLK_ACTUAL , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , .capabilities2 =MMC_CAP2_NO_2BLKS_READ , .dma_rx_offset =0x2000 ,
drivers/mmc/host/tmio_mmc_pio.c +5 -0
@@ -150,6 +150,11 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)for (clock = host->mmc->f_min, clk =0x80000080 ; new_clock >= (clock<<1 ); clk >>=1 ) clock <<=1 ; + +/* 1/1 clock is option */ +if ((host->pdata->flags &TMIO_MMC_CLK_ACTUAL ) && + ((clk >>22 ) &0x1 )) + clk |=0xff ; }if (host->set_clk_div)
include/linux/mfd/tmio.h +5 -0
@@ -99,6 +99,11 @@*/ #define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) +/* +* Some controllers allows to set SDx actual clock +*/ +#define TMIO_MMC_CLK_ACTUAL (1 << 10) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
Hi Chris, Simon
These are v2 of fixup patches for mmc tmio/shmobile. I tesed these patches on my environment.
I'm very happy if someone test these patches.
Kuninori Morimoto (4):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
mmc: tmio: ensure that the clock has been stopped before set_clock
Shinobu Uehara (6):
mmc: block: add block number limitation flag for multiple block read
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: check ILL_FUNC instead of CBSY
mmc: tmio: add actual clock support as option
arch/arm/mach-shmobile/board-koelsch.c | 6 ++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 26 ++++++++++++++++++--- drivers/mmc/host/tmio_mmc_dma.c | 8 +++---- drivers/mmc/host/tmio_mmc_pio.c | 40 +++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++ include/linux/mmc/host.h | 3 +++ 8 files changed, 110 insertions(+), 18 deletions(-)
PATCH v2 1/10 mmc: block: add block number limitation flag for multiple block read
From: Shinobu Uehara <[email protected]>
In some controllers, when performing a multiple block read of one or two blocks, depending on the timing with which the response register is read, the response value may not be read properly.MMC_CAP2_NO_MULTI_READ flags disable all multiple block read, but, it is over-kill for this issue.
This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read when it was two blocks.
This is additional option of MMC_CAP2_NO_MULTI_READ
[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
--- arch/arm/mach-shmobile/board-koelsch.c | 6 +++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 2 +- include/linux/mmc/host.h | 3 +++ 5 files changed, 26 insertions(+), 8 deletions(-)
arch/arm/mach-shmobile/board-koelsch.c +3 -3
@@ -333,7 +333,7 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT , };
@@ -346,7 +346,7 @@ static struct resource sdhi0_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi1_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT , };
@@ -359,7 +359,7 @@ static struct resource sdhi1_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi2_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };
arch/arm/mach-shmobile/board-lager.c +2 -2
@@ -634,7 +634,7 @@ static void __init lager_add_rsnd_device(void)static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };
@@ -648,7 +648,7 @@ static struct resource sdhi0_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi2_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };
drivers/mmc/card/block.c +17 -2
@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,/* Some controllers can't do multiblock reads due to hw bugs */ if (card->host->caps2 &MMC_CAP2_NO_MULTI_READ && -rq_data_dir (req) ==READ ) - brq->data.blocks =1 ; +rq_data_dir (req) ==READ ) { + +if (card->host->caps2 &MMC_CAP2_2BLKS_LIMIT ) { +/* +* In some controllers, when performing a +* multiple block read of one or two blocks, +* depending on the timing with which the +* response register is read, the response +* value may not be read properly. +* Use single block read for this HW bug +*/ +if (brq->data.blocks ==2 ) + brq->data.blocks =1 ; + }else { + brq->data.blocks =1 ; + } + } }if (brq->data.blocks >1 || do_rel_wr) {
drivers/mmc/host/sh_mobile_sdhi.c +1 -1
@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , - .capabilities2 =MMC_CAP2_NO_MULTI_READ , + .capabilities2 =MMC_CAP2_NO_2BLKS_READ , };static const struct of_device_id sh_mobile_sdhi_of_match[] = {
include/linux/mmc/host.h +3 -0
@@ -266,6 +266,9 @@ struct mmc_host {#define MMC_CAP2_BOOTPART_NOACC (1 << 0)/* Boot partition no access */ #define MMC_CAP2_FULL_PWR_CYCLE (1 << 2)/* Can do full power cycle */ #define MMC_CAP2_NO_MULTI_READ (1 << 3)/* Multiblock reads don't work */ +#define MMC_CAP2_2BLKS_LIMIT (1 << 4)/* 2 blocks limit for multi read */ +#define MMC_CAP2_NO_2BLKS_READ (MMC_CAP2_NO_MULTI_READ | \ + MMC_CAP2_2BLKS_LIMIT)#define MMC_CAP2_HS200_1_8V_SDR (1 << 5)/* can support */ #define MMC_CAP2_HS200_1_2V_SDR (1 << 6)/* can support */ #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \
Signature · 1 line
1.7.9.5
[Bug] mmc: MMC and SDHI has a kernel panic error when transfer data.
Hi Magnus, Simon
I tested SDHI and MMCIF at Linux-upstream-v3.16-rc5 on Lager. When I tried to read/write a 100MB or 350MB of data, kernel panic occurs. I find out that error relates to HIGHMEM the commit "667d0f7 ARM: shmobile:
Enable HIGHMEM in shmobile_defconfig". Because, when I remove CONFIG_HIGHMEM from config file, SDHI and MMCIF does not occur kernel panic error any more.
commit 667d0f7b0e940bf36e8d12bd7d64aa0f9217b3ac
Author: Magnus Damm<[email protected]> Date: Wed Apr 2 18:06:24 2014 +0900
ARM: shmobile: Enable HIGHMEM in shmobile_defconfig
Many mach-shmobile hardware platforms include support for more than 1GiB of RAM. Enable HIGHMEM by default to allow use of larger amounts of memory.
I attach error log of SDHI and MMCIF and boot_log file. So, Please fix this bug when you have time.
Best regards,
Cao Minh Hiep
root@linaro-nano:~# dmesg
Booting Linux on physical CPU 0x0
Linux version 3.16.0-rc5 (jinso@jinso-OptiPlex-980) (gcc version 4.8.3 20140401 (prereleas4
CPU: ARMv7 Processor [413fc0f2] revision 2 (ARMv7), cr=10c5347d
CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
Ignoring memory block 0x180000000 - 0x200000000
Machine model: Lager
debug: ignoring loglevel setting.
Memory policy: Data cache writealloc
On node 0 totalpages: 524288
free_area_init_node: node 0, pgdat c0603b00, node_mem_map ee7f9000
Normal zone: 1520 pages used for memmap
Normal zone: 0 pages reserved
Normal zone: 194560 pages, LIFO batch:31
HighMem zone: 2576 pages used for memmap
HighMem zone: 329728 pages, LIFO batch:31
PERCPU: Embedded 5 pages/cpu @ee79e000 s6912 r0 d13568 u32768
pcpu-alloc: s6912 r0 d13568 u32768 alloc=8*4096
pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [0] 4 [0] 5 [0] 6 [0] 7
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 522768
Kernel command line: console=ttySC6,115200 ignore_loglevel rw root=/dev/nfs ip=dhcp
PID hash table entries: 4096 (order: 2, 16384 bytes)
Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
Memory: 2073328K/2097152K available (4615K kernel code, 196K rwdata, 1068K rodata, 242K in)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xffe00000 (2048 kB)
vmalloc : 0xf0000000 - 0xff000000 ( 240 MB)
lowmem : 0xc0000000 - 0xef800000 ( 760 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
.text : 0xc0008000 - 0xc0595f8c (5688 kB)
.init : 0xc0596000 - 0xc05d2b00 ( 243 kB)
.data : 0xc05d4000 - 0xc0605280 ( 197 kB)
.bss : 0xc0605288 - 0xc0636bf4 ( 199 kB)
Hierarchical RCU implementation.
NR_IRQS:16 nr_irqs:16 16
Architected cp15 timer(s) running at 10.00MHz (virt).
sched_clock: 56 bits at 10MHz, resolution 100ns, wraps every 3435973836800ns
Switching to timer-based delay loop
Console: colour dummy device 80x30
Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS )
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
CPU: Testing write buffer coherency: ok
CPU0: update cpu_capacity 1535
CPU0: thread -1, cpu 0, socket 0, mpidr 80000000
Setting up static identity map for 0x40489258 - 0x404892b0
CPU1: Booted secondary processor
CPU1: update cpu_capacity 1535
CPU1: thread -1, cpu 1, socket 0, mpidr 80000001
CPU2: Booted secondary processor
CPU2: update cpu_capacity 1535
CPU2: thread -1, cpu 2, socket 0, mpidr 80000002
CPU3: Booted secondary processor
CPU3: update cpu_capacity 1535
CPU3: thread -1, cpu 3, socket 0, mpidr 80000003
CPU4: failed to boot: -22
CPU5: failed to boot: -22
CPU6: failed to boot: -22
CPU7: failed to boot: -22
Brought up 4 CPUs
SMP: Total of 4 processors activated.
CPU: All CPU(s) started in SVC mode.
devtmpfs: initialized
VFP support v0.3: implementor 41 architecture 4 part 30 variant f rev 0
pinctrl core: initialized pinctrl subsystem
regulator-dummy: no parameters
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
renesas_irqc e61c0000.interrupt-controller: driving 4 irqs
sh-pfc e6060000.pfc: r8a77900_pfc support registered
No ATAGs?
hw-breakpoint: Failed to enable monitor mode on CPU 1.
fixed-3.3V: 3300 mV
platform regulator@1: Driver reg-fixed-voltage requests probe deferral
platform regulator@3: Driver reg-fixed-voltage requests probe deferral
gpio-regulator regulator@2: Could not obtain regulator setting GPIOs: -517
platform regulator@2: Driver gpio-regulator requests probe deferral
gpio-regulator regulator@4: Could not obtain regulator setting GPIOs: -517
platform regulator@4: Driver gpio-regulator requests probe deferral
vgaarb: loaded
SCSI subsystem initialized
libata version 3.00 loaded.
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
media: Linux media interface: v0.10
Linux video capture interface: v2.00
sh_cmt sh-cmt-48-gen2.0: ch0: used for clock events
sh_cmt sh-cmt-48-gen2.0: ch1: used as clock source
Advanced Linux Sound Architecture Driver Initialized.
Switched to clocksource arch_sys_counter
NET: Registered protocol family 2
TCP established hash table entries: 8192 (order: 3, 32768 bytes)
TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 512 (order: 2, 16384 bytes)
UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 0 bytes, default 64
futex hash table entries: 2048 (order: 5, 131072 bytes)
NFS: Registering the id_resolver key type
Key type id_resolver registered
Key type id_legacy registered
nfs4filelayout_init: NFSv4 File Layout Driver Registering...
msgmni has been set to 1473
bounce: pool size: 64 pages
Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
gpio_rcar e6050000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6050000.gpio: driving 32 GPIOs
gpio_rcar e6051000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6051000.gpio: driving 32 GPIOs
gpio_rcar e6052000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6052000.gpio: driving 32 GPIOs
gpio_rcar e6053000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6053000.gpio: driving 32 GPIOs
gpio_rcar e6054000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6054000.gpio: driving 32 GPIOs
gpio_rcar e6055000.gpio: Runtime PM disabled, clock forced on.
gpio_rcar e6055000.gpio: driving 32 GPIOs
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
SuperH (H)SCI(F) driver initialized
sh-sci e6e60000.serial: Runtime PM disabled, clock forced on.
e6e60000.serial: ttySC6 at MMIO 0xe6e60000 (irq = 184, base_baud = 0) is a scif
console [ttySC6] enabled
sh-sci e6e68000.serial: Runtime PM disabled, clock forced on.
e6e68000.serial: ttySC7 at MMIO 0xe6e68000 (irq = 185, base_baud = 0) is a scif
[drm] Initialized drm 1.1.0 20060810
rcar-du rcar-du-r8a7790: fb0: frame buffer device
rcar-du rcar-du-r8a7790: registered panic notifier
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[drm] No driver support for vblank timestamp query.
[drm] Initialized rcar-du 1.0.0 20130110 on minor 0
sata_rcar ee500000.sata: Runtime PM disabled, clock forced on.
scsi0 : sata_rcar
ata1: SATA max UDMA/133 irq 138
renesas_spi e6b10000.spi: Runtime PM disabled, clock forced on.
m25p80 spi0.0: s25fl512s (65536 Kbytes)
3 ofpart partitions found on MTD device spi0.0
Creating 3 MTD partitions on "spi0.0":
0x000000000000-0x000000040000 : "loader"
0x000000040000-0x000000440000 : "user"
0x000000440000-0x000004000000 : "flash"
renesas_spi e6b10000.spi: probed
spi_sh_msiof e6e10000.spi: Runtime PM disabled, clock forced on.
sh-eth ee700000.ethernet: Runtime PM disabled, clock forced on.
libphy: sh_mii: probed
sh-eth ee700000.ethernet eth0: Base address at 0xee700000, 2e:09:0a:00:6e:bc, IRQ 194.
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
ohci-pci: OHCI PCI platform driver
mousedev: PS/2 mouse device common for all mice
rcar_thermal e61f0000.thermal: Runtime PM disabled, clock forced on.
rcar_thermal e61f0000.thermal: 1 sensor probed
sh_mobile_sdhi ee100000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee100000.sd: Got CD GPIO #902.
platform ee100000.sd: Driver sh_mobile_sdhi requests probe deferral
sh_mobile_sdhi ee140000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee140000.sd: Got CD GPIO #918.
platform ee140000.sd: Driver sh_mobile_sdhi requests probe deferral
sh_mmcif ee220000.mmc: Runtime PM disabled, clock forced on.
sh_mmcif ee220000.mmc: No vqmmc regulator found
of_dma_request_slave_channel: dma-names property of node '/mmc@ee220000' missing or empty
sh_mmcif ee220000.mmc: driver version 2010-04-28
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
SDHI0 Vcc: 3300 mV
SDHI2 Vcc: 3300 mV
SDHI0 VccQ: 1800 <--> 3300 mV at 3300 mV
SDHI2 VccQ: 1800 <--> 3300 mV at 3300 mV
sh_mobile_sdhi ee100000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee100000.sd: Got CD GPIO #902.
of_dma_request_slave_channel: dma-names property of node '/sd@ee100000' missing or empty
sh_mobile_sdhi ee100000.sd: mmc1 base at 0xee100000 clock rate 97 MHz
sh_mobile_sdhi ee140000.sd: Runtime PM disabled, clock forced on.
sh_mobile_sdhi ee140000.sd: Got CD GPIO #918.
ata1: link resume succeeded after 1 retries
of_dma_request_slave_channel: dma-names property of node '/sd@ee140000' missing or empty
ata1: SATA link down (SStatus 0 SControl 300)
sh_mobile_sdhi ee140000.sd: mmc2 base at 0xee140000 clock rate 48 MHz
input: gpio_keys as /devices/gpio_keys/input/input0
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
mmc0: BKOPS_EN bit is not set
mmc0: new high speed MMC card at address 0001
mmcblk0: mmc0:0001 MMC08G 7.32 GiB
mmcblk0boot0: mmc0:0001 MMC08G partition 1 2.00 MiB
mmcblk0boot1: mmc0:0001 MMC08G partition 2 2.00 MiB
mmcblk0: p1 p2
mmcblk0boot1: unknown partition table
mmcblk0boot0: unknown partition table
sh-eth ee700000.ethernet eth0: attached PHY 1 (IRQ 416) to driver Micrel KSZ8041RNLI
Sending DHCP requests ..
sh-eth ee700000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
., OK
IP-Config: Got DHCP answer from 172.16.1.27, my address is 172.16.1.35
IP-Config: Complete:
device=eth0, hwaddr=2e:09:0a:00:6e:bc, ipaddr=172.16.1.35, mask=255.255.255.0, gw=1727
host=172.16.1.35, domain=, nis-domain=(none)
bootserver=172.16.1.27, rootserver=172.16.1.27, rootpath=
nameserver0=172.16.1.27
SDHI2 VccQ: disabling
SDHI0 VccQ: disabling
SDHI2 Vcc: disabling
SDHI0 Vcc: disabling
ALSA device list:
No soundcards found.
VFS: Mounted root (nfs filesystem) on device 0:13.
devtmpfs: mounted
Freeing unused kernel memory: 240K (c0596000 - c05d2000)
random: init urandom read with 65 bits of entropy available
random: nonblocking pool is initialized
systemd-udevd[657]: starting version 204
CPU4: failed to boot: -22
CPU5: failed to boot: -22
CPU6: failed to boot: -22
CPU7: failed to boot: -22
init: plymouth main process (571) killed by ABRT signal
init: plymouth-splash main process (962) terminated with status 2
init: failsafe main process (1014) killed by TERM signal
init: plymouth-stop pre-start process (1129) terminated with status 1
init: tty1 main process (1131) killed by TERM signalroot@linaro-nano:~# mount /dev/mmcblk0p1 /mnt/eMMC/ kjournald starting. Commit interval 5 seconds EXT3-fs (mmcblk0p1): using internal journal EXT3-fs (mmcblk0p1): recovery complete EXT3-fs (mmcblk0p1): mounted filesystem with ordered data mode root@linaro-nano:~# mount -t tmpfs -o size=400m tmpfs /tmp/ root@linaro-nano:~# dd if=/dev/urandom of=/tmp/file-100mb bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 3.29865 s, 3.2 MB/s root@linaro-nano:~#
root@linaro-nano:~# cp /tmp/file-100mb /mnt/eMMC/ root@linaro-nano:~# cUnable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0004000 [00000000] *pgd=00000000 Internal error: Oops: 17 [#1] SMP ARM CPU: 1 PID: 494 Comm: irq/202-ee22000 Not tainted 3.16.0-rc5 #1 task: ed972040 ti: ee3b8000 task.ti: ee3b8000 PC is at sh_mmcif_irqt+0x944/0xc18 LR is at sh_mmcif_irqt+0x30/0xc18 pc : [<c0355638>] lr : [<c0354d24>] psr: 80070013 sp : ee3b9ea8 ip : ee3b9ea8 fp : ee3b9efc r10: 00000001 r9 : c005f688 r8 : ee3b8000 r7 : ee2eade0 r6 : ed8610f8 r5 : ed861034 r4 : edb76680 r3 : 00000000 r2 : 00000200 r1 : 00000000 r0 : edb766f8 Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c5347d Table: 6d16806a DAC: 00000015 Process irq/202-ee22000 (pid: 494, stack limit = 0xee3b8240) Stack: (0xee3b9ea8 to 0xee3ba000) 9ea0: 00000000 c005f688 00000000 ee010a74 60070013 00000001 9ec0: 00000003 edb766b4 c005f688 edb766f8 ee3b9f0c ee2eadc0 ee2eadc0 ee010a00 9ee0: ee2eade0 ee3b8000 c005f688 00000001 ee3b9f1c ee3b9f00 c005f6ac c0354d00 9f00: 00000004 ee010a00 ee2eadc0 ee3b8020 ee3b9f5c ee3b9f20 c005f990 c005f694 9f20: c0055b6c 00000000 00000000 c005f7e4 c005f898 ee2ead80 00000000 ee2eadc0 9f40: c005f898 00000000 00000000 00000000 ee3b9fac ee3b9f60 c003f5a0 c005f8a4 9f60: ee3b9f60 00000000 00000000 ee2eadc0 00000000 00000000 ee3b9f78 ee3b9f78 9f80: 00000000 00000000 ee3b9f88 ee3b9f88 ee2ead80 c003f4b0 00000000 00000000 9fa0: 00000000 ee3b9fb0 c000e958 c003f4bc 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 Backtrace: [<c0354cf4>] (sh_mmcif_irqt) from [<c005f6ac>] (irq_thread_fn+0x24/0x3c) r10:00000001 r9:c005f688 r8:ee3b8000 r7:ee2eade0 r6:ee010a00 r5:ee2eadc0 r4:ee2eadc0 [<c005f688>] (irq_thread_fn) from [<c005f990>] (irq_thread+0xf8/0x174) r6:ee3b8020 r5:ee2eadc0 r4:ee010a00 r3:00000004 [<c005f898>] (irq_thread) from [<c003f5a0>] (kthread+0xf0/0x104) r10:00000000 r9:00000000 r8:00000000 r7:c005f898 r6:ee2eadc0 r5:00000000 r4:ee2ead80 [<c003f4b0>] (kthread) from [<c000e958>] (ret_from_fork+0x14/0x3c) r7:00000000 r6:00000000 r5:c003f4b0 r4:ee2ead80 Code: e7f001f2 e5942068 e1530122 2a000004 (e4910004) ---[ end trace 00854a296d6158ad ]--- Unable to handle kernel paging request at virtual address ffffffec pgd = c0004000 [ffffffec] *pgd=6f7fd821, *pte=00000000, *ppte=00000000 Internal error: Oops: 17 [#2] SMP ARM CPU: 1 PID: 494 Comm: irq/202-ee22000 Tainted: G D 3.16.0-rc5 #1 task: ed972040 ti: ee3b8000 task.ti: ee3b8000 PC is at kthread_data+0x10/0x18 LR is at irq_thread_dtor+0x58/0xb4 pc : [<c003f748>] lr : [<c005f83c>] psr: 20070113 sp : ee3b9c00 ip : ee3b9c10 fp : ee3b9c0c r10: c0355638 r9 : 00000001 r8 : ee3b9c60 r7 : ee3b8008 r6 : c0600a68 r5 : ed972040 r4 : ed972040 r3 : 00000000 r2 : ee3b9c10 r1 : ee3b9f28 r0 : ed972040 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 10c5347d Table: 6d16806a DAC: 00000015 Process irq/202-ee22000 (pid: 494, stack limit = 0xee3b8240) Stack: (0xee3b9c00 to 0xee3ba000) 9c00: ee3b9c24 ee3b9c10 c005f83c c003f744 ed972040 00000000 ee3b9c44 ee3b9c28 9c20: c003d014 c005f7f0 00000000 ed972040 00000000 c035563a ee3b9c7c ee3b9c48 9c40: c0026cc4 c003cf68 c0024bc4 c05de72c ee3b9e60 0000000b c035563a ee3b8000 9c60: ee3b9c7c ee3b9c70 c0024c88 ee3b8000 ee3b9cfc ee3b9c80 c00120bc c0026934 9c80: ee3b8240 0000000b 00000000 60070113 00000008 00000000 65000000 30306637 9ca0: 20326631 34393565 38363032 35316520 32313033 61322032 30303030 28203430 9cc0: 31393465 34303030 c0002029 c047faa0 c054045e 00000000 00000017 00000000 9ce0: ee3b9e60 ed972040 00000000 00000017 ee3b9d14 ee3b9d00 c047f3e4 c0011e08 9d00: ee3b9e60 ee3b9e60 ee3b9db4 ee3b9d18 c001a358 c047f394 00000000 00000001 9d20: c006eb28 00000001 ed411c38 ee7a7440 c05cd440 00000001 c05d6714 c05d009c 9d40: 00000100 c05cd440 ee3b9d8c ee3b9d58 c0050f58 c0050cb0 c002ede8 c048564c 9d60: ee3b9d60 00000020 ee3b8010 ee3b8000 c05d0088 c05d009c 00000000 ee3b8010 9d80: ee3b9ddc ee3b9d90 c002893c 00000017 c05db210 00000000 ee3b9e60 ee3b8000 9da0: c005f688 00000001 ee3b9e5c ee3b9db8 c00091d8 c001a054 ee7a7440 ee3b8000 9dc0: c05ccaf4 00000000 ee3b9e6c 00000064 ee7a7440 ed9720f0 ee7a74f0 c05d6714 9de0: 00000000 ee7a7440 ee3b9e24 ee3b9df8 c0052fac c0051f94 c05cd440 ed972040 9e00: ee3b9e2c ee3b9e10 c002e8dc c04855f4 edb766c4 ee2eadc0 ee3b9e6c ee3b9e28 9e20: c003a36c c0037894 c002f58c c0485700 c0042dcc a0070093 edb766b4 ee2eadc0 9e40: c0355638 80070013 ffffffff ee3b9e94 ee3b9efc ee3b9e60 c0012958 c00091a8 9e60: edb766f8 00000000 00000200 00000000 edb76680 ed861034 ed8610f8 ee2eade0 9e80: ee3b8000 c005f688 00000001 ee3b9efc ee3b9ea8 ee3b9ea8 c0354d24 c0355638 9ea0: 80070013 ffffffff 00000000 c005f688 00000000 ee010a74 60070013 00000001 9ec0: 00000003 edb766b4 c005f688 edb766f8 ee3b9f0c ee2eadc0 ee2eadc0 ee010a00 9ee0: ee2eade0 ee3b8000 c005f688 00000001 ee3b9f1c ee3b9f00 c005f6ac c0354d00 9f00: 00000004 ee010a00 ee2eadc0 ee3b8020 ee3b9f5c ee3b9f20 c005f990 c005f694 9f20: c0055b6c 00000000 00000000 c005f7e4 c005f898 ee2ead80 00000000 ee2eadc0 9f40: c005f898 00000000 00000000 00000000 ee3b9fac ee3b9f60 c003f5a0 c005f8a4 9f60: ee3b9f60 00000000 00000000 ee2eadc0 00000000 00000000 ee3b9f78 ee3b9f78 9f80: 00000001 00010001 ee3b9f88 ee3b9f88 ee2ead80 c003f4b0 00000000 00000000 9fa0: 00000000 ee3b9fb0 c000e958 c003f4bc 00000000 00000000 00000000 00000000 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 Backtrace: [<c003f738>] (kthread_data) from [<c005f83c>] (irq_thread_dtor+0x58/0xb4) [<c005f7e4>] (irq_thread_dtor) from [<c003d014>] (task_work_run+0xb8/0xd0) r5:00000000 r4:ed972040 [<c003cf5c>] (task_work_run) from [<c0026cc4>] (do_exit+0x39c/0x884) r6:c035563a r5:00000000 r4:ed972040 r3:00000000 [<c0026928>] (do_exit) from [<c00120bc>] (die+0x2c0/0x3c4) r7:ee3b8000 [<c0011dfc>] (die) from [<c047f3e4>] (__do_kernel_fault.part.11+0x5c/0x7c) r10:00000017 r9:00000000 r8:ed972040 r7:ee3b9e60 r6:00000000 r5:00000017 r4:00000000 [<c047f388>] (__do_kernel_fault.part.11) from [<c001a358>] (do_page_fault+0x310/0x370) r7:ee3b9e60 r3:ee3b9e60 [<c001a048>] (do_page_fault) from [<c00091d8>] (do_DataAbort+0x3c/0xa0) r10:00000001 r9:c005f688 r8:ee3b8000 r7:ee3b9e60 r6:00000000 r5:c05db210 r4:00000017 [<c000919c>] (do_DataAbort) from [<c0012958>] (__dabt_svc+0x38/0x60) Exception stack(0xee3b9e60 to 0xee3b9ea8) 9e60: edb766f8 00000000 00000200 00000000 edb76680 ed861034 ed8610f8 ee2eade0 9e80: ee3b8000 c005f688 00000001 ee3b9efc ee3b9ea8 ee3b9ea8 c0354d24 c0355638 9ea0: 80070013 ffffffff r7:ee3b9e94 r6:ffffffff r5:80070013 r4:c0355638 [<c0354cf4>] (sh_mmcif_irqt) from [<c005f6ac>] (irq_thread_fn+0x24/0x3c) r10:00000001 r9:c005f688 r8:ee3b8000 r7:ee2eade0 r6:ee010a00 r5:ee2eadc0 r4:ee2eadc0 [<c005f688>] (irq_thread_fn) from [<c005f990>] (irq_thread+0xf8/0x174) r6:ee3b8020 r5:ee2eadc0 r4:ee010a00 r3:00000004 [<c005f898>] (irq_thread) from [<c003f5a0>] (kthread+0xf0/0x104) r10:00000000 r9:00000000 r8:00000000 r7:c005f898 r6:ee2eadc0 r5:00000000 r4:ee2ead80 [<c003f4b0>] (kthread) from [<c000e958>] (ret_from_fork+0x14/0x3c) r7:00000000 r6:00000000 r5:c003f4b0 r4:ee2ead80 Code: e1a0c00d e92dd800 e24cb004 e5903238 (e5130014) ---[ end trace 00854a296d6158ae ]--- Fixing recursive fault but reboot is needed! root@linaro-nano:~# mount -t tmpfs -o size=400m tmpfs /tmp/ root@linaro-nano:~# dd if=/dev/urandom of=/tmp/file-100mb bs=1M count=100 100+0 records in 100+0 records out 104857600 bytes (105 MB) copied, 32.9928 s, 3.2 MB/s root@linaro-nano:~# mount /dev/mmcblk1p1 /mnt/sd1/ kjournald starting. Commit interval 5 seconds EXT3-fs (mmcblk1p1): using internal journal EXT3-fs (mmcblk1p1): mounted filesystem with ordered data mode root@linaro-nano:~# sync; echo 3 > /proc/sys/vm/drop_caches bash (1177): drop_caches: 3 root@linaro-nano:~# cp /tmp/file-100mb /mnt/sd1/ Unable to handle kernel paging request at virtual address ffc03000 pgd = c0004000 [ffc03000] *pgd=6f7fa811, *pte=00000000, *ppte=00000000 Internal error: Oops: 7 [#1] SMP ARM CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.16.0-rc5 #2 task: c05df418 ti: c05d4000 task.ti: c05d4000 PC is at __raw_writesw+0x1c/0xe4 LR is at __tmio_mmc_sdcard_irq+0x270/0x42c pc : [<c047d5bc>] lr : [<c0355de8>] psr: 200f0193 sp : c05d5e2c ip : 00000000 fp : c05d5e5c r10: c06050f3 r9 : ee0107c0 r8 : 00000200 r7 : ffc00000 r6 : ed01a610 r5 : a00f0193 r4 : ed9e5a80 r3 : 00000000 r2 : 000000f8 r1 : ffc03000 r0 : f00bc030 Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel Control: 10c5347d Table: 69a7c06a DAC: 00000015 Process swapper/0 (pid: 0, stack limit = 0xc05d4240) Stack: (0xc05d5e2c to 0xc05d6000) 5e20: ed9e5a80 a00f0193 c0355de8 02000000 ed9e5a80 5e40: 000000c7 00000000 00000000 ef7fcc40 c05d5e7c c05d5e60 c035615c c0355b84 5e60: 02000000 42800700 ed9e6d00 000000c7 c05d5eb4 c05d5e80 c005f174 c035611c 5e80: c0070fac c0047f94 ee7a01c0 ee0107c0 c05ebf04 00000000 c05d5f74 ef7fcc40 5ea0: 413fc0f2 00000000 c05d5ecc c05d5eb8 c005f2b4 c005f148 ee0107c0 c05ebf04 5ec0: c05d5ee4 c05d5ed0 c0062058 c005f278 000000c7 c05d1af4 c05d5efc c05d5ee8 5ee0: c005eb9c c0061fa8 000001a7 000000c7 c05d5f1c c05d5f00 c000f184 c005eb80 5f00: 000001a0 f0002000 c05d5f40 c05dc88c c05d5f3c c05d5f20 c0009320 c000f120 5f20: c000f484 c000f488 600f0013 ffffffff c05d5f94 c05d5f40 c00129c0 c00092e8 5f40: ee79e420 00000000 0011f146 00000000 c05d4018 c05d4000 c05d4000 c05c7dc0 5f60: ef7fcc40 413fc0f2 00000000 c05d5f94 c05d5f98 c05d5f88 c000f484 c000f488 5f80: 600f0013 ffffffff c05d5fa4 c05d5f98 c00562c0 c000f468 c05d5fb4 c05d5fa8 5fa0: c0480d0c c00561d8 c05d5ff4 c05d5fb8 c0596b74 c0480cb0 ffffffff ffffffff 5fc0: c0596644 00000000 00000000 c05c7dc0 00000000 c0605654 c05dc40c c05c7dbc 5fe0: c05e0498 4000406a 00000000 c05d5ff8 40008074 c05968b4 00000000 00000000 Backtrace: [<c0355b78>] (__tmio_mmc_sdcard_irq) from [<c035615c>] (tmio_mmc_irq+0x4c/0x6c) r8:ef7fcc40 r7:00000000 r6:00000000 r5:000000c7 r4:ed9e5a80 r3:02000000 [<c0356110>] (tmio_mmc_irq) from [<c005f174>] (handle_irq_event_percpu+0x38/0x130) r5:000000c7 r4:ed9e6d00 [<c005f13c>] (handle_irq_event_percpu) from [<c005f2b4>] (handle_irq_event+0x48/0x68) r10:00000000 r9:413fc0f2 r8:ef7fcc40 r7:c05d5f74 r6:00000000 r5:c05ebf04 r4:ee0107c0 [<c005f26c>] (handle_irq_event) from [<c0062058>] (handle_fasteoi_irq+0xbc/0x144) r5:c05ebf04 r4:ee0107c0 [<c0061f9c>] (handle_fasteoi_irq) from [<c005eb9c>] (generic_handle_irq+0x28/0x38) r5:c05d1af4 r4:000000c7 [<c005eb74>] (generic_handle_irq) from [<c000f184>] (handle_IRQ+0x70/0x98) r4:000000c7 r3:000001a7 [<c000f114>] (handle_IRQ) from [<c0009320>] (gic_handle_irq+0x44/0x68) r6:c05dc88c r5:c05d5f40 r4:f0002000 r3:000001a0 [<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50) Exception stack(0xc05d5f40 to 0xc05d5f88) 5f40: ee79e420 00000000 0011f146 00000000 c05d4018 c05d4000 c05d4000 c05c7dc0 5f60: ef7fcc40 413fc0f2 00000000 c05d5f94 c05d5f98 c05d5f88 c000f484 c000f488 5f80: 600f0013 ffffffff r6:ffffffff r5:600f0013 r4:c000f488 r3:c000f484 [<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154) [<c00561cc>] (cpu_startup_entry) from [<c0480d0c>] (rest_init+0x68/0x80) [<c0480ca4>] (rest_init) from [<c0596b74>] (start_kernel+0x2cc/0x31c) [<c05968a8>] (start_kernel) from [<40008074>] (0x40008074) Code: 1afffff6 e92d4030 e2522008 4a00000e (e8b11038) ---[ end trace b95a7313963532bd ]--- Kernel panic - not syncing: Fatal exception in interrupt CPU1: stopping CPU: 1 PID: 0 Comm: swapper/1 Tainted: G D 3.16.0-rc5 #2 Backtrace: [<c0011bbc>] (dump_backtrace) from [<c0011df8>] (show_stack+0x18/0x1c) r6:c05d1af4 r5:00000000 r4:00000000 r3:00200040 [<c0011de0>] (show_stack) from [<c0484454>] (dump_stack+0x7c/0x98) [<c04843d8>] (dump_stack) from [<c0014368>] (handle_IPI+0xcc/0x16c) r4:00000001 r3:600f0193 [<c001429c>] (handle_IPI) from [<c000933c>] (gic_handle_irq+0x60/0x68) r6:c05dc88c r5:ee09bf78 r4:f0002000 r3:00000005 [<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50) Exception stack(0xee09bf78 to 0xee09bfc0) bf60: ee7a6420 00000000 bf80: 0000542e 00000000 ee09a010 ee09a000 ee09a000 c06056cc 4000406a 413fc0f2 bfa0: 00000000 ee09bfcc ee09bfd0 ee09bfc0 c000f484 c000f488 600f0013 ffffffff r6:ffffffff r5:600f0013 r4:c000f488 r3:c000f484 [<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154) [<c00561cc>] (cpu_startup_entry) from [<c001402c>] (secondary_start_kernel+0x124/0x140) [<c0013f08>] (secondary_start_kernel) from [<400093e4>] (0x400093e4) r4:6e06406a r3:c00093cc CPU3: stopping CPU: 3 PID: 0 Comm: swapper/3 Tainted: G D 3.16.0-rc5 #2 Backtrace: [<c0011bbc>] (dump_backtrace) from [<c0011df8>] (show_stack+0x18/0x1c) r6:c05d1af4 r5:00000000 r4:00000000 r3:00200040 [<c0011de0>] (show_stack) from [<c0484454>] (dump_stack+0x7c/0x98) [<c04843d8>] (dump_stack) from [<c0014368>] (handle_IPI+0xcc/0x16c) r4:00000003 r3:60070193 [<c001429c>] (handle_IPI) from [<c000933c>] (gic_handle_irq+0x60/0x68) r6:c05dc88c r5:ee09ff78 r4:f0002000 r3:00000005 [<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50) Exception stack(0xee09ff78 to 0xee09ffc0) ff60: ee7b6420 00000000 ff80: 000037ec 00000000 ee09e010 ee09e000 ee09e000 c06056cc 4000406a 413fc0f2 ffa0: 00000000 ee09ffcc ee09ffd0 ee09ffc0 c000f484 c000f488 60070013 ffffffff r6:ffffffff r5:60070013 r4:c000f488 r3:c000f484 [<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154) [<c00561cc>] (cpu_startup_entry) from [<c001402c>] (secondary_start_kernel+0x124/0x140) [<c0013f08>] (secondary_start_kernel) from [<400093e4>] (0x400093e4) r4:6e06406a r3:c00093cc CPU2: stopping CPU: 2 PID: 0 Comm: swapper/2 Tainted: G D 3.16.0-rc5 #2 Backtrace: [<c0011bbc>] (dump_backtrace) from [<c0011df8>] (show_stack+0x18/0x1c) r6:c05d1af4 r5:00000000 r4:00000000 r3:00200040 [<c0011de0>] (show_stack) from [<c0484454>] (dump_stack+0x7c/0x98) [<c04843d8>] (dump_stack) from [<c0014368>] (handle_IPI+0xcc/0x16c) r4:00000002 r3:60070193 [<c001429c>] (handle_IPI) from [<c000933c>] (gic_handle_irq+0x60/0x68) r6:c05dc88c r5:ee09df78 r4:f0002000 r3:00000005 [<c00092dc>] (gic_handle_irq) from [<c00129c0>] (__irq_svc+0x40/0x50) Exception stack(0xee09df78 to 0xee09dfc0) df60: ee7ae420 00000000 df80: 00003e08 00000000 ee09c010 ee09c000 ee09c000 c06056cc 4000406a 413fc0f2 dfa0: 00000000 ee09dfcc ee09dfd0 ee09dfc0 c000f484 c000f488 60070013 ffffffff r6:ffffffff r5:60070013 r4:c000f488 r3:c000f484 [<c000f45c>] (arch_cpu_idle) from [<c00562c0>] (cpu_startup_entry+0xf4/0x154) [<c00561cc>] (cpu_startup_entry) from [<c001402c>] (secondary_start_kernel+0x124/0x140) [<c0013f08>] (secondary_start_kernel) from [<400093e4>] (0x400093e4) r4:6e06406a r3:c00093cc drm_kms_helper: panic occurred, switching back to text console ---[ end Kernel panic - not syncing: Fatal exception in interrupt
PATCH v2 2/10 mmc: tmio: care about DMA tx/rx addr offset
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Basically, SD_BUF0 Tx/Rx addresses are same in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)
This patch adds new .dma_rx_offset and cares it
--- drivers/mmc/host/sh_mobile_sdhi.c | 3 +++ drivers/mmc/host/tmio_mmc_dma.c | 2 +- include/linux/mfd/tmio.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/sh_mobile_sdhi.c +3 -0
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {unsigned long tmio_flags;unsigned long capabilities;unsigned long capabilities2; +dma_addr_t dma_rx_offset; };static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, .capabilities2 = MMC_CAP2_NO_2BLKS_READ, + .dma_rx_offset = 0x2000, };static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -228,6 +230,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) mmc_data->flags |= of_data->tmio_flags; mmc_data->capabilities |= of_data->capabilities; mmc_data->capabilities2 |= of_data->capabilities2; + dma_priv->dma_rx_offset = of_data->dma_rx_offset; }/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
drivers/mmc/host/tmio_mmc_dma.c +1 -1
@@ -311,7 +311,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdatif (pdata->dma->chan_priv_rx) cfg.slave_id = pdata->dma->slave_id_rx; cfg.direction =DMA_DEV_TO_MEM ; - cfg.src_addr = cfg.dst_addr; + cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset; cfg.dst_addr =0 ; ret =dmaengine_slave_config (host->chan_rx, &cfg);if (ret <0 )
include/linux/mfd/tmio.h +1 -0
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {int slave_id_tx;int slave_id_rx;int alignment_shift; +dma_addr_t dma_rx_offset;bool (*filter)(struct dma_chan *chan,void *arg); };
Signature · 1 line
1.7.9.5
PATCH v2 3/10 mmc: tmio: clear error IRQ status
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Next card access will be always
error if it didn't clear error status
--- drivers/mmc/host/tmio_mmc_pio.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mmc/host/tmio_mmc_pio.c +3 -0
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,pr_debug_status (*status);pr_debug_status (*ireg); + +/* Clear the status except the interrupt status */ +sd_ctrl_write32 (host,CTL_STATUS ,TMIO_MASK_IRQ ); } static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
Signature · 1 line
1.7.9.5
PATCH v2 4/10 mmc: tmio: control multiple block transfer mode
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Renesas SDHI has "Multiple Block Transfer Mode" settings on SD_CMD register which controls CMD12 automatically.
This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)
[Kuninori Morimoto: tidyuped for upstreaming
enabled this flags for all SH-Mobile/R-Car]
--- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_pio.c | 10 ++++++++++ include/linux/mfd/tmio.h | 6 ++++++ 3 files changed, 21 insertions(+)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -225,6 +225,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_SDIO_IRQ ; +/* +* All SDHI have CMD12 controll bit +*/ + mmc_data->flags |=TMIO_MMC_HAVE_CMD12_CTRL ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_pio.c +10 -0
@@ -44,6 +44,7 @@#include <linux/pm_qos.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include <linux/mmc/sdio.h> #include <linux/scatterlist.h> #include <linux/spinlock.h> #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)#define TRANSFER_READ 0x1000#define TRANSFER_MULTI 0x2000#define SECURITY_CMD 0x4000 +#define NO_CMD12_ISSUE 0x4000/* TMIO_MMC_HAVE_CMD12_CTRL */ static int tmio_mmc_start_command (struct tmio_mmc_host *host,struct mmc_command *cmd) {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_commandif (data->blocks >1 ) {sd_ctrl_write16 (host,CTL_STOP_INTERNAL_ACTION ,0x100 ); c |=TRANSFER_MULTI ; + +/* +* Disable auto CMD12 at IO_RW_EXTENDED when +* multiple block transfer +*/ +if ((host->pdata->flags &TMIO_MMC_HAVE_CMD12_CTRL ) && + (cmd->opcode ==SD_IO_RW_EXTENDED )) + c |=NO_CMD12_ISSUE ; }if (data->flags &MMC_DATA_READ ) c |=TRANSFER_READ ;
include/linux/mfd/tmio.h +6 -0
@@ -83,6 +83,12 @@*/ #define TMIO_MMC_HAVE_HIGH_REG (1 << 6) +/* +* Some controllers have CMD12 automatically +* issue/non-issue register +*/ +#define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH v2 5/10 mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Renesas R-Car SDHI should set reserved bits on CTL_SDIO_STATUS register when writing. This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags for this purpose
[Kuninori Morimoto: tidyuped for upstreaming
enabled this flags for all SH-Mobile/R-Car]
--- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_pio.c | 7 ++++++- include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -230,6 +230,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_HAVE_CMD12_CTRL ; +/* +* All SDHI need SDIO_INFO1 reserved bit +*/ + mmc_data->flags |=TMIO_MMC_SDIO_STATUS_QUIRK ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_pio.c +6 -1
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)struct mmc_host *mmc = host->mmc;struct tmio_mmc_data *pdata = host->pdata;unsigned int ireg, status; +unsigned int sdio_status;if (!(pdata->flags &TMIO_MMC_SDIO_IRQ ))return IRQ_HANDLED ;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid) status =sd_ctrl_read16 (host,CTL_SDIO_STATUS ); ireg = status &TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask; -sd_ctrl_write16 (host,CTL_SDIO_STATUS , status & ~TMIO_SDIO_MASK_ALL ); + sdio_status = status & ~TMIO_SDIO_MASK_ALL ; +if (pdata->flags &TMIO_MMC_SDIO_STATUS_QUIRK ) + sdio_status |=6 ; + +sd_ctrl_write16 (host,CTL_SDIO_STATUS , sdio_status);if (mmc->caps &MMC_CAP_SDIO_IRQ && ireg &TMIO_SDIO_STAT_IOIRQ )mmc_signal_sdio_irq (mmc);
include/linux/mfd/tmio.h +5 -0
@@ -89,6 +89,11 @@*/ #define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) +/* +* Some controllers needs to set 1 on SDIO status reserved bits +*/ +#define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH v2 6/10 mmc: tmio: check ILL_FUNC instead of CBSY
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Some controllers need to check SD bus status when writing data. Then, it checks ILL_FUNC bit on SD_INFO2 register, and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags. Same method is required on tmio_mmc_data_irq() which will be called after writing data.
Current driver is checking CBSY bit for this purpose, but, some controllers doesn't have CBSY bit. This patch checks ILL_FUNC bit instead of CBSY bit if it has TMIO_MMC_HAS_IDLE_WAIT flags
[Kuninori Morimoto: tidyuped for upstreaming]
--- drivers/mmc/host/tmio_mmc_pio.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/mmc/host/tmio_mmc_pio.c +12 -1
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host) goto out;if (host->chan_tx && (data->flags &MMC_DATA_WRITE ) && !host->force_pio) { +u32 status =sd_ctrl_read32 (host,CTL_STATUS ); +bool done = false; +/* * Has all data been written out yet? Testing on SuperH showed, * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)* DATAEND interrupt with the BUSY bit set, in this cases * waiting for one more interrupt fixes the problem. */ -if (!(sd_ctrl_read32 (host,CTL_STATUS ) &TMIO_STAT_CMD_BUSY )) { +if (host->pdata->flags &TMIO_MMC_HAS_IDLE_WAIT ) { +if (status &TMIO_STAT_ILL_FUNC ) + done = true; + }else { +if (!(status &TMIO_STAT_CMD_BUSY )) + done = true; + } + +if (done) {tmio_mmc_disable_mmc_irqs (host,TMIO_STAT_DATAEND );tasklet_schedule (&host->dma_complete); }
Signature · 1 line
1.7.9.5
PATCH v2 7/10 mmc: tmio: remove Renesas specific #ifdef
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag, and remove Renesas specific #ifdef from tmio driver
--- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_dma.c | 6 ++---- include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 12 insertions(+), 4 deletions(-)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -235,6 +235,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_SDIO_STATUS_QUIRK ; +/* +* All SDHI have DMA control register +*/ + mmc_data->flags |=TMIO_MMC_HAVE_CTL_DMA_REG ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_dma.c +2 -4
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)if (!host->chan_tx || !host->chan_rx)return ; -#if defined(CONFIG_SUPERH ) || defined(CONFIG_ARCH_SHMOBILE ) -/* Switch DMA mode on or off - SuperH specific? */ -sd_ctrl_write16 (host,CTL_DMA_ENABLE , enable ?2 :0 ); -#endif +if (host->pdata->flags &TMIO_MMC_HAVE_CTL_DMA_REG ) +sd_ctrl_write16 (host,CTL_DMA_ENABLE , enable ?2 :0 ); }void tmio_mmc_abort_dma (struct tmio_mmc_host *host)
include/linux/mfd/tmio.h +5 -0
@@ -94,6 +94,11 @@*/ #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) +/* +* Some controllers have DMA enable/disable register +*/ +#define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH v2 8/10 mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(), and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.
--- drivers/mmc/host/tmio_mmc_pio.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/host/tmio_mmc_pio.c +0 -1
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)for (clock = host->mmc->f_min, clk =0x80000080 ; new_clock >= (clock<<1 ); clk >>=1 ) clock <<=1 ; - clk |=0x100 ; }if (host->set_clk_div)
Signature · 1 line
1.7.9.5
PATCH v2 9/10 mmc: tmio: ensure that the clock has been stopped before set_clock
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
This patch ensures that the clock has been stopped before it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch
--- drivers/mmc/host/tmio_mmc_pio.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/tmio_mmc_pio.c +1 -0
@@ -895,6 +895,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) }if (host->power ==TMIO_MMC_OFF_STOP )tmio_mmc_reset (host); +tmio_mmc_clk_stop (host);tmio_mmc_set_clock (host, ios->clock);if (host->power ==TMIO_MMC_OFF_STOP )/* power up SD card and the bus */
Signature · 1 line
1.7.9.5
PATCH v2 10/10 mmc: tmio: add actual clock support as option
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Some controller is supporting actual clock on SD_CLK_CTRL :: DIV[7:0]. Renesas SH-Mobile SDHI doesn't support,
but, Renesas R-Car SDHI supports it.
This patch adds new TMIO_MMC_CLK_ACTUAL flag for it.
[Kuninori Morimoto: tidyuped for upstreaming]
--- drivers/mmc/host/sh_mobile_sdhi.c | 6 ++++-- drivers/mmc/host/tmio_mmc_pio.c | 5 +++++ include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-)
drivers/mmc/host/sh_mobile_sdhi.c +4 -2
@@ -49,12 +49,14 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = { };static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = { - .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , + .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE | +TMIO_MMC_CLK_ACTUAL , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , };static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { - .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , + .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE | +TMIO_MMC_CLK_ACTUAL , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , .capabilities2 =MMC_CAP2_NO_2BLKS_READ , .dma_rx_offset =0x2000 ,
drivers/mmc/host/tmio_mmc_pio.c +5 -0
@@ -150,6 +150,11 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)for (clock = host->mmc->f_min, clk =0x80000080 ; new_clock >= (clock<<1 ); clk >>=1 ) clock <<=1 ; + +/* 1/1 clock is option */ +if ((host->pdata->flags &TMIO_MMC_CLK_ACTUAL ) && + ((clk >>22 ) &0x1 )) + clk |=0xff ; }if (host->set_clk_div)
include/linux/mfd/tmio.h +5 -0
@@ -99,6 +99,11 @@*/ #define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) +/* +* Some controllers allows to set SDx actual clock +*/ +#define TMIO_MMC_CLK_ACTUAL (1 << 10) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
Simon Horman
Acked-byQuoted 5 lines · Kuninori Morimoto
Hi Chris, Simon
These are v2 of fixup patches for mmc tmio/shmobile. I tesed these patches on my environment.
I'm very happy if someone test these patches.
Quoted 25 lines
Kuninori Morimoto (4):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting fromtmio_mmc_set_clock()
mmc: tmio: ensure that the clock has been stopped beforeset_clockShinobu Uehara (6):
mmc: block: add block number limitation flag for multiple block read
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: addTMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: checkILL_FUNCinstead of CBSY
mmc: tmio: add actual clock support as optionarch/arm/mach-shmobile/board-koelsch.c | 6 ++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 26 ++++++++++++++++++--- drivers/mmc/host/tmio_mmc_dma.c | 8 +++---- drivers/mmc/host/tmio_mmc_pio.c | 40 +++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++ include/linux/mmc/host.h | 3 +++ 8 files changed, 110 insertions(+), 18 deletions(-)
Hi Morimoto-san, Simon-san
Quoted 5 lines · Kuninori Morimoto
Hi Chris, Simon
These are v2 of fixup patches for mmc tmio/shmobile. I tesed these patches on my environment.
I'm very happy if someone test these patches.
I have just tested these series on Lager. if remove CONFIG_HIGHMEM from config file, They are good at SDHI and MMC on my environment.
Quoted 14 lines
Kuninori Morimoto (4):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting fromtmio_mmc_set_clock()
mmc: tmio: ensure that the clock has been stopped beforeset_clockShinobu Uehara (6):
mmc: block: add block number limitation flag for multiple block read
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: addTMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: checkILL_FUNCinstead of CBSY
mmc: tmio: add actual clock support as option
Quoted 12 lines
arch/arm/mach-shmobile/board-koelsch.c | 6 ++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 26 ++++++++++++++++++--- drivers/mmc/host/tmio_mmc_dma.c | 8 +++---- drivers/mmc/host/tmio_mmc_pio.c | 40 +++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++ include/linux/mmc/host.h | 3 +++ 8 files changed, 110 insertions(+), 18 deletions(-)
Best regards,
Cao Minh Hiep.
Hi Hiep-san,
Quoted 11 lines · カオ ミン ヒェップ
Hi Morimoto-san, Simon-san
Quoted 5 lines · Kuninori Morimoto
Hi Chris, Simon
These are v2 of fixup patches for mmc tmio/shmobile. I tesed these patches on my environment.
I'm very happy if someone test these patches.I have just tested these series on Lager. if remove
CONFIG_HIGHMEMfrom config file,
They are good at SDHI and MMC on my environment.
Could you provided a Tested-by tag?
Quoted 35 lines
Quoted 14 lines
Kuninori Morimoto (4):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting fromtmio_mmc_set_clock()
mmc: tmio: ensure that the clock has been stopped beforeset_clockShinobu Uehara (6):
mmc: block: add block number limitation flag for multiple block read
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: addTMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: checkILL_FUNCinstead of CBSY
mmc: tmio: add actual clock support as optionQuoted 12 lines
arch/arm/mach-shmobile/board-koelsch.c | 6 ++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 26 ++++++++++++++++++--- drivers/mmc/host/tmio_mmc_dma.c | 8 +++---- drivers/mmc/host/tmio_mmc_pio.c | 40 +++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++ include/linux/mmc/host.h | 3 +++ 8 files changed, 110 insertions(+), 18 deletions(-)Best regards,
Cao Minh Hiep.--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
カオ ミン ヒェップ
Tested-by Nguyen Xuan NuiHi Simon-san
Quoted 8 lines · Simon Horman
Hi Hiep-san,
Quoted 5 lines · カオ ミン ヒェップ
Hi Morimoto-san, Simon-san
Quoted 2 lines · Kuninori Morimoto
Hi Chris, Simon
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
These are v2 of fixup patches for mmc tmio/shmobile. I tesed these patches on my environment.
I'm very happy if someone test these patches.I have just tested these series on Lager. if remove
CONFIG_HIGHMEMfrom config file,
They are good at SDHI and MMC on my environment.Could you provided a Tested-by tag?
Quoted 40 lines
Quoted 26 lines
Quoted 14 lines
Kuninori Morimoto (4):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting fromtmio_mmc_set_clock()
mmc: tmio: ensure that the clock has been stopped beforeset_clockShinobu Uehara (6):
mmc: block: add block number limitation flag for multiple block read
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: addTMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: checkILL_FUNCinstead of CBSY
mmc: tmio: add actual clock support as optionQuoted 12 lines
arch/arm/mach-shmobile/board-koelsch.c | 6 ++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 26 ++++++++++++++++++--- drivers/mmc/host/tmio_mmc_dma.c | 8 +++---- drivers/mmc/host/tmio_mmc_pio.c | 40 +++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++ include/linux/mmc/host.h | 3 +++ 8 files changed, 110 insertions(+), 18 deletions(-)Quoted 8 lines
Best regards,
Cao Minh Hiep.--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 14 lines · カオ ミン ヒェップ
Hi Simon-san
Quoted 11 lines · Simon Horman
Hi Hiep-san,
Quoted 8 lines · カオ ミン ヒェップ
Hi Morimoto-san, Simon-san
Quoted 5 lines · Kuninori Morimoto
Hi Chris, Simon
These are v2 of fixup patches for mmc tmio/shmobile. I tesed these patches on my environment.
I'm very happy if someone test these patches.
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
I have just tested these series on Lager. if remove
CONFIG_HIGHMEMfrom config file,
They are good at SDHI and MMC on my environment.Could you provided a Tested-by tag?
Tested-by Nguyen Xuan Nui <[email protected]>Reported-by Hiep Cao Minh <[email protected]>
Thanks.
Chris, would you consider taking this series?
Quoted 41 lines
Quoted 40 lines
Quoted 26 lines
Quoted 14 lines
Kuninori Morimoto (4):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting fromtmio_mmc_set_clock()
mmc: tmio: ensure that the clock has been stopped beforeset_clockShinobu Uehara (6):
mmc: block: add block number limitation flag for multiple block read
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: addTMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: checkILL_FUNCinstead of CBSY
mmc: tmio: add actual clock support as optionQuoted 12 lines
arch/arm/mach-shmobile/board-koelsch.c | 6 ++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 26 ++++++++++++++++++--- drivers/mmc/host/tmio_mmc_dma.c | 8 +++---- drivers/mmc/host/tmio_mmc_pio.c | 40 +++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++ include/linux/mmc/host.h | 3 +++ 8 files changed, 110 insertions(+), 18 deletions(-)Quoted 8 lines
Best regards,
Cao Minh Hiep.--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi
Quoted 9 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
These are v2 of fixup patches for mmc tmio/shmobile. I tesed these patches on my environment.
I'm very happy if someone test these patches.I have just tested these series on Lager. if remove
CONFIG_HIGHMEMfrom config file,
They are good at SDHI and MMC on my environment.Could you provided a Tested-by tag?
Tested-by Nguyen Xuan Nui <[email protected]>Reported-by Hiep Cao Minh <[email protected]>
I guess, both "Tested-by" is correct :)
# "Reported-by" means "bug report", not "test report"
Best regards
---
Kuninori Morimoto
Hi Morimoto-san,
Quoted 9 lines · Kuninori Morimoto
Hi
Quoted 7 lines
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
These are v2 of fixup patches for mmc tmio/shmobile. I tesed these patches on my environment.
I'm very happy if someone test these patches.I have just tested these series on Lager. if remove
CONFIG_HIGHMEMfrom config file,
They are good at SDHI and MMC on my environment.Could you provided a Tested-by tag?
Quoted 8 lines
Quoted 2 lines
Tested-by Nguyen Xuan Nui <[email protected]>Reported-by Hiep Cao Minh <[email protected]>I guess, both "Tested-by" is correct :)
Tested-by Nguyen Xuan Nui <[email protected]>Tested-by Hiep Cao Minh <[email protected]># "Reported-by" means "bug report", not "test report"
Thanks for pointing it.
Simon-san, Could you please do as Morimoto-san pointed?
Best regards,
Cao Minh Hiep.
Quoted 9 lines
Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 1/5 mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
This patch adds DT compatible for Renesas R-Car Gen1/Gen2. Current driver has SoC level .compatible (r8a7778/r8a7779/r8a7790/r8a7791),
but these can be match as generation level.
--- drivers/mmc/host/sh_mobile_sdhi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/mmc/host/sh_mobile_sdhi.c +2 -0
@@ -64,8 +64,10 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = { { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], }, { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], }, { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], }, + { .compatible = "renesas,sdhi-rcar-gen1", .data = &of_rcar_gen1_compatible, }, { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, }, { .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, }, + { .compatible = "renesas,sdhi-rcar-gen2", .data = &of_rcar_gen2_compatible, }, { .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, }, { .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, }, {},
Signature · 1 line
1.7.9.5
Re: [PATCH 1/5] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
Quoted 11 lines · Kuninori Morimoto
From: Kuninori Morimoto <[email protected]>
This patch adds DT compatible for Renesas R-Car Gen1/Gen2. Current driver has SoC level .compatible (r8a7778/r8a7779/r8a7790/r8a7791),
but these can be match as generation level.Signed-off-by Kuninori Morimoto <[email protected]>--- drivers/mmc/host/sh_mobile_sdhi.c | 2 ++ 1 file changed, 2 insertions(+)
I think you should also update Documentation/devicetree/bindings/mmc/tmio_mmc.txt
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
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
Re: [PATCH 1/5] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
Hi Geert
Quoted 7 lines
Quoted 7 lines
From: Kuninori Morimoto <[email protected]>
This patch adds DT compatible for Renesas R-Car Gen1/Gen2. Current driver has SoC level .compatible (r8a7778/r8a7779/r8a7790/r8a7791),
but these can be match as generation level.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Kuninori Morimoto <[email protected]>--- drivers/mmc/host/sh_mobile_sdhi.c | 2 ++ 1 file changed, 2 insertions(+)I think you should also update
Documentation/devicetree/bindings/mmc/tmio_mmc.txt
Indeed, thanks
Will do in v2
Best regards
---
Kuninori Morimoto
PATCH 2/5 ARM: shmobile: r8a7778: add generation level compatible for SDHI
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
--- arch/arm/boot/dts/r8a7778.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/r8a7778.dtsi +3 -3
@@ -206,7 +206,7 @@ }; sdhi0: sd@ffe4c000 { - compatible = "renesas,sdhi-r8a7778"; + compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1"; reg = <0xffe4c000 0x100>; interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>; cap-sd-highspeed;
@@ -215,7 +215,7 @@ }; sdhi1: sd@ffe4d000 { - compatible = "renesas,sdhi-r8a7778"; + compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1"; reg = <0xffe4d000 0x100>; interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>; cap-sd-highspeed;
@@ -224,7 +224,7 @@ }; sdhi2: sd@ffe4f000 { - compatible = "renesas,sdhi-r8a7778"; + compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1"; reg = <0xffe4f000 0x100>; interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>; cap-sd-highspeed;
Signature · 1 line
1.7.9.5
PATCH 3/5 ARM: shmobile: r8a7779: add generation level compatible for SDHI
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
--- arch/arm/boot/dts/r8a7779.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/r8a7779.dtsi +4 -4
@@ -316,7 +316,7 @@ }; sdhi0: sd@ffe4c000 { - compatible = "renesas,sdhi-r8a7779"; + compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1"; reg = <0xffe4c000 0x100>; interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
@@ -326,7 +326,7 @@ }; sdhi1: sd@ffe4d000 { - compatible = "renesas,sdhi-r8a7779"; + compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1"; reg = <0xffe4d000 0x100>; interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
@@ -336,7 +336,7 @@ }; sdhi2: sd@ffe4e000 { - compatible = "renesas,sdhi-r8a7779"; + compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1"; reg = <0xffe4e000 0x100>; interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
@@ -346,7 +346,7 @@ }; sdhi3: sd@ffe4f000 { - compatible = "renesas,sdhi-r8a7779"; + compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1"; reg = <0xffe4f000 0x100>; interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
Signature · 1 line
1.7.9.5
PATCH 4/5 ARM: shmobile: r8a7790: add generation level compatible for SDHI
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
--- arch/arm/boot/dts/r8a7790.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/r8a7790.dtsi +4 -4
@@ -353,7 +353,7 @@ }; sdhi0: sd@ee100000 { - compatible = "renesas,sdhi-r8a7790"; + compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2"; reg = <0 0xee100000 0 0x200>; interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
@@ -362,7 +362,7 @@ }; sdhi1: sd@ee120000 { - compatible = "renesas,sdhi-r8a7790"; + compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2"; reg = <0 0xee120000 0 0x200>; interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
@@ -371,7 +371,7 @@ }; sdhi2: sd@ee140000 { - compatible = "renesas,sdhi-r8a7790"; + compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2"; reg = <0 0xee140000 0 0x100>; interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
@@ -380,7 +380,7 @@ }; sdhi3: sd@ee160000 { - compatible = "renesas,sdhi-r8a7790"; + compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2"; reg = <0 0xee160000 0 0x100>; interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
Signature · 1 line
1.7.9.5
PATCH 5/5 ARM: shmobile: r8a7791: add generation level compatible for SDHI
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
--- arch/arm/boot/dts/r8a7791.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/r8a7791.dtsi +3 -3
@@ -341,7 +341,7 @@ }; sdhi0: sd@ee100000 { - compatible = "renesas,sdhi-r8a7791"; + compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2"; reg = <0 0xee100000 0 0x200>; interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7791_CLK_SDHI0>;
@@ -349,7 +349,7 @@ }; sdhi1: sd@ee140000 { - compatible = "renesas,sdhi-r8a7791"; + compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2"; reg = <0 0xee140000 0 0x100>; interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7791_CLK_SDHI1>;
@@ -357,7 +357,7 @@ }; sdhi2: sd@ee160000 { - compatible = "renesas,sdhi-r8a7791"; + compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2"; reg = <0 0xee160000 0 0x100>; interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7791_CLK_SDHI2>;
Signature · 1 line
1.7.9.5
v2 cover mmc: shmobile: adds generatoin level DT compatible
In reply to Kuninori MorimotoHi Chris, Simon
These are v2 patches of Renesas SDHI driver.
These patches add R-Car generatoin level
DT compatible on driver/platform.
Kuninori Morimoto (5):
mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
ARM: shmobile: r8a7778: add generation level compatible for SDHI
ARM: shmobile: r8a7779: add generation level compatible for SDHI
ARM: shmobile: r8a7790: add generation level compatible for SDHI
ARM: shmobile: r8a7791: add generation level compatible for SDHI
Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 2 ++ arch/arm/boot/dts/r8a7778.dtsi | 6 +++--- arch/arm/boot/dts/r8a7779.dtsi | 8 ++++---- arch/arm/boot/dts/r8a7790.dtsi | 8 ++++---- arch/arm/boot/dts/r8a7791.dtsi | 6 +++--- drivers/mmc/host/sh_mobile_sdhi.c | 2 ++ 6 files changed, 18 insertions(+), 14 deletions(-)
Best regards
---
Kuninori Morimoto
PATCH v2 1/5 mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
From: Kuninori Morimoto <[email protected]>
This patch adds DT compatible for Renesas R-Car Gen1/Gen2. Current driver has SoC level .compatible (r8a7778/r8a7779/r8a7790/r8a7791),
but these can be match as generation level.
---
v1 -> v2
- update tmio_mmc.txt
Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 2 ++ drivers/mmc/host/sh_mobile_sdhi.c | 2 ++ 2 files changed, 4 insertions(+)
Documentation/devicetree/bindings/mmc/tmio_mmc.txt +2 -0
@@ -11,6 +11,8 @@ optional bindings can be used. Required properties: - compatible: "renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit + "renesas,sdhi-rcar-gen1" - a generic R-Car Gen1 SDHI unit + "renesas,sdhi-rcar-gen2" - a generic R-Car Gen2 SDHI unit "renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC "renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC "renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoC
drivers/mmc/host/sh_mobile_sdhi.c +2 -0
@@ -64,8 +64,10 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = { { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], }, { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], }, { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], }, + { .compatible = "renesas,sdhi-rcar-gen1", .data = &of_rcar_gen1_compatible, }, { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, }, { .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, }, + { .compatible = "renesas,sdhi-rcar-gen2", .data = &of_rcar_gen2_compatible, }, { .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, }, { .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, }, {},
Signature · 1 line
1.7.9.5
Re: [PATCH 1/5 v2] mmc: shmobile: add renesas,sdhi-rcar-gen1/gen2 in DT compatible
Quoted 6 lines · Kuninori Morimoto
From: Kuninori Morimoto <[email protected]>
This patch adds DT compatible for Renesas R-Car Gen1/Gen2. Current driver has SoC level .compatible (r8a7778/r8a7779/r8a7790/r8a7791),
but these can be match as generation level.
Is this compatibility explicitly documented anywhere?
Quoted 46 lines
Signed-off-by Kuninori Morimoto <[email protected]>---
v1 -> v2- update tmio_mmc.txt
Documentation/devicetree/bindings/mmc/tmio_mmc.txt | 2 ++ drivers/mmc/host/sh_mobile_sdhi.c | 2 ++ 2 files changed, 4 insertions(+)Documentation/devicetree/bindings/mmc/tmio_mmc.txt +2
-0@@ -11,6 +11,8 @@ optional bindings can be used. Required properties: - compatible: "renesas,sdhi-shmobile" - a generic sh-mobile SDHI unit + "renesas,sdhi-rcar-gen1" - a generic R-Car Gen1 SDHI unit + "renesas,sdhi-rcar-gen2" - a generic R-Car Gen2 SDHI unit "renesas,sdhi-sh7372" - SDHI IP on SH7372 SoC "renesas,sdhi-sh73a0" - SDHI IP on SH73A0 SoC "renesas,sdhi-r8a73a4" - SDHI IP on R8A73A4 SoCdrivers/mmc/host/sh_mobile_sdhi.c +2
-0@@ -64,8 +64,10 @@ static const struct of_device_id sh_mobile_sdhi_of_match[] = { { .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], }, { .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], }, { .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], }, + { .compatible = "renesas,sdhi-rcar-gen1", .data = &of_rcar_gen1_compatible, }, { .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, }, { .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, }, + { .compatible = "renesas,sdhi-rcar-gen2", .data = &of_rcar_gen2_compatible, }, { .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, }, { .compatible = "renesas,sdhi-r8a7791", .data = &of_rcar_gen2_compatible, }, {},Signature · 6 lines
1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 2/5 ARM: shmobile: r8a7778: add generation level compatible for SDHI
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
---
v1 -> v2
- no change
arch/arm/boot/dts/r8a7778.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/r8a7778.dtsi +3 -3
@@ -206,7 +206,7 @@ }; sdhi0: sd@ffe4c000 { - compatible = "renesas,sdhi-r8a7778"; + compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1"; reg = <0xffe4c000 0x100>; interrupts = <0 87 IRQ_TYPE_LEVEL_HIGH>; cap-sd-highspeed;
@@ -215,7 +215,7 @@ }; sdhi1: sd@ffe4d000 { - compatible = "renesas,sdhi-r8a7778"; + compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1"; reg = <0xffe4d000 0x100>; interrupts = <0 88 IRQ_TYPE_LEVEL_HIGH>; cap-sd-highspeed;
@@ -224,7 +224,7 @@ }; sdhi2: sd@ffe4f000 { - compatible = "renesas,sdhi-r8a7778"; + compatible = "renesas,sdhi-r8a7778", "renesas,sdhi-rcar-gen1"; reg = <0xffe4f000 0x100>; interrupts = <0 86 IRQ_TYPE_LEVEL_HIGH>; cap-sd-highspeed;
Signature · 1 line
1.7.9.5
PATCH v2 3/5 ARM: shmobile: r8a7779: add generation level compatible for SDHI
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
---
v1 -> v2
- no change
arch/arm/boot/dts/r8a7779.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/r8a7779.dtsi +4 -4
@@ -316,7 +316,7 @@ }; sdhi0: sd@ffe4c000 { - compatible = "renesas,sdhi-r8a7779"; + compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1"; reg = <0xffe4c000 0x100>; interrupts = <0 104 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7779_CLK_SDHI0>;
@@ -326,7 +326,7 @@ }; sdhi1: sd@ffe4d000 { - compatible = "renesas,sdhi-r8a7779"; + compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1"; reg = <0xffe4d000 0x100>; interrupts = <0 105 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7779_CLK_SDHI1>;
@@ -336,7 +336,7 @@ }; sdhi2: sd@ffe4e000 { - compatible = "renesas,sdhi-r8a7779"; + compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1"; reg = <0xffe4e000 0x100>; interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7779_CLK_SDHI2>;
@@ -346,7 +346,7 @@ }; sdhi3: sd@ffe4f000 { - compatible = "renesas,sdhi-r8a7779"; + compatible = "renesas,sdhi-r8a7779", "renesas,sdhi-rcar-gen1"; reg = <0xffe4f000 0x100>; interrupts = <0 106 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7779_CLK_SDHI3>;
Signature · 1 line
1.7.9.5
PATCH v2 4/5 ARM: shmobile: r8a7790: add generation level compatible for SDHI
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
---
v1 -> v2
- no change
arch/arm/boot/dts/r8a7790.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/r8a7790.dtsi +4 -4
@@ -353,7 +353,7 @@ }; sdhi0: sd@ee100000 { - compatible = "renesas,sdhi-r8a7790"; + compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2"; reg = <0 0xee100000 0 0x200>; interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7790_CLK_SDHI0>;
@@ -362,7 +362,7 @@ }; sdhi1: sd@ee120000 { - compatible = "renesas,sdhi-r8a7790"; + compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2"; reg = <0 0xee120000 0 0x200>; interrupts = <0 166 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7790_CLK_SDHI1>;
@@ -371,7 +371,7 @@ }; sdhi2: sd@ee140000 { - compatible = "renesas,sdhi-r8a7790"; + compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2"; reg = <0 0xee140000 0 0x100>; interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7790_CLK_SDHI2>;
@@ -380,7 +380,7 @@ }; sdhi3: sd@ee160000 { - compatible = "renesas,sdhi-r8a7790"; + compatible = "renesas,sdhi-r8a7790", "renesas,sdhi-rcar-gen2"; reg = <0 0xee160000 0 0x100>; interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7790_CLK_SDHI3>;
Signature · 1 line
1.7.9.5
PATCH v2 5/5 ARM: shmobile: r8a7791: add generation level compatible for SDHI
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
---
v1 -> v2
- no change
arch/arm/boot/dts/r8a7791.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/r8a7791.dtsi +3 -3
@@ -341,7 +341,7 @@ }; sdhi0: sd@ee100000 { - compatible = "renesas,sdhi-r8a7791"; + compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2"; reg = <0 0xee100000 0 0x200>; interrupts = <0 165 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7791_CLK_SDHI0>;
@@ -349,7 +349,7 @@ }; sdhi1: sd@ee140000 { - compatible = "renesas,sdhi-r8a7791"; + compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2"; reg = <0 0xee140000 0 0x100>; interrupts = <0 167 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7791_CLK_SDHI1>;
@@ -357,7 +357,7 @@ }; sdhi2: sd@ee160000 { - compatible = "renesas,sdhi-r8a7791"; + compatible = "renesas,sdhi-r8a7791", "renesas,sdhi-rcar-gen2"; reg = <0 0xee160000 0 0x100>; interrupts = <0 168 IRQ_TYPE_LEVEL_HIGH>; clocks = <&mstp3_clks R8A7791_CLK_SDHI2>;
Signature · 1 line
1.7.9.5
Hi Chris, Simon
These are resend of v2 fixup patches for mmc tmio/shmobile. I tesed these patches on my environment,
and Nguyen, Hiep had tested on their environment.
Kuninori Morimoto (4):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
mmc: tmio: ensure that the clock has been stopped before set_clock
Shinobu Uehara (6):
mmc: block: add block number limitation flag for multiple block read
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: check ILL_FUNC instead of CBSY
mmc: tmio: add actual clock support as option
arch/arm/mach-shmobile/board-koelsch.c | 6 ++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 26 ++++++++++++++++++--- drivers/mmc/host/tmio_mmc_dma.c | 8 +++---- drivers/mmc/host/tmio_mmc_pio.c | 40 +++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++ include/linux/mmc/host.h | 3 +++ 8 files changed, 110 insertions(+), 18 deletions(-)
Best regards
---
Kuninori Morimoto
PATCH RESEND v2 1/10 mmc: block: add block number limitation flag for multiple block read
From: Shinobu Uehara <[email protected]>
In some controllers, when performing a multiple block read of one or two blocks, depending on the timing with which the response register is read, the response value may not be read properly.MMC_CAP2_NO_MULTI_READ flags disable all multiple block read, but, it is over-kill for this issue.
This patch adds new MMC_CAP2_2BLKS_LIMIT to use single block read when it was two blocks.
This is additional option of MMC_CAP2_NO_MULTI_READ
[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
--- arch/arm/mach-shmobile/board-koelsch.c | 6 +++--- arch/arm/mach-shmobile/board-lager.c | 4 ++-- drivers/mmc/card/block.c | 19 +++++++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 2 +- include/linux/mmc/host.h | 3 +++ 5 files changed, 26 insertions(+), 8 deletions(-)
arch/arm/mach-shmobile/board-koelsch.c +3 -3
@@ -331,7 +331,7 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT , };
@@ -344,7 +344,7 @@ static struct resource sdhi0_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi1_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT , };
@@ -357,7 +357,7 @@ static struct resource sdhi1_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi2_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };
arch/arm/mach-shmobile/board-lager.c +2 -2
@@ -630,7 +630,7 @@ static void __init lager_add_rsnd_device(void)static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };
@@ -644,7 +644,7 @@ static struct resource sdhi0_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi2_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };
drivers/mmc/card/block.c +17 -2
@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,/* Some controllers can't do multiblock reads due to hw bugs */ if (card->host->caps2 &MMC_CAP2_NO_MULTI_READ && -rq_data_dir (req) =READ ) - brq->data.blocks =1 ; +rq_data_dir (req) =READ ) { + +if (card->host->caps2 &MMC_CAP2_2BLKS_LIMIT ) { +/* +* In some controllers, when performing a +* multiple block read of one or two blocks, +* depending on the timing with which the +* response register is read, the response +* value may not be read properly. +* Use single block read for this HW bug +*/ +if (brq->data.blocks =2 ) + brq->data.blocks =1 ; + }else { + brq->data.blocks =1 ; + } + } }if (brq->data.blocks >1 || do_rel_wr) {
drivers/mmc/host/sh_mobile_sdhi.c +1 -1
@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , - .capabilities2 =MMC_CAP2_NO_MULTI_READ , + .capabilities2 =MMC_CAP2_NO_2BLKS_READ , };static const struct of_device_id sh_mobile_sdhi_of_match[] = {
include/linux/mmc/host.h +3 -0
@@ -266,6 +266,9 @@ struct mmc_host {#define MMC_CAP2_BOOTPART_NOACC (1 << 0)/* Boot partition no access */ #define MMC_CAP2_FULL_PWR_CYCLE (1 << 2)/* Can do full power cycle */ #define MMC_CAP2_NO_MULTI_READ (1 << 3)/* Multiblock reads don't work */ +#define MMC_CAP2_2BLKS_LIMIT (1 << 4)/* 2 blocks limit for multi read */ +#define MMC_CAP2_NO_2BLKS_READ (MMC_CAP2_NO_MULTI_READ | \ + MMC_CAP2_2BLKS_LIMIT)#define MMC_CAP2_HS200_1_8V_SDR (1 << 5)/* can support */ #define MMC_CAP2_HS200_1_2V_SDR (1 << 6)/* can support */ #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \
Signature · 1 line
1.7.9.5
Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
Quoted 6 lines · Kuninori Morimoto
From: Shinobu Uehara <[email protected]>
In some controllers, when performing a multiple block read of one or two blocks, depending on the timing with which the response register is read, the response value may not be read properly.
Can't his be solved in software in the host driver? Or is it pure bug in the HW?
Quoted 8 lines
MMC_CAP2_NO_MULTI_READflags disable all multiple block read, but, it is over-kill for this issue.
This patch adds newMMC_CAP2_2BLKS_LIMITto use single block read when it was two blocks.
This is additional option ofMMC_CAP2_NO_MULTI_READ[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
Quoted 7 lines
Tested-by Nguyen Xuan Nui <[email protected]>Tested-by Hiep Cao Minh <[email protected]>Signed-off-by Shinobu Uehara <[email protected]>Signed-off-by Kuninori Morimoto <[email protected]>--- arch/arm/mach-shmobile/board-koelsch.c | 6 +++--- arch/arm/mach-shmobile/board-lager.c | 4 ++--
I prefer to split up patches into ARM patches and MMC patches if it's possible. That makes it easier to review and collect acks from SoC maintainers.
Quoted 10 lines
drivers/mmc/card/block.c | 19 +++++++++++++++++-- drivers/mmc/host/sh_mobile_sdhi.c | 2 +- include/linux/mmc/host.h | 3 +++ 5 files changed, 26 insertions(+), 8 deletions(-)arch/arm/mach-shmobile/board-koelsch.c +0
-0
arch/arm/mach-shmobile/board-koelsch.c SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26)); · line 334
Quoted 5 lines
arch/arm/mach-shmobile/board-koelsch.c +1
-1@@ -331,7 +331,7 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ ,
Why are MMC_CAP2_NO_MULTI_READ /MMC_CAP2_NO_2BLKS_READ configured from platform data. If this is HW bug, aren't that related to the actual mmc controller and version of it - not the board/platform?
This applies to more caps and boards further down below in this patch as well.
To me, it seems like these belongs into the host driver instead!?
Quoted 48 lines
arch/arm/mach-shmobile/board-koelsch.c +2
-2.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT, };@@ -344,7 +344,7 @@ static struct resource sdhi0_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi1_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT , };@@ -357,7 +357,7 @@ static struct resource sdhi1_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi2_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };arch/arm/mach-shmobile/board-lager.c +2
-2@@ -630,7 +630,7 @@ static void __init lager_add_rsnd_device(void)static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };@@ -644,7 +644,7 @@ static struct resource sdhi0_resources[] __initdata = {static struct sh_mobile_sdhi_info sdhi2_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ , .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , };drivers/mmc/card/block.c +0
-0
drivers/mmc/card/block.c static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, · line 1405
Quoted 8 lines
drivers/mmc/card/block.c +3
-2@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,/* Some controllers can't do multiblock reads due to hw bugs */ if (card->host->caps2 &MMC_CAP2_NO_MULTI_READ && -rq_data_dir (req) ==READ ) - brq->data.blocks =1 ; +rq_data_dir (req) ==READ ) { + +if (card->host->caps2 &MMC_CAP2_2BLKS_LIMIT ) {
This conforms to what the commit message states, that MMC_CAP2_2BLKS_LIMIT needs to be used together with MMC_CAP2_NO_MULTI_READ to take effect. I think I would prefer to have them separate.
Anyway, according to your cap configuration changes, you are replacing MMC_CAP2_NO_MULTI_READ with MMC_CAP2_2BLKS_LIMIT, instead of adding it...
Quoted 45 lines
drivers/mmc/card/block.c +14
-0+/* +* In some controllers, when performing a +* multiple block read of one or two blocks, +* depending on the timing with which the +* response register is read, the response +* value may not be read properly. +* Use single block read for this HW bug +*/ +if (brq->data.blocks ==2 ) + brq->data.blocks =1 ; + }else { + brq->data.blocks =1 ; + } + } }if (brq->data.blocks >1 || do_rel_wr) {drivers/mmc/host/sh_mobile_sdhi.c +1
-1@@ -55,7 +55,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , - .capabilities2 =MMC_CAP2_NO_MULTI_READ , + .capabilities2 =MMC_CAP2_NO_2BLKS_READ , };static const struct of_device_id sh_mobile_sdhi_of_match[] = {include/linux/mmc/host.h +3
-1@@ -266,6 +266,9 @@ struct mmc_host {#define MMC_CAP2_BOOTPART_NOACC (1 << 0)/* Boot partition no access */ #define MMC_CAP2_FULL_PWR_CYCLE (1 << 2)/* Can do full power cycle */ #define MMC_CAP2_NO_MULTI_READ (1 << 3)/* Multiblock reads don't work */ +#define MMC_CAP2_2BLKS_LIMIT (1 << 4)/* 2 blocks limit for multi read */ +#define MMC_CAP2_NO_2BLKS_READ (MMC_CAP2_NO_MULTI_READ | \ + MMC_CAP2_2BLKS_LIMIT)#define MMC_CAP2_HS200_1_8V_SDR (1 << 5)/* can support */ #define MMC_CAP2_HS200_1_2V_SDR (1 << 6)/* can support */ #define MMC_CAP2_HS200 (MMC_CAP2_HS200_1_8V_SDR | \ --
Quoted 2 lines
1.7.9.5
Kind regards
Uffe
Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
Hi Ulf
Thank you for your feedback
Quoted 16 lines
Quoted 8 lines
MMC_CAP2_NO_MULTI_READflags disable all multiple block read, but, it is over-kill for this issue.
This patch adds newMMC_CAP2_2BLKS_LIMITto use single block read when it was two blocks.
This is additional option ofMMC_CAP2_NO_MULTI_READ[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
Quoted 7 lines
Tested-by Nguyen Xuan Nui <[email protected]>Tested-by Hiep Cao Minh <[email protected]>Signed-off-by Shinobu Uehara <[email protected]>Signed-off-by Kuninori Morimoto <[email protected]>--- arch/arm/mach-shmobile/board-koelsch.c | 6 +++--- arch/arm/mach-shmobile/board-lager.c | 4 ++--
Quoted 2 lines
I prefer to split up patches into ARM patches and MMC patches if it's possible. That makes it easier to review and collect acks from SoC maintainers.
I see. will do
Quoted 10 lines
arch/arm/mach-shmobile/board-koelsch.c SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26)); · line 334
Quoted 6 lines
arch/arm/mach-shmobile/board-koelsch.c +1
-1@@ -331,7 +331,7 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ ,Why are
MMC_CAP2_NO_MULTI_READ/MMC_CAP2_NO_2BLKS_READ configured from platform data. If this is HW bug, aren't that related to the actual mmc controller and version of it - not the board/platform?
In historical reason, your idea can be implemented on DT case. But above style is very normal for non-DT case in this driver...
Quoted 3 lines
This applies to more caps and boards further down below in this patch as well.
To me, it seems like these belongs into the host driver instead!?
This issue is similar to MMC_CAP2_NO_MULTI_READ,
and it is located in block.c.
So, we added it there too.
If you can't accept it, we will consider it again.
But is it possilbe to keep consistency if host side exchange block size without using framework ??
Quoted 15 lines
drivers/mmc/card/block.c static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, · line 1405
Quoted 9 lines
drivers/mmc/card/block.c +3
-2@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,/* Some controllers can't do multiblock reads due to hw bugs */ if (card->host->caps2 &MMC_CAP2_NO_MULTI_READ && -rq_data_dir (req) ==READ ) - brq->data.blocks =1 ; +rq_data_dir (req) ==READ ) { + +if (card->host->caps2 &MMC_CAP2_2BLKS_LIMIT ) {This conforms to what the commit message states, that
MMC_CAP2_2BLKS_LIMITneeds to be used together withMMC_CAP2_NO_MULTI_READto take effect. I think I would prefer to have them separate.
Quoted 3 lines
Anyway, according to your cap configuration changes, you are replacing
MMC_CAP2_NO_MULTI_READwithMMC_CAP2_2BLKS_LIMIT, instead of adding it...
Because this method will check caps2 flag twice for MMC_CAP2_2BLKS_LIMIT and MMC_CAP2_NO_MULTI_READ in such case. But, these are similar flag, and is no effect for almost all drivers. We avoided such checks.
Best regards
---
Kuninori Morimoto
Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
Quoted 44 lines · Kuninori Morimoto
Hi Ulf
Thank you for your feedback
Quoted 16 lines
Quoted 8 lines
MMC_CAP2_NO_MULTI_READflags disable all multiple block read, but, it is over-kill for this issue.
This patch adds newMMC_CAP2_2BLKS_LIMITto use single block read when it was two blocks.
This is additional option ofMMC_CAP2_NO_MULTI_READ[Kuninori Morimoto: tidyup for upstreaming, and cared mach-shmobile]
Quoted 7 lines
Tested-by Nguyen Xuan Nui <[email protected]>Tested-by Hiep Cao Minh <[email protected]>Signed-off-by Shinobu Uehara <[email protected]>Signed-off-by Kuninori Morimoto <[email protected]>--- arch/arm/mach-shmobile/board-koelsch.c | 6 +++--- arch/arm/mach-shmobile/board-lager.c | 4 ++--Quoted 2 lines
I prefer to split up patches into ARM patches and MMC patches if it's possible. That makes it easier to review and collect acks from SoC maintainers.
I see. will do
Quoted 10 lines
arch/arm/mach-shmobile/board-koelsch.c SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26)); · line 334
Quoted 6 lines
arch/arm/mach-shmobile/board-koelsch.c +1
-1@@ -331,7 +331,7 @@ SDHI_REGULATOR(2, RCAR_GP_PIN(7, 19), RCAR_GP_PIN(2, 26));static struct sh_mobile_sdhi_info sdhi0_info__initdata = { .tmio_caps =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ |MMC_CAP_POWER_OFF_CARD , - .tmio_caps2 =MMC_CAP2_NO_MULTI_READ , + .tmio_caps2 =MMC_CAP2_NO_2BLKS_READ ,Why are
MMC_CAP2_NO_MULTI_READ/MMC_CAP2_NO_2BLKS_READ configured from platform data. If this is HW bug, aren't that related to the actual mmc controller and version of it - not the board/platform?In historical reason, your idea can be implemented on DT case. But above style is very normal for non-DT case in this driver...
Quoted 3 lines
This applies to more caps and boards further down below in this patch as well.
To me, it seems like these belongs into the host driver instead!?
Quoted 7 lines
This issue is similar to
MMC_CAP2_NO_MULTI_READ,
and it is located inblock.c.
So, we added it there too.If you can't accept it, we will consider it again.
But is it possilbe to keep consistency if host side exchange block size without using framework ??
Nope, we need adaptations to the framework and I have no objections to that.
Quoted 16 lines
Quoted 16 lines
drivers/mmc/card/block.c static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq, · line 1405
Quoted 10 lines
drivers/mmc/card/block.c +3
-2@@ -1400,8 +1400,23 @@ static void mmc_blk_rw_rq_prep(struct mmc_queue_req *mqrq,/* Some controllers can't do multiblock reads due to hw bugs */ if (card->host->caps2 &MMC_CAP2_NO_MULTI_READ && -rq_data_dir (req) ==READ ) - brq->data.blocks =1 ; +rq_data_dir (req) ==READ ) { + +if (card->host->caps2 &MMC_CAP2_2BLKS_LIMIT ) {This conforms to what the commit message states, that
MMC_CAP2_2BLKS_LIMITneeds to be used together withMMC_CAP2_NO_MULTI_READto take effect. I think I would prefer to have them separate.
Quoted 8 lines
Quoted 3 lines
Anyway, according to your cap configuration changes, you are replacing
MMC_CAP2_NO_MULTI_READwithMMC_CAP2_2BLKS_LIMIT, instead of adding it...Because this method will check caps2 flag twice for
MMC_CAP2_2BLKS_LIMITandMMC_CAP2_NO_MULTI_READin such case. But, these are similar flag, and is no effect for almost all drivers. We avoided such checks.
I see, but I don't think such "optimization" is worth much. To me it just adds a bit of confusion. I would prefer to have them separate.
Kind regards
Uffe
Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
Hi Ulf
Thank you for your feedback
Quoted 5 lines
Quoted 3 lines
If you can't accept it, we will consider it again.
But is it possilbe to keep consistency if host side exchange block size without using framework ??Nope, we need adaptations to the framework and I have no objections to that.
Thank you.
Basically, I agree with your opinion (= it locals to host driver side, not on framework) but, I couldn't find good method for it
(the size is decided on framework, and it seems host side driver can't do something to it) And, we noticed similar flag.
But, hmm... if we can have callback function on framework...
/*
* this can replace MMC_CAP2_NO_MULTI_READ ? */
void no_multi_read_fixup(struct mmc_blk_request *brq,
struct request *req)
{
if (rq_data_dir(req) = READ)
brq->data.blocks = 1;
}
/*
* we can use this instead of MMC_CAP2_2BLKS_LIMIT ? */
void two_block_limit_read_fixup(struct mmc_blk_request *brq,
struct request *req)
{
if ((rq_data_dir(req) = READ) &&
(brq->data.blocks = 2))
brq->data.blocks = 1;
}static void mmc_blk_rw_rq_prep(xxxx)
{
...
if (brq->data.blocks > 1) {
...
if (card->host->host_data_fixup)
card->host->host_data_fixup(brq, req)
}
...
}Quoted 7 lines
Quoted 4 lines
Because this method will check caps2 flag twice for
MMC_CAP2_2BLKS_LIMITandMMC_CAP2_NO_MULTI_READin such case. But, these are similar flag, and is no effect for almost all drivers. We avoided such checks.I see, but I don't think such "optimization" is worth much. To me it just adds a bit of confusion. I would prefer to have them separate.
OK, I see.
I already posted v3 patch-set which doesn't have this patch. I will post v3 of this patch if above v3 patch-set were accepted.
Best regards
---
Kuninori Morimoto
Re: [PATCH 01/10 v2 resend] mmc: block: add block number limitation flag for multiple block read
Hi Ulf again
What do you think this idea ?
We can move MMC_CAP2_NO_MULTI_READ from host.h to driver side
Quoted 22 lines
/*
* this can replaceMMC_CAP2_NO_MULTI_READ? */
void no_multi_read_fixup(structmmc_blk_request*brq,
struct request *req){ if (rq_data_dir(req) == READ) brq->data.blocks = 1; }/*
* we can use this instead ofMMC_CAP2_2BLKS_LIMIT? */
void two_block_limit_read_fixup(structmmc_blk_request*brq,
struct request *req){ if ((rq_data_dir(req) == READ) && (brq->data.blocks == 2)) brq->data.blocks = 1; }static void
mmc_blk_rw_rq_prep(xxxx)
Quoted 10 lines
{
...
if (brq->data.blocks > 1) {
...
if (card->host->host_data_fixup)
card->host->host_data_fixup(brq, req)
}
...
}Best regards
---
Kuninori Morimoto
PATCH RESEND v2 2/10 mmc: tmio: care about DMA tx/rx addr offset
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
Basically, SD_BUF0 Tx/Rx addresses are same in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)
This patch adds new .dma_rx_offset and cares it
--- drivers/mmc/host/sh_mobile_sdhi.c | 3 +++ drivers/mmc/host/tmio_mmc_dma.c | 2 +- include/linux/mfd/tmio.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/sh_mobile_sdhi.c +3 -0
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {unsigned long tmio_flags;unsigned long capabilities;unsigned long capabilities2; +dma_addr_t dma_rx_offset; };static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, .capabilities2 = MMC_CAP2_NO_2BLKS_READ, + .dma_rx_offset = 0x2000, };static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -228,6 +230,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) mmc_data->flags |= of_data->tmio_flags; mmc_data->capabilities |= of_data->capabilities; mmc_data->capabilities2 |= of_data->capabilities2; + dma_priv->dma_rx_offset = of_data->dma_rx_offset; }/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
drivers/mmc/host/tmio_mmc_dma.c +1 -1
@@ -312,7 +312,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdatif (pdata->dma->chan_priv_rx) cfg.slave_id = pdata->dma->slave_id_rx; cfg.direction =DMA_DEV_TO_MEM ; - cfg.src_addr = cfg.dst_addr; + cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset; cfg.src_addr_width =DMA_SLAVE_BUSWIDTH_2_BYTES ; cfg.dst_addr =0 ; ret =dmaengine_slave_config (host->chan_rx, &cfg);
include/linux/mfd/tmio.h +1 -0
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {int slave_id_tx;int slave_id_rx;int alignment_shift; +dma_addr_t dma_rx_offset;bool (*filter)(struct dma_chan *chan,void *arg); };
Signature · 1 line
1.7.9.5
PATCH RESEND v2 3/10 mmc: tmio: clear error IRQ status
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Next card access will be always
error if it didn't clear error status
--- drivers/mmc/host/tmio_mmc_pio.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mmc/host/tmio_mmc_pio.c +3 -0
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,pr_debug_status (*status);pr_debug_status (*ireg); + +/* Clear the status except the interrupt status */ +sd_ctrl_write32 (host,CTL_STATUS ,TMIO_MASK_IRQ ); } static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
Signature · 1 line
1.7.9.5
PATCH RESEND v2 4/10 mmc: tmio: control multiple block transfer mode
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Renesas SDHI has "Multiple Block Transfer Mode" settings on SD_CMD register which controls CMD12 automatically.
This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)
[Kuninori Morimoto: tidyuped for upstreaming
enabled this flags for all SH-Mobile/R-Car]
--- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_pio.c | 10 ++++++++++ include/linux/mfd/tmio.h | 6 ++++++ 3 files changed, 21 insertions(+)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -225,6 +225,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_SDIO_IRQ ; +/* +* All SDHI have CMD12 controll bit +*/ + mmc_data->flags |=TMIO_MMC_HAVE_CMD12_CTRL ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_pio.c +10 -0
@@ -44,6 +44,7 @@#include <linux/pm_qos.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include <linux/mmc/sdio.h> #include <linux/scatterlist.h> #include <linux/spinlock.h> #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)#define TRANSFER_READ 0x1000#define TRANSFER_MULTI 0x2000#define SECURITY_CMD 0x4000 +#define NO_CMD12_ISSUE 0x4000/* TMIO_MMC_HAVE_CMD12_CTRL */ static int tmio_mmc_start_command (struct tmio_mmc_host *host,struct mmc_command *cmd) {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_commandif (data->blocks >1 ) {sd_ctrl_write16 (host,CTL_STOP_INTERNAL_ACTION ,0x100 ); c |=TRANSFER_MULTI ; + +/* +* Disable auto CMD12 at IO_RW_EXTENDED when +* multiple block transfer +*/ +if ((host->pdata->flags &TMIO_MMC_HAVE_CMD12_CTRL ) && + (cmd->opcode ==SD_IO_RW_EXTENDED )) + c |=NO_CMD12_ISSUE ; }if (data->flags &MMC_DATA_READ ) c |=TRANSFER_READ ;
include/linux/mfd/tmio.h +6 -0
@@ -83,6 +83,12 @@*/ #define TMIO_MMC_HAVE_HIGH_REG (1 << 6) +/* +* Some controllers have CMD12 automatically +* issue/non-issue register +*/ +#define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH RESEND v2 5/10 mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Renesas R-Car SDHI should set reserved bits on CTL_SDIO_STATUS register when writing. This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags for this purpose
[Kuninori Morimoto: tidyuped for upstreaming
enabled this flags for all SH-Mobile/R-Car]
--- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_pio.c | 7 ++++++- include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -230,6 +230,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_HAVE_CMD12_CTRL ; +/* +* All SDHI need SDIO_INFO1 reserved bit +*/ + mmc_data->flags |=TMIO_MMC_SDIO_STATUS_QUIRK ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_pio.c +6 -1
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)struct mmc_host *mmc = host->mmc;struct tmio_mmc_data *pdata = host->pdata;unsigned int ireg, status; +unsigned int sdio_status;if (!(pdata->flags &TMIO_MMC_SDIO_IRQ ))return IRQ_HANDLED ;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid) status =sd_ctrl_read16 (host,CTL_SDIO_STATUS ); ireg = status &TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask; -sd_ctrl_write16 (host,CTL_SDIO_STATUS , status & ~TMIO_SDIO_MASK_ALL ); + sdio_status = status & ~TMIO_SDIO_MASK_ALL ; +if (pdata->flags &TMIO_MMC_SDIO_STATUS_QUIRK ) + sdio_status |=6 ; + +sd_ctrl_write16 (host,CTL_SDIO_STATUS , sdio_status);if (mmc->caps &MMC_CAP_SDIO_IRQ && ireg &TMIO_SDIO_STAT_IOIRQ )mmc_signal_sdio_irq (mmc);
include/linux/mfd/tmio.h +5 -0
@@ -89,6 +89,11 @@*/ #define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) +/* +* Some controllers needs to set 1 on SDIO status reserved bits +*/ +#define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH RESEND v2 6/10 mmc: tmio: check ILL_FUNC instead of CBSY
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Some controllers need to check SD bus status when writing data. Then, it checks ILL_FUNC bit on SD_INFO2 register, and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags. Same method is required on tmio_mmc_data_irq() which will be called after writing data.
Current driver is checking CBSY bit for this purpose, but, some controllers doesn't have CBSY bit. This patch checks ILL_FUNC bit instead of CBSY bit if it has TMIO_MMC_HAS_IDLE_WAIT flags
[Kuninori Morimoto: tidyuped for upstreaming]
--- drivers/mmc/host/tmio_mmc_pio.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/mmc/host/tmio_mmc_pio.c +12 -1
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host) goto out;if (host->chan_tx && (data->flags &MMC_DATA_WRITE ) && !host->force_pio) { +u32 status =sd_ctrl_read32 (host,CTL_STATUS ); +bool done = false; +/* * Has all data been written out yet? Testing on SuperH showed, * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)* DATAEND interrupt with the BUSY bit set, in this cases * waiting for one more interrupt fixes the problem. */ -if (!(sd_ctrl_read32 (host,CTL_STATUS ) &TMIO_STAT_CMD_BUSY )) { +if (host->pdata->flags &TMIO_MMC_HAS_IDLE_WAIT ) { +if (status &TMIO_STAT_ILL_FUNC ) + done = true; + }else { +if (!(status &TMIO_STAT_CMD_BUSY )) + done = true; + } + +if (done) {tmio_mmc_disable_mmc_irqs (host,TMIO_STAT_DATAEND );tasklet_schedule (&host->dma_complete); }
Signature · 1 line
1.7.9.5
PATCH RESEND v2 7/10 mmc: tmio: remove Renesas specific #ifdef
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag, and remove Renesas specific #ifdef from tmio driver
--- drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_dma.c | 6 ++---- include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 12 insertions(+), 4 deletions(-)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -235,6 +235,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_SDIO_STATUS_QUIRK ; +/* +* All SDHI have DMA control register +*/ + mmc_data->flags |=TMIO_MMC_HAVE_CTL_DMA_REG ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_dma.c +2 -4
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)if (!host->chan_tx || !host->chan_rx)return ; -#if defined(CONFIG_SUPERH ) || defined(CONFIG_ARCH_SHMOBILE ) -/* Switch DMA mode on or off - SuperH specific? */ -sd_ctrl_write16 (host,CTL_DMA_ENABLE , enable ?2 :0 ); -#endif +if (host->pdata->flags &TMIO_MMC_HAVE_CTL_DMA_REG ) +sd_ctrl_write16 (host,CTL_DMA_ENABLE , enable ?2 :0 ); }void tmio_mmc_abort_dma (struct tmio_mmc_host *host)
include/linux/mfd/tmio.h +5 -0
@@ -94,6 +94,11 @@*/ #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) +/* +* Some controllers have DMA enable/disable register +*/ +#define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH RESEND v2 8/10 mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(), and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.
--- drivers/mmc/host/tmio_mmc_pio.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/host/tmio_mmc_pio.c +0 -1
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)for (clock = host->mmc->f_min, clk =0x80000080 ; new_clock >= (clock<<1 ); clk >>=1 ) clock <<=1 ; - clk |=0x100 ; }if (host->set_clk_div)
Signature · 1 line
1.7.9.5
PATCH RESEND v2 9/10 mmc: tmio: ensure that the clock has been stopped before set_clock
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
This patch ensures that the clock has been stopped before it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch
--- drivers/mmc/host/tmio_mmc_pio.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/tmio_mmc_pio.c +1 -0
@@ -895,6 +895,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) }if (host->power ==TMIO_MMC_OFF_STOP )tmio_mmc_reset (host); +tmio_mmc_clk_stop (host);tmio_mmc_set_clock (host, ios->clock);if (host->power ==TMIO_MMC_OFF_STOP )/* power up SD card and the bus */
Signature · 1 line
1.7.9.5
Hi Chris, Ulf, Simon
These are v3 fixup patches for mmc tmio/shmobile.
I dropped [1/10] patch (which Ulf was pointed) from v2 patch-set. We will post it again in the future,
but we want last 9 patches in upstream at this point.
Kuninori Morimoto (4):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
mmc: tmio: ensure that the clock has been stopped before set_clock
Shinobu Uehara (5):
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: check ILL_FUNC instead of CBSY
mmc: tmio: add actual clock support as option
drivers/mmc/host/sh_mobile_sdhi.c | 24 ++++++++++++++++++++-- drivers/mmc/host/tmio_mmc_dma.c | 8 +++----- drivers/mmc/host/tmio_mmc_pio.c | 40 ++++++++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++++ 4 files changed, 84 insertions(+), 10 deletions(-)
Best regards
---
Kuninori Morimoto
PATCH v3 1/9 mmc: tmio: care about DMA tx/rx addr offset
From: Kuninori Morimoto <[email protected]>
Basically, SD_BUF0 Tx/Rx addresses are same in normal TMIO controller,
but, it is different on Renesas R-Car SDHI controller if it uses DMAC
(Rx address needs to add 0x2000 to Tx address)
This patch adds new .dma_rx_offset and cares it
---
v2 -> v3
- no change
drivers/mmc/host/sh_mobile_sdhi.c | 3 +++ drivers/mmc/host/tmio_mmc_dma.c | 2 +- include/linux/mfd/tmio.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/sh_mobile_sdhi.c +3 -0
@@ -39,6 +39,7 @@ struct sh_mobile_sdhi_of_data {unsigned long tmio_flags;unsigned long capabilities;unsigned long capabilities2; +dma_addr_t dma_rx_offset; };static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
@@ -56,6 +57,7 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_WRPROTECT_DISABLE, .capabilities = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ, .capabilities2 = MMC_CAP2_NO_MULTI_READ, + .dma_rx_offset = 0x2000, };static const struct of_device_id sh_mobile_sdhi_of_match[] = {
@@ -228,6 +230,7 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) mmc_data->flags |= of_data->tmio_flags; mmc_data->capabilities |= of_data->capabilities; mmc_data->capabilities2 |= of_data->capabilities2; + dma_priv->dma_rx_offset = of_data->dma_rx_offset; }/* SD control register space size is 0x100, 0x200 for bus_shift=1 */
drivers/mmc/host/tmio_mmc_dma.c +1 -1
@@ -312,7 +312,7 @@ void tmio_mmc_request_dma(struct tmio_mmc_host *host, struct tmio_mmc_data *pdatif (pdata->dma->chan_priv_rx) cfg.slave_id = pdata->dma->slave_id_rx; cfg.direction =DMA_DEV_TO_MEM ; - cfg.src_addr = cfg.dst_addr; + cfg.src_addr = cfg.dst_addr + pdata->dma->dma_rx_offset; cfg.src_addr_width =DMA_SLAVE_BUSWIDTH_2_BYTES ; cfg.dst_addr =0 ; ret =dmaengine_slave_config (host->chan_rx, &cfg);
include/linux/mfd/tmio.h +1 -0
@@ -96,6 +96,7 @@ struct tmio_mmc_dma {int slave_id_tx;int slave_id_rx;int alignment_shift; +dma_addr_t dma_rx_offset;bool (*filter)(struct dma_chan *chan,void *arg); };
Signature · 1 line
1.7.9.5
PATCH v3 2/9 mmc: tmio: clear error IRQ status
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Next card access will be always
error if it didn't clear error status
---
v2 -> v3
- no change
drivers/mmc/host/tmio_mmc_pio.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mmc/host/tmio_mmc_pio.c +3 -0
@@ -557,6 +557,9 @@ static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,pr_debug_status (*status);pr_debug_status (*ireg); + +/* Clear the status except the interrupt status */ +sd_ctrl_write32 (host,CTL_STATUS ,TMIO_MASK_IRQ ); } static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
Signature · 1 line
1.7.9.5
PATCH v3 3/9 mmc: tmio: control multiple block transfer mode
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Renesas SDHI has "Multiple Block Transfer Mode" settings on SD_CMD register which controls CMD12 automatically.
This patch cares it, because
CMD12 is not needed when CMD53 (= SD_IO_RW_EXTENDED)
[Kuninori Morimoto: tidyuped for upstreaming
enabled this flags for all SH-Mobile/R-Car]
---
v2 -> v3
- no change
drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_pio.c | 10 ++++++++++ include/linux/mfd/tmio.h | 6 ++++++ 3 files changed, 21 insertions(+)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -225,6 +225,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_SDIO_IRQ ; +/* +* All SDHI have CMD12 controll bit +*/ + mmc_data->flags |=TMIO_MMC_HAVE_CMD12_CTRL ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_pio.c +10 -0
@@ -44,6 +44,7 @@#include <linux/pm_qos.h> #include <linux/pm_runtime.h> #include <linux/regulator/consumer.h> +#include <linux/mmc/sdio.h> #include <linux/scatterlist.h> #include <linux/spinlock.h> #include <linux/workqueue.h>
@@ -295,6 +296,7 @@ static void tmio_mmc_done_work(struct work_struct *work)#define TRANSFER_READ 0x1000#define TRANSFER_MULTI 0x2000#define SECURITY_CMD 0x4000 +#define NO_CMD12_ISSUE 0x4000/* TMIO_MMC_HAVE_CMD12_CTRL */ static int tmio_mmc_start_command (struct tmio_mmc_host *host,struct mmc_command *cmd) {
@@ -331,6 +333,14 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_commandif (data->blocks >1 ) {sd_ctrl_write16 (host,CTL_STOP_INTERNAL_ACTION ,0x100 ); c |=TRANSFER_MULTI ; + +/* +* Disable auto CMD12 at IO_RW_EXTENDED when +* multiple block transfer +*/ +if ((host->pdata->flags &TMIO_MMC_HAVE_CMD12_CTRL ) && + (cmd->opcode ==SD_IO_RW_EXTENDED )) + c |=NO_CMD12_ISSUE ; }if (data->flags &MMC_DATA_READ ) c |=TRANSFER_READ ;
include/linux/mfd/tmio.h +6 -0
@@ -83,6 +83,12 @@*/ #define TMIO_MMC_HAVE_HIGH_REG (1 << 6) +/* +* Some controllers have CMD12 automatically +* issue/non-issue register +*/ +#define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH v3 4/9 mmc: tmio: add TMIO_MMC_SDIO_STATUS_QUIRK
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Renesas R-Car SDHI should set reserved bits on CTL_SDIO_STATUS register when writing. This patch adds new TMIO_MMC_SDIO_STATUS_QUIRK flags for this purpose
[Kuninori Morimoto: tidyuped for upstreaming
enabled this flags for all SH-Mobile/R-Car]
---
v2 -> v3
- no change
drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_pio.c | 7 ++++++- include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -230,6 +230,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_HAVE_CMD12_CTRL ; +/* +* All SDHI need SDIO_INFO1 reserved bit +*/ + mmc_data->flags |=TMIO_MMC_SDIO_STATUS_QUIRK ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_pio.c +6 -1
@@ -650,6 +650,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)struct mmc_host *mmc = host->mmc;struct tmio_mmc_data *pdata = host->pdata;unsigned int ireg, status; +unsigned int sdio_status;if (!(pdata->flags &TMIO_MMC_SDIO_IRQ ))return IRQ_HANDLED ;
@@ -657,7 +658,11 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid) status =sd_ctrl_read16 (host,CTL_SDIO_STATUS ); ireg = status &TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask; -sd_ctrl_write16 (host,CTL_SDIO_STATUS , status & ~TMIO_SDIO_MASK_ALL ); + sdio_status = status & ~TMIO_SDIO_MASK_ALL ; +if (pdata->flags &TMIO_MMC_SDIO_STATUS_QUIRK ) + sdio_status |=6 ; + +sd_ctrl_write16 (host,CTL_SDIO_STATUS , sdio_status);if (mmc->caps &MMC_CAP_SDIO_IRQ && ireg &TMIO_SDIO_STAT_IOIRQ )mmc_signal_sdio_irq (mmc);
include/linux/mfd/tmio.h +5 -0
@@ -89,6 +89,11 @@*/ #define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7) +/* +* Some controllers needs to set 1 on SDIO status reserved bits +*/ +#define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH v3 5/9 mmc: tmio: check ILL_FUNC instead of CBSY
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Some controllers need to check SD bus status when writing data. Then, it checks ILL_FUNC bit on SD_INFO2 register, and this method is controlled via TMIO_MMC_HAS_IDLE_WAIT flags. Same method is required on tmio_mmc_data_irq() which will be called after writing data.
Current driver is checking CBSY bit for this purpose, but, some controllers doesn't have CBSY bit. This patch checks ILL_FUNC bit instead of CBSY bit if it has TMIO_MMC_HAS_IDLE_WAIT flags
[Kuninori Morimoto: tidyuped for upstreaming]
---
v2 -> v3
- no change
drivers/mmc/host/tmio_mmc_pio.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/mmc/host/tmio_mmc_pio.c +12 -1
@@ -475,6 +475,9 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host) goto out;if (host->chan_tx && (data->flags &MMC_DATA_WRITE ) && !host->force_pio) { +u32 status =sd_ctrl_read32 (host,CTL_STATUS ); +bool done = false; +/* * Has all data been written out yet? Testing on SuperH showed, * that in most cases the first interrupt comes already with the
@@ -483,7 +486,15 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host)* DATAEND interrupt with the BUSY bit set, in this cases * waiting for one more interrupt fixes the problem. */ -if (!(sd_ctrl_read32 (host,CTL_STATUS ) &TMIO_STAT_CMD_BUSY )) { +if (host->pdata->flags &TMIO_MMC_HAS_IDLE_WAIT ) { +if (status &TMIO_STAT_ILL_FUNC ) + done = true; + }else { +if (!(status &TMIO_STAT_CMD_BUSY )) + done = true; + } + +if (done) {tmio_mmc_disable_mmc_irqs (host,TMIO_STAT_DATAEND );tasklet_schedule (&host->dma_complete); }
Signature · 1 line
1.7.9.5
PATCH v3 6/9 mmc: tmio: remove Renesas specific #ifdef
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
This patch adds new TMIO_MMC_HAVE_CTL_DMA_REG flag, and remove Renesas specific #ifdef from tmio driver
---
v2 -> v3
- no change
drivers/mmc/host/sh_mobile_sdhi.c | 5 +++++ drivers/mmc/host/tmio_mmc_dma.c | 6 ++---- include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 12 insertions(+), 4 deletions(-)
drivers/mmc/host/sh_mobile_sdhi.c +5 -0
@@ -235,6 +235,11 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)*/ mmc_data->flags |=TMIO_MMC_SDIO_STATUS_QUIRK ; +/* +* All SDHI have DMA control register +*/ + mmc_data->flags |=TMIO_MMC_HAVE_CTL_DMA_REG ; +if (of_id && of_id->data) {const struct sh_mobile_sdhi_of_data *of_data = of_id->data; mmc_data->flags |= of_data->tmio_flags;
drivers/mmc/host/tmio_mmc_dma.c +2 -4
@@ -28,10 +28,8 @@ void tmio_mmc_enable_dma(struct tmio_mmc_host *host, bool enable)if (!host->chan_tx || !host->chan_rx)return ; -#if defined(CONFIG_SUPERH ) || defined(CONFIG_ARCH_SHMOBILE ) -/* Switch DMA mode on or off - SuperH specific? */ -sd_ctrl_write16 (host,CTL_DMA_ENABLE , enable ?2 :0 ); -#endif +if (host->pdata->flags &TMIO_MMC_HAVE_CTL_DMA_REG ) +sd_ctrl_write16 (host,CTL_DMA_ENABLE , enable ?2 :0 ); }void tmio_mmc_abort_dma (struct tmio_mmc_host *host)
include/linux/mfd/tmio.h +5 -0
@@ -94,6 +94,11 @@*/ #define TMIO_MMC_SDIO_STATUS_QUIRK (1 << 8) +/* +* Some controllers have DMA enable/disable register +*/ +#define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
PATCH v3 7/9 mmc: tmio: remove SCLKEN bit setting from tmio_mmc_set_clock()
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
TMIO clock is set via tmio_mmc_set_clock() -> tmio_mmc_clk_start(), and SCLKEN bit will be set on tmio_mmc_clk_start().
It is not needed on tmio_mmc_set_clock() function.
The required clock setting will not be able to set
in some clocks without this patch.
---
v2 -> v3
- no change
drivers/mmc/host/tmio_mmc_pio.c | 1 - 1 file changed, 1 deletion(-)
drivers/mmc/host/tmio_mmc_pio.c +0 -1
@@ -150,7 +150,6 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)for (clock = host->mmc->f_min, clk =0x80000080 ; new_clock >= (clock<<1 ); clk >>=1 ) clock <<=1 ; - clk |=0x100 ; }if (host->set_clk_div)
Signature · 1 line
1.7.9.5
PATCH v3 8/9 mmc: tmio: ensure that the clock has been stopped before set_clock
In reply to Kuninori MorimotoFrom: Kuninori Morimoto <[email protected]>
This patch ensures that the clock has been stopped before it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch
---
v2 -> v3
- no change
drivers/mmc/host/tmio_mmc_pio.c | 1 + 1 file changed, 1 insertion(+)
drivers/mmc/host/tmio_mmc_pio.c +1 -0
@@ -895,6 +895,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) }if (host->power ==TMIO_MMC_OFF_STOP )tmio_mmc_reset (host); +tmio_mmc_clk_stop (host);tmio_mmc_set_clock (host, ios->clock);if (host->power ==TMIO_MMC_OFF_STOP )/* power up SD card and the bus */
Signature · 1 line
1.7.9.5
PATCH v3 9/9 mmc: tmio: add actual clock support as option
In reply to Kuninori MorimotoFrom: Shinobu Uehara <[email protected]>
Some controller is supporting actual clock on SD_CLK_CTRL :: DIV[7:0]. Renesas SH-Mobile SDHI doesn't support,
but, Renesas R-Car SDHI supports it.
This patch adds new TMIO_MMC_CLK_ACTUAL flag for it.
[Kuninori Morimoto: tidyuped for upstreaming]
---
v2 -> v3
- no change
drivers/mmc/host/sh_mobile_sdhi.c | 6 ++++-- drivers/mmc/host/tmio_mmc_pio.c | 5 +++++ include/linux/mfd/tmio.h | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-)
drivers/mmc/host/sh_mobile_sdhi.c +4 -2
@@ -49,12 +49,14 @@ static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = { };static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = { - .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , + .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE | +TMIO_MMC_CLK_ACTUAL , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , };static const struct sh_mobile_sdhi_of_data of_rcar_gen2_compatible = { - .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE , + .tmio_flags =TMIO_MMC_HAS_IDLE_WAIT |TMIO_MMC_WRPROTECT_DISABLE | +TMIO_MMC_CLK_ACTUAL , .capabilities =MMC_CAP_SD_HIGHSPEED |MMC_CAP_SDIO_IRQ , .capabilities2 =MMC_CAP2_NO_MULTI_READ , .dma_rx_offset =0x2000 ,
drivers/mmc/host/tmio_mmc_pio.c +5 -0
@@ -150,6 +150,11 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock)for (clock = host->mmc->f_min, clk =0x80000080 ; new_clock >= (clock<<1 ); clk >>=1 ) clock <<=1 ; + +/* 1/1 clock is option */ +if ((host->pdata->flags &TMIO_MMC_CLK_ACTUAL ) && + ((clk >>22 ) &0x1 )) + clk |=0xff ; }if (host->set_clk_div)
include/linux/mfd/tmio.h +5 -0
@@ -99,6 +99,11 @@*/ #define TMIO_MMC_HAVE_CTL_DMA_REG (1 << 9) +/* +* Some controllers allows to set SDx actual clock +*/ +#define TMIO_MMC_CLK_ACTUAL (1 << 10) +int tmio_core_mmc_enable (void __iomem *cnf,int shift,unsigned long base);int tmio_core_mmc_resume (void __iomem *cnf,int shift,unsigned long base);void tmio_core_mmc_pwr (void __iomem *cnf,int shift,int state);
Signature · 1 line
1.7.9.5
Quoted 7 lines · Kuninori Morimoto
Hi Chris, Ulf, Simon
These are v3 fixup patches for mmc tmio/shmobile.
I dropped [1/10] patch (which Ulf was pointed) from v2 patch-set. We will post it again in the future,
but we want last 9 patches in upstream at this point.
Thanks Kuninori and Shinobu!
I have applied all patches but "mmc: tmio: ensure that the clock has been stopped before set_clock".
Since I decided to apply my own tmio patchset prior this series, the above patch needs to be re-based, if needed at all. Could you please have a look and send and possibly send a new version.
Kind regards
Uffe
Quoted 23 lines
Kuninori Morimoto (4):
mmc: tmio: care about DMA tx/rx addr offset
mmc: tmio: remove Renesas specific #ifdef
mmc: tmio: remove SCLKEN bit setting fromtmio_mmc_set_clock()
mmc: tmio: ensure that the clock has been stopped beforeset_clockShinobu Uehara (5):
mmc: tmio: clear error IRQ status
mmc: tmio: control multiple block transfer mode
mmc: tmio: addTMIO_MMC_SDIO_STATUS_QUIRK
mmc: tmio: checkILL_FUNCinstead of CBSY
mmc: tmio: add actual clock support as optiondrivers/mmc/host/sh_mobile_sdhi.c | 24 ++++++++++++++++++++-- drivers/mmc/host/tmio_mmc_dma.c | 8 +++----- drivers/mmc/host/tmio_mmc_pio.c | 40 ++++++++++++++++++++++++++++++++++--- include/linux/mfd/tmio.h | 22 ++++++++++++++++++++ 4 files changed, 84 insertions(+), 10 deletions(-)Best regards
---
Kuninori Morimoto
PATCH v4 1/1 mmc: tmio: ensure that the clock has been stopped before set_clock
From: Kuninori Morimoto <[email protected]>
This patch ensures that the clock has been stopped before it calls tmio_mmc_set_clock().
The clock settings might be failed without this patch
---
v3 -> v4
- based on latest git://git.linaro.org/people/ulf.hansson/mmc.git#next
drivers/mmc/host/tmio_mmc_pio.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mmc/host/tmio_mmc_pio.c +3 -0
@@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)tmio_mmc_clk_stop (host);break ;case MMC_POWER_UP : +tmio_mmc_clk_stop (host);tmio_mmc_set_clock (host, ios->clock);tmio_mmc_power_on (host, ios->vdd);tmio_mmc_clk_start (host);tmio_mmc_set_bus_width (host, ios->bus_width);break ;case MMC_POWER_ON : +tmio_mmc_clk_stop (host);tmio_mmc_set_clock (host, ios->clock);tmio_mmc_clk_start (host);tmio_mmc_set_bus_width (host, ios->bus_width);
@@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)tmio_mmc_clk_update (host);if (host->clk_cache) { +tmio_mmc_clk_stop (host);tmio_mmc_set_clock (host, host->clk_cache);tmio_mmc_clk_start (host); }
Signature · 1 line
1.7.9.5
Re: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
Quoted 20 lines · Kuninori Morimoto
From: Kuninori Morimoto <[email protected]>
This patch ensures that the clock has been stopped before it calls
tmio_mmc_set_clock().
The clock settings might be failed without this patchSigned-off-by Kuninori Morimoto <[email protected]>---
v3 -> v4- based on latest
git://git.linaro.org/people/ulf.hansson/mmc.git#nextdrivers/mmc/host/tmio_mmc_pio.c | 3 +++ 1 file changed, 3 insertions(+)drivers/mmc/host/tmio_mmc_pio.c +0
-0
drivers/mmc/host/tmio_mmc_pio.c static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · line 927
Quoted 4 lines
drivers/mmc/host/tmio_mmc_pio.c +1
-0@@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)tmio_mmc_clk_stop (host);break ;case MMC_POWER_UP : +tmio_mmc_clk_stop (host);
I don't think this is needed. Let me elaborate on why.
There two scenarios for when you may come down this path.
Either after ->probe() or after a MMC_POWER_OFF has been handled. In both scenarios, tmio_mmc_clk_stop(host) has already been invoked.
Well, actually in the ->probe() we invoke tmio_mmc_clk_stop() and then tmio_mmc_reset(), should those maybe be done in reverse order to make sure the clock is stopped?
Quoted 11 lines
drivers/mmc/host/tmio_mmc_pio.c +1
-0tmio_mmc_set_clock (host, ios->clock);tmio_mmc_power_on (host, ios->vdd);tmio_mmc_clk_start (host);tmio_mmc_set_bus_width (host, ios->bus_width);break ;case MMC_POWER_ON : +tmio_mmc_clk_stop (host);tmio_mmc_set_clock (host, ios->clock);tmio_mmc_clk_start (host);tmio_mmc_set_bus_width (host, ios->bus_width);
drivers/mmc/host/tmio_mmc_pio.c int tmio_mmc_host_runtime_resume(struct device *dev) · line 1204
Quoted 4 lines
drivers/mmc/host/tmio_mmc_pio.c +1
-0@@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)tmio_mmc_clk_update (host);if (host->clk_cache) { +tmio_mmc_clk_stop (host);
This should also not be needed.
To get runtime PM resumed, you must first be runtime PM suspended. In the runtime PM suspend callback we have already invoked tmio_mmc_set_clock().
Well, again it may depend on if tmio_mmc_reset() should be followed by a tmio_mmc_clk_stop(), which isn't the case right now.
Quoted 6 lines
drivers/mmc/host/tmio_mmc_pio.c +0
-1tmio_mmc_set_clock (host, host->clk_cache);tmio_mmc_clk_start (host); } --1.7.9.5
Finally, another question - somewhat related to clocks but not so much to this patch.
Shouldn't tmio_mmc_set_clock() when requested rate is 0, actually invoke tmio_mmc_clk_stop()? How will otherwise the clock be stopped?
Kind regards
Uffe
Re: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
Quoted 51 lines · Ulf Hansson
Quoted 20 lines · Kuninori Morimoto
From: Kuninori Morimoto <[email protected]>
This patch ensures that the clock has been stopped before it calls
tmio_mmc_set_clock().
The clock settings might be failed without this patchSigned-off-by Kuninori Morimoto <[email protected]>---
v3 -> v4- based on latest
git://git.linaro.org/people/ulf.hansson/mmc.git#nextdrivers/mmc/host/tmio_mmc_pio.c | 3 +++ 1 file changed, 3 insertions(+)drivers/mmc/host/tmio_mmc_pio.c +0
-0drivers/mmc/host/tmio_mmc_pio.c static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · line 927
Quoted 4 lines
drivers/mmc/host/tmio_mmc_pio.c +1
-0@@ -924,12 +924,14 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)tmio_mmc_clk_stop (host);break ;case MMC_POWER_UP : +tmio_mmc_clk_stop (host);I don't think this is needed. Let me elaborate on why.
There two scenarios for when you may come down this path.
Either after ->probe() or after a
MMC_POWER_OFFhas been handled. In both scenarios,tmio_mmc_clk_stop(host)has already been invoked.Well, actually in the ->probe() we invoke
tmio_mmc_clk_stop()and thentmio_mmc_reset(), should those maybe be done in reverse order to make sure the clock is stopped?Quoted 13 lines
drivers/mmc/host/tmio_mmc_pio.c +1
-0tmio_mmc_set_clock (host, ios->clock);tmio_mmc_power_on (host, ios->vdd);tmio_mmc_clk_start (host);tmio_mmc_set_bus_width (host, ios->bus_width);break ;case MMC_POWER_ON : +tmio_mmc_clk_stop (host);tmio_mmc_set_clock (host, ios->clock);tmio_mmc_clk_start (host);tmio_mmc_set_bus_width (host, ios->bus_width);@@ -1199,6 +1201,7 @@ int tmio_mmc_host_runtime_resume(struct device *dev)tmio_mmc_clk_update (host);
Quoted 8 lines
drivers/mmc/host/tmio_mmc_pio.c int tmio_mmc_host_runtime_resume(struct device *dev) · line 1204
Quoted 2 lines
drivers/mmc/host/tmio_mmc_pio.c +1
-0if (host->clk_cache) { +tmio_mmc_clk_stop (host);This should also not be needed.
To get runtime PM resumed, you must first be runtime PM suspended. In the runtime PM suspend callback we have already invoked
tmio_mmc_set_clock().
/s /tmio_mmc_set_clock() / tmio_mmc_clk_stop()
Quoted 19 lines
Well, again it may depend on if
tmio_mmc_reset()should be followed by atmio_mmc_clk_stop(), which isn't the case right now.Quoted 6 lines
drivers/mmc/host/tmio_mmc_pio.c +0
-1tmio_mmc_set_clock (host, host->clk_cache);tmio_mmc_clk_start (host); } --1.7.9.5
Finally, another question - somewhat related to clocks but not so much to this patch.
Shouldn't
tmio_mmc_set_clock()when requested rate is 0, actually invoketmio_mmc_clk_stop()? How will otherwise the clock be stopped?Kind regards
Uffe
Re: [PATCH v4] mmc: tmio: ensure that the clock has been stopped before set_clock
Hi Ulf
Quoted 10 lines
Quoted 10 lines
I don't think this is needed. Let me elaborate on why.
There two scenarios for when you may come down this path.
Either after ->probe() or after a
MMC_POWER_OFFhas been handled. In both scenarios,tmio_mmc_clk_stop(host)has already been invoked.Well, actually in the ->probe() we invoke
tmio_mmc_clk_stop()and thentmio_mmc_reset(), should those maybe be done in reverse order to make sure the clock is stopped?
(snip)
Quoted 3 lines
Quoted 3 lines
To get runtime PM resumed, you must first be runtime PM suspended. In the runtime PM suspend callback we have already invoked
tmio_mmc_set_clock().
I see
Thank you for you detail explain about that
Best regards
---
Kuninori Morimoto