[U-Boot] [PATCH v2] dm: spi: prevent setting a speed of 0 Hz

Jagan Teki jagan at amarulasolutions.com
Wed Oct 31 06:22:01 UTC 2018


On Wed, Oct 31, 2018 at 1:40 AM Simon Goldschmidt
<simon.k.r.goldschmidt at 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)


More information about the U-Boot mailing list