[PATCH v3 00/10] Add tune support of Mediatek MMC driver

2015-10-27 Thread Chaotian Jing
Add SD SDR50/SDR104 mode support Add implement of tune function with CMD19/CMD21 Chaotian Jing (10): mmc: core: Add DT bindings for eMMC hardware reset support mmc: dt-bindings: update Mediatek MMC bindings mmc: mediatek: make cmd_ints_mask to const mmc: mediatek: change the argument &

[PATCH v3 01/10] mmc: core: Add DT bindings for eMMC hardware reset support

2015-10-27 Thread Chaotian Jing
Sometime only need set MMC_CAP_HW_RESET for one of MMC hosts, So set it in device tree is better. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- Documentation/devicetree/bindings/mmc/mmc.txt | 1 + drivers/mmc/core/host.c | 2 ++ 2 files changed, 3 inse

[PATCH v3 03/10] mmc: mediatek: make cmd_ints_mask to const

2015-10-27 Thread Chaotian Jing
cmd_ints_mask and data_ints_mask are constant value, so make it to const Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/ho

[PATCH v3 05/10] mmc: mediatek: fix got GPD checksum error interrupt when data transfer

2015-10-27 Thread Chaotian Jing
Even if we only use one gpd, we need alloc 2 gpd and make the gpd->next pointer to the second gpd, or may get gpd checksum error, this was checked by hardware Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 11 +++ 1 file changed, 7 i

[PATCH v3 02/10] mmc: dt-bindings: update Mediatek MMC bindings

2015-10-27 Thread Chaotian Jing
Add 400Mhz clock source for HS400 mode Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b/Documen

[PATCH v3 07/10] arm64: dts: mediatek: add eMMC hw reset support

2015-10-27 Thread Chaotian Jing
Add eMMC hardware reset support Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8173-evb.dts b/arch/arm64/boot/dts/mediatek/mt8173-evb.dts index 4

[PATCH v3 09/10] mmc: mediatek: add HS400 support

2015-10-27 Thread Chaotian Jing
add HS400 mode and tune support Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 249 +- 1 file changed, 244 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mt

[PATCH v3 04/10] mmc: mediatek: change the argument "ddr" to "timing"

2015-10-27 Thread Chaotian Jing
use the ios->timing directly is better It can reflect current timing and do settings by timing Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/mmc

Re: [PATCH 3/4] mmc: mediatek: Add tune support

2015-10-15 Thread Chaotian Jing
On Thu, 2015-10-15 at 11:17 +0200, Ulf Hansson wrote: > [...] > > >> > > >> > struct clk *src_clk;/* msdc source clock */ > >> > + struct clk *src_clk_parent; /* src_clk's parent */ > >> > + struct clk *hs400_src; /* 400Mhz source clock */ > >> > >> Hmm, so you need to

[PATCH v2] mmc: core: Fix init_card in 52Mhz

2015-10-08 Thread Chaotian Jing
. The mmc_send_status was originally only done for mmc_test, so if retune needed, do not call mmc_send_status. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> Suggested-by: Adrian Hunter <adrian.hun...@intel.com> --- drivers/mmc/card/mmc_test.c | 6 ++ drivers/mmc/core/mm

[PATCH] mmc: core: Fix init_card in 52Mhz

2015-10-08 Thread Chaotian Jing
. The mmc_send_status was originally only done for mmc_test, so if retune needed, do not call mmc_send_status, and move it to mmc_test code. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> Suggested-by: Adrian Hunter <adrian.hun...@intel.com> --- drivers/mmc/card/mmc

[PATCH v2 0/9] Add tune support of Mediatek MMC driver

2015-10-20 Thread Chaotian Jing
DT bindings for eMMC hardware reset Add pinctrl of data strobe pin for HS400 mode Modify eMMC driving settings Add 400mhz source clock for HS400 mode Add eMMC HS200/HS400 mode support Add SD SDR50/SDR104 mode support Add implement of tune function with CMD19/CMD21 Chaotian Jing (9): mmc: core: Add

[PATCH v2 2/9] mmc: dt-bindings: update Mediatek MMC bindings

