[PATCH] mmc: mediatek: fix race condition between msdc_request_timeout and irq

2020-12-17 Thread Chaotian Jing
o need check the return value of cancel_delayed_work(). Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 18 ++ 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index de09c6347524..898ed1b023df

[PATCH v2 2/2] mmc: block: add CMD13 polling for ioctl() cmd with R1B response

2019-09-05 Thread Chaotian Jing
currently there is no CMD13 polling and other code to wait card change to transfer state after R1B command completed. and this polling operation cannot do in user space, because other request may coming before the CMD13 from user space. Signed-off-by: Chaotian Jing --- drivers/mmc/core/block.c

[PATCH v2] fix device in programming state after ioctl()

2019-09-05 Thread Chaotian Jing
that card was in transfer state. this patch add CMD13 polling for R1B command to avoid this issue. Chaotian Jing (2): mmc: block: make the card_busy_detect() more generic mmc: block: add CMD13 polling for ioctl() cmd with R1B response drivers/mmc/core/block.c | 150

[PATCH v2 1/2] mmc: block: make the card_busy_detect() more generic

2019-09-05 Thread Chaotian Jing
to use the card_busy_detect() to wait card levae the programming state, there may be do not have the "struct request *" argument. Signed-off-by: Chaotian Jing --- drivers/mmc/core/block.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/driver

Re: [PATCH 2/2] mmc: block: add CMD13 polling for ioctl() cmd with R1B response

