diff options
author | Ashok Reddy Soma <ashok.reddy.soma@xilinx.com> | 2021-07-09 05:53:42 -0600 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2021-07-26 09:18:45 +0200 |
commit | a70bdafd67afa8d5a5ec73280c74a51a03640b66 (patch) | |
tree | d91df2341052d2606051231f175326cce6830304 /drivers/mmc | |
parent | ee9ae005dc4cbd0a9a792c0b78385055f18b9a8a (diff) | |
download | u-boot-a70bdafd67afa8d5a5ec73280c74a51a03640b66.zip u-boot-a70bdafd67afa8d5a5ec73280c74a51a03640b66.tar.gz u-boot-a70bdafd67afa8d5a5ec73280c74a51a03640b66.tar.bz2 |
mmc: zynq_sdhci: Split set_tapdelay function to in and out
Split arasan_zynqmp_set_tapdelay() to handle input and output tapdelays
separately. This is required to handle zero values for ITAP and OTAP
values. If we dont split, we will have to remove the if() in the
function, which makes ITAP values to be overwritten when OTAP values are
called to set and vice-versa.
Restrict tap_delay value calculated to max allowed 8 bits for ITAP and 6
bits for OTAP for ZynqMP.
Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/zynq_sdhci.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/zynq_sdhci.c b/drivers/mmc/zynq_sdhci.c index bf638e9..95d42cc 100644 --- a/drivers/mmc/zynq_sdhci.c +++ b/drivers/mmc/zynq_sdhci.c @@ -226,7 +226,10 @@ static int sdhci_zynqmp_sdcardclk_set_phase(struct sdhci_host *host, tap_delay = (degrees * tap_max) / 360; - arasan_zynqmp_set_tapdelay(priv->deviceid, 0, tap_delay); + /* Limit output tap_delay value to 6 bits */ + tap_delay &= SDHCI_ARASAN_OTAPDLY_SEL_MASK; + + arasan_zynqmp_set_out_tapdelay(priv->deviceid, tap_delay); return 0; } @@ -279,7 +282,10 @@ static int sdhci_zynqmp_sampleclk_set_phase(struct sdhci_host *host, tap_delay = (degrees * tap_max) / 360; - arasan_zynqmp_set_tapdelay(priv->deviceid, tap_delay, 0); + /* Limit input tap_delay value to 8 bits */ + tap_delay &= SDHCI_ARASAN_ITAPDLY_SEL_MASK; + + arasan_zynqmp_set_in_tapdelay(priv->deviceid, tap_delay); return 0; } |