Debian Codegraph @

src/soc/mediatek/mt8173/memory.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <assert.h>
4 #include <console/console.h>
5 #include <soc/addressmap.h>
6 #include <soc/dramc_register.h>
7 #include <soc/dramc_pi_api.h>
8 #include <soc/emi.h>
9 #include <soc/pll.h>
10 #include <symbols.h>
11
12 void mt_mem_init(const struct mt8173_sdram_params *sdram_params)
13 {
14 int i = 0;
15
16 /* init mempll */
17 mem_pll_init(sdram_params);
18
19 /* memory calibration */
20 mt_set_emi(sdram_params);
21
22 if (CONFIG(MEMORY_TEST)) {
23 /*
24 * do memory test:
25 * set memory scan range 0x2000
26 * larger test length, longer system boot up time
27 */
28 i = complex_mem_test(_dram, 0x2000);
29
30 printk(BIOS_DEBUG, "[MEM] complex R/W mem test %s : %d\n",
31 (i == 0) ? "pass" : "fail", i);
32
33 ASSERT(i == 0);
34 }
35 }