2019-09-04 Thread Chaotian Jing
On Wed, 2019-09-04 at 14:11 +, Avri Altman wrote: > > static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct > > mmc_blk_data *md, > >struct mmc_blk_ioc_data *idata) > > { > > @@ -623,6 +675,9 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card > > *card,

[PATCH 1/2] mmc: block: make the card_busy_detect() more generic

2019-09-04 Thread Chaotian Jing
to use the card_busy_detect() to wait card levae the programming state, there may be do not have the "struct request *" argument. Signed-off-by: Chaotian Jing --- drivers/mmc/core/block.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/driver

fix device in programming state after ioctl()

2019-09-04 Thread Chaotian Jing
to avoid this issue. Chaotian Jing (2): mmc: block: make the card_busy_detect() more generic mmc: block: add CMD13 polling for ioctl() cmd with R1B response drivers/mmc/core/block.c | 111 --- 1 file changed, 57 insertions(+), 54 deletions(-) -- 2.18.0

[PATCH 2/2] mmc: block: add CMD13 polling for ioctl() cmd with R1B response

2019-09-04 Thread Chaotian Jing
currently there is no CMD13 polling and other code to wait card change to transfer state after R1B command completed. and this polling operation cannot do in user space, because other request may coming before the CMD13 from user space. Signed-off-by: Chaotian Jing --- drivers/mmc/core/block.c

[PATCH 1/2] mmc: mediatek: fix controller busy when plug out SD

2019-08-22 Thread Chaotian Jing
when plug out SD card, may get data CRC error, the MMC core will issue CMD13 to get card status, then CMD13 timeout(due to card plug out) will trigger CMD19 tuning, first CMD19 timeout has not call msdc_reset_hw() and cause the next CMD19 gets controller busy. Signed-off-by: Chaotian Jing

fix controller busy issue and add 24bits segment support

2019-08-22 Thread Chaotian Jing
the below 2 patches fix controller busy issue when plug out SD card and add 24bits segment size support. Chaotian Jing (2): mmc: mediatek: fix controller busy when plug out SD mmc: mediatek: support 24bits segment size drivers/mmc/host/mtk-sd.c | 24 ++-- 1 file changed

[PATCH 2/2] mmc: mediatek: support 24bits segment size

2019-08-22 Thread Chaotian Jing
MSDC IP which support 64G DRAM will support 24bits BDMA buffer length, so add support it. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 16 +--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index

Re: fix controller busy issue and add 24bits segment support

2019-06-01 Thread Chaotian Jing
Hi Ulf, Gentle ping for this patch. On Sun, 2019-05-19 at 15:57 +0800, Chaotian Jing wrote: > the below 2 patches fix controller busy issue when plug out SD card > and add 24bits segment size support. > > Chaotian Jing (2): > mmc: mediatek: fix controller busy when plug

Re: [PATCH 4/4] mmc: mtk-sd: select REGULATOR

2019-05-05 Thread Chaotian Jing
On Sat, 2019-05-04 at 20:24 +1000, NeilBrown wrote: > The mtk-sd driver requires a regulator to be present, even if it is > the "fixed" regulator. So select REGULATOR to make it hard to build > unusable configurations. > > Signed-off-by: NeilBrown Reviewed-by:Chaotian Jing > --- >

Re: [PATCH 3/4] mmc: mtk-sd: enable internal card-detect logic.

2019-05-05 Thread Chaotian Jing
On Sat, 2019-05-04 at 20:24 +1000, NeilBrown wrote: > The mtk-sd silicon has integrated card-detect logic that is > enabled on the MT7621. The circuit is phased out on newer hardware so > we should be careful to only enabled it on hardware known to support > it. This a new "use_internal_cd" flag

Re: [PATCH 2/4] mmc: mtk-sd: add support for config found in mt7620 family SOCs.

2019-05-05 Thread Chaotian Jing
On Sat, 2019-05-04 at 20:24 +1000, NeilBrown wrote: > mt7620 family MIPS SOCs contain the mtk-sd silicon. > Add support for this. > > Signed-off-by: NeilBrown Reviewed-by:Chaotian Jing > --- > Documentation/devicetree/bindings/mmc/mtk-sd.txt |1 + > drivers/mmc/host/mtk-sd.c

Re: [PATCH 1/4] mmc: mtk-sd: don't hard-code interrupt trigger type

2019-05-05 Thread Chaotian Jing
On Sat, 2019-05-04 at 20:24 +1000, NeilBrown wrote: > When using devicetree for configuration, interrupt trigger type > should be described in the dts file, not hard-coded in the C code. > > The mtk-sd silicon in the mt7621 soc uses an active-high interrupt > and so cannot be used with the

Re: [PATCH 4/5] mmc: mtk-sd: enable internal card-detect logic.

2019-04-18 Thread Chaotian Jing
On Tue, 2019-04-16 at 14:47 +1000, NeilBrown wrote: > The mtk-sd silicon has integrated card-detect logic that is > enabled, at least, on the MT7621 as used in the GNUBEE NAS. > > If the sdhci isn't marked non-removable and doesn't have a > cd-gpio configured, assume the internal cd logic should

Re: [PATCH 2/5] mmc: mtk-sd: don't hard-code interrupt trigger type

2019-04-18 Thread Chaotian Jing
On Wed, 2019-04-17 at 08:12 +1000, NeilBrown wrote: > On Tue, Apr 16 2019, Chaotian Jing wrote: > > > On Tue, 2019-04-16 at 14:47 +1000, NeilBrown wrote: > >> When using devicetree for configuration, interrupt trigger type > >> should be described in the dts file

Re: [PATCH 2/5] mmc: mtk-sd: don't hard-code interrupt trigger type

2019-04-16 Thread Chaotian Jing
On Tue, 2019-04-16 at 14:47 +1000, NeilBrown wrote: > When using devicetree for configuration, interrupt trigger type > should be described in the dts file, not hard-coded in the C code. > > The mtk-sd silicon in the mt7621 soc uses an active-high interrupt > and so cannot be used with the

Re: [PATCH] MAINTAINERS: Add section for MediaTek MMC/SD/SDIO driver

2019-04-11 Thread Chaotian Jing
On Thu, 2019-04-11 at 11:49 +0200, Ulf Hansson wrote: > Chaotian, > > On Mon, 25 Mar 2019 at 13:24, Ulf Hansson wrote: > > > > Cc: Chaotian Jing > > Signed-off-by: Ulf Hansson > > --- > > MAINTAINERS | 6 ++ > > 1 file changed, 6 ins

Re: [PATCH v2] Fix HS setting in mmc_hs400_to_hs200()

2019-02-22 Thread Chaotian Jing
Hi Ulf, this is just a ping, do you have any comments of this series of patches ? Thx! On Fri, 2019-02-15 at 13:59 +0800, Chaotian Jing wrote: > Change vs v1: > do not retry CMD6 in __mmc_switch() > do not move the reduce clock operation after switch HS > > Chaotian Jing (2)

[PATCH v2 1/2] mmc: core: do not retry CMD6 in __mmc_switch()

2019-02-14 Thread Chaotian Jing
the response type of CMD6 is R1B, when the first CMD6 gets response CRC error, do retry may get timeout error due to card may still in busy state, which cause this retry make no sense. Signed-off-by: Chaotian Jing --- drivers/mmc/core/mmc_ops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 2/2] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-02-14 Thread Chaotian Jing
onse CRC error is not a fatal error, if host gets CMD6 response CRC error, it means that card has already received this command. Signed-off-by: Chaotian Jing Fixes: ef3d232245ab ("mmc: mmc: Relax checking for switch errors after HS200 switch") --- drivers/mmc/core/mmc.c | 21 +

