summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common/emi.c
blob: a8163cb14d48e35f2a095769251fea3e4362dfbf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/* SPDX-License-Identifier: GPL-2.0-only */

#include <assert.h>
#include <cbmem.h>
#include <commonlib/bsd/mem_chip_info.h>
#include <soc/emi.h>

size_t sdram_size(void)
{
	const struct mem_chip_info *mc;
	size_t size = 0;

	if (ENV_RAMINIT) {
		size = mtk_dram_size();
		printk(BIOS_INFO, "dram size (romstage): %#lx\n", size);
		return size;
	}

	mc = cbmem_find(CBMEM_ID_MEM_CHIP_INFO);
	assert(mc);

	size = mem_chip_info_total_density_bytes(mc);

	printk(BIOS_INFO, "dram size: %#lx\n", size);
	return size;
}

void mt_set_emi(struct dramc_param *dparam)
{
	/* Do nothing */
}