huayang duan has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: force run dram full-k blob ......................................................................
google/kukui: force run dram full-k blob
Force load dram.bin and run it for full dram calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/romstage.c 1 file changed, 53 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/1
diff --git a/src/mainboard/google/kukui/romstage.c b/src/mainboard/google/kukui/romstage.c index 131d167..f3774a1 100644 --- a/src/mainboard/google/kukui/romstage.c +++ b/src/mainboard/google/kukui/romstage.c @@ -14,6 +14,7 @@ */
#include <arch/stages.h> +#include <assert.h> #include <soc/emi.h> #include <soc/mmu_operations.h> #include <soc/mt6358.h> @@ -33,7 +34,7 @@ int (*dram_init)(void *param); size_t blob_size, region_size;
- region_size = _edram_init_code - _dram_init_code; + region_size = REGION_SIZE(dram_init_code); blob_size = cbfs_boot_load_file("dram.bin", _dram_init_code, region_size, CBFS_TYPE_RAW); if (blob_size == 0) { @@ -42,18 +43,43 @@ }
dram_init = (int (*)(void *))_dram_init_code; + printk(BIOS_ERR, "dram.bin after _dram_init_code\n");
return dram_init(NULL); }
+static const struct sdram_params *get_full_k_param(void) +{ + const struct sdram_params *params = NULL; + + //load params from flash(the params generated by full-k blob) + //TODO + //params = read_params_from_flash() + params = get_sdram_config(); + + return params; +} + +static bool force_full_k_dram = true; static void dram_initialize(void) { - int err = dram_blob_load_and_run(); - if (err == 0) - return; + const struct sdram_params *params = NULL;
- printk(BIOS_ERR, "dram_blob error:%d\n", err); - mt_mem_init(get_sdram_config()); + params = get_full_k_param(); + + //if (!params->have_full_k_params) { + if (force_full_k_dram) { + int err = dram_blob_load_and_run(); + if (err == 0) { + printk(BIOS_INFO, "dram_blob load success\n"); + return; + } + printk(BIOS_ERR, "dram_blob error:%d\n", err); + } + + //load params from sdram-ddr-config + params = get_sdram_config(); + mt_mem_init(params); }
void platform_romstage_main(void) @@ -69,5 +95,26 @@ pmic_init_scp_voltage(); rtc_boot(); dram_initialize(); + + printk(BIOS_DEBUG, "before do first complex_mem_test \n"); + for (u8 *addr = (u8*)0x40000000; addr < (u8*)0x100000000; addr+=0x40000000) { + int i = complex_mem_test(addr, 0x50000); + + printk(BIOS_DEBUG, "[MEM]addr:0x%p complex R/W mem test %s : %d\n", addr, + (i == 0) ? "pass" : "fail", i); + + ASSERT(i == 0); + } + mtk_mmu_after_dram(); + + printk(BIOS_DEBUG, "before do second complex_mem_test \n"); + for (u8 *addr = (u8*)0x40000000; addr < (u8*)0x100000000; addr+=0x40000000) { + int i = complex_mem_test(addr, 0x50000); + + printk(BIOS_DEBUG, "[MEM]addr:0x%p complex R/W mem test %s : %d\n", addr, + (i == 0) ? "pass" : "fail", i); + + ASSERT(i == 0); + } }
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: force run dram full-k blob ......................................................................
Patch Set 1:
(8 comments)
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 99: printk(BIOS_DEBUG, "before do first complex_mem_test \n"); unnecessary whitespace before a quoted newline
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 100: for (u8 *addr = (u8*)0x40000000; addr < (u8*)0x100000000; addr+=0x40000000) { "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 100: for (u8 *addr = (u8*)0x40000000; addr < (u8*)0x100000000; addr+=0x40000000) { "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 100: for (u8 *addr = (u8*)0x40000000; addr < (u8*)0x100000000; addr+=0x40000000) { spaces required around that '+=' (ctx:VxV)
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 111: printk(BIOS_DEBUG, "before do second complex_mem_test \n"); unnecessary whitespace before a quoted newline
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 112: for (u8 *addr = (u8*)0x40000000; addr < (u8*)0x100000000; addr+=0x40000000) { "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 112: for (u8 *addr = (u8*)0x40000000; addr < (u8*)0x100000000; addr+=0x40000000) { "(foo*)" should be "(foo *)"
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 112: for (u8 *addr = (u8*)0x40000000; addr < (u8*)0x100000000; addr+=0x40000000) { spaces required around that '+=' (ctx:VxV)
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: force run dram full-k blob ......................................................................
Patch Set 1:
(4 comments)
https://review.coreboot.org/c/coreboot/+/35110/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35110/1//COMMIT_MSG@7 PS1, Line 7: full-k What is full-k?
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 46: printk(BIOS_ERR, "dram.bin after _dram_init_code\n"); Please rephrase to be understandable to a user.
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 74: printk(BIOS_INFO, "dram_blob load success\n"); Successfully loaded and run DRAM initialization blob.
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 80: //load params from sdram-ddr-config Please add a space after `//`.
Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: force run dram full-k blob ......................................................................
Patch Set 1:
(2 comments)
I would suggest putting the "complex memory test" loops in a separate function, so as to avoid having it written twice
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 106: ASSERT(i == 0); One tab too much?
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 118: ASSERT(i == 0); One tab too much?
Hello build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35110
to look at the new patch set (#2).
Change subject: google/kukui: Run DRAM full calibration flow ......................................................................
google/kukui: Run DRAM full calibration flow
If not found correct params of full calibration from flash, do DRAM full dram calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/romstage.c 1 file changed, 31 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/2
Yu-Ping Wu has uploaded a new patch set (#4) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Run DRAM full calibration flow ......................................................................
google/kukui: Run DRAM full calibration flow
If correct params of full calibration are not found from flash, do DRAM full dram calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/romstage.c 1 file changed, 31 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/4
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 10:
(8 comments)
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 41: if (ret == length) : return true; : else : return false; return ret == length;
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 53: BIOS_ERR BIOS_INFO?
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 53: %s with ret(0x%lx), length:0x%lx\n %s: ret=%#lx, length=%#lx\n
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 55: if (ret == length) : return true; : else : return false; return ret == length
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 73: BIOS_ERR BIOS_INFO ?
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 75: if (ret == length) : return true; : else : return false; return ret == length
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 80: true true or false?
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 144: remove the extra blank line
Yu-Ping Wu has uploaded a new patch set (#19) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 9 files changed, 122 insertions(+), 56 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/19
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 19:
(13 comments)
https://review.coreboot.org/c/coreboot/+/35110/1//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35110/1//COMMIT_MSG@7 PS1, Line 7: full-k
What is full-k?
Commit message rephrased.
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 46: printk(BIOS_ERR, "dram.bin after _dram_init_code\n");
Please rephrase to be understandable to a user.
Done
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 74: printk(BIOS_INFO, "dram_blob load success\n");
Successfully loaded and run DRAM initialization blob.
Done
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 80: //load params from sdram-ddr-config
Please add a space after `//`.
Done
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 106: ASSERT(i == 0);
One tab too much?
Done
https://review.coreboot.org/c/coreboot/+/35110/1/src/mainboard/google/kukui/... PS1, Line 118: ASSERT(i == 0);
One tab too much?
Done
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 41: if (ret == length) : return true; : else : return false;
return ret == length;
Done
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 53: BIOS_ERR
BIOS_INFO?
Done
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 53: %s with ret(0x%lx), length:0x%lx\n
%s: ret=%#lx, length=%#lx\n
Done
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 55: if (ret == length) : return true; : else : return false;
return ret == length
Done
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 73: BIOS_ERR
BIOS_INFO ?
Done
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 75: if (ret == length) : return true; : else : return false;
return ret == length
Done
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 144:
remove the extra blank line
Done
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 19:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35110/19/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/19/src/mainboard/google/kukui... PS19, Line 100: struct sdram_params *dst
https://review.coreboot.org/c/coreboot/+/35110/19/src/mainboard/google/kukui... PS19, Line 107: if (read_calibration_data_from_flash(freq_params) && : have_calibration_params(freq_params)) { : printk(BIOS_ERR, "have dram calibraion params\n"); : mt_mem_init(freq_params); : return; : } else { : int err = dram_blob_load_and_run(freq_params); : if (err == 0) { : printk(BIOS_INFO, "successfully load dram_blob and " : "run DRAM calibration\n"); : : write_calibration_data_to_flash(freq_params); : return; : } : printk(BIOS_ERR, "dram_blob load fail with error %d\n", err); : } : : /* init params setting from sdram configs if no have dram calibraion result */ : init_sdram_params(freq_params, get_sdram_config()); : mt_mem_init(freq_params); if (!read..() || !have...()) { /* Try to re-run full-calibration if available. */ int err = dram_run_full_calibration(); if (err == 0) { printk... write_calibration... return; } printk('failed to do full calibration (%d), fall back to default parameters.'); init_sdram_params(...); }
mt_mem_init(freq_params);
Paul Menzel has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 19:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/19//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35110/19//COMMIT_MSG@12 PS19, Line 12: DRAM blob and perform DRAM full calibration. How much time is saved? Please add specific measurements.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 19:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/19/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/19/src/mainboard/google/kukui... PS19, Line 64: calibration_result_start error: 'struct sdram_params' has no member named 'calibration_result_start'
build bot (Jenkins) has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 20:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/20/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/20/src/mainboard/google/kukui... PS20, Line 116: printk(BIOS_ERR, "failed to do full calibration(%d), fall back to load default sdram param\n", err); line over 96 characters
Huayang Duan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 20:
(3 comments)
https://review.coreboot.org/c/coreboot/+/35110/19/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/19/src/mainboard/google/kukui... PS19, Line 64: calibration_result_start
error: 'struct sdram_params' has no member named 'calibration_result_start'
Done
https://review.coreboot.org/c/coreboot/+/35110/19/src/mainboard/google/kukui... PS19, Line 100: struct sdram_params
*dst
Done
https://review.coreboot.org/c/coreboot/+/35110/19/src/mainboard/google/kukui... PS19, Line 107: if (read_calibration_data_from_flash(freq_params) && : have_calibration_params(freq_params)) { : printk(BIOS_ERR, "have dram calibraion params\n"); : mt_mem_init(freq_params); : return; : } else { : int err = dram_blob_load_and_run(freq_params); : if (err == 0) { : printk(BIOS_INFO, "successfully load dram_blob and " : "run DRAM calibration\n"); : : write_calibration_data_to_flash(freq_params); : return; : } : printk(BIOS_ERR, "dram_blob load fail with error %d\n", err); : } : : /* init params setting from sdram configs if no have dram calibraion result */ : init_sdram_params(freq_params, get_sdram_config()); : mt_mem_init(freq_params);
if (!read..() || !have...()) { […]
Done
Hello Yu-Ping Wu, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35110
to look at the new patch set (#21).
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 9 files changed, 114 insertions(+), 53 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/21
Hello Yu-Ping Wu, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35110
to look at the new patch set (#22).
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 10 files changed, 115 insertions(+), 53 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/22
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 22:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 80: true
true or false?
@huayang
Huayang Duan has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 22:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/10/src/mainboard/google/kukui... PS10, Line 80: true
@huayang
Done, no need check the return value of clean operate.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 22:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/22/src/mainboard/google/kukui... File src/mainboard/google/kukui/chromeos.fmd:
https://review.coreboot.org/c/coreboot/+/35110/22/src/mainboard/google/kukui... PS22, Line 30: RW_DDR_TRAINING(PRESERVE) @0x400000 0x2000 This is exceeding the aligned boundary.
I just realized the fmd is only using 4M, and we should revise the fmd to enlarge sections equally, and find a better space for it...
Hello Yu-Ping Wu, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35110
to look at the new patch set (#23).
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 10 files changed, 110 insertions(+), 52 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/23
Yu-Ping Wu has uploaded a new patch set (#24) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 10 files changed, 115 insertions(+), 53 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/24
Hello Yu-Ping Wu, build bot (Jenkins),
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/35110
to look at the new patch set (#25).
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 159 insertions(+), 49 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/25
Yu-Ping Wu has uploaded a new patch set (#26) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 159 insertions(+), 49 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/26
Yu-Ping Wu has uploaded a new patch set (#27) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 159 insertions(+), 49 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/27
Yu-Ping Wu has uploaded a new patch set (#28) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 143 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/28
Yu-Ping Wu has uploaded a new patch set (#29) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 144 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/29
Yu-Ping Wu has uploaded a new patch set (#30) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 126 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/30
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 30:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/30//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35110/30//COMMIT_MSG@14 PS30, Line 14: BUG=b:134351649 Add b:139099592
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 30:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... PS30, Line 83: && Should be "||".
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 30:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... PS30, Line 44: CALIBRATION_REGION Please add an assert for this.
# the section defined in chromeos.fmd is only 0x2000 bytes. assert(length < 0x2000);
Yu-Ping Wu has uploaded a new patch set (#31) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 132 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/31
Yu-Ping Wu has uploaded a new patch set (#32) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
BUG=b:134351649 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 132 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/32
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 32:
(3 comments)
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... PS30, Line 83: &&
Should be "||".
Done
https://review.coreboot.org/c/coreboot/+/35110/32/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/32/src/mainboard/google/kukui... PS32, Line 33: void Change the type to 'struct params_data' in case the caller passes the wrong type.
https://review.coreboot.org/c/coreboot/+/35110/32/src/mainboard/google/kukui... PS32, Line 42: void Change the type to 'struct params_data' in case the caller passes the wrong type.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 35:
(6 comments)
https://review.coreboot.org/c/coreboot/+/35110/19//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35110/19//COMMIT_MSG@12 PS19, Line 12: DRAM blob and perform DRAM full calibration.
How much time is saved? Please add specific measurements.
Bootup time added.
https://review.coreboot.org/c/coreboot/+/35110/30//COMMIT_MSG Commit Message:
https://review.coreboot.org/c/coreboot/+/35110/30//COMMIT_MSG@14 PS30, Line 14: BUG=b:134351649
Add b:139099592
Done
https://review.coreboot.org/c/coreboot/+/35110/22/src/mainboard/google/kukui... File src/mainboard/google/kukui/chromeos.fmd:
https://review.coreboot.org/c/coreboot/+/35110/22/src/mainboard/google/kukui... PS22, Line 30: RW_DDR_TRAINING(PRESERVE) @0x400000 0x2000
This is exceeding the aligned boundary. […]
FMAP layout extended to 8MB in https://review.coreboot.org/c/coreboot/+/35612
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... PS30, Line 44: CALIBRATION_REGION
Please add an assert for this. […]
Why not assert(length <= 0x2000);
https://review.coreboot.org/c/coreboot/+/35110/32/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/32/src/mainboard/google/kukui... PS32, Line 33: void
Change the type to 'struct params_data' in case the caller passes the wrong type.
Done
https://review.coreboot.org/c/coreboot/+/35110/32/src/mainboard/google/kukui... PS32, Line 42: void
Change the type to 'struct params_data' in case the caller passes the wrong type.
Done
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 35:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... PS30, Line 44: CALIBRATION_REGION
Why not […]
you are correct, <=.
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 35:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/30/src/mainboard/google/kukui... PS30, Line 44: CALIBRATION_REGION
you are correct, <=.
Ack
Yu-Ping Wu has uploaded a new patch set (#36) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 139 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/36
Yu-Ping Wu has uploaded a new patch set (#37) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 139 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/37
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 39:
(4 comments)
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 64: -1; should we enum these values?
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 78: | I think you mean &
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 79: return printk(BIOS_ERR, "Full calibration blob executed without saving parameters. " "Please ensure the blob is built properly.\n");
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 100: if (!read_calibration_data_from_flash(&dparam, sizeof(dparam)) || : !is_valid_dramc_param(&dparam) || : dparam.header.config != config) { We probably want to give more reason telling user why we choose re-calibrating data.
bool had_valid_data = false;
if (!read...) { printk(BIOS_ERR, "Failed to read calibration data.\n"); } else if (!is_valid_dramc_param...) { // Probably dump version, magic, ... etc to make it easier for debugging. printk(BIOS_ERR, "Invalid DRAM calibration data, need to do full calibration.\n"); } else if (dparam.header.config != config) { printk(BIOS_ERR, "Incompatible config for DRAM calibration data (expected: XX, saved: XX).. } else { has_valid_data = true; }
if (has_valid_data) {...
Yu-Ping Wu has uploaded a new patch set (#40) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 159 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/40
Yu-Ping Wu has uploaded a new patch set (#41) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 159 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/41
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 41:
(4 comments)
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 64: -1;
should we enum these values?
The return value is not used (only compared with 0). What's the benefit to enum them?
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 78: |
I think you mean &
Done
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 79: return
printk(BIOS_ERR, "Full calibration blob executed without saving parameters. " […]
Done
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 100: if (!read_calibration_data_from_flash(&dparam, sizeof(dparam)) || : !is_valid_dramc_param(&dparam) || : dparam.header.config != config) {
We probably want to give more reason telling user why we choose re-calibrating data. […]
How about using 'BIOS_NOTICE'? I don't think missing flash data is an error.
Yu-Ping Wu has uploaded a new patch set (#42) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: mb/google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
mb/google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/chromeos.fmd M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 11 files changed, 159 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/42
Yu-Ping Wu has uploaded a new patch set (#43) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: mb/google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
mb/google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 10 files changed, 158 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/43
Yu-Ping Wu has uploaded a new patch set (#44) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: mb/google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
mb/google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/romstage.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-H9HCNNNCPMALHR-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-K4UBE3D4AA-MGCL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDH6001DA-B422-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDP6001DA-B425-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-KMDV6001DA-B620-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT29VZZZAD8DQKSL-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-MT53E1G32D4NQ-4GB.c M src/mainboard/google/kukui/sdram_params/sdram-lpddr4x-SDADA4CR-128G-4GB.c 10 files changed, 150 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/44
Yu-Ping Wu has uploaded a new patch set (#47) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: mb/google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
mb/google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/romstage.c M src/soc/mediatek/mt8183/include/soc/dramc_param.h M src/soc/mediatek/mt8183/include/soc/emi.h M src/soc/mediatek/mt8183/memory.c 5 files changed, 169 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/47
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: mb/google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 47:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... File src/mainboard/google/kukui/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 35: DRAM_CBFS := $(CONFIG_CBFS_PREFIX)/dram @hungte Should we move the changes in this file to soc/mediatek/mt8183/Makefile.inc?
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 55: .write_to_flash = &write_calibration_data_to_flash, @hungte Should we also put get_sdram_config() into dramc_param_ops?
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: mb/google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 47:
(4 comments)
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... File src/mainboard/google/kukui/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 35: DRAM_CBFS := $(CONFIG_CBFS_PREFIX)/dram
@hungte Should we move the changes in this file to soc/mediatek/mt8183/Makefile. […]
That may be a good idea. In the meantime I think we should make it a Kconfig. Would be best if in the end we can override it from configs so chrome os local builds can use files from local repo. Maybe config
MT8183_DRAM_FULLK_BLOB default "3rdparty/blobs/soc/mediatek/mt8183/dram.elf"
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 36: BIOS_INFO BIOS_DEBUG
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 44: assert(length <= CALIBRATION_REGION_SIZE); Can we replace this with Static_assert?
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 55: .write_to_flash = &write_calibration_data_to_flash,
@hungte Should we also put get_sdram_config() into dramc_param_ops?
sounds like a good idea.
we may even put the CONFIG_EMCP thing into a function like
.get_config
Yu-Ping Wu has uploaded a new patch set (#48) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: mb/google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
mb/google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/romstage.c M src/soc/mediatek/mt8183/include/soc/emi.h M src/soc/mediatek/mt8183/memory.c 4 files changed, 173 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/48
Yu-Ping Wu has uploaded a new patch set (#49) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: mb/google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
mb/google/kukui: Load calibration params and run DRAM calibration flow
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/Makefile.inc M src/mainboard/google/kukui/romstage.c M src/soc/mediatek/mt8183/include/soc/emi.h M src/soc/mediatek/mt8183/memory.c 4 files changed, 179 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/49
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: mb/google/kukui: Load calibration params and run DRAM calibration flow ......................................................................
Patch Set 49:
(3 comments)
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 100: if (!read_calibration_data_from_flash(&dparam, sizeof(dparam)) || : !is_valid_dramc_param(&dparam) || : dparam.header.config != config) {
How about using 'BIOS_NOTICE'? I don't think missing flash data is an error.
Done
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 36: BIOS_INFO
BIOS_DEBUG
Done
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 55: .write_to_flash = &write_calibration_data_to_flash,
sounds like a good idea. […]
Done
Yu-Ping Wu has uploaded a new patch set (#50) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
soc/mediatek/mt8183: Run DRAM full calibration
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/romstage.c M src/soc/mediatek/mt8183/Makefile.inc M src/soc/mediatek/mt8183/include/soc/emi.h M src/soc/mediatek/mt8183/memory.c 4 files changed, 182 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/50
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
Patch Set 50:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... File src/mainboard/google/kukui/Makefile.inc:
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 35: DRAM_CBFS := $(CONFIG_CBFS_PREFIX)/dram
That may be a good idea. In the meantime I think we should make it a Kconfig. […]
Let's add the config in another CL.
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/47/src/mainboard/google/kukui... PS47, Line 44: assert(length <= CALIBRATION_REGION_SIZE);
Can we replace this with Static_assert?
Done
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
Patch Set 50:
(6 comments)
Good refactoring!
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... File src/soc/mediatek/mt8183/memory.c:
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 56: ", header->magic header.maigc = %#X (expected: %#x)\n", header->magic, DRAMC_PARAM_MAGIC);
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 57: version print expected version as well
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 58: .siz print expected size as well
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 68: BIOS_NOTICE BIOS_WARNING
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 75: BIOS_NOTICE BIOS_WARNING
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 107: | &
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
Patch Set 50:
(2 comments)
https://review.coreboot.org/c/coreboot/+/35110/50/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/50/src/mainboard/google/kukui... PS50, Line 48: assert(length <= CALIBRATION_REGION_SIZE); this is no longer needed since we have the _Static_assert.
https://review.coreboot.org/c/coreboot/+/35110/50/src/mainboard/google/kukui... PS50, Line 64: .get_sdram_config = &get_sdram_config, hmmm, given that this is already defined in soc/sdram_configs.h, I think we don't need to pass it from mainboard implementation, unless if you have good reasons (for example you have to use same function in mtk-dramk blob, or you think this will be not calling SOC's get_sdram_config in some case.
Yu-Ping Wu has uploaded a new patch set (#51) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
soc/mediatek/mt8183: Run DRAM full calibration
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/romstage.c M src/soc/mediatek/mt8183/Makefile.inc M src/soc/mediatek/mt8183/include/soc/emi.h M src/soc/mediatek/mt8183/memory.c 4 files changed, 184 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/51
Yu-Ping Wu has uploaded a new patch set (#52) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
soc/mediatek/mt8183: Run DRAM full calibration
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/romstage.c M src/soc/mediatek/mt8183/Makefile.inc M src/soc/mediatek/mt8183/include/soc/emi.h M src/soc/mediatek/mt8183/memory.c 4 files changed, 184 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/52
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
Patch Set 52:
(8 comments)
https://review.coreboot.org/c/coreboot/+/35110/50/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/50/src/mainboard/google/kukui... PS50, Line 48: assert(length <= CALIBRATION_REGION_SIZE);
this is no longer needed since we have the _Static_assert.
Done
https://review.coreboot.org/c/coreboot/+/35110/50/src/mainboard/google/kukui... PS50, Line 64: .get_sdram_config = &get_sdram_config,
hmmm, given that this is already defined in soc/sdram_configs. […]
Done
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... File src/soc/mediatek/mt8183/memory.c:
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 56: ", header->magic
header. […]
Done
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 57: version
print expected version as well
Done
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 58: .siz
print expected size as well
Done
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 68: BIOS_NOTICE
BIOS_WARNING
Done
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 75: BIOS_NOTICE
BIOS_WARNING
Done
https://review.coreboot.org/c/coreboot/+/35110/50/src/soc/mediatek/mt8183/me... PS50, Line 107: |
&
Done
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
Patch Set 52:
(4 comments)
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... PS52, Line 28: CALIBRATION_REGION Please add a comment above:
/* This must be defined in chromeos.fmd in same name and size. */
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... PS52, Line 32: CALIBRATION_REGION does this really work? can you temporarily set REGION_SIZE to a smaller size and check?
We probably need to use #CALIBRATION_REGION instead?
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... PS52, Line 37: (void *) I wonder if we really need to do this cast? (void * should be converted automatically?)
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... PS52, Line 47: (void *) const void *
Yu-Ping Wu has uploaded a new patch set (#53) to the change originally created by huayang duan. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
soc/mediatek/mt8183: Run DRAM full calibration
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com --- M src/mainboard/google/kukui/romstage.c M src/soc/mediatek/mt8183/Makefile.inc M src/soc/mediatek/mt8183/include/soc/emi.h M src/soc/mediatek/mt8183/memory.c 4 files changed, 184 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/10/35110/53
Yu-Ping Wu has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
Patch Set 53:
(4 comments)
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... PS52, Line 28: CALIBRATION_REGION
Please add a comment above: […]
Done
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... PS52, Line 32: CALIBRATION_REGION
does this really work? can you temporarily set REGION_SIZE to a smaller size and check? […]
Yes I tested it before.
src/mainboard/google/kukui/romstage.c:32:1: error: static assertion failed: "sizeof(struct dramc_param) exceeds RW_DDR_TRAINING
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... PS52, Line 37: (void *)
I wonder if we really need to do this cast? (void * should be converted automatically?)
Cast removed.
https://review.coreboot.org/c/coreboot/+/35110/52/src/mainboard/google/kukui... PS52, Line 47: (void *)
const void *
Cast removed.
Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
Patch Set 53: Code-Review+2
(1 comment)
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... File src/mainboard/google/kukui/romstage.c:
https://review.coreboot.org/c/coreboot/+/35110/39/src/mainboard/google/kukui... PS39, Line 64: -1;
The return value is not used (only compared with 0). […]
Ack
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35110 )
Change subject: soc/mediatek/mt8183: Run DRAM full calibration ......................................................................
soc/mediatek/mt8183: Run DRAM full calibration
Load the calibration params from flash first and check the correctness of the params. If the params have correct format, perform DRAM fast calibration with these params to reduce bootup time. Otherwise, load the DRAM blob and perform DRAM full calibration.
Bootup time of DRAM partial calibration: - 1,349,385 usecs with low frequency - 924,698 usecs with middle frequency - 1,270,089 usecs with high frequency 3,544,172 usecs in total.
Bootup time of DRAM fast calibration: - 216,663 usecs with low frequency - 328,220 usecs with middle frequency - 322,612 usecs with high frequency 867,495 usecs in total.
BUG=b:139099592 BRANCH=none TEST=emerge-kukui coreboot
Change-Id: I8de29b14b1fb24b3b4f351c855c5c4d8f350cc34 Signed-off-by: Huayang Duan huayang.duan@mediatek.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/35110 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Hung-Te Lin hungte@chromium.org --- M src/mainboard/google/kukui/romstage.c M src/soc/mediatek/mt8183/Makefile.inc M src/soc/mediatek/mt8183/include/soc/emi.h M src/soc/mediatek/mt8183/memory.c 4 files changed, 184 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Hung-Te Lin: Looks good to me, approved
diff --git a/src/mainboard/google/kukui/romstage.c b/src/mainboard/google/kukui/romstage.c index a86690b..2b7dd6a 100644 --- a/src/mainboard/google/kukui/romstage.c +++ b/src/mainboard/google/kukui/romstage.c @@ -14,6 +14,9 @@ */
#include <arch/stages.h> +#include <console/console.h> +#include <fmap.h> +#include <soc/dramc_param.h> #include <soc/emi.h> #include <soc/mmu_operations.h> #include <soc/mt6358.h> @@ -22,6 +25,42 @@
#include "early_init.h"
+/* This must be defined in chromeos.fmd in same name and size. */ +#define CALIBRATION_REGION "RW_DDR_TRAINING" +#define CALIBRATION_REGION_SIZE 0x2000 + +_Static_assert(sizeof(struct dramc_param) <= CALIBRATION_REGION_SIZE, + "sizeof(struct dramc_param) exceeds " CALIBRATION_REGION); + +static bool read_calibration_data_from_flash(struct dramc_param *dparam) +{ + const size_t length = sizeof(*dparam); + size_t ret = fmap_read_area(CALIBRATION_REGION, dparam, length); + printk(BIOS_DEBUG, "%s: ret=%#lx, length=%#lx\n", + __func__, ret, length); + + return ret == length; +} + +static bool write_calibration_data_to_flash(const struct dramc_param *dparam) +{ + const size_t length = sizeof(*dparam); + size_t ret = fmap_overwrite_area(CALIBRATION_REGION, dparam, length); + printk(BIOS_DEBUG, "%s: ret=%#lx, length=%#lx\n", + __func__, ret, length); + + return ret == length; +} + +/* dramc_param is ~2K and too large to fit in stack. */ +static struct dramc_param dramc_parameter; + +static struct dramc_param_ops dparam_ops = { + .param = &dramc_parameter, + .read_from_flash = &read_calibration_data_from_flash, + .write_to_flash = &write_calibration_data_to_flash, +}; + void platform_romstage_main(void) { /* This will be done in verstage if CONFIG_VBOOT is enabled. */ @@ -34,6 +73,6 @@ mt_pll_raise_ca53_freq(1989 * MHz); pmic_init_scp_voltage(); rtc_boot(); - mt_mem_init(get_sdram_config()); + mt_mem_init(&dparam_ops); mtk_mmu_after_dram(); } diff --git a/src/soc/mediatek/mt8183/Makefile.inc b/src/soc/mediatek/mt8183/Makefile.inc index 72a4d9c..70fd080 100644 --- a/src/soc/mediatek/mt8183/Makefile.inc +++ b/src/soc/mediatek/mt8183/Makefile.inc @@ -81,6 +81,14 @@ sspm.bin-type := raw sspm.bin-compression := $(CBFS_COMPRESS_FLAG)
+DRAM_CBFS := $(CONFIG_CBFS_PREFIX)/dram +$(DRAM_CBFS)-file := $(MT8183_BLOB_DIR)/dram.elf +$(DRAM_CBFS)-type := stage +$(DRAM_CBFS)-compression := none +ifneq ($(wildcard $($(DRAM_CBFS)-file)),) + cbfs-files-y += $(DRAM_CBFS) +endif + BL31_MAKEARGS += PLAT=mt8183
CPPFLAGS_common += -Isrc/soc/mediatek/mt8183/include diff --git a/src/soc/mediatek/mt8183/include/soc/emi.h b/src/soc/mediatek/mt8183/include/soc/emi.h index ab21bc7..624c0a4 100644 --- a/src/soc/mediatek/mt8183/include/soc/emi.h +++ b/src/soc/mediatek/mt8183/include/soc/emi.h @@ -71,6 +71,8 @@ u16 delay_cell_unit; };
+struct dramc_param_ops; + enum { LP4X_DDR1600, LP4X_DDR2400, @@ -86,6 +88,6 @@ const struct sdram_params *get_sdram_config(void); void enable_emi_dcm(void); void mt_set_emi(const struct sdram_params *freq_params); -void mt_mem_init(const struct sdram_params *freq_params); +void mt_mem_init(struct dramc_param_ops *dparam_ops);
#endif /* SOC_MEDIATEK_MT8183_EMI_H */ diff --git a/src/soc/mediatek/mt8183/memory.c b/src/soc/mediatek/mt8183/memory.c index 67f6c65..c2ddb99 100644 --- a/src/soc/mediatek/mt8183/memory.c +++ b/src/soc/mediatek/mt8183/memory.c @@ -14,18 +14,18 @@ */
#include <assert.h> +#include <cbfs.h> #include <console/console.h> +#include <soc/dramc_param.h> #include <soc/dramc_pi_api.h> #include <soc/emi.h> +#include <string.h> #include <symbols.h>
-void mt_mem_init(const struct sdram_params *freq_params) +static void mt_mem_test(void) { u64 rank_size[RANK_MAX];
- /* memory calibration */ - mt_set_emi(freq_params); - if (CONFIG(MEMORY_TEST)) { size_t r; u8 *addr = _dram; @@ -49,3 +49,132 @@ } } } + +static void dump_param_header(const struct dramc_param *dparam) +{ + const struct dramc_param_header *header = &dparam->header; + + printk(BIOS_DEBUG, "header.status = %#x\n", header->status); + printk(BIOS_DEBUG, "header.magic = %#x (expected: %#x)\n", + header->magic, DRAMC_PARAM_HEADER_MAGIC); + printk(BIOS_DEBUG, "header.version = %#x (expected: %#x)\n", + header->version, DRAMC_PARAM_HEADER_VERSION); + printk(BIOS_DEBUG, "header.size = %#x (expected: %#lx)\n", + header->size, sizeof(*dparam)); + printk(BIOS_DEBUG, "header.config = %#x\n", header->config); + printk(BIOS_DEBUG, "header.flags = %#x\n", header->flags); + printk(BIOS_DEBUG, "header.checksum = %#x\n", header->checksum); +} + +static int dram_run_fast_calibration(const struct dramc_param *dparam, + u16 config) +{ + if (!is_valid_dramc_param(dparam)) { + printk(BIOS_WARNING, + "Invalid DRAM calibration data from flash\n"); + dump_param_header(dparam); + return -1; + } + + if (dparam->header.config != config) { + printk(BIOS_WARNING, + "Incompatible config for calibration data from flash " + "(expected: %#x, saved: %#x)\n", + config, dparam->header.config); + return -1; + } + + return 0; +} + +static int dram_run_full_calibration(struct dramc_param *dparam, u16 config) +{ + initialize_dramc_param(dparam, config); + + /* Load and run the provided blob for full-calibration if available */ + struct prog dram = PROG_INIT(PROG_REFCODE, CONFIG_CBFS_PREFIX "/dram"); + + if (prog_locate(&dram)) + return -1; + + if (cbfs_prog_stage_load(&dram)) + return -2; + + prog_set_entry(&dram, prog_entry(&dram), dparam); + prog_run(&dram); + + if (dparam->header.status != DRAMC_SUCCESS) { + printk(BIOS_ERR, "Full calibration failed: status = %d\n", + dparam->header.status); + return -3; + } + + if (!(dparam->header.flags & DRAMC_FLAG_HAS_SAVED_DATA)) { + printk(BIOS_ERR, + "Full calibration executed without saving parameters. " + "Please ensure the blob is built properly.\n"); + return -4; + } + + return 0; +} + +static void set_source_to_flash(struct sdram_params *freq_params) +{ + for (u8 shuffle = DRAM_DFS_SHUFFLE_1; shuffle < DRAM_DFS_SHUFFLE_MAX; + shuffle++) + freq_params[shuffle].source = DRAMC_PARAM_SOURCE_FLASH; +} + +static void init_sdram_params(struct sdram_params *dst, + const struct sdram_params *src) +{ + for (u8 shuffle = DRAM_DFS_SHUFFLE_1; shuffle < DRAM_DFS_SHUFFLE_MAX; + shuffle++) + memcpy(&dst[shuffle], src, sizeof(*dst)); +} + +void mt_mem_init(struct dramc_param_ops *dparam_ops) +{ + struct dramc_param *dparam = dparam_ops->param; + struct sdram_params *freq_params = dparam->freq_params; + + u16 config = 0; + if (CONFIG(MT8183_DRAM_EMCP)) + config |= DRAMC_CONFIG_EMCP; + + /* Load calibration params from flash and run fast calibration */ + if (dparam_ops->read_from_flash(dparam)) { + if (dram_run_fast_calibration(dparam, config) == 0) { + printk(BIOS_INFO, + "DRAM calibraion params loaded from flash\n"); + mt_set_emi(freq_params); + mt_mem_test(); + return; + } + } else { + printk(BIOS_WARNING, + "Failed to read calibration data from flash\n"); + } + + /* Run full calibration */ + int err = dram_run_full_calibration(dparam, config); + if (err == 0) { + printk(BIOS_INFO, "Successfully loaded DRAM blobs and " + "ran DRAM calibration\n"); + set_source_to_flash(dparam->freq_params); + dparam_ops->write_to_flash(dparam); + printk(BIOS_DEBUG, "Calibration params saved to flash: " + "version=%#x, size=#%x\n", + dparam->header.version, dparam->header.size); + return; + } + + printk(BIOS_ERR, "Failed to do full calibration (%d), " + "falling back to load default sdram param\n", err); + + /* Init params from sdram configs and run partial calibration */ + init_sdram_params(freq_params, get_sdram_config()); + mt_set_emi(freq_params); + mt_mem_test(); +}