]> git.baikalelectronics.ru Git - uboot.git/commit
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)
commitf0f03f212d564d989bef09a0b43d44ea0f5fe9de
treeb09273e05b6a8918be77507c4af4d3d5b03cbc73
parentc7032453cf27d929b2202c99e49d2f5f31cc5543
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