arm: mvebu: turris_mox: Support 1 GB version of Turris Mox
authorMarek Behún <marek.behun@nic.cz>
Mon, 17 Dec 2018 15:10:09 +0000 (16:10 +0100)
committerStefan Roese <sr@denx.de>
Mon, 21 Jan 2019 10:39:50 +0000 (11:39 +0100)
Use get_ram_size to determine if the RAM size on Turris Mox is 512 MiB
or 1 GiB.

Signed-off-by: Marek Behún <marek.behun@nic.cz>
Signed-off-by: Stefan Roese <sr@denx.de>
arch/arm/mach-mvebu/arm64-common.c
board/CZ.NIC/turris_mox/turris_mox.c

index 47bbf69944ec74996427d8382ac21cd34c076e88..aaf7b7c4472c4f9834dc9957606ff010df82993f 100644 (file)
@@ -84,7 +84,7 @@ static void a8k_dram_init_banksize(void)
        }
 }
 
-int dram_init_banksize(void)
+__weak int dram_init_banksize(void)
 {
        if (CONFIG_IS_ENABLED(ARMADA_8K))
                a8k_dram_init_banksize();
@@ -94,7 +94,7 @@ int dram_init_banksize(void)
        return 0;
 }
 
-int dram_init(void)
+__weak int dram_init(void)
 {
        if (CONFIG_IS_ENABLED(ARMADA_8K)) {
                gd->ram_size = a8k_dram_scan_ap_sz();
index d16d6fd124d90fc56ce5c9a33242103239013e64..65d50a92ddfe7b5a898d3757b8726943653b5488 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
+int dram_init(void)
+{
+       gd->ram_base = 0;
+       gd->ram_size = (phys_size_t)get_ram_size(0, 0x40000000);
+
+       return 0;
+}
+
+int dram_init_banksize(void)
+{
+       gd->bd->bi_dram[0].start = (phys_addr_t)0;
+       gd->bd->bi_dram[0].size = gd->ram_size;
+
+       return 0;
+}
+
 #if defined(CONFIG_OF_BOARD_FIXUP)
 int board_fix_fdt(void *blob)
 {