
31 Oct
2018
31 Oct
'18
7:22 a.m.
On Wed, Oct 31, 2018 at 1:40 AM Simon Goldschmidt simon.k.r.goldschmidt@gmail.com wrote:
When the device tree is missing a correct spi slave description below the bus (compatible "spi-flash" or spi-max-frequency are missing), the 'set_speed' callback can be called with 'speed' == 0 Hz. At least with cadence qspi, this leads to a division by zero.
Prevent this by initializing speed to 100 kHz in this case (same fallback value as is done in 'dm_spi_claim_bus') and issue a warning to console.
Why can't driver plat->frequency in cadence driver initialize 100KH? plat->frequency = fdtdec_get_int(blob, node, "spi-max-frequency", 100000)