timer: Change timer util functions to 64-bit
Since mono_time is now 64-bit, the utility functions interfacing with
mono_time should also be 64-bit so precision isn't lost.
Fixed build errors related to printing the now int64_t result of
stopwatch_duration_[m|u]secs in various places.
BUG=b:237082996
BRANCH=All
TEST=Boot dewatt
Change-Id: I169588f5e14285557f2d03270f58f4c07c0154d5
Signed-off-by: Rob Barnes <robbarnes@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66170
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
diff --git a/src/soc/mediatek/common/mcu.c b/src/soc/mediatek/common/mcu.c
index d0a1107..42b3124 100644
--- a/src/soc/mediatek/common/mcu.c
+++ b/src/soc/mediatek/common/mcu.c
@@ -31,7 +31,7 @@
if (mcu->reset)
mcu->reset(mcu);
- printk(BIOS_DEBUG, "%s: Loaded (and reset) %s in %ld msecs (%zd bytes)\n",
+ printk(BIOS_DEBUG, "%s: Loaded (and reset) %s in %lld msecs (%zd bytes)\n",
__func__, mcu->firmware_name, stopwatch_duration_msecs(&sw), mcu->run_size);
return CB_SUCCESS;
diff --git a/src/soc/mediatek/common/memory.c b/src/soc/mediatek/common/memory.c
index f3f784e..e420722 100644
--- a/src/soc/mediatek/common/memory.c
+++ b/src/soc/mediatek/common/memory.c
@@ -265,7 +265,7 @@
ret = dram_run_fast_calibration(dparam);
if (ret != 0) {
printk(BIOS_ERR, "DRAM-K: Failed to run fast calibration "
- "in %ld msecs, error: %d\n",
+ "in %lld msecs, error: %d\n",
stopwatch_duration_msecs(&sw), ret);
/* Erase flash data after fast calibration failed */
@@ -274,7 +274,7 @@
DRAMC_PARAM_HEADER_VERSION,
dparam, mrc_cache_size);
} else {
- printk(BIOS_INFO, "DRAM-K: Fast calibration passed in %ld msecs\n",
+ printk(BIOS_INFO, "DRAM-K: Fast calibration passed in %lld msecs\n",
stopwatch_duration_msecs(&sw));
return;
}
@@ -290,13 +290,13 @@
stopwatch_init(&sw);
int err = dram_run_full_calibration(dparam);
if (err == 0) {
- printk(BIOS_INFO, "DRAM-K: Full calibration passed in %ld msecs\n",
+ printk(BIOS_INFO, "DRAM-K: Full calibration passed in %lld msecs\n",
stopwatch_duration_msecs(&sw));
mrc_cache_stash_data(MRC_TRAINING_DATA,
DRAMC_PARAM_HEADER_VERSION,
dparam, mrc_cache_size);
} else {
- printk(BIOS_ERR, "DRAM-K: Full calibration failed in %ld msecs\n",
+ printk(BIOS_ERR, "DRAM-K: Full calibration failed in %lld msecs\n",
stopwatch_duration_msecs(&sw));
}
}
diff --git a/src/soc/mediatek/common/mt6359p.c b/src/soc/mediatek/common/mt6359p.c
index 580079e..de22b3e 100644
--- a/src/soc/mediatek/common/mt6359p.c
+++ b/src/soc/mediatek/common/mt6359p.c
@@ -141,7 +141,7 @@
mt6359p_write(PMIC_BUCK_VPA_DLC_CON1, 0x800);
}
- printk(BIOS_DEBUG, "%s: Set efuses in %ld msecs\n",
+ printk(BIOS_DEBUG, "%s: Set efuses in %lld msecs\n",
__func__, stopwatch_duration_msecs(&sw));
}
diff --git a/src/soc/mediatek/common/spm.c b/src/soc/mediatek/common/spm.c
index 71cad48..e39f3da 100644
--- a/src/soc/mediatek/common/spm.c
+++ b/src/soc/mediatek/common/spm.c
@@ -209,7 +209,7 @@
return -1;
}
- printk(BIOS_INFO, "SPM: %s done in %ld msecs, spm pc = %#x\n",
+ printk(BIOS_INFO, "SPM: %s done in %lld msecs, spm pc = %#x\n",
__func__, stopwatch_duration_msecs(&sw),
read32(&mtk_spm->md32pcm_pc));
diff --git a/src/soc/mediatek/mt8183/spm.c b/src/soc/mediatek/mt8183/spm.c
index e35fc57..5fba84d 100644
--- a/src/soc/mediatek/mt8183/spm.c
+++ b/src/soc/mediatek/mt8183/spm.c
@@ -264,7 +264,7 @@
assert(offset < file_size);
printk(BIOS_DEBUG, "SPM: version = %s\n", spm_bin + offset);
- printk(BIOS_INFO, "SPM binary loaded in %ld msecs\n",
+ printk(BIOS_INFO, "SPM binary loaded in %lld msecs\n",
stopwatch_duration_msecs(&sw));
return 0;
@@ -330,7 +330,7 @@
spm_init_event_vector(pcmdesc);
spm_kick_pcm_to_run();
- printk(BIOS_INFO, "SPM: %s done in %ld msecs\n", __func__,
+ printk(BIOS_INFO, "SPM: %s done in %lld msecs\n", __func__,
stopwatch_duration_msecs(&sw));
return 0;