spi: zynqmp_gqspi: Fix tap delay values at 100MHz and 150MHz
authorSiva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Thu, 7 Mar 2019 10:38:48 +0000 (16:08 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 16 Apr 2019 09:51:34 +0000 (11:51 +0200)
This patch fixes the tap delay values to be set at 100MHz and 150MHz
as per TRM by fixing the if condition to use <= instead of <.

Signed-off-by: Siva Durga Prasad Paladugu <siva.durga.paladugu@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/spi/zynqmp_gqspi.c

index da9413c066159763f82d0312c7542bdca74c5cd5..04ea42cbccc40f96df2782cc29c594fcf6485894 100644 (file)
@@ -267,7 +267,7 @@ void zynqmp_qspi_set_tapdelay(struct udevice *bus, u32 baudrateval)
                zynqmp_mmio_read(IOU_TAPDLY_BYPASS_OFST, &tapdlybypass);
                tapdlybypass |= (TAP_DLY_BYPASS_LQSPI_RX_VALUE <<
                                TAP_DLY_BYPASS_LQSPI_RX_SHIFT);
-       } else if (reqhz < GQSPI_FREQ_100MHZ) {
+       } else if (reqhz <= GQSPI_FREQ_100MHZ) {
                zynqmp_mmio_read(IOU_TAPDLY_BYPASS_OFST, &tapdlybypass);
                tapdlybypass |= (TAP_DLY_BYPASS_LQSPI_RX_VALUE <<
                                TAP_DLY_BYPASS_LQSPI_RX_SHIFT);
@@ -277,7 +277,7 @@ void zynqmp_qspi_set_tapdelay(struct udevice *bus, u32 baudrateval)
                datadlyadj |= ((GQSPI_USE_DATA_DLY << GQSPI_USE_DATA_DLY_SHIFT)
                                | (GQSPI_DATA_DLY_ADJ_VALUE <<
                                        GQSPI_DATA_DLY_ADJ_SHIFT));
-       } else if (reqhz < GQSPI_FREQ_150MHZ) {
+       } else if (reqhz <= GQSPI_FREQ_150MHZ) {
                lpbkdlyadj = readl(&regs->lpbkdly);
                lpbkdlyadj |= ((GQSPI_LPBK_DLY_ADJ_LPBK_MASK) |
                                GQSPI_LPBK_DLY_ADJ_DLY_0);