[PATCH] mmc:esdhc: use generic IO entry to replace fix IO to support different endian mode

2014-04-13 Thread Haijun Zhang
different platforms. 3. Update IO entry for Nintendo Wii SDHCI controllers. This change needs to be verified. This patch has been verified on p1021rdb-pc(Powerpc), VF610(arm), ls1021A(arm) platforms. Signed-off-by: Haijun Zhang --- .../devicetree/bindings/mmc/fsl-esdhc.txt | 3 + drivers

[PATCH V5] mmc:core: Avoid useless detecting task when card is busy

2013-09-25 Thread Haijun Zhang
x7c/0x80 [ee06dff0] [c000de58] kernel_thread+0x4c/0x68 <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0001 Signed-off-by: Haijun Zhang Acked-by: Ulf Hansson --- drivers/mmc/card/block.c | 28 ++-- drivers/mmc/core/core.c | 5 + 2 files changed, 31 i

[PATCH V5] mmc:core: Avoid useless detecting task when card is busy

2013-09-25 Thread Haijun Zhang
x7c/0x80 [ee06dff0] [c000de58] kernel_thread+0x4c/0x68 <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0001 Signed-off-by: Haijun Zhang --- drivers/mmc/card/block.c | 28 ++-- drivers/mmc/core/core.c | 5 + 2 files changed, 31 insertions(+), 2 deletions(-)

[PATCH v4] mmc:core: Avoid useless detecting task when card is busy

2013-09-24 Thread Haijun Zhang
x7c/0x80 [ee06dff0] [c000de58] kernel_thread+0x4c/0x68 <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0001 Signed-off-by: Haijun Zhang --- changes for V4: - Enable detect change during req error recovery drivers/mmc/card/block.c | 29 +++-- driv

[PATCH 5/5] mmc:esdhc: Avoid writting to power register

2013-09-24 Thread Haijun Zhang
eSDHC host don't have a standand power control register. Also eSDHC host which support spec 1.0 and spec 2.0 don't support voltage switch. So add this change avoid writing other bit of this register by mistake. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci-of-esdhc.c | 5 +++

[PATCH 4/5] mmc:esdhc: Workaround about clock glitch issue on eSDHC host

2013-09-24 Thread Haijun Zhang
any issue. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci-esdhc.h| 25 ++--- drivers/mmc/host/sdhci-of-esdhc.c | 56 +++ include/linux/mmc/sdhci.h | 2 ++ 3 files changed, 80 insertions(+), 3 deletions(-) diff --git a/drivers

[PATCH 3/5] mmc:esdhc: Update timeout clock according to actual clock

2013-09-24 Thread Haijun Zhang
enabled and used. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci-esdhc.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h index a2a0642..e70c4e6 100644 --- a/drivers/mmc/host/sdhci-esdhc.h +++ b/drivers/mmc/host

[PATCH 1/5] mmc:core: Add restrictions for data transfer and card ease

2013-09-24 Thread Haijun Zhang
(CMD25) for some crappy cards. Signed-off-by: Haijun Zhang --- drivers/mmc/core/core.c | 45 ++--- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index bf18b6b..b429baa 100644 --- a/drivers

[PATCH 2/5] mmc:sdhc: Calculate timeout_clk from actual sd clock

2013-09-24 Thread Haijun Zhang
enabled and used. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 7a7fb4f..c614c31 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1238,6 +1238,10

[PATCH V3] mmc:core: Avoid useless detecting task when card is busy

2013-09-23 Thread Haijun Zhang
x7c/0x80 [ee06dff0] [c000de58] kernel_thread+0x4c/0x68 <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0001 Signed-off-by: Haijun Zhang --- changes for V3: - Remove mmc_try_claim_host. changes for V2: - Add card detecting once the last request is done. driv

[PATCH V2] mmc:core: Avoid useless detecting task when card is busy

2013-09-17 Thread Haijun Zhang
x7c/0x80 [ee06dff0] [c000de58] kernel_thread+0x4c/0x68 <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0001 Signed-off-by: Haijun Zhang --- changes for V2: - Add card detecting once the last request is done. drivers/mmc/card/block.c | 28 ++-- driv

