mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-27 23:20:26 +09:00
spi: kirkwood: prevent limiting speed to 0
After commit 1fe929ed497bcc8975be8d37383ebafd22b99dd2 ("spi: kirkwood: prevent configuring speed exceeding max controller freq") the spi frequency could be set to 0 on platform where spi-max-frequency is not defined (e.g. on armada-388-gp). Prevent limiting speed in mentioned cases. Signed-off-by: Grzegorz Jaszczyk <jaz@semihalf.com> Tested-by: Kostya Porotchkin <kostap@marvell.com> Reviewed-by: Marcin Wojtas <marcin@marvell.com> Reviewed-by: Kostya Porotchkin <kostap@marvell.com> Signed-off-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
562f8d5b36
commit
9c84159ce1
@ -115,7 +115,7 @@ static int mvebu_spi_set_speed(struct udevice *bus, uint hz)
|
|||||||
u32 data, divider;
|
u32 data, divider;
|
||||||
unsigned int spr, sppr;
|
unsigned int spr, sppr;
|
||||||
|
|
||||||
if (hz > spi->max_hz) {
|
if (spi->max_hz && (hz > spi->max_hz)) {
|
||||||
debug("%s: limit speed to the max_hz of the bus %d\n",
|
debug("%s: limit speed to the max_hz of the bus %d\n",
|
||||||
__func__, spi->max_hz);
|
__func__, spi->max_hz);
|
||||||
hz = spi->max_hz;
|
hz = spi->max_hz;
|
||||||
|
Loading…
Reference in New Issue
Block a user