1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
3 #include <console/console.h>
7 size_t sdram_size(void)
10 u64 rank_size
[RANK_MAX
];
11 static size_t dram_size
= 0;
16 get_rank_size_by_emi(rank_size
);
17 rank_num
= get_rank_nr_by_emi();
19 for (int i
= 0; i
< rank_num
; i
++)
20 dram_size
+= rank_size
[i
];
22 printk(BIOS_INFO
, "dram size = %#lx\n", dram_size
);