[PATCH 2/2] mmc:esdhc: Enable DMA err bit for eSDHC host

2013-09-16 Thread Haijun Zhang
eSDHC host had bit eSDHC_IRQSTAT[3] to indicate that DMA (SDMA or ADMA) transfer has failed. So enable this bit detecting and its interrupt. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci-of-esdhc.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/mmc

[PATCH 1/2] mmc:sdhc: Add vendor specific interrupt and handle routine

2013-09-16 Thread Haijun Zhang
sdhci_dma_show in sdhc.h for platform usr. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci.c | 25 +++-- drivers/mmc/host/sdhci.h | 5 + 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index b4d7f27

[PATCH 5/5] mmc:esdhc: eSDHC host don't have highspeed bit

2013-09-03 Thread Haijun Zhang
eSDHC host is not a standand host, there is no SDHCI_CTRL_HISPD bit in SDHCI_HOST_CONTROL register. Add this quirk to avoid changing the Data transfer width bit of eSDHC host. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci-esdhc.h | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH 3/5] mmc: esdhc: workaround for dma err in the last system transaction

2013-09-03 Thread Haijun Zhang
last descriptor line. Signed-off-by: Haijun Zhang --- - Depend on patch [1/5] drivers/mmc/host/sdhci-of-esdhc.c | 101 ++ 1 file changed, 91 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of

[PATCH 1/5] powerpc/85xx: Add support for 85xx cpu type detection

2013-09-03 Thread Haijun Zhang
Add this file to help detect cpu type in runtime. These macros will be more favorable for driver to apply errata and workaround to specified cpu type. Signed-off-by: Haijun Zhang Signed-off-by: Zhao Chenhui --- arch/powerpc/include/asm/mpc85xx.h | 92 ++ 1

[PATCH 2/5] mmc:sdhc: Share function sdhci_reset for platform use

2013-09-03 Thread Haijun Zhang
In some case, sdhci_reset is need to be invoked in some platform related workaround. So export it for public use. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci.c | 3 ++- drivers/mmc/host/sdhci.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host

[PATCH 4/5] mmc: esdhc: Correct host version of T4240-R1.0-R2.0

