& QCA_RST_BOOTSTRAP_MEM_TYPE_MASK)
>> QCA_RST_BOOTSTRAP_MEM_TYPE_SHIFT);
+/*
+ * There are two major different versions of Dragino 2. Initial one uses DDR1
+ * and a custom PCB. The new one is based on Dragino HE module which has DDR2.
+ *
+ * Both versions have a "bug" in DRAM type detection. They don't use both GPIOs
+ * (12 and 28) for setting DRAM type during bootstrap - only GPIO28 is used.
+ *
+ * Therefore, use a custom DRAM type detection here (ignore LSB bit)
+ */
+#if defined(CONFIG_FOR_DRAGINO_V2) || defined(CONFIG_FOR_MESH_POTATO_V2)
+ dram_type = dram_type >> 1;
+
+ if (dram_type)
+ dram_type = RAM_MEMORY_TYPE_DDR2;
+ else
+ dram_type = RAM_MEMORY_TYPE_DDR1;
+#else
switch (dram_type) {
case QCA_RST_BOOTSTRAP_MEM_TYPE_SDR_VAL:
dram_type = RAM_MEMORY_TYPE_SDR;
dram_type = RAM_MEMORY_TYPE_UNKNOWN;
break;
}
+#endif
return dram_type;
#endif