Merge branch '2019-05-28-master-imports'
[oweals/u-boot.git] / arch / arm / mach-sunxi / dram_sunxi_dw.c
index bd606ccc659f2491b70f1d10dc60021bc9846071..85e7a1874e1bea206d5b39d676101547e21e8837 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * sun8i H3 platform dram controller init
  *
@@ -6,8 +7,6 @@
  * (C) Copyright 2015      Vishnu Patekar <vishnupatekar0510@gmail.com>
  * (C) Copyright 2015      Hans de Goede <hdegoede@redhat.com>
  * (C) Copyright 2015      Jens Kuske <jenskuske@gmail.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
 #include <asm/io.h>
@@ -340,6 +339,10 @@ static void mctl_set_cr(uint16_t socid, struct dram_para *para)
        writel(MCTL_CR_BL8 | MCTL_CR_INTERLEAVED |
 #if defined CONFIG_SUNXI_DRAM_DDR3
               MCTL_CR_DDR3 | MCTL_CR_2T |
+#elif defined CONFIG_SUNXI_DRAM_DDR2
+              MCTL_CR_DDR2 | MCTL_CR_2T |
+#elif defined CONFIG_SUNXI_DRAM_LPDDR3
+              MCTL_CR_LPDDR3 | MCTL_CR_1T |
 #else
 #error Unsupported DRAM type!
 #endif
@@ -721,6 +724,9 @@ unsigned long sunxi_dram_init(void)
        uint16_t socid = SOCID_R40;
        /* Currently we cannot support R40 with dual rank memory */
        para.dual_rank = 0;
+#elif defined(CONFIG_MACH_SUN8I_V3S)
+       /* TODO: set delays and mbus priority for V3s */
+       uint16_t socid = SOCID_H3;
 #elif defined(CONFIG_MACH_SUN50I)
        uint16_t socid = SOCID_A64;
 #elif defined(CONFIG_MACH_SUN50I_H5)