2015-10-20 Thread Chaotian Jing
Add 400Mhz clock source for HS400 mode Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b/Documen

[PATCH v2 1/9] mmc: core: Add DT bindings for eMMC hardware reset support

2015-10-20 Thread Chaotian Jing
Sometime only need set MMC_CAP_HW_RESET for one of MMC hosts, So set it in device tree is better. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- Documentation/devicetree/bindings/mmc/mmc.txt | 1 + drivers/mmc/core/host.c | 2 ++ 2 files changed, 3 inse

[PATCH v2 4/9] mmc: mediatek: change the argument "ddr" to "timing"

2015-10-20 Thread Chaotian Jing
use the ios->timing directly is better It can reflect current timing and do settings by timing Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/mmc

[PATCH v2 6/9] mmc: mediatek: add implement of ops->hw_reset()

2015-10-20 Thread Chaotian Jing
add implement of ops->hw_reset() for eMMC Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 3858163..5627644 100644 ---

[PATCH v2 5/9] mmc: mediatek: fix got GPD checksum error interrupt when data transfer

2015-10-20 Thread Chaotian Jing
Even if we only use one gpd, we need alloc 2 gpd and make the gpd->next pointer to the second gpd, or may get gpd checksum error, this was checked by hardware Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 11 +++ 1 file changed, 7 i

[PATCH v2 8/9] mmc: mediatek: add HS400 support

2015-10-20 Thread Chaotian Jing
add HS400 mode and tune support Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 241 +- 1 file changed, 236 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mt

[PATCH v2 9/9] arm64: dts: mediatek: add HS200/HS400/SDR50/SDR104 support

2015-10-20 Thread Chaotian Jing
add HS200/HS400 support for eMMC add SDR50/SDR104 support for SD Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 27 --- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/me

[PATCH v2 3/9] mmc: mediatek: make cmd_ints_mask to const

2015-10-20 Thread Chaotian Jing
cmd_ints_mask and data_ints_mask are constant value, so make it to const Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/ho

[PATCH v2 7/9] mmc: mmc: extend the mmc_send_tuning()

2015-10-20 Thread Chaotian Jing
CMD21 to CMD19, then got error. in addition, extend an argument of "cmd_error" to allow getting if there was cmd error when tune response. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/core/mmc_ops.c | 8 drivers/mmc/host/dw_mm

Re: [PATCH 3/4] mmc: mediatek: Add tune support

2015-10-14 Thread Chaotian Jing
On Wed, 2015-10-14 at 12:05 +0200, Ulf Hansson wrote: > On 13 October 2015 at 11:37, Chaotian Jing <chaotian.j...@mediatek.com> wrote: > > Add CMD19/CMD21 support for EMMC/SD/SDIO tuning > > Add HS400 mode support > > > > Signed-off-by: Chaotian

[PATCH v3] mmc: core: Fix init_card in 52Mhz

2015-10-12 Thread Chaotian Jing
. The mmc_send_status was originally only done for mmc_test, should drop it. And, rename the "eMMC hardware reset" to "Reset test", as we would also be able to use the test for SD-cards. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> Suggested-by: Adrian Hunte

[PATCH 4/4] arm64: dts: mediatek:: Add HS200/HS400/SDR50/SDR104 support

2015-10-13 Thread Chaotian Jing
Add HS200/HS400 support for EMMC Add SDR50/SDR104 support for SD Add 400Mhz source clock Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 21 - arch/arm64/boot/dts/mediatek/mt8173.dtsi| 5 +++-- 2 files c

[PATCH 3/4] mmc: mediatek: Add tune support

2015-10-13 Thread Chaotian Jing
Add CMD19/CMD21 support for EMMC/SD/SDIO tuning Add HS400 mode support Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 359 ++ 1 file changed, 332 insertions(+), 27 deletions(-) diff --git a/drivers/mm

[PATCH 0/4] Add tune support of Mediatek MMC driver

