aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/xilinx-spi.c
diff options
context:
space:
mode:
authorNathan Barrett-Morrison <[email protected]>2022-11-28 16:41:47 +0000
committerMark Brown <[email protected]>2022-11-29 18:45:32 +0000
commitf8fc65e50ad71c139a12a96e64eeba5005e491d5 (patch)
tree0c050521c861a2170b7e6a56b9b84c779d237da7 /drivers/fpga/xilinx-spi.c
parentspi: microchip: pci1xxxx: Add suspend and resume support for PCI1XXXX SPI driver (diff)
downloadkernel-f8fc65e50ad71c139a12a96e64eeba5005e491d5.tar.gz
kernel-f8fc65e50ad71c139a12a96e64eeba5005e491d5.zip
spi: cadence-quadspi: Add minimum operable clock rate warning to baudrate divisor calculation
This Cadence QSPI IP has a 4-bit clock divisor field for baud rate division. For example: 0b0000 = /2 0b0001 = /4 0b0010 = /6 ... 0b1111 = /32 The maximum divisor is 32 (when div = CQSPI_REG_CONFIG_BAUD_MASK). If we assume a reference clock of 500MHz and we set our spi-max-frequency to something low, such as 10 MHz. The calculated bit field for the divisor ends up being: DIV_ROUND_UP(500000000/(2*10000000))-1 = 25 25 is 0b11001... which truncates to a divisor field of 0b1001 (or /20). This is higher than our anticipated max-frequency of 10MHz (500MHz/20 = 25 MHz). Instead, let's make sure we're always using the maximum divisor (/32) in this case and give the user a warning about the rate adjustment. Signed-off-by: Nathan Barrett-Morrison <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'drivers/fpga/xilinx-spi.c')
0 files changed, 0 insertions, 0 deletions