2013-09-03 Thread Haijun Zhang
Vender version and sdhc spec version of T4240-R1.0-R2.0 is incorrect. The right value should be VVN=0x13, SVN = 0x1. The wrong version number will break down the ADMA data transfer. This defect only exist in T4240-R1.0-R2.0. Signed-off-by: Haijun Zhang --- - Depend on patch [1/5

[PATCH 4/4] mmc:of_spi: Update the code of getting voltage-ranges

2013-08-25 Thread Haijun Zhang
Using function mmc_of_parse_voltage() to get voltage-ranges. Signed-off-by: Haijun Zhang Acked-by: Anton Vorontsov --- drivers/mmc/host/of_mmc_spi.c | 23 +++ 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host

[PATCH 1/4] mmc:core: parse voltage from device-tree

2013-08-25 Thread Haijun Zhang
Add function to support get voltage from device-tree. If there are voltage-range specified in device-tree node, this function will parse it and return the available voltage mask. Signed-off-by: Haijun Zhang Acked-by: Anton Vorontsov --- .../devicetree/bindings/mmc/fsl-esdhc.txt | 4

[PATCH 2/4] mmc:sdhc: get voltage from sdhc host

2013-08-25 Thread Haijun Zhang
We use host->ocr_mask to hold the voltage get from device-tree node, In case host->ocr_mask was available, we use host->ocr_mask as the final available voltage can be used by MMC/SD/SDIO card. Signed-off-by: Haijun Zhang Reviewed-by: Anton Vorontsov --- drivers/mmc/host/sdh

[PATCH 3/4] mmc:esdhc: add support to get voltage from device-tree

2013-08-25 Thread Haijun Zhang
Add suppport to get voltage from device-tree node for esdhc host, if voltage-ranges was specified in device-tree node we can get ocr_mask instead of read from host capacity register. If not voltages still can be get from host capacity register. Signed-off-by: Haijun Zhang Acked-by: Anton

[PATCH] mmc:sdhci: Add Auto-CMD12 err detecting and handling routine

2013-08-23 Thread Haijun Zhang
When Auto-CMD12 is enabled, Auto-cmd12 error status and signal bit should be set to reflect this behaviour in case error. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci.c | 32 +--- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/drivers/mmc

[PATCH] mmc:core: Avoid useless detecting task when card is busy

2013-08-21 Thread Haijun Zhang
0x4c/0x68 <7>sdhci [sdhci_irq()]: *** mmc0 got interrupt: 0x0001 Signed-off-by: Haijun Zhang --- drivers/mmc/core/core.c | 5 + drivers/mmc/core/mmc.c | 3 ++- drivers/mmc/core/sd.c | 3 ++- drivers/mmc/core/sdio.c | 3 ++- 4 files changed, 11 insertions(+), 3 deletions(-) diff

[PATCH 1/3 V5] mmc:core: parse voltage from device-tree

2013-08-13 Thread Haijun Zhang
Add function to support get voltage from device-tree. If there are voltage-range specified in device-tree node, this function will parse it and return the available voltage mask. Signed-off-by: Haijun Zhang --- changes for v5: - add binding spec for this device node changes for v4

[PATCH 3/3 V3] mmc:esdhc: add support to get voltage from device-tree

2013-08-11 Thread Haijun Zhang
Add suppport to get voltage from device-tree node for esdhc host, if voltage-ranges was specified in device-tree node we can get ocr_mask instead of read from host capacity register. If not voltages still can be get from host capacity register. Signed-off-by: Haijun Zhang --- changes for V3

[PATCH 1/3 V4] mmc:core: parse voltage from device-tree

2013-08-11 Thread Haijun Zhang
Add function to support get voltage from device-tree. If there are voltage-range specified in device-tree node, this function will parse it and return the available voltage mask. Signed-off-by: Haijun Zhang --- changes for V4: - Add new parameter mask to return voltages. changes for V3

[PATCH V3] mmc:of_spi: Update the code of getting voltage-ranges

2013-08-11 Thread Haijun Zhang
Using function mmc_of_parse_voltage() to get voltage-ranges. Signed-off-by: Haijun Zhang --- changes for V3: - changes the type of ocr_mask and function mmc_of_parse_voltage drivers/mmc/host/of_mmc_spi.c | 23 +++ 1 file changed, 3 insertions(+), 20 deletions

[PATCH 2/3 V3] mmc:sdhc: get voltage from sdhc host

2013-08-11 Thread Haijun Zhang
We use host->ocr_mask to hold the voltage get from device-tree node, In case host->ocr_mask was available, we use host->ocr_mask as the final available voltage can be used by MMC/SD/SDIO card. Signed-off-by: Haijun Zhang --- changes for V3: - changed the type of mask drivers

[PATCH 1/3 V3] mmc:core: parse voltage from device-tree

2013-08-08 Thread Haijun Zhang
Add function to support get voltage from device-tree. If there are voltage-range specified in device-tree node, this function will parse it and return the available voltage mask. Signed-off-by: Haijun Zhang --- changes for V3: - Correct the type of return value. changes for v2

[PATCH 2/3 V2] mmc:sdhc: get voltage from sdhc host

2013-08-08 Thread Haijun Zhang
We use host->ocr_mask to hold the voltage get from device-tree node, In case host->ocr_mask was available, we use host->ocr_mask as the final available voltage can be used by MMC/SD/SDIO card. Signed-off-by: Haijun Zhang --- changes for v2: - Change the type of the value dr

[PATCH V2] mmc:of_spi: Update the code of getting voltage-ranges

2013-08-08 Thread Haijun Zhang
Using function mmc_of_parse_voltage() to get voltage-ranges. Signed-off-by: Haijun Zhang --- changes for V2: - changed the type of ocr_mask drivers/mmc/host/of_mmc_spi.c | 22 -- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/mmc/host

[PATCH V2] mmc:sdhci: Wait longer for command with busy flags

2013-08-08 Thread Haijun Zhang
err. Signed-off-by: Haijun Zhang --- changes for V2: - Correct the timer drivers/mmc/host/sdhci.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index a78bd4f..578 100644 --- a/drivers/mmc/host

[PATCH] mmc:sdhci: Wait longer for command with busy flags

2013-07-31 Thread Haijun Zhang
err. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index a78bd4f..7b89ed6 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -986,6 +986,7

[PATCH 1/3 V2] mmc:core: parse voltage from device-tree

2013-07-31 Thread Haijun Zhang
Add function to support get voltage from device-tree. If there are voltage-range specified in device-tree node, this function will parse it and return the avail voltage mask. Signed-off-by: Haijun Zhang --- changes for v2: - Update the parameters of function drivers/mmc/core/core.c

[PATCH] mmc:of_spi: Update the code of getting voltage-ranges

2013-07-31 Thread Haijun Zhang
Using function mmc_of_parse_voltage() to get voltage-ranges. Signed-off-by: Haijun Zhang --- drivers/mmc/host/of_mmc_spi.c | 22 -- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c index d720b5e

[PATCH 3/3 V2] mmc:esdhc: add support to get voltage from device-tree

2013-07-31 Thread Haijun Zhang
Add suppport to get voltage from device-tree node for esdhc host, if voltage-ranges was specified in device-tree node we can get ocr_mask instead of read from host capacity register. If not voltages still can be get from host capacity register. Signed-off-by: Haijun Zhang --- changes for v2

[PATCH 1/3] mmc:core: parse voltage from device-tree

2013-07-28 Thread Haijun Zhang
Add function to support get voltage from device-tree. If there are voltage-range specified in device-tree node, this function will parse it and return the avail voltage mask. Signed-off-by: Haijun Zhang --- drivers/mmc/core/core.c | 48 include

[PATCH 3/3] mmc:esdhc: add support to get voltage from device-tree

2013-07-28 Thread Haijun Zhang
Add suppport to get voltage from device-tree node for esdhc host, if voltage-ranges was specified in device-tree node we can get ocr_mask instead of read from host capacity register. If not voltages still can be get from host capacity register. Signed-off-by: Haijun Zhang --- drivers/mmc/host

[PATCH 2/3] mmc:sdhc: get voltage from sdhc host

2013-07-28 Thread Haijun Zhang
We use host->ocr_mask to hold the voltage get from device-tree node, In case host->ocr_mask was available, we use host->ocr_mask as the final available voltage can be used by MMC/SD/SDIO card. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci.c | 3 +++ include/linux/mmc/sdhci.h

[PATCH 2/2 V2] mmc: esdhc: get voltage from dts file

2013-07-24 Thread Haijun Zhang
Add voltage-range support in esdhc of T4, So we can choose to read voltages from dts file as one optional. If we can get a valid voltage-range from device node, we use this voltage as the final voltage support. Else we still read from capacity or from other provider. Signed-off-by: Haijun Zhang

[PATCH 1/2 V2] Powerpc: Add voltage support in dts file

2013-07-23 Thread Haijun Zhang
eSDHC of T4240 had 1.8v voltage support. Add this node to specify eSDHC voltage capacity. If this node not specified eSDHC driver still can read from eSDHC host capacity register. Signed-off-by: Haijun Zhang Signed-off-by: Anton Vorontsov --- changes for v2: - rewrite the voltage-ranges

[PATCH 1/2] Powerpc: Add voltage support in dts file

2013-07-22 Thread Haijun Zhang
eSDHC of T4240 had 1.8v voltage support. Add this node to specify eSDHC voltage capacity. If this node not specified eSDHC driver still can read from eSDHC host capacity register. Signed-off-by: Haijun Zhang Signed-off-by: Anton Vorontsov --- changes for this patch set: - split from

[PATCH 2/2] Powerpc: Add 3.3v voltage support for T4240QDS

2013-07-22 Thread Haijun Zhang
Freescale T4240QDS reference board has extra voltage shifters added to allow 3.3V operation, so add 3.3v voltage support for T4240QDS. Signed-off-by: Haijun Zhang Signed-off-by: Anton Vorontsov --- changes for this patch set: - split from patch [PATCH 1/2] Powerpc: Add - voltage

[PATCH 2/2] mmc: esdhc: get voltage from dts file

2013-07-22 Thread Haijun Zhang
Add voltage-range support in esdhc of T4, So we can choose to read voltages from dts file as one optional. If we can get a valid voltage-range from device node, we use this voltage as the final voltage support. Else we still read from capacity or from other provider. Signed-off-by: Haijun Zhang

[PATCH 1/2] Powerpc: Add voltage ranges support for T4

2013-07-22 Thread Haijun Zhang
Special voltages that can be support by eSDHC of T4 in esdhc node. Signed-off-by: Haijun Zhang Signed-off-by: Anton Vorontsov --- Documentation/devicetree/bindings/mmc/fsl-esdhc.txt | 3 +++ arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 1 + 2 files changed, 4 insertions(+) diff --git

[PATCH 3/4 V3] mmc: esdhc: Correct host version of T4240-R1.0-R2.0

2013-07-18 Thread Haijun Zhang
Vender version and sdhc spec version of T4240-R1.0-R2.0 is incorrect. The right value should be VVN=0x13, SVN = 0x1. The wrong version number will break down the ADMA data transfer. This defect only exist in T4240-R1.0-R2.0. Also share vvn and svr for public use. Signed-off-by: Haijun Zhang

[PATCH 4/4 V2] mmc: esdhc: Add broken timeout quirk for p4/p5 board

2013-07-17 Thread Haijun Zhang
Sometimes command can't be completed within the time give in eSDHC_SYSCTL[DTOCV]. So just give the max value 0x14 to avoid this issue. Signed-off-by: Haijun Zhang --- changes for v2: - Rebuild patch of eSDHC host need long time to generate command interrupt drivers/mmc

[PATCH 2/4 V2] mmc: esdhc: workaround for dma err in the last system transaction

2013-07-17 Thread Haijun Zhang
last descriptor line. Signed-off-by: Haijun Zhang --- changes for V2: - Update the svr version list drivers/mmc/host/sdhci-of-esdhc.c | 112 ++ 1 file changed, 102 insertions(+), 10 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers

[PATCH 3/4 V2] mmc: esdhc: Correct host version of T4240-R1.0

2013-07-17 Thread Haijun Zhang
: Haijun Zhang --- changes for V2: - Remove broken ADMA quirk. - Rebuild patch of Add quirks to support T4240 board drivers/mmc/host/sdhci-of-esdhc.c | 29 + 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/drivers/mmc/host/sdhci-of

[PATCH 1/4 V4] powerpc/85xx: Add support for 85xx cpu type detection

2013-07-16 Thread Haijun Zhang
Add this file to help detect cpu type in runtime. These macros will be more favorable for driver to apply errata and workaround to specified cpu type. Signed-off-by: Haijun Zhang Signed-off-by: Zhao Chenhui --- changes for v4: - Add new set of soc arch/powerpc/include/asm/mpc85xx.h

[PATCH V3] powerpc/85xx: Add support for 85xx cpu type detection

2013-07-10 Thread Haijun Zhang
Add this file to help detect cpu type in runtime. These macros will be more favorable for driver to apply errata and workaround to specified cpu type. Signed-off-by: Haijun Zhang Signed-off-by: Zhao Chenhui --- changes for v3: - remove get_svr and is_svr_rev arch/powerpc/include/asm

[PATCH 1/4 V2] powerpc/85xx: Add support for 85xx cpu type detection

2013-07-10 Thread Haijun Zhang
Add this file to help detect cpu type in runtime. These macros will be more favorable for driver to apply errata and workaround to specified cpu type. Signed-off-by: Haijun Zhang Signed-off-by: Zhao Chenhui --- changes v2: - Remove inline function - Ignore E bit of SOC

[PATCH 3/4 V2] mmc: esdhc: Add quirks to support T4240QDS board

2013-07-08 Thread Haijun Zhang
On T4240QDS board controllers has an unusable ADMA engine, so use SDMA instead. Also 3.0v is support on T4240QDS board even if the capacity detailed only 1.8v support. Without this quirk SD card will declare voltage not support and Signed-off-by: Haijun Zhang --- changes for v2: - Change

[PATCH] Powerpc/t4240: change the compatible flags for t4240qds board

2013-07-08 Thread Haijun Zhang
In order to make a difference between different T4240 board. Specify T4240QDS board the unique compatible flags for t4240qds eSDHC host. Signed-off-by: Haijun Zhang --- arch/powerpc/boot/dts/fsl/t4240si-post.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc

[PATCH 3/4] mmc: esdhc: Add quirks to support T4240 board

2013-07-07 Thread Haijun Zhang
On T4240 board controllers has an unusable ADMA engine, so use SDMA instead. Also 3.0v is support on T4240 board even if the capacity detailed only 1.8v support. Without this quirk SD card will declare voltage not support and Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci-pltfm.c | 5

[PATCH 2/4] mmc: esdhc: workaround for dma err in the last system transaction

2013-07-07 Thread Haijun Zhang
last descriptor line. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci-of-esdhc.c | 113 +++--- 1 file changed, 104 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c index 15039e2..b22cab0 100644

[PATCH 1/4] powerpc/85xx: Add support for 85xx cpu type detection

2013-07-07 Thread Haijun Zhang
Add this file to help detect cpu type in runtime. These macros and inline routines will be more favorable for driver to apply errata and workaround to specified cpu type. Signed-off-by: Haijun Zhang Signed-off-by: Zhao Chenhui --- arch/powerpc/include/asm/mpc85xx.h | 96

[PATCH 4/4] mmc: eSDHC: Some eSDHC host need long time to generate command interrupt

2013-07-07 Thread Haijun Zhang
Command complete interrupt not always generate within 10 * HZ. Sometimes 500 * HZ or more. So enlarge this detecting value to ensure the host had sufficient time to generate command complete interrupt. Signed-off-by: Haijun Zhang --- drivers/mmc/host/sdhci-of-esdhc.c | 3 +++ drivers/mmc/host

[PATCH] mmc:host: Correct the Register bit in eSDHCI_HOST_CONTROL

2013-04-07 Thread Haijun Zhang
Avoid writting to SDHCI_HOST_CONTROL[DTW] bit by mistake. Signed-off-by: Haijun Zhang CC: Anton Vorontsov --- drivers/mmc/host/sdhci-esdhc.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc.h b/drivers/mmc/host/sdhci-esdhc.h index d25f9ab

[PATCH] mmc:host eSDHC: mmc:host host need long time to generate command complete interrupt

2013-04-07 Thread Haijun Zhang
According to Spec 2.0, command complete interrupt will generate within 150 SD-CLK. But this was not enough on T4240 board. So give it sufficient time to detect command timeout. 1000 * HZ will be enough, this value was test on all T4 board, all worked well. Signed-off-by: Haijun Zhang CC: Anton

[PATCH] mmc:block Add Fixup of BROKEN CMD23 for SANDISK card

2013-04-07 Thread Haijun Zhang
and, card status 0x400900 mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900 end_request: I/O error, dev mmcblk0, sector 0 Buffer I/O error on device mmcblk0, logical block 0 mmcblk0: timed out sending SET_BLOCK_COUNT command, card status 0x400900 Signed-off-by: Haijun Z

[PATCH] mmc:host eSDHC: Remove duplicate code of enable_dma

2013-04-07 Thread Haijun Zhang
Remove duplicate code "enable_dma()" in platform_resume. Enable_dma was invoked already in sdhci_resume_host before ops->platform_resume was executed Signed-off-by: Haijun Zhang CC: Anton Vorontsov --- drivers/mmc/host/sdhci-of-esdhc.c |1 - 1 files changed, 0 insertions(+)

[PATCH V5] Powerpc eSDHC Recover from the ADMA error

2012-12-03 Thread Haijun Zhang
so if ADMA descriptor line is fetched at the same time, then DMA engine might report false ADMA error. eSDHC might not be able to Continue(PROCTL[CREQ]=1)after Stop at Block Gap. This issue will impact the eSDHC IP VVN2.3. Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang Acked-by: Anton Voro

[PATCH V5] Powerpc eSDHC Recover from the ADMA error

2012-11-29 Thread Haijun Zhang
also if ADMA descriptor line is fetched at the same time, then DMA engine might report false ADMA error. eSDHC might not be able to Continue(PROCTL[CREQ]=1)after Stop at Block Gap. This issue will impact the eSDHC IP VVN2.3. Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang Acked-by:

[PATCH 1/2 V5] Powerpc/eSDHC: Calculate the applicable mmc erase timeout value

2012-11-28 Thread Haijun Zhang
can be read after the card had setup and decoded, As esdhc-imx also use this func and this quirk so this patch will also work on esdhci-imx, but this patch only test on powerpc platform, if there are any negative impact on esdhc-imx please let me know. Signed-off-by: Haijun Zhang Signed-off-by

[PATCH] Powerpc/eSDHC: Calculate the applicable mmc erase timeout value

2012-11-28 Thread Haijun Zhang
can be read after the card had setup and decoded, As esdhc-imx also use this func and this quirk so this patch will also work on esdhci-imx, but this patch only test on powerpc platform, if there are any negative impact on esdhc-imx please let me know. Signed-off-by: Haijun Zhang Signed-off-by

[PATCH V4] Powerpc eSDHC Recover from the ADMA error

2012-11-28 Thread Haijun Zhang
Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang Acked-by: Anton Vorontsov CC: Chris Ball --- changes for v4: - Correct inconsistent issue changes for v3: - Correct the if statement in function workground changes for v2: - Invert the condition of the if

[PATCH] Powerpc/eSDHC: Calculate the applicable mmc erase timeout value

2012-11-28 Thread Haijun Zhang
can be read after the card had setup and decoded, As esdhc-imx also use this func and this quirk so this patch will also work on esdhci-imx, but this patch only test on powerpc platform, if there are any negative impact on esdhc-imx please let me know. Signed-off-by: Haijun Zhang Signed-off-by

[PATCH 1/2 v4] Powerpc/eSDHC: Calculate the applicable mmc erase timeout value

2012-11-28 Thread Haijun Zhang
can be read after the card had setup and decoded, As esdhc-imx also use this func and this quirk so this patch will also work on esdhci-imx, but this patch only test on powerpc platform, if there are any negative impact on esdhc-imx please let me know. Signed-off-by: Haijun Zhang Signed-off-by

[PATCH 1/2 V2] mmc:block : Convert the cmd_timeou_ms to u64 to avoid overflow

2012-11-26 Thread Haijun Zhang
Convert the cmd_timeou_ms to u64 to avoid overflow Signed-off-by: Jerry Huang Signed-off-by: Haijun Zhang Reviewed-by: Anton Vorontsov CC: Chris Ball --- drivers/mmc/card/block.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc

[PATCH 2/2 V2] mmc:host: Use u64 to calculate the timeout value to avoid overflow

2012-11-26 Thread Haijun Zhang
- drivers/mmc/host/omap.c - drivers/mmc/host/tifm_sd.c - drivers/mmc/host/wbsd.c Signed-off-by: Jerry Huang Signed-off-by: Haijun Zhang Reviewed-by: Anton Vorontsov CC: Chris Ball --- changes for v2: - Remove the needless type convertion. drivers/mmc/host/atmel-mci.c |7

[PATCH] Use u64 to calculate the timeout value to avoid overflow

2012-11-26 Thread Haijun Zhang
- drivers/mmc/host/omap.c - drivers/mmc/host/tifm_sd.c - drivers/mmc/host/wbsd.c Signed-off-by: Jerry Huang Signed-off-by: Haijun Zhang CC: Anton Vorontsov CC: Chris Ball --- drivers/mmc/host/atmel-mci.c |7 +++ drivers/mmc/host/bfin_sdh.c|2 +- drivers/mmc/host

[PATCH] Powerpc eSDHC: Convert the cmd_timeou_ms to u64 to avoid overflow

2012-11-26 Thread Haijun Zhang
Convert the cmd_timeou_ms to u64 to avoid overflow Signed-off-by: Jerry Huang Signed-off-by: Haijun Zhang CC: Anton Vorontsov CC: Chris Ball --- drivers/mmc/card/block.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card

[PATCH 1/2 v3] Powerpc/eSDHC: Calculate the applicable mmc erase timeout value

2012-11-18 Thread Haijun Zhang
As large area erase needs long time usually a few minutes, which the host can't wait will bring about timeout error. So we need to split the large area to small sections which only need short erase time to avoid timeout error. Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang Ack

[PATCH 2/2 v3] Powerpc/eSDHC: Add limit to data and erase timeout value calculation

2012-11-18 Thread Haijun Zhang
Some cards apply too larg timeout value for host to response, So limit the maximum data transfer timeout value and maximum erase timeout value to aviod timeout issue. Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang Acked-by: Anton Vorontsov --- changes for v3: - Add limit to

[PATCH] Powerpc eSDHC: Use u64 to calculate the timeout value to avoid overflow

2012-11-18 Thread Haijun Zhang
As some mmc cards need large timeout value usually a few seconds, so data timeout nanosecond will overflow with u32 variable and give the wrong timeout value, so use u64 will be safe. Signed-off-by: Jerry Huang Signed-off-by: Haijun Zhang Acked-by: Anton Vorontsov --- drivers/mmc/core/core.c

[PATCH 1/2 v3] Powerpc/eSDHC: Calculate the applicable mmc erase timeout value

2012-11-18 Thread Haijun Zhang
As large area erase needs long time usually a few minutes, which the host can't wait will bring about timeout error. So we need to split the large area to small sections which only need short erase time to avoid timeout error. Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang Signed-o

[PATCH 1/2 v2] Powerpc/eSDHC: Calculate the applicable mmc erase timeout value

2012-11-18 Thread Haijun Zhang
As large area erase needs long time usually a few minutes, which the host can't wait will bring about timeout error. So we need to split the large area to small sections which only need short erase time to avoid timeout error. Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang Signed-o

[PATCH 2/2] Powerpc/eSDHC: Add limit to data and erase timeout value calculation

2012-11-18 Thread Haijun Zhang
Some cards apply too larg timeout value for host to response, So limit the maximum data transfer timeout value and maximum erase timeout value to aviod timeout issue. Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang Signed-off-by: Anton Vorontsov --- changes for v2: - Add limit

[PATCH] Powerpc eSDHC: Use u64 to calculate the timeout value to avoid overflow

2012-11-18 Thread Haijun Zhang
As some mmc cards need large timeout value usually a few seconds, so data timeout nanosecond will overflow with u32 variable and give the wrong timeout value, so use u64 will be safe. Signed-off-by: Jerry Huang Signed-off-by: Haijun Zhang Signed-off-by: Anton Vorontsov --- drivers/mmc/core

[PATCH 1/2 V2] Powerpc/eSDHC: Calculate the applicable mmc erase timeout value

2012-11-13 Thread Haijun Zhang
As large area erase needs long time usually a few minutes, which the host can't wait will bring about timeout error. So we need to split the large area to small sections which only need short erase time to avoid timeout error. Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang CC:

[PATCH 2/2 V2] Powerpc/eSDHC: Add limit to data and erase timeout value calculation

2012-11-13 Thread Haijun Zhang
Some cards apply too larg timeout value for host to response, So limit the maximum data transfer timeout value and maximum erase timeout value to aviod timeout issue. Signed-off-by: Haijun Zhang Signed-off-by: Jerry Huang CC: Anton Vorontsov --- changes for v2: - Add limit to data and

[PATCH] Powerpc eSDHC: Use u64 to calculate the timeout value to avoid overflow

2012-11-11 Thread Haijun Zhang
As some mmc cards need large timeout value usually a few seconds, so data timeout nanosecond will overflow with u32 variable and give the wrong timeout value, so use u64 will be safe. Signed-off-by: Jerry Huang Signed-off-by: Haijun Zhang CC: Anton Vorontsov --- drivers/mmc/core/core.c