]> Git Repo - u-boot.git/blobdiff - drivers/spi/ti_qspi.c
Merge patch series "*** Commonize board code for K3 based SoMs ***"
[u-boot.git] / drivers / spi / ti_qspi.c
index 7c3b1f7b88e1ebafc7861edc24442179e090c592..a16412ec6fb9f5b39dd6252b17648efea2774405 100644 (file)
@@ -5,10 +5,10 @@
  * Copyright (C) 2013, Texas Instruments, Incorporated
  */
 
-#include <common.h>
 #include <cpu_func.h>
 #include <log.h>
 #include <asm/cache.h>
+#include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/arch/omap.h>
 #include <malloc.h>
@@ -29,7 +29,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)
@@ -467,8 +468,8 @@ static int ti_qspi_of_to_plat(struct udevice *bus)
        priv->memory_map = map_physmem(mmap_addr, mmap_size, MAP_NOCACHE);
        priv->mmap_size = mmap_size;
 
-       priv->max_hz = fdtdec_get_int(blob, node, "spi-max-frequency", -1);
-       if (priv->max_hz < 0) {
+       priv->max_hz = dev_read_u32_default(bus, "spi-max-frequency", 0);
+       if (!priv->max_hz) {
                debug("Error: Max frequency missing\n");
                return -ENODEV;
        }
This page took 0.032298 seconds and 4 git commands to generate.