summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/common
diff options
context:
space:
mode:
authorRex-BC Chen <rex-bc.chen@mediatek.com>2022-08-15 10:17:48 +0800
committerMartin Roth <martin.roth@amd.corp-partner.google.com>2022-08-27 15:59:41 +0000
commitb1c3b9963b5627bab9b05ce0eabc1369afad591d (patch)
tree18818084e706600682a7e3d2a3e5591548c70653 /src/soc/mediatek/common
parentf83b7d494e3ceb6bec11027ae5f21999ee5ad196 (diff)
soc/mediatek: Move emi.c to common folder
The emi.c is the same for MT8186 and MT8188, so we could move it to the common folder and reuse it. TEST=build pass BUG=b:236331724 Signed-off-by: Bo-Chen Chen <rex-bc.chen@mediatek.com> Change-Id: I225f1d07c973129172f01bf7f4d7f5d5abe7c02b Reviewed-on: https://review.coreboot.org/c/coreboot/+/66328 Reviewed-by: Yidi Lin <yidilin@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/mediatek/common')
-rw-r--r--src/soc/mediatek/common/emi.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/soc/mediatek/common/emi.c b/src/soc/mediatek/common/emi.c
new file mode 100644
index 0000000000..d5470d2fd3
--- /dev/null
+++ b/src/soc/mediatek/common/emi.c
@@ -0,0 +1,32 @@
+/* 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);
+
+ for (unsigned int i = 0; i < mc->num_channels; ++i)
+ size += mc->channel[i].density;
+
+ printk(BIOS_INFO, "dram size: %#lx\n", size);
+ return size;
+}
+
+void mt_set_emi(struct dramc_param *dparam)
+{
+ /* Do nothing */
+}