]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spi: zynq_qspi: Fix BAUD_RATE_DIV calculation
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Fri, 28 Mar 2014 06:55:57 +0000 (12:25 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 28 Mar 2014 07:54:54 +0000 (08:54 +0100)
Correct the baud rate divisor calculation by looping
until baud_rate_val < 7 instead of 8 as 8 is an invalid
baud rate divisor.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/spi/zynq_qspi.c

index 6a30c4a685cb85d652104e3512c64667aca7b75b..2332f23476d46133b63f79b70154b88ecb645d4e 100644 (file)
@@ -458,7 +458,7 @@ static int zynq_qspi_setup_transfer(struct spi_device *qspi,
        /* Set the clock frequency */
        if (zqspi->speed_hz != req_hz) {
                baud_rate_val = 0;
-               while ((baud_rate_val < 8) &&
+               while ((baud_rate_val < 7) &&
                        (zqspi->input_clk_hz / (2 << baud_rate_val)) > req_hz) {
                                baud_rate_val++;
                }