06 Oct, 2014

1 commit

  • The dw_mmc driver was responding to errors with debug(). Change that
    to prinf()/puts() respectively so that any errors are immediately
    obvious. Also adjust english in comments.

    Signed-off-by: Pavel Machek
    Signed-off-by: Marek Vasut
    Cc: Chin Liang See
    Cc: Dinh Nguyen
    Cc: Albert Aribaud
    Cc: Tom Rini
    Cc: Wolfgang Denk
    Cc: Pavel Machek
    Cc: Pantelis Antoniou
    Acked-by: Chin Liang See

    Pavel Machek
     

02 Aug, 2014

1 commit


16 May, 2014

1 commit


24 Mar, 2014

3 commits

  • The way that struct mmc was implemented was a bit of a mess;
    configuration and internal state all jumbled up in a single structure.

    On top of that the way initialization is done with mmc_register leads
    to a lot of duplicated code in drivers.

    Typically the initialization got something like this in every driver.

    struct mmc *mmc = malloc(sizeof(struct mmc));
    memset(mmc, 0, sizeof(struct mmc);
    /* fill in fields of mmc struct */
    /* store private data pointer */
    mmc_register(mmc);

    By using the new mmc_create call one just passes an mmc config struct
    and an optional private data pointer like this:

    struct mmc = mmc_create(&cfg, priv);

    All in tree drivers have been updated to the new form, and expect
    mmc_register to go away before long.

    Changes since v1:

    * Use calloc instead of manually calling memset.
    * Mark mmc_register as deprecated.

    Signed-off-by: Pantelis Antoniou

    Pantelis Antoniou
     
  • Using an array is pointless; even more pointless (and scary) is using
    sprintf to fill it without a format string.

    Signed-off-by: Pantelis Antoniou

    Pantelis Antoniou
     
  • Remove the in-structure ops and put them in mmc_ops with
    a constant pointer to it.

    This makes the mmc structure smaller as well as conserving
    code space (in theory).

    All in-tree drivers are converted as well; this is done in a
    single patch in order to not break git bisect.

    Changes since V1:
    Fix compilation b0rked issue on omap platforms where OMAP_GPIO was
    not set.

    Signed-off-by: Pantelis Antoniou

    Pantelis Antoniou
     

07 Feb, 2014

1 commit

  • This patch corrects the divider value written to CLKDIV register.
    Since SDCLKIN is divided inside controller by the DIVRATIO value set
    in the CLKSEL register, we need to use the same output clock value to
    calculate the CLKDIV value.
    as per user manual: cclk_in = SDCLKIN / (DIVRATIO + 1)

    Input parameter to mmc_clk is changed to dwmci_host, since
    we need the same to read DWMCI_CLKSEL register.

    This improves the read timing values for channel 0 on SMDK5250
    from 0.288sec to 0.144sec

    Signed-off-by: Rajeshwari S Shinde
    Acked-by: Jaehoon Chung
    Signed-off-by: Pantelis Antoniou

    Rajeshwari S Shinde
     

14 Jan, 2014

1 commit


09 Jan, 2014

2 commits

  • Bounce buffer implementation takes care of proper data buffer alignemt
    and correct flush/invalidation of data cache at once so we no longer
    depend on input data variety and make sure CPU and MMC controller deal
    with expected data in case of enabled data cache.

    Bounce buffer requires to add its definition (CONFIG_BOUNCE_BUFFER) in
    board configuration, otherwise corresponding library won't be compiled
    and linker will fail to build resulting executable.

    Difference since v1 - fixed compile-time warning with type casting to
    "void *":

    Slight edit to remove UTF8 characters in the commit message.

    Acked-by: Jaehoon Chung
    Tested-by: Jaehoon Chung
    Acked-by: Pantelis Antoniou

    ====
    passing argument 2 of 'bounce_buffer_start' discards 'const' qualifier
    from pointer target type
    ====

    Signed-off-by: Alexey Brodkin

    Cc: Mischa Jonker
    Cc: Alim Akhtar
    Cc: Rajeshwari Shinde
    Cc: Jaehoon Chung
    Cc: Amar
    Cc: Kyungmin Park
    Cc: Minkyu Kang
    Cc: Simon Glass
    Cc: Pantelis Antoniou
    Cc: Andy Fleming

    Alexey Brodkin
     
  • To enhance the SDMMC DesignWare driver to use calloc instead of
    malloc. This will avoid the incident that uninitialized members
    of mmc structure are later used for NULL comparison.

    Signed-off-by: Chin Liang See
    Cc: Rajeshwari Shinde
    Cc: Jaehoon Chung
    Cc: Mischa Jonker
    Cc: Alexey Brodkin
    Cc: Andy Fleming
    Cc: Pantelis Antoniou
    Acked-by: Pantelis Antoniou

    Chin Liang See
     

08 Dec, 2013

2 commits

  • If platform provides "host->fifoth_val" it will be used for
    initialization of DWMCI_FIFOTH register. Otherwise default value will be
    used.

    This implementation allows:
    * escape unclear and recursive calculations that are currently in use
    * use whatever custom value for DWMCI_FIFOTH initialization if any
    particular SoC requires it

    Signed-off-by: Alexey Brodkin

    Cc: Mischa Jonker
    Cc: Alim Akhtar
    Cc: Rajeshwari Shinde
    Cc: Jaehoon Chung
    Cc: Amar
    Cc: Kyungmin Park
    Cc: Minkyu Kang
    Cc: Simon Glass
    Cc: Pantelis Antoniou
    Cc: Andy Fleming
    Acked-by: Jaehoon Chung
    Acked-by: Pantelis Antoniou

    Alexey Brodkin
     
  • dw-mmc.c is the general driver file.
    So, remove the exynos specific code at dw-mmc.c.
    Instead, exynos specific cod can be move into exynos-dw_mmc.c.

    Signed-off-by: Jaehoon Chung
    Acked-by: Alexey Brodkin
    Acked-by: Pantelis Antoniou
    Acked-by: Minkyu Kang

    Jaehoon Chung
     

31 Oct, 2013

2 commits


20 Sep, 2013

2 commits

  • This fixes two issues:
    * a descriptor was allocated for every block, while a descriptor can
    take 8 blocks
    * there was an off-by-one error in the descriptor preparation: there
    were two last descriptors, one with length==0

    Signed-off-by: Mischa Jonker
    Cc: Alexey Brodkin
    Cc: Jaehoon Chung
    Cc: Andy Fleming

    Mischa Jonker
     
  • In dwmci_prepare_data, the descriptors are allocated for DMA transfer.
    These are allocated using the ALLOC_CACHE_ALIGN_BUFFER. This macro uses
    the stack to allocate these descriptors. This becomes a problem if the
    DMA transfer continues after the processor leaves the function in which
    the descriptors were allocated.

    Therefore, I have moved the allocated of the buffers up one level, to
    dwmci_send_cmd(). The DMA transfer should be complete when leaving this
    function.

    Signed-off-by: Mischa Jonker
    Cc: Alexey Brodkin
    Cc: Jaehoon Chung
    Cc: Andy Fleming
    Acked-by: Jaehoon Chung
    Acked-by: Pantelis Antoniou

    Mischa Jonker
     

24 Jul, 2013

1 commit


17 Jul, 2013

1 commit

  • 1. No contents of "asm/arch/clk.h" is used within "dw_mmc.c".
    2. If arch doesn't have "asm/arch/clk.h" driver won't build.

    Without mentioned inclusion dw_mmc driver could be built for arches
    other than ARM. For ARM driver still builds without it.

    Signed-off-by: Alexey Brodkin

    Cc: Mischa Jonker
    Cc: Andy Fleming
    Cc: Rajeshwari Shinde
    Cc: Amar
    Cc: Minkyu Kang
    Cc: Jaehoon Chung
    Signed-off-by: Andy Fleming

    Alexey Brodkin
     

17 Jun, 2013

1 commit

  • Current DWMMC driver used to give FIFO underrun/overrun error every 3rd time
    for mmc rescan command.
    In current code FIFO_DEPTH is getting calculated after reading the default FIFOTH
    register and extracting the RX_WMARK bits from it i.e (RX_WMARK = FIFO_DEPTH/2 -1).
    Instead of storing the correct value, we were recalculating the FIFO_DEPT each
    time which is not correct.

    Based on "[PATCH V9 3/9] DWMMC: Initialise dwmci and resolve EMMC read write issues"
    http://permalink.gmane.org/gmane.comp.boot-loaders.u-boot/160247

    Signed-off-by: Hatim Ali
    Signed-off-by: Rajeshwari Shinde
    Acked-by: Simon Glass
    Tested-by: Simon Glass
    Acked-by: Jaehoon Chung
    Acked-by: Andy Fleming
    Signed-off-by: Minkyu Kang

    Rajeshwari Shinde
     

13 Jun, 2013

1 commit

  • This patch enumerates dwmci and set auto stop command during
    dwmci initialisation.
    EMMC read/write is not happening in current implementation
    due to improper fifo size computation. Hence modified the fifo size
    computation to resolve EMMC read write issues.

    Signed-off-by: Amar
    Acked-by: Jaehoon Chung
    Signed-off-by: Minkyu Kang

    Amar
     

22 Oct, 2012

1 commit