Ensuring spi_calibration is run when there is a change of sclk
frequency. This will ensure the qspi flash access works for high
sclk frequency

Signed-off-by: Chin Liang See <[email protected]>
Cc: Dinh Nguyen <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Stefan Roese <[email protected]>
Cc: Vikas Manocha <[email protected]>
Cc: Jagannadh Teki <[email protected]>
Cc: Pavel Machek <[email protected]>
---
 drivers/spi/cadence_qspi.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c
index 34a0f46..512bf2d 100644
--- a/drivers/spi/cadence_qspi.c
+++ b/drivers/spi/cadence_qspi.c
@@ -128,6 +128,9 @@ static int cadence_spi_set_speed(struct udevice *bus, uint 
hz)
 
        cadence_spi_write_speed(bus, hz);
 
+       /* to ensure spi_calibration is run when SCLK frequency change */
+       plat->max_hz = hz;
+
        /* Calibration required for different SCLK speed or chip select */
        if (priv->qspi_calibrated_hz != plat->max_hz ||
            priv->qspi_calibrated_cs != spi_chip_select(bus)) {
-- 
1.7.7.4

_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to