spi: kirkwood: support extended baud rates
authorKen Ma <make@marvell.com>
Fri, 30 Apr 2021 13:26:29 +0000 (15:26 +0200)
committerStefan Roese <sr@denx.de>
Sun, 16 May 2021 04:48:45 +0000 (06:48 +0200)
commit037818c544c44b31dd532409e3abc3747e24a60d
treeb09273e05b6a8918be77507c4af4d3d5b03cbc73
parent76a516452b38c4f1542db382ebaf05054797100c
spi: kirkwood: support extended baud rates

The Armada SoC family implementation of this SPI hardware module has
extended the configuration register to allow for a wider range of SPI
clock rates. Specifically the Serial Baud Rate Pre-selection bits in the
SPI Interface Configuration Register now also use bits 6 and 7 as well.

Modify the baud rate calculation to handle these differences for the
Armada case. Potentially a baud rate can be setup using a number of
different pre-scalar and scalar combinations. This code tries all
possible pre-scalar divisors (8 in total) to try and find the most
accurate set.

Signed-off-by: Ken Ma <make@marvell.com>
Signed-off-by: Stefan Roese <sr@denx.de>
drivers/spi/kirkwood_spi.c