soc/mediatek/mt8192: add dram log prefix

1 Add dram log prefix: [MEM]
2 Print error code when memtest fails.

Signed-off-by: Xi Chen <xixi.chen@mediatek.com>
Change-Id: I6c53c9cecf5996227a3e343fc703b9880d9afeac
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46585
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Xi Chen 2020-10-20 17:55:14 +08:00 committed by Hung-Te Lin
parent 3398f3152c
commit 3827f56fe1
1 changed files with 6 additions and 6 deletions

View File

@ -15,14 +15,14 @@ static int mt_mem_test(const struct dramc_data *dparam)
const struct ddr_base_info *ddr_info = &dparam->ddr_info; const struct ddr_base_info *ddr_info = &dparam->ddr_info;
for (u8 rank = RANK_0; rank < ddr_info->support_ranks; rank++) { for (u8 rank = RANK_0; rank < ddr_info->support_ranks; rank++) {
int i = complex_mem_test(addr, 0x2000); int result = complex_mem_test(addr, 0x2000);
printk(BIOS_DEBUG, "[MEM] complex R/W mem test %s\n", if (result != 0) {
(i == 0) ? "pass" : "fail"); printk(BIOS_ERR,
"[MEM] complex R/W mem test failed: %d\n", result);
if (i != 0) {
printk(BIOS_ERR, "DRAM memory test failed\n");
return -1; return -1;
} else {
printk(BIOS_DEBUG, "[MEM] complex R/W mem test passed\n");
} }
addr += ddr_info->rank_size[rank]; addr += ddr_info->rank_size[rank];