[PATCH v2] Fix HS setting in mmc_hs400_to_hs200()

2019-02-14 Thread Chaotian Jing
Change vs v1: do not retry CMD6 in __mmc_switch() do not move the reduce clock operation after switch HS Chaotian Jing (2): mmc: core: do not retry CMD6 in __mmc_switch() mmc: mmc: Fix HS setting in mmc_hs400_to_hs200() drivers/mmc/core/mmc.c | 21 +++-- drivers/mmc

Re: [PATCH v1] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-02-14 Thread Chaotian Jing
On Thu, 2019-02-14 at 09:14 +0100, Ulf Hansson wrote: > On Thu, 14 Feb 2019 at 03:14, Chaotian Jing > wrote: > > > > On Wed, 2019-02-13 at 13:08 +0100, Ulf Hansson wrote: > > > On Wed, 13 Feb 2019 at 10:07, Chaotian Jing > > > wrote: > > > > &

Re: [PATCH v1] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-02-13 Thread Chaotian Jing
On Wed, 2019-02-13 at 13:08 +0100, Ulf Hansson wrote: > On Wed, 13 Feb 2019 at 10:07, Chaotian Jing > wrote: > > > > mmc_hs400_to_hs200() begins with the card and host in HS400 mode. > > Therefore, any commands sent to the card should use HS400 timing. > > r

