| 1 |
|
| 2 |
|
| 3 |
#include <assert.h> |
| 4 |
#include <cbmem.h> |
| 5 |
#include <commonlib/bsd/mem_chip_info.h> |
| 6 |
#include <soc/emi.h> |
| 7 |
|
| 8 |
size_t sdram_size(void) |
| 9 |
{ |
| 10 |
const struct mem_chip_info *mc; |
| 11 |
size_t size = 0; |
| 12 |
|
| 13 |
if (ENV_RAMINIT) { |
| 14 |
size = mtk_dram_size(); |
| 15 |
printk(BIOS_INFO, "dram size (romstage): %#lx\n", size); |
| 16 |
return size; |
| 17 |
} |
| 18 |
|
| 19 |
mc = cbmem_find(CBMEM_ID_MEM_CHIP_INFO); |
| 20 |
assert(mc); |
| 21 |
|
| 22 |
size = mem_chip_info_total_density_bytes(mc); |
| 23 |
|
| 24 |
printk(BIOS_INFO, "dram size: %#lx\n", size); |
| 25 |
return size; |
| 26 |
} |
| 27 |
|
| 28 |
void mt_set_emi(struct dramc_param *dparam) |
| 29 |
{ |
| 30 |
|
| 31 |
} |