05 Nov, 2019

2 commits


12 Sep, 2019

1 commit


23 Jun, 2019

1 commit


26 Jan, 2019

1 commit


07 May, 2018

1 commit

  • When U-Boot started using SPDX tags we were among the early adopters and
    there weren't a lot of other examples to borrow from. So we picked the
    area of the file that usually had a full license text and replaced it
    with an appropriate SPDX-License-Identifier: entry. Since then, the
    Linux Kernel has adopted SPDX tags and they place it as the very first
    line in a file (except where shebangs are used, then it's second line)
    and with slightly different comment styles than us.

    In part due to community overlap, in part due to better tag visibility
    and in part for other minor reasons, switch over to that style.

    This commit changes all instances where we have a single declared
    license in the tag as both the before and after are identical in tag
    contents. There's also a few places where I found we did not have a tag
    and have introduced one.

    Signed-off-by: Tom Rini

    Tom Rini
     

04 Feb, 2018

1 commit

  • Introduce SDR104 and HS200 support
    The implementation takes linux kernel sdhci.c and sdhci-esdhc-imx.c
    as reference.
    - Implement esdhc_change_pinstate to dynamically change pad settings
    - Implement esdhc_set_timing
    - Implement esdhc_set_voltage to switch voltage
    - Implement fsl_esdhc_execute_tuning to execute time process
    - Enlarge the cfg->f_max to 200MHz.
    - Parse fsl,tuning-step, fsl,tuning-start-tap and
    fsl,strobe-dll-delay-target from device tree.
    - Parse no-1-8-v property
    - Introduce esdhc_soc_data to indicate the flags and caps

    Signed-off-by: Peng Fan
    Cc: Stefano Babic
    Cc: Fabio Estevam
    Cc: Jaehoon Chung
    Reviewed-by: Jaehoon Chung

    Peng Fan
     

07 Nov, 2017

1 commit

  • The following error has been observed on i.MX25 with a high-speed SDSC
    card:
    Data Write Failed in PIO Mode.

    It was caused by the timeout set on PRSSTAT.BWEN, which was triggered
    because this bit takes 15 ms to be set after writing the first block to
    DATPORT with this card. Without this timeout, all the blocks are
    properly written.

    This timeout was implemented by decrementing a variable, so it was
    depending on the CPU frequency. Fix this issue by setting this timeout
    to a long enough absolute duration (500 ms).

    Signed-off-by: Benoît Thébaudeau
    Cc: Stefano Babic
    Cc: Fabio Estevam
    Cc: Jaehoon Chung
    Reviewed-by: Fabio Estevam
    Reviewed-by: Jagan Teki

    Benoît Thébaudeau
     

12 Jul, 2017

2 commits

  • When using eMMC with 1.8V I/O, the VSELECT bit need to be set in
    the USDHC controller when init.

    This patch adds a parameter "vs18_enable" in fsl_esdhc_cfg
    structure and priv data, so each controller can have different
    settings.

    We could not use CONFIG_SYS_FSL_ESDHC_FORCE_VSELECT, it has problem
    that it will apply to all USDHC controllers and it only set the 1.8V
    at init phase. So if user does not select to the eMMC device,
    the voltage on the I/O pins are not correct.

    Signed-off-by: Peng Fan
    Cc: Jaehoon Chung
    Cc: York Sun
    Cc: Stefano Babic

    Peng Fan
     
  • The type should be int, not u8. cfg->wp_enable will finally be
    assigned to priv->wp_enable whose type is int.

    Signed-off-by: Peng Fan

    Peng Fan
     

24 Sep, 2016

1 commit


29 Jun, 2016

2 commits

  • Introudce wp_enable. To check WPSPL, wp_enable needs to be set
    to 1 in board code.

    Take i.MX6UL for example, for some boards, they do not use WP singal,
    so they does not configure USDHC1_WP_SELECT_INPUT, and its default
    value is 0(GPIO1_IO02). However GPIO1_IO02 is muxed for i2c usage and
    SION bit set. So USDHC controller can always get wp signal and WPSPL
    shows write protect and blocks driver continuing. This is not what
    we want to see, so add wp_enable, and if set to 0, just omit the
    WPSPL checking and this does not effect normal working of usdhc
    controller.

    If wp-gpios is provided in dts, wp_enable is set to 1, otherwise 0.

    Signed-off-by: Peng Fan
    Cc: Pantelis Antoniou
    Cc: York Sun
    Cc: Stefano Babic
    Cc: Fabio Estevam
    Tested-by: Fabio Estevam
    Reviewed-by: York Sun

    Peng Fan
     
  • When booting in eMMC fast boot, MMC host does not exit from
    boot mode after bootrom loading image. So the first command
    'CMD0' sent in uboot will pull down the CMD line to low and
    cause errors.

    This patch cleans the MMC boot register in "mmc_init" to put the
    MMC host back to normal mode.

    Also clear DLL_CTRL delay line settings at USDHC initialization
    to eliminate the pre-settings from boot rom.

    Signed-off-by: Peng Fan
    Cc: Pantelis Antoniou
    Cc: York Sun
    Cc: Stefano Babic
    Cc: Fabio Estevam
    Tested-by: Fabio Estevam
    Reviewed-by: York Sun

    Peng Fan
     

06 Apr, 2016

1 commit


03 Jan, 2016

1 commit

  • The low four bits of the SYSCTL register are reserved on the USDHC
    controller on i.MX6 and i.MX7 processors, but are used for clocking
    operations on earlier models.

    Guard against their usage by hiding the bit mask macros on those
    processors.

    These bits are used to prevent glitches when changing clocks on
    i.MX35 et al. Use the RSTA bit instead for i.MX6 and i.MX7.

    >From the i.MX6DQ RM:
    To prevent possible glitch on the card clock, clear the
    FRC_SDCLK_ON bit when changing clock divisor value(SDCLKFS
    or DVS in System Control Register) or setting RSTA bit.

    Signed-off-by: Eric Nelson
    Reviewed-by: Fabio Estevam
    Reviewed-by: Stefano Babic
    Reviewed-by: Hector Palacios

    Eric Nelson
     

30 Oct, 2015

1 commit


05 May, 2015

2 commits

  • The SD clock could be generated by platform clock or peripheral
    clock for some platforms. This patch adds peripheral clock
    support for T1024/T1040/T2080. To enable it, define
    CONFIG_FSL_ESDHC_USE_PERIPHERAL_CLK.

    Signed-off-by: Yangbo Lu
    Cc: York Sun
    Cc: Pantelis Antoniou
    Reviewed-by: York Sun

    Yangbo Lu
     
  • Add adapter card type identification support by reading
    FPGA STAT_PRES1 register SDHC Card ID[0:2] bits. To use this function,
    define CONFIG_FSL_ESDHC_ADAPTER_IDENT.

    Signed-off-by: Yangbo Lu
    Cc: York Sun
    Cc: Pantelis Antoniou
    [York Sun: resolve conflicts in README.fsl-esdhc]
    Reviewed-by: York Sun

    Yangbo Lu
     

24 Apr, 2015

1 commit


02 Mar, 2015

1 commit


25 Feb, 2015

1 commit


23 Feb, 2015

1 commit


09 Sep, 2014

1 commit


23 Apr, 2014

1 commit


24 Mar, 2014

1 commit

  • 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
     

21 Aug, 2013

1 commit

  • The code from the internal on-chip ROM. It loads the final uboot image
    into DDR, then jump to it to begin execution.

    The SPL's size is sizeable, the maximum size must not exceed the size of L2
    SRAM. It initializes the DDR through SPD code, and copys final uboot image
    to DDR. So there are two stage uboot images:
    * spl_boot, 96KB size. The env variables are copied to L2 SRAM, so that
    ddr spd code can get the interleaving mode setting in env. It loads
    final uboot image from offset 96KB.
    * final uboot image, size is variable depends on the functions enabled.

    Signed-off-by: Ying Zhang
    Acked-by: York Sun

    Ying Zhang
     

24 Jul, 2013

1 commit


14 Apr, 2013

1 commit

  • Rework the waiting for transfer completion loop condition
    to continue waiting until both Transfer Complete and DMA End
    interrupts occur. Checking of DLA bit in Present State register
    looks not needed in addition to interrupts status checking,
    so it can be removed from the condition. Also, DMA Error
    condition is added to the list of data errors, checked in the loop.

    Signed-off-by: Andrew Gabbasov

    Andrew Gabbasov
     

03 Apr, 2013

1 commit

  • Maximum bus width supported by some i.MX6 boards is not 8bit like
    others. In case where both host controller and card support 8bit transfers,
    they agree to communicate on 8bit interface while some boards support only 4bit interface.
    Due to this reason the mmc 8bit default mode fails on these boards. To rectify this,
    define maximum bus width supported by these boards (4bit). If max_bus_width is not
    defined, it is 0 by default and 8bit width support will be enabled in host
    capabilities otherwise host capabilities are modified accordingly.

    It is tested with a MMCplus card.

    Signed-off-by: Abbas Raza
    cc: stefano Babic
    cc: Andy Fleming
    Acked-by: Dirk Behme
    Acked-by: Andrew Gabbasov

    Abbas Raza
     

16 Oct, 2012

1 commit

  • On mxc, each SDHC instance has a dedicated clock, so gd->sdhc_clk is not
    suitable for the multi-instance use case (initialization made directly with
    fsl_esdhc_initialize()).

    This patch fixes this issue by adding a configuration field for the SDHC input
    clock frequency.

    Signed-off-by: Benoît Thébaudeau
    Cc: Stefano Babic
    Cc: Eric Bénard
    Cc: Otavio Salvador
    Cc: Fabio Estevam
    Cc: Jason Liu
    Cc: Matt Sealey
    Cc: Andy Fleming

    Benoît Thébaudeau
     

01 Sep, 2012

1 commit

  • The cache snooping feature of Freescale's eSDHC IP is not available on i.MX, so
    disable it globally for this architecture. This avoids setting no_snoop for all
    i.MX boards, and it prevents setting a reserved bit of a reserved register if
    fsl_esdhc_mmc_init() is used on i.MX, like in
    arch/arm/cpu/armv7/imx-common/cpu.c/cpu_mmc_init().

    Since no_snoop was only used on i.MX, get rid of it BTW.

    Signed-off-by: Benoît Thébaudeau
    Cc: Andy Fleming
    Cc: Stefano Babic
    Cc: Kim Phillips

    Benoît Thébaudeau
     

09 May, 2012

1 commit

  • This patch imports parts of two patches from the Freescale U-Boot with the following
    commit messages:

    ENGR00156405 ESDHC: Add workaround for auto-clock gate errata ENGcm03648
    http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/commit/drivers/mmc/imx_esdhc.c?h=imx_v2009.08_12.01.01&id=e436525a70fe47623d346bc7d9f08f12ff8ad787
    The errata, not applicable to USDHC, causes ESDHC to shut off clock to the card
    when auto-clock gating is enabled for commands with busy signalling and no data
    phase. The card might require the clock to exit the busy state, so the workaround
    is to disable the auto-clock gate bits in SYSCTL register for such commands. The
    workaround also entails polling on DAT0 bit in the PRSSTAT register to learn when
    busy state is complete. Auto-clock gating is re-enabled at the end of busy state.

    ENGR00156670-1 ESDHC/USDHC: Remove delay before each cmd and some bug fixes
    http://git.freescale.com/git/cgit.cgi/imx/uboot-imx.git/commit/drivers/mmc/imx_esdhc.c?h=imx_v2009.08_12.01.01&id=a77c6fec8596891be96b2cdbc742c9824844b92a
    Removed delay of 10 ms before each command. There should not be a need to have this
    delay after the ENGR00156405 patch that polls until card is not busy anymore before
    proceeding to next cmd.

    This patch imports the polling part of both patches. The auto-clock gating code
    don't apply for i.MX6 as implemented in these two patches.

    SYSCTL_RSTA was defined twice. Remove one definition.

    Signed-off-by: Dirk Behme
    CC: Andy Fleming
    CC: Fabio Estevam
    CC: Stefano Babic

    Dirk Behme
     

11 Apr, 2011

1 commit

  • P1010 and P1014 has v2.3 version of FSL eSDHC controller in which watermark
    level register description has been changed:

    9-15 bits represent WR_WML[0:6], Max value = 128 represented by 0x00
    25-31 bits represent RD_WML[0:6], Max value = 128 represented by 0x00

    Signed-off-by: Priyanka Jain
    Signed-off-by: Poonam Aggrwal
    Tested-by: Stefano Babic
    Signed-off-by: Kumar Gala

    Priyanka Jain
     

24 Apr, 2010

1 commit


07 Apr, 2010

3 commits


08 Mar, 2010

1 commit


26 Jan, 2010

1 commit


17 Jul, 2009

1 commit

  • This patch implements fdt_fixup_esdhc() function that is used to fixup
    the device tree.

    The function adds status = "disabled" propery if esdhc pins muxed away,
    otherwise it fixups clock-frequency for esdhc nodes.

    Signed-off-by: Anton Vorontsov
    Acked-by: Kim Phillips

    Anton Vorontsov