[PATCH v1] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-02-13 Thread Chaotian Jing
a suitable setting for all eMMC cards when clock frequency reduced to 50Mhz but card & host still in hs400 mode. this patch refers to mmc_select_hs400(), make the reduce clock frequency after card timing change. Signed-off-by: Chaotian Jing Fixes: ef3d232245ab ("mmc: mmc: Relax checking f

Re: [PATCH] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-02-12 Thread Chaotian Jing
On Wed, 2019-02-13 at 08:24 +0100, Ulf Hansson wrote: > On Wed, 13 Feb 2019 at 04:13, Chaotian Jing > wrote: > > > > On Wed, 2019-02-13 at 08:54 +0800, Chaotian Jing wrote: > > > On Tue, 2019-02-12 at 10:04 +0200, Adrian Hunter wrote: > > > > O

Re: [PATCH] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-02-12 Thread Chaotian Jing
On Wed, 2019-02-13 at 08:54 +0800, Chaotian Jing wrote: > On Tue, 2019-02-12 at 10:04 +0200, Adrian Hunter wrote: > > On 12/02/19 4:04 AM, Chaotian Jing wrote: > > > On Tue, 2019-02-05 at 15:42 +0200, Adrian Hunter wrote: > > >> On 5/02/19 3:06 PM, Ulf Hansson wro

Re: [PATCH] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-02-12 Thread Chaotian Jing
On Tue, 2019-02-12 at 10:04 +0200, Adrian Hunter wrote: > On 12/02/19 4:04 AM, Chaotian Jing wrote: > > On Tue, 2019-02-05 at 15:42 +0200, Adrian Hunter wrote: > >> On 5/02/19 3:06 PM, Ulf Hansson wrote: > >>> On Mon, 4 Feb 2019 at 14:42, Adrian Hunter > >>

Re: [PATCH] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-02-11 Thread Chaotian Jing
>>> wrote: > >>>> > >>>> On 1/02/19 10:10 AM, Ulf Hansson wrote: > >>>>> On Fri, 1 Feb 2019 at 02:38, Chaotian Jing > >>>>> wrote: > >>>>>> > >>>>>> On Thu, 2019-01-31 at 16:58 +01

Re: [PATCH] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-01-31 Thread Chaotian Jing
On Thu, 2019-01-31 at 16:58 +0100, Ulf Hansson wrote: > On Thu, 31 Jan 2019 at 08:53, Chaotian Jing > wrote: > > > > mmc_hs400_to_hs200() begins with the card and host in HS400 mode. > > Therefore, any commands sent to the card should use HS400 timing. > > It is

[PATCH] mmc: mmc: Fix HS setting in mmc_hs400_to_hs200()

2019-01-30 Thread Chaotian Jing
, host is still in hs400 mode but clock changed from 200Mhz to 50Mhz, which makes the tuning result unsuitable and cause the switch command gets response CRC error. this patch refers to mmc_select_hs400(), make the reduce clock frequency after card timing change. Signed-off-by: Chaotian Jing

[PATCH] mmc: mediatek: fix incorrect register setting of hs400_cmd_int_delay

2019-01-23 Thread Chaotian Jing
to set cmd internal delay, need set PAD_TUNE register but not PAD_CMD_TUNE register. Signed-off-by: Chaotian Jing --- 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/mtk-sd.c index 8afeaf8..833ef05 100644

[PATCH 6/6] mmc: mediatek: drop too much code of tuning method

2018-10-13 Thread Chaotian Jing
the tuning code is becoming more and more bloated, let's make the set cmd/data delay to inline function to avoid too much redundant code. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 133 +- 1 file changed, 38 insertions(+), 95

[PATCH 6/6] mmc: mediatek: drop too much code of tuning method

2018-10-13 Thread Chaotian Jing
the tuning code is becoming more and more bloated, let's make the set cmd/data delay to inline function to avoid too much redundant code. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 133 +- 1 file changed, 38 insertions(+), 95

[PATCH 2/6] mmc: mediatek: fill the actual clock for mmc debugfs

2018-10-13 Thread Chaotian Jing
as the mmc core layer has the mmc->actual_clock, so fill it and drop msdc_host->sclk. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 1

[PATCH 4/6] mmc: mediatek: tune CMD/DATA together

2018-10-13 Thread Chaotian Jing
for MSDC IP which supports both data tune and async fifo, it can tune cmd/data together. which can save the time and make the tune result of CMD more stable as data line are 4bit or 8bit. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 87

[PATCH 5/6] mmc: mediatek: add MT8183 MMC driver support

2018-10-13 Thread Chaotian Jing
MT8183 puts the tune register at top layer, so need add new code to support it. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 283 ++ 1 file changed, 233 insertions(+), 50 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers

[PATCH 2/6] mmc: mediatek: fill the actual clock for mmc debugfs

2018-10-13 Thread Chaotian Jing
as the mmc core layer has the mmc->actual_clock, so fill it and drop msdc_host->sclk. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 1

[PATCH 4/6] mmc: mediatek: tune CMD/DATA together

2018-10-13 Thread Chaotian Jing
for MSDC IP which supports both data tune and async fifo, it can tune cmd/data together. which can save the time and make the tune result of CMD more stable as data line are 4bit or 8bit. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 87

[PATCH 5/6] mmc: mediatek: add MT8183 MMC driver support

2018-10-13 Thread Chaotian Jing
MT8183 puts the tune register at top layer, so need add new code to support it. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 283 ++ 1 file changed, 233 insertions(+), 50 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers

mmc: mediatek: add MT8183 MMC driver support

2018-10-13 Thread Chaotian Jing
ant code Chaotian Jing (6): mmc: dt-bindings: add support for MT8183 SoC mmc: mediatek: fill the actual clock for mmc debugfs mmc: mediatek: fix cannot receive new request when msdc_cmd_is_ready fail mmc: mediatek: tune CMD/DATA together mmc: mediatek: add MT8183 MMC driver support

[PATCH 1/6] mmc: dt-bindings: add support for MT8183 SoC

2018-10-13 Thread Chaotian Jing
Add the devicetree binding for MT8183 SoC Signed-off-by: Chaotian Jing --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b/Documentation/devicetree/bindings/mmc/mtk-sd.txt index f2208f4

[PATCH 3/6] mmc: mediatek: fix cannot receive new request when msdc_cmd_is_ready fail

2018-10-13 Thread Chaotian Jing
when msdc_cmd_is_ready return fail, the req_timeout work has not been inited and cancel_delayed_work() will return false, then, the request return directly and never call mmc_request_done(). so need call mod_delayed_work() before msdc_cmd_is_ready() Signed-off-by: Chaotian Jing --- drivers/mmc

mmc: mediatek: add MT8183 MMC driver support

2018-10-13 Thread Chaotian Jing
ant code Chaotian Jing (6): mmc: dt-bindings: add support for MT8183 SoC mmc: mediatek: fill the actual clock for mmc debugfs mmc: mediatek: fix cannot receive new request when msdc_cmd_is_ready fail mmc: mediatek: tune CMD/DATA together mmc: mediatek: add MT8183 MMC driver support

[PATCH 1/6] mmc: dt-bindings: add support for MT8183 SoC

2018-10-13 Thread Chaotian Jing
Add the devicetree binding for MT8183 SoC Signed-off-by: Chaotian Jing --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b/Documentation/devicetree/bindings/mmc/mtk-sd.txt index f2208f4

[PATCH 3/6] mmc: mediatek: fix cannot receive new request when msdc_cmd_is_ready fail

2018-10-13 Thread Chaotian Jing
when msdc_cmd_is_ready return fail, the req_timeout work has not been inited and cancel_delayed_work() will return false, then, the request return directly and never call mmc_request_done(). so need call mod_delayed_work() before msdc_cmd_is_ready() Signed-off-by: Chaotian Jing --- drivers/mmc

Re: [PATCH 2/2] mmc: mediatek: add bus_clk control

2018-09-28 Thread Chaotian Jing
On Sat, 2018-09-29 at 01:28 +0800, Sean Wang wrote: > Hi, > > On Fri, 2018-09-28 at 19:40 +0800, Chaotian Jing wrote: > > when gate MSDC0_HCLK, access register will hang, even the MSDC driver > > will never accessing register after HCLK was gated, but for safety, need >

Re: [PATCH 2/2] mmc: mediatek: add bus_clk control

2018-09-28 Thread Chaotian Jing
On Sat, 2018-09-29 at 01:28 +0800, Sean Wang wrote: > Hi, > > On Fri, 2018-09-28 at 19:40 +0800, Chaotian Jing wrote: > > when gate MSDC0_HCLK, access register will hang, even the MSDC driver > > will never accessing register after HCLK was gated, but for safety, need >

Re: [PATCH 1/2] mmc: dt-bindings: add "bus-clk" for MT2712

2018-09-28 Thread Chaotian Jing
On Sat, 2018-09-29 at 01:34 +0800, Sean Wang wrote: > On Fri, 2018-09-28 at 19:40 +0800, Chaotian Jing wrote: > > On MT2712 MSDC0/3, HCLK/bus-clk need gate/ungate together, > > or will hang when access MSDC register. > > > > Signed-off-by: Chaotian Jing > >

Re: [PATCH 1/2] mmc: dt-bindings: add "bus-clk" for MT2712

2018-09-28 Thread Chaotian Jing
On Sat, 2018-09-29 at 01:34 +0800, Sean Wang wrote: > On Fri, 2018-09-28 at 19:40 +0800, Chaotian Jing wrote: > > On MT2712 MSDC0/3, HCLK/bus-clk need gate/ungate together, > > or will hang when access MSDC register. > > > > Signed-off-by: Chaotian Jing > >

[PATCH v1 2/2] mmc: mediatek: add bus_clk control

2018-09-28 Thread Chaotian Jing
when gate MSDC0_HCLK, access register will hang, even the MSDC driver will never accessing register after HCLK was gated, but for safety, need gate the bus_clk(which used to access register) too. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 6 ++ 1 file changed, 6 insertions

[PATCH v1 2/2] mmc: mediatek: add bus_clk control

2018-09-28 Thread Chaotian Jing
when gate MSDC0_HCLK, access register will hang, even the MSDC driver will never accessing register after HCLK was gated, but for safety, need gate the bus_clk(which used to access register) too. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 6 ++ 1 file changed, 6 insertions

[PATCH v1 1/2] mmc: dt-bindings: add "bus-clk" for MT2712

2018-09-28 Thread Chaotian Jing
On MT2712 MSDC0/3, HCLK/bus-clk need gate/ungate together, or will hang when access MSDC register. Signed-off-by: Chaotian Jing --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b

[PATCH v1 1/2] mmc: dt-bindings: add "bus-clk" for MT2712

2018-09-28 Thread Chaotian Jing
On MT2712 MSDC0/3, HCLK/bus-clk need gate/ungate together, or will hang when access MSDC register. Signed-off-by: Chaotian Jing --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b

[PATCH 1/2] mmc: dt-bindings: add "bus-clk" for MT2712

2018-09-28 Thread Chaotian Jing
On MT2712 MSDC0/3, HCLK/bus-clk need gate/ungate together, or will hang when access MSDC register. Signed-off-by: Chaotian Jing --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b

[PATCH 1/2] mmc: dt-bindings: add "bus-clk" for MT2712

2018-09-28 Thread Chaotian Jing
On MT2712 MSDC0/3, HCLK/bus-clk need gate/ungate together, or will hang when access MSDC register. Signed-off-by: Chaotian Jing --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/mmc/mtk-sd.txt b

mmc: mediatek: add bus_clk control

2018-09-28 Thread Chaotian Jing
Chaotian Jing (2): mmc: dt-bindings: add "bus-clk" for MT2712 mmc: mediatek: add bus_clk control Documentation/devicetree/bindings/mmc/mtk-sd.txt | 1 + drivers/mmc/host/mtk-sd.c| 6 ++ 2 files changed, 7 insertions(+) -- 1.8.1.1.dirty

mmc: mediatek: add bus_clk control

2018-09-28 Thread Chaotian Jing
Chaotian Jing (2): mmc: dt-bindings: add "bus-clk" for MT2712 mmc: mediatek: add bus_clk control Documentation/devicetree/bindings/mmc/mtk-sd.txt | 1 + drivers/mmc/host/mtk-sd.c| 6 ++ 2 files changed, 7 insertions(+) -- 1.8.1.1.dirty

[PATCH 2/2] mmc: mediatek: add bus_clk control

2018-09-28 Thread Chaotian Jing
when gate MSDC0_HCLK, access register will hang, even the MSDC driver will never accessing register after HCLK was gated, but for safety, need gate the bus_clk(which used to access register) too. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 6 ++ 1 file changed, 6 insertions

[PATCH 2/2] mmc: mediatek: add bus_clk control

2018-09-28 Thread Chaotian Jing
when gate MSDC0_HCLK, access register will hang, even the MSDC driver will never accessing register after HCLK was gated, but for safety, need gate the bus_clk(which used to access register) too. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 6 ++ 1 file changed, 6 insertions

mmc: mediatek: add 64G DRAM DMA support

2018-04-25 Thread Chaotian Jing
Change vs V1: fix build warning of 32bit arch Chaotian Jing (1): mmc: mediatek: add 64G DRAM DMA support drivers/mmc/host/mtk-sd.c | 56 +-- 1 file changed, 49 insertions(+), 7 deletions(-) -- 1.8.1.1.dirty

mmc: mediatek: add 64G DRAM DMA support

2018-04-25 Thread Chaotian Jing
Change vs V1: fix build warning of 32bit arch Chaotian Jing (1): mmc: mediatek: add 64G DRAM DMA support drivers/mmc/host/mtk-sd.c | 56 +-- 1 file changed, 49 insertions(+), 7 deletions(-) -- 1.8.1.1.dirty

[PATCH v2] mmc: mediatek: add 64G DRAM DMA support

2018-04-25 Thread Chaotian Jing
MT2712 MSDC supports 64G DRAM DMA access, it needs update gpd/bd structure. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 56 +-- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/drive

[PATCH v2] mmc: mediatek: add 64G DRAM DMA support

2018-04-25 Thread Chaotian Jing
MT2712 MSDC supports 64G DRAM DMA access, it needs update gpd/bd structure. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 56 +-- 1 file changed, 49 insertions(+), 7 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc

mmc: mediatek: add 64G DRAM DMA support

2018-04-23 Thread Chaotian Jing
Chaotian Jing (1): mmc: mediatek: add 64G DRAM DMA support drivers/mmc/host/mtk-sd.c | 44 +++- 1 file changed, 39 insertions(+), 5 deletions(-) -- 1.8.1.1.dirty

mmc: mediatek: add 64G DRAM DMA support

2018-04-23 Thread Chaotian Jing
Chaotian Jing (1): mmc: mediatek: add 64G DRAM DMA support drivers/mmc/host/mtk-sd.c | 44 +++- 1 file changed, 39 insertions(+), 5 deletions(-) -- 1.8.1.1.dirty

[PATCH] mmc: mediatek: add 64G DRAM DMA support

2018-04-23 Thread Chaotian Jing
MT2712 MSDC supports 64G DRAM DMA access, it needs update gpd/bd structure. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 44 +++- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/drivers/mm

[PATCH] mmc: mediatek: add 64G DRAM DMA support

2018-04-23 Thread Chaotian Jing
MT2712 MSDC supports 64G DRAM DMA access, it needs update gpd/bd structure. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 44 +++- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host

Re: [PATCH v6 01/12] mmc: dt-bindings: Add reg/source_cg/latch-ck for Mediatek MMC bindings

2017-10-22 Thread Chaotian Jing
Hi Rob & Ulf, Gentle ping... Any other comments about this series of patch ? On Mon, 2017-10-16 at 09:46 +0800, Chaotian Jing wrote: > Change the comptiable for support of multi-platform > Make compatible explicit, as MMC host of mt8173 has difference with > mt8135(mt8173 s

Re: [PATCH v6 01/12] mmc: dt-bindings: Add reg/source_cg/latch-ck for Mediatek MMC bindings

2017-10-22 Thread Chaotian Jing
Hi Rob & Ulf, Gentle ping... Any other comments about this series of patch ? On Mon, 2017-10-16 at 09:46 +0800, Chaotian Jing wrote: > Change the comptiable for support of multi-platform > Make compatible explicit, as MMC host of mt8173 has difference with > mt8135(mt8173 s

[PATCH v6 01/12] mmc: dt-bindings: Add reg/source_cg/latch-ck for Mediatek MMC bindings

2017-10-15 Thread Chaotian Jing
for mediatek,latch-ck Note that source_cg and mediatek,latch-ck are optional for some projects, eg, MT2701 do not have source_cg, and MT2712 do not need mediatek,latch-ck Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 18 +++

[PATCH v6 01/12] mmc: dt-bindings: Add reg/source_cg/latch-ck for Mediatek MMC bindings

2017-10-15 Thread Chaotian Jing
for mediatek,latch-ck Note that source_cg and mediatek,latch-ck are optional for some projects, eg, MT2701 do not have source_cg, and MT2712 do not need mediatek,latch-ck Signed-off-by: Chaotian Jing --- Documentation/devicetree/bindings/mmc/mtk-sd.txt | 18 +++--- 1 file changed, 15 insertions

[PATCH v6 05/12] mmc: mediatek: add pad_tune0 support

2017-10-15 Thread Chaotian Jing
from mt2701, the register of PAD_TUNE has been phased out, while there is a new register of PAD_TUNE0 Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 51 ++- 1 file changed, 33 insertions(+), 18 del

[PATCH v6 05/12] mmc: mediatek: add pad_tune0 support

2017-10-15 Thread Chaotian Jing
from mt2701, the register of PAD_TUNE has been phased out, while there is a new register of PAD_TUNE0 Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 51 ++- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/drivers/mmc/host

[PATCH v6 08/12] mmc: mediatek: add stop_clk fix and enhance_rx support

2017-10-15 Thread Chaotian Jing
mt2712 supports stop_clk fix and enhance_rx, which can improve host stability. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 47 +++ 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/drive

[PATCH v6 08/12] mmc: mediatek: add stop_clk fix and enhance_rx support

2017-10-15 Thread Chaotian Jing
mt2712 supports stop_clk fix and enhance_rx, which can improve host stability. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 47 +++ 1 file changed, 43 insertions(+), 4 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc

[PATCH v6 06/12] mmc: mediatek: add async fifo and data tune support

2017-10-15 Thread Chaotian Jing
mt2701/mt2712 supports async fifo & data tune, which can improve host stability. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 52 +-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git

[PATCH v6 06/12] mmc: mediatek: add async fifo and data tune support

2017-10-15 Thread Chaotian Jing
mt2701/mt2712 supports async fifo & data tune, which can improve host stability. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 52 +-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mtk-sd.c b/dri

[PATCH v6 04/12] mmc: mediatek: make hs400_tune_response only for mt8173

2017-10-15 Thread Chaotian Jing
the origin design of hs400_tune_response is for mt8173 because of mt8173 has a special design. for doing that, we add a new member "compatible", by now it's only for mt8173. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 11 +--

[PATCH v6 04/12] mmc: mediatek: make hs400_tune_response only for mt8173

2017-10-15 Thread Chaotian Jing
the origin design of hs400_tune_response is for mt8173 because of mt8173 has a special design. for doing that, we add a new member "compatible", by now it's only for mt8173. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 11 +-- 1 file changed, 9 insertions(+), 2

[PATCH v6 11/12] mmc: mediatek: improve eMMC hs400 mode read performance

2017-10-15 Thread Chaotian Jing
enlarge outstanding value to improve read performance Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index d75a93d..95759bb

[PATCH v6 12/12] mmc: mediatek: perfer to use rise edge latching for cmd line

2017-10-15 Thread Chaotian Jing
data lines have applied to perfer to use rise edge, also need apply it to cmd line. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mt

[PATCH v6 11/12] mmc: mediatek: improve eMMC hs400 mode read performance

2017-10-15 Thread Chaotian Jing
enlarge outstanding value to improve read performance Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index d75a93d..95759bb 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b

[PATCH v6 12/12] mmc: mediatek: perfer to use rise edge latching for cmd line

2017-10-15 Thread Chaotian Jing
data lines have applied to perfer to use rise edge, also need apply it to cmd line. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 95759bb..27a6225

[PATCH v6 09/12] mmc: mediatek: add support of source_cg clock

2017-10-15 Thread Chaotian Jing
source clock need an independent cg to control, when doing clk mode switch, need gate source clock to avoid hw issue(multi-bit sync hw hang) Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 23 ++- 1 file changed, 22 insertions

[PATCH v6 07/12] mmc: mediatek: add busy_check support

2017-10-15 Thread Chaotian Jing
bit7 of PATCH_BIT1 has different meaning in new design, to compatible with previous platform, clear this bit in new platform. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/ho

[PATCH v6 03/12] arm64: dts: mt8173: remove "mediatek,mt8135-mmc" from mmc nodes

2017-10-15 Thread Chaotian Jing
devicetree bindings has been updated to support multi-platforms, so that each platform has its owns compatible name. And, this compatible name may used in driver to distinguish with other platform. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- arch/arm64/boot/dts/mediatek/

[PATCH v6 10/12] mmc: mediatek: add latch-ck support

2017-10-15 Thread Chaotian Jing
some platform(eg.mt2701) does not support "stop clk fix", in this case, need set correct latch-ck to avoid crc error caused by stop clock block-internally. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.c | 6 ++ 1 file changed, 6 ins

[PATCH v6 09/12] mmc: mediatek: add support of source_cg clock

2017-10-15 Thread Chaotian Jing
source clock need an independent cg to control, when doing clk mode switch, need gate source clock to avoid hw issue(multi-bit sync hw hang) Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git

[PATCH v6 07/12] mmc: mediatek: add busy_check support

2017-10-15 Thread Chaotian Jing
bit7 of PATCH_BIT1 has different meaning in new design, to compatible with previous platform, clear this bit in new platform. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk

[PATCH v6 03/12] arm64: dts: mt8173: remove "mediatek,mt8135-mmc" from mmc nodes

2017-10-15 Thread Chaotian Jing
devicetree bindings has been updated to support multi-platforms, so that each platform has its owns compatible name. And, this compatible name may used in driver to distinguish with other platform. Signed-off-by: Chaotian Jing --- arch/arm64/boot/dts/mediatek/mt8173.dtsi | 12 1

[PATCH v6 10/12] mmc: mediatek: add latch-ck support

2017-10-15 Thread Chaotian Jing
some platform(eg.mt2701) does not support "stop clk fix", in this case, need set correct latch-ck to avoid crc error caused by stop clock block-internally. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/mm

[PATCH v6 00/12] mmc: mediatek: add support of mt2701/mt2712

2017-10-15 Thread Chaotian Jing
t;hs400_tune" flag in dev_comp. Changed vs v1: based on Ulf/Rob/Matthias's comments of DTS binding file, make the binding file clearly and fix probe issue. Chaotian Jing (12): mmc: dt-bindings: Add reg/source_cg/latch-ck for Mediatek MMC bindings mmc: mediatek: add support of mt2701/mt

[PATCH v6 00/12] mmc: mediatek: add support of mt2701/mt2712

2017-10-15 Thread Chaotian Jing
t;hs400_tune" flag in dev_comp. Changed vs v1: based on Ulf/Rob/Matthias's comments of DTS binding file, make the binding file clearly and fix probe issue. Chaotian Jing (12): mmc: dt-bindings: Add reg/source_cg/latch-ck for Mediatek MMC bindings mmc: mediatek: add support of mt2701/mt

[PATCH v6 02/12] mmc: mediatek: add support of mt2701/mt2712

2017-10-15 Thread Chaotian Jing
mt2701/mt2712 has 12bit clock div, which is not compatible with mt8135/mt8173. and, some additional features will be added in mt2701/mt2712, so that need distinguish it by comatibale name. Signed-off-by: Chaotian Jing <chaotian.j...@mediatek.com> --- drivers/mmc/host/mtk-sd.

[PATCH v6 02/12] mmc: mediatek: add support of mt2701/mt2712

2017-10-15 Thread Chaotian Jing
mt2701/mt2712 has 12bit clock div, which is not compatible with mt8135/mt8173. and, some additional features will be added in mt2701/mt2712, so that need distinguish it by comatibale name. Signed-off-by: Chaotian Jing --- drivers/mmc/host/mtk-sd.c | 82

Re: [PATCH v5 01/12] mmc: dt-bindings: Add reg/source_cg/latch-ck for Mediatek MMC bindings

2017-10-13 Thread Chaotian Jing
On Fri, 2017-10-13 at 16:50 -0500, Rob Herring wrote: > On Wed, Oct 11, 2017 at 10:41:25AM +0800, Chaotian Jing wrote: > > Change the comptiable for support of multi-platform > > Make compatible explicit > > Add description for reg > > Add description for source_cg >

Re: [PATCH v5 01/12] mmc: dt-bindings: Add reg/source_cg/latch-ck for Mediatek MMC bindings

2017-10-13 Thread Chaotian Jing
On Fri, 2017-10-13 at 16:50 -0500, Rob Herring wrote: > On Wed, Oct 11, 2017 at 10:41:25AM +0800, Chaotian Jing wrote: > > Change the comptiable for support of multi-platform > > Make compatible explicit > > Add description for reg > > Add description for source_cg >

  1   2   3   4   5   >