2015-10-13 Thread Chaotian Jing
Add DT bindings for eMMC hardware reset Add pinctrl of data strobe pin for HS400 mode Modify eMMC driving settings Add 400mhz source clock for HS400 mode Add eMMC HS200/HS400 mode support Add SD SDR50/SDR104 mode support Add implement of tune funtion with CMD19/CMD21 Chaotian Jing (4): mmc

[PATCH 2/4] mmc: dt-bindings: update Mediatek MMC bindings

2015-10-13 Thread Chaotian Jing
Add 400Mhz clock source for HS400 mode Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.

[PATCH 1/4] mmc: core: Add DT bindings for eMMC hardware reset support

2015-10-13 Thread Chaotian Jing
Sometime only need set MMC_CAP_HW_RESET for one of MMC hosts, So set it in device tree is better. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- Documentation/devicetree/bindings/mmc/mmc.txt | 1 + drivers/mmc/core/host.c | 2 ++ 2 files changed, 3 inse

Re: [PATCH 2/4] mmc: dt-bindings: update Mediatek MMC bindings

2015-10-13 Thread Chaotian Jing
On Tue, 2015-10-13 at 11:38 +0100, Mark Rutland wrote: > On Tue, Oct 13, 2015 at 05:37:56PM +0800, Chaotian Jing wrote: > > Add 400Mhz clock source for HS400 mode > > > > Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> > > --- > > Documentation/

[PATCH] mmc: core: Fix init_card in 52Mhz

2015-09-29 Thread Chaotian Jing
, So need ensure frequency is lower than 400Khz when re-init card. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/core/mmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index e726903..f2d0c2a 100644 --- a/drive

[PATCH] mmc: core: fix dead loop of mmc_retune

2015-09-30 Thread Chaotian Jing
une was called, then dead loop of mmc_retune Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/core/core.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 0520064..a3eb20b 100644 --- a/dr

Re: [PATCH] mmc: core: Fix init_card in 52Mhz

2015-09-30 Thread Chaotian Jing
On Wed, 2015-09-30 at 11:24 +0300, Adrian Hunter wrote: > On 30/09/15 06:28, Chaotian Jing wrote: > > Suppose that we got a data crc error, and it triggers the mmc_reset. > > mmc_reset will call mmc_send_status to see if HW reset was supported. > > before issue CMD

[PATCH] mmc: mediatek: Add MMC_CAP_RUNTIME_RESUME support

2015-09-22 Thread Chaotian Jing
Add MMC_CAP_RUNTIME_RESUME support to save resume time Drop unnecessary SDC_ARG write Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mt

[PATCH v3] mmc: core: fix __mmc_switch timeout caused by preempt

2015-11-26 Thread Chaotian Jing
. So, need calculate timeout first, then call __mmc_send_status(), if already timeout and card still in programing state, then treat it to the real timeout error. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/core/mmc_ops.c | 10 +- 1 file changed, 9 inse

[PATCH] mmc: core: fix __mmc_switch timeout caused by preempt

2015-11-25 Thread Chaotian Jing
. So, need calculate timeout first, then call __mmc_send_status(), if already timeout and card still in programing state, then treat it to the real timeout error. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/core/mmc_ops.c | 23 ++- 1 file chang

[PATCH v4] mmc: core: fix __mmc_switch timeout caused by preempt

2015-11-29 Thread Chaotian Jing
. So, need calculate timeout first, then call __mmc_send_status(), if already timeout and card still in programing state, then treat it to the real timeout error. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/core/mmc_ops.c | 9 - 1 file changed, 8 insertions

[PATCH] mmc: mediatek: change some dev_err to dev_dbg

2015-12-01 Thread Chaotian Jing
there are too many error logs shown when use CMD21/CMD19 to do tune, and it will appear at each resume time, print out so many logs to the uart console cost too mush time. so change it to dev_dbg. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd

[PATCH v2] mmc: core: fix __mmc_switch timeout caused by preempt

2015-11-26 Thread Chaotian Jing
. So, need calculate timeout first, then call __mmc_send_status(), if already timeout and card still in programing state, then treat it to the real timeout error. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/core/mmc_ops.c | 23 +++ 1 file chang