huayang duan has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35481 )
Change subject: mediatek/mt8183: Clean the calibration result if calibration or mem test fail ......................................................................
mediatek/mt8183: Clean the calibration result if calibration or mem test fail
If DRAM calibration fail or mem test fail by using the params store at flash, should clean the calibration result which store at flash and triggle system reset to regenerate new params.
BUG=b:80501386 BRANCH=none TEST=Boots correctly on Kukui.
Change-Id: I8e1d4f5bc7b45f45a8bfef74e86ec0ff6a556af4 --- M src/soc/mediatek/mt8183/dramc_pi_calibration_api.c M src/soc/mediatek/mt8183/memory.c 2 files changed, 15 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/35481/1
diff --git a/src/soc/mediatek/mt8183/dramc_pi_calibration_api.c b/src/soc/mediatek/mt8183/dramc_pi_calibration_api.c old mode 100644 new mode 100755 index 2bd185c..4769620 --- a/src/soc/mediatek/mt8183/dramc_pi_calibration_api.c +++ b/src/soc/mediatek/mt8183/dramc_pi_calibration_api.c @@ -17,6 +17,7 @@ #include <console/console.h> #include <delay.h> #include <device/mmio.h> +#include <reset.h> #include <soc/emi.h> #include <soc/dramc_register.h> #include <soc/dramc_pi_api.h> @@ -1964,7 +1965,12 @@ dramc_engine2_end(chn); write32(&ch[chn].ao.dummy_rd, dummy_rd_backup);
- assert(sum != 0); + if (sum == 0) { + clean_calibration_data(); + dramc_show("system will be reboot in 5 secoeds.\n"); + delay(5); + do_board_reset(); + }
if (sum <= 3) best_step = first + (sum >> 1); diff --git a/src/soc/mediatek/mt8183/memory.c b/src/soc/mediatek/mt8183/memory.c index 67f6c65..6a37c4e 100644 --- a/src/soc/mediatek/mt8183/memory.c +++ b/src/soc/mediatek/mt8183/memory.c @@ -15,6 +15,8 @@
#include <assert.h> #include <console/console.h> +#include <delay.h> +#include <reset.h> #include <soc/dramc_pi_api.h> #include <soc/emi.h> #include <symbols.h> @@ -43,7 +45,12 @@ printk(BIOS_DEBUG, "[MEM] complex R/W mem test %s : %d\n", (i == 0) ? "pass" : "fail", i);
- ASSERT(i == 0); + if (i != 0) { + clean_calibration_data(); + dramc_show("system will be reboot in 5 secoeds.\n"); + delay(5); + do_board_reset(); + }
addr += rank_size[r]; }