Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / mach-uniphier / dram / umc-sld8.c
index e83176658364f5c470b10c73d16d4989ac036ee8..a11586952d84b535c6ce97d359cb4e8bc6c5dc64 100644 (file)
@@ -1,17 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
- * Copyright (C) 2011-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
+ * Copyright (C) 2011-2014 Panasonic Corporation
+ * Copyright (C) 2015-2016 Socionext Inc.
+ *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
-#include <linux/err.h>
+#include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
 #include <asm/processor.h>
 
 #include "../init.h"
-#include "ddrphy-regs.h"
+#include "ddrphy-init.h"
 #include "umc-regs.h"
 
 #define DRAM_CH_NR     2
@@ -150,7 +150,7 @@ static int umc_ch_init(void __iomem *dc_base, void __iomem *ca_base,
        int ret;
 
        writel(UMC_INITSET_INIT1EN, dc_base + UMC_INITSET);
-       while (readl(dc_base + UMC_INITSET) & UMC_INITSTAT_INIT1ST)
+       while (readl(dc_base + UMC_INITSTAT) & UMC_INITSTAT_INIT1ST)
                cpu_relax();
 
        writel(0x00000101, dc_base + UMC_DIOCTLA);
@@ -178,7 +178,7 @@ int uniphier_sld8_umc_init(const struct uniphier_board_data *bd)
        for (ch = 0; ch < DRAM_CH_NR; ch++) {
                ret = umc_ch_init(dc_base, ca_base, bd->dram_freq,
                                  bd->dram_ch[ch].size,
-                                 bd->dram_ddr3plus, ch);
+                                 !!(bd->flags & UNIPHIER_BD_DDR3PLUS), ch);
                if (ret) {
                        pr_err("failed to initialize UMC ch%d\n", ch);
                        return ret;