diff options
author | Valentin Longchamp <valentin.longchamp@keymile.com> | 2012-08-15 05:31:49 +0000 |
---|---|---|
committer | Prafulla Wadaskar <prafulla@marvell.com> | 2012-09-03 17:28:51 +0530 |
commit | 8203b201eaa1b33758956294b3ec70b326f8ba5c (patch) | |
tree | 28a16a951302bfb2adea574bb3d6208899c55cdd /arch/arm/include/asm/arch-kirkwood/spi.h | |
parent | f46b4a1aadb4ab834bcf333a9dd4c7804296e185 (diff) |
kw_spi: fix clock prescaler computation
The computation was not correct with low clock values: setting a 1MHz
clock would result in an overlap that would then configure a 25Mhz
clock.
This patch implements a correct computation method according to the
kirkwood functionnal spec. table 600 (Serial Memory Interface
Configuration Register).
Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
cc: Holger Brunck <holger.brunck@keymile.com>
cc: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Prafulla Wadaskar <Prafulla@marvell.com>
Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
Diffstat (limited to 'arch/arm/include/asm/arch-kirkwood/spi.h')
-rw-r--r-- | arch/arm/include/asm/arch-kirkwood/spi.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-kirkwood/spi.h b/arch/arm/include/asm/arch-kirkwood/spi.h index c79bed7ed9..113f258756 100644 --- a/arch/arm/include/asm/arch-kirkwood/spi.h +++ b/arch/arm/include/asm/arch-kirkwood/spi.h @@ -49,6 +49,7 @@ struct kwspi_registers { #define MISO_MPP11 (1 << 2) #define KWSPI_CLKPRESCL_MASK 0x1f +#define KWSPI_CLKPRESCL_MIN 0x12 #define KWSPI_CSN_ACT 1 /* Activates serial memory interface */ #define KWSPI_SMEMRDY (1 << 1) /* SerMem Data xfer ready */ #define KWSPI_IRQUNMASK 1 /* unmask SPI interrupt */ |