22 Jan, 2018

2 commits


12 Jan, 2018

2 commits

  • data is defined as struct mmc_data *data.
    So it should not be compared to 0.

    Problem identified with Coccinelle.

    Signed-off-by: Heinrich Schuchardt
    Reviewed-by: Bin Meng

    Heinrich Schuchardt
     
  • Fixes emmc initialization regression on the db410c platform.

    Clearing this register while SDHCI_PRESENT_STATE reports
    SDHCI_CMD_INHIBIT leads to undefined behaviour on the db410c.

    When commit 7dde50 was merged (mmc: sdhci: Wait for SDHCI_INT_DATA_END
    when transferring), SDHCI transfers transitioned to wait for bit
    SDHCI_INT_DATA_END before flagging transfers done.

    Without this patch, the db410 platform fails to initialize its eMMC
    due to all of its transfers timing out (SDHCI_INT_DATA_END is never
    raised after all the blocks have been transferred).

    Signed-off-by: Jorge Ramirez-Ortiz

    Jorge Ramirez-Ortiz
     

17 Aug, 2017

1 commit


15 May, 2017

1 commit

  • In the programmable clock mode, the SDCLK frequency is incorrectly
    assigned when the maximum clock has been assigned during probe,
    this causes the SDHCI not work well.

    In the programmable clock mode, when calculating the SDCLK Frequency
    Select, when the maximum clock has been assigned, it is the actual
    value, should not be multiplied by host->clk_mul. Otherwise, the
    maximum clock is multiplied host->clk_mul by the base clock achieved
    from the BASECLKF field of the Capabilities 0 Register.

    Signed-off-by: Wenyou Yang

    Wenyou Yang
     

14 Apr, 2017

1 commit

  • sdhci_transfer_data() function transfers the blocks passed up to the
    number of blocks defined in mmc_data, but returns immediately once all
    the blocks are transferred, even if the loop exit condition is not met
    (bit SDHCI_INT_DATA_END set in the STATUS word).

    When doing multiple writes to mmc, returning right after the last block
    is transferred can cause the write to fail when sending the
    MMC_CMD_STOP_TRANSMISSION command right after the
    MMC_CMD_WRITE_MULTIPLE_BLOCK command, leaving the mmc driver in an
    unconsistent state until reboot. This error was observed in the rpi3
    board.

    This patch waits for the SDHCI_INT_DATA_END bit to be set even after
    sending all the blocks.

    Test: Reliably wrote 2GiB of data to mmc in a rpi3.

    Signed-off-by: Alex Deymo
    Reviewed-by: Simon Glass

    Alex Deymo
     

21 Mar, 2017

1 commit


25 Jan, 2017

2 commits

  • Some SDHCI drivers might need to do some special controller configuration
    after the common clock set_ios() function has been called (speed / width
    configuration). This patch adds a call to the newly created function
    set_ios_port() when its configured in the host driver.

    This will be used by the Xenon SDHCI controller driver used on the
    Marvell Armada 3700 and 7k/8k ARM64 SoCs.

    Signed-off-by: Stefan Roese
    Cc: Jaehoon Chung
    Cc: Simon Glass
    Reviewed-by: Jaehoon Chung

    Stefan Roese
     
  • This patch completely clears the SDHCI_CLOCK_CONTROL register before the
    new value is configured instead of just clearing the 2 bits
    SDHCI_CLOCK_CARD_EN and SDHCI_CLOCK_INT_EN. Without this change, some
    clock configurations will lead to the "Internal clock never stabilised."
    error message on the Xenon SDHCI controller used on the Marvell Armada
    3700 and 7k/8k ARM64 SoCs.

    The Linux SDHCI core driver also writes 0 to this register before
    the new value is configured. So this patch simplifies the driver a bit
    and brings the U-Boot driver more in-line with the Linux one.

    Signed-off-by: Stefan Roese
    Cc: Jaehoon Chung
    Cc: Siva Durga Prasad Paladugu
    Cc: Michal Simek
    Reviewed-by: Jaehoon Chung

    Stefan Roese
     

23 Jan, 2017

1 commit


13 Jan, 2017

1 commit

  • Until recently, sdhci_ops was used only for overriding IO accessors.
    (so, host->ops was not set by any drivers except bcm2835_sdhci.c)

    Now, we have more optional callbacks, get_cd, set_control_reg, and
    set_clock. However, the code

    if (host->ops->get_cd)
    host->ops->get_cd(host);

    ... expects host->ops is set for all drivers.

    Commit 5e96217f0434 ("mmc: pic32_sdhci: move the code to
    pic32_sdhci.c") and commit 62226b68631b ("mmc: sdhci: move the
    callback function into sdhci_ops") added sdhci_ops for pic32_sdhci.c
    and s5p_sdhci.c, but the other drivers still do not (need not) set
    host->ops because all callbacks in sdhci_ops are optional.

    host->ops must be checked to avoid the system crash caused by NULL
    pointer access.

    Signed-off-by: Masahiro Yamada

    Masahiro Yamada
     

11 Jan, 2017

8 commits


30 Dec, 2016

1 commit

  • While I moved the options, I also renamed them so that they are all
    prefixed with MMC_SDHCI_.

    This commit was created in the following steps.

    [1] Rename with the following command
    find . -name .git -prune -o ! -path ./scripts/config_whitelist.txt \
    -type f -print | xargs sed -i -e '
    s/CONFIG_MMC_SDMA/CONFIG_MMC_SDHCI_SDMA/g
    s/CONFIG_BCM2835_SDHCI/CONFIG_MMC_SDHCI_BCM2835/g
    s/CONFIG_KONA_SDHCI/CONFIG_MMC_SDHCI_KONA/g
    s/CONFIG_MV_SDHCI/CONFIG_MMC_SDHCI_MV/g
    s/CONFIG_S5P_SDHCI/CONFIG_MMC_SDHCI_S5P/g
    s/CONFIG_SPEAR_SDHCI/CONFIG_MMC_SDHCI_SPEAR/g
    '

    [2] create the Kconfig entries in drivers/mmc/Kconfig

    [3] Move the options by the following command
    tools/moveconfig.py -y MMC_SDHCI_SDMA MMC_SDHCI_BCM2835 \
    MMC_SDHCI_KONA MMC_SDHCI_MV MMC_SDHCI_S5P MMC_SDHCI_SPEAR

    [4] Sort drivers/mmc/Makefile for readability

    Signed-off-by: Masahiro Yamada
    Reviewed-by: Tom Rini
    Reviewed-by: Jaehoon Chung

    Masahiro Yamada
     

28 Oct, 2016

2 commits


10 Oct, 2016

2 commits


20 Sep, 2016

7 commits


05 Aug, 2016

7 commits

  • When disabled CONFIG_MMC_SDMA, variable caps didn't use.
    This patch fixes the compiler error for -Wunused-but-set-variable

    Signed-off-by: Jaehoon Chung

    Jaehoon Chung
     
  • Some arguments don't need to pass to sdhci_setup_cfg.
    Generic variable can be used in sdhci_setup_cfg, and some arguments are
    already included in sdhci_host struct.

    It's enough that just pass the board specific things to sdhci_setup_cfg().
    After removing the unnecessary arguments, it's more simpler than before.
    It doesn't consider "Version" and "Capabilities" anymore in each SoC
    driver.

    Signed-off-by: Jaehoon Chung
    Reviewed-by: Simon Glass

    Jaehoon Chung
     
  • buswidth isn't used anywhere in sdhci_setup_cfg.

    Signed-off-by: Jaehoon Chung
    Reviewed-by: Minkyu Kang
    Reviewed-by: Simon Glass

    Jaehoon Chung
     
  • This "commit 429790026021d522d51617217d4b86218cca5750" is wrong.
    SDHCI_QUIRK_NO_HISPD_BIT is for skipping to set CTRL_HISPD bit.

    For example, Exynos didn't have CTRL_HISPD. But Highspeed mode
    is supported.
    (This quirks doesn't mean that driver didn't support the Highseepd mode.)

    Note: If driver didn't support the Highspeed Mode, use or add the other
    quirks.

    After applied this patch, all Exynos SoCs are just running with 25MHz.

    Signed-off-by: Jaehoon Chung

    Jaehoon Chung
     
  • Use the generic error number instead of specific error number.
    If use the generic error number, it can debug more easier.

    Signed-off-by: Jaehoon Chung
    Reviewed-by: Simon Glass
    Reviewed-by: Minkyu Kang

    Jaehoon Chung
     
  • There is no data, it doesn't needs to wait for completing data transfer.
    (It seems that it can be removed.)
    Almost all timeout error is occured from stop command without data.
    After applied this patch, I hope that we don't need to increase timeout value anymore.

    Signed-off-by: Jaehoon Chung
    Acked-by: Lukasz Majewski
    Tested-by: Lukasz Majewski
    Acked-by: Minkyu Kang

    Jaehoon Chung
     
  • The current timeout detection logic is not very nice; it calls
    get_timer(start) in the while() loop, and then calls it again after
    the loop to check if a timeout error happened.

    Because of the time difference between the two calls of get_timer(),
    the timeout detected after the loop may not be true.

    Signed-off-by: Masahiro Yamada
    Acked-by: Jaehoon Chung
    Signed-off-by: Jaehoon Chung

    Masahiro Yamada
     

22 Jul, 2016

1 commit