• Douglas Anderson's avatar
    phy: rockchip-emmc: Increase lock time allowance · 49f9ccd8
    Douglas Anderson authored
    Previous PHY code waited a fixed amount of time for the DLL to lock at
    power on time.  Unfortunately, the time for the DLL to lock is actually
    a bit more dynamic and can be longer if the card clock is slower.
    
    Instead of waiting a fixed 30 us, let's now dynamically wait until the
    lock bit gets set.  We'll wait up to 10 ms which should be OK even if
    the card clock is at the super slow 100 kHz.
    
    On its own, this change makes the PHY power on code a little more
    robust.  Before this change the PHY was relying on the eMMC code to make
    sure the PHY was only powered on when the card clock was set to at least
    50 MHz before, though this reliance wasn't documented anywhere.
    
    This change will be even more useful in future changes where we actually
    need to be able to wait for a DLL lock at slower clock speeds.
    Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
    Acked-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
    Reviewed-by: default avatarShawn Lin <shawn.lin@rock-chips.com>
    Tested-by: default avatarHeiko Stuebner <heiko@sntech.de>
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    49f9ccd8
phy-rockchip-emmc.c 8.01 KB