Files
u-boot/drivers
Andre Przywara fcd6d936aa spi: sunxi: improve SPI clock calculation
The current SPI clock divider calculation has two problems:
- We use a normal round-down division, which results in a divider
  typically being too small, resulting in a too high frequency on the bus.
- The calculaction for the power-of-two divider is very inaccurate, and
  again rounds down, which might lead to wild bus frequencies.

This wasn't a real problem so far, since most chips can handle slightly
higher bus frequencies just fine. Also the actual speed was mostly lost
anyway, due to release_bus() reseting the device. And the power-of-2
calculation was probably never used, because it only applies to
frequencies below 47 KHz.
However this will become a problem for the F1C100s support, due to its
much higher base frequency.

Calculate a safe divider correctly (using round-up), and re-use that
value when calculating the power-of-2 value. We also separate the
maximum frequency and the input clock on the way, since they will be
different for the F1C100s.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
2022-07-18 11:27:59 +01:00
..
2022-04-25 09:25:00 +02:00
2022-06-24 14:16:00 +02:00
2022-07-11 14:58:57 -04:00
2022-01-13 07:57:49 -05:00
2022-01-13 07:57:49 -05:00
2022-07-11 14:58:57 -04:00
2022-06-08 14:00:22 -04:00
2022-05-03 21:39:22 +02:00
2022-07-11 14:58:57 -04:00