Files
u-boot/drivers
Brandon Maier d9aa19efa8 spi: zynqmp_gqspi: fix set_speed bug on multiple runs
If zynqmp_qspi_set_speed() is called multiple times with the same speed,
then on the second call it will skip recalculating the baud_rate_val as
it assumes the speed is already configured correctly. But it will still
write the baud_rate_val to the configuration register and call
zynqmp_gqspi_set_tapdelay(). Because it skipped recalculating the
baud_rate_val, it will use the initial value of 0 . This causes the
driver to run at maximum speed which for many spi flashes is too fast and
causes data corruption.

Instead only write out a new baud_rate_val if we have calculated the
correct baud_rate_val.

This opens up another issue with the "if (speed == 0)", we don't save
off the new plat->speed_hz value when setting the baud rate on the
speed=0 path. Instead mimic what the Linux zynqmp gqspi driver does, and
have speed==0 just use the same calculation as a normal speed. That will
cause the baud_rate_val to use the slowest speed possible, which is the
safest option.

Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
CC: jagan@amarulasolutions.com
CC: michal.simek@xilinx.com
CC: Ashok Reddy Soma <ashokred@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2021-02-23 14:56:59 +01:00
..
2021-01-31 23:55:56 +00:00
2021-01-31 14:08:56 +01:00
2021-02-23 14:56:55 +01:00
2021-02-23 14:56:59 +01:00
2021-01-30 14:25:41 -07:00
2021-01-18 15:23:06 -05:00
2021-01-05 16:20:26 -05:00
2021-01-25 21:52:01 +00:00
2021-01-18 15:23:06 -05:00
2020-12-18 20:32:21 -07:00
2021-01-23 11:30:31 +01:00
2020-11-06 10:18:20 +08:00