summaryrefslogtreecommitdiff
path: root/drivers/spi
diff options
context:
space:
mode:
authorStefan Mätje <stefan.maetje@esd.eu>2021-11-30 03:06:56 +0300
committerTom Rini <trini@konsulko.com>2022-01-16 16:31:03 +0300
commita6e562fe36b2bae780589a81a11fceb6e1b4a9f7 (patch)
treeec452c000cdc36d7e3fcf0acc3b0e998e9e5b2d2 /drivers/spi
parent5ce7df1078a506f01d63d821b6531fac86e079b9 (diff)
downloadu-boot-a6e562fe36b2bae780589a81a11fceb6e1b4a9f7.tar.xz
Fix wrong QSPI clock calculation for AM4372
On AM4372 the SPI_GCLK input gets its clock from the PRCM module which divides the PER_CLKOUTM2 frequency (192MHz) by a fixed factor of 4. See AM437x Reference Manual in section 27 QSPI >> 27.2 Integration. The QSPI_FCLK therefore needs to take this factor into account and becomes (192000000 / 4). Signed-off-by: Stefan Mätje <stefan.maetje@esd.eu>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/ti_qspi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c
index c542f40c7d..99acb10882 100644
--- a/drivers/spi/ti_qspi.c
+++ b/drivers/spi/ti_qspi.c
@@ -30,7 +30,8 @@ DECLARE_GLOBAL_DATA_PTR;
/* ti qpsi register bit masks */
#define QSPI_TIMEOUT 2000000
-#define QSPI_FCLK 192000000
+/* AM4372: QSPI gets SPI_GCLK from PRCM unit as PER_CLKOUTM2 divided by 4. */
+#define QSPI_FCLK (192000000 / 4)
#define QSPI_DRA7XX_FCLK 76800000
#define QSPI_WLEN_MAX_BITS 128
#define QSPI_WLEN_MAX_BYTES (QSPI_WLEN_MAX_BITS >> 3)