Yidi Lin has submitted this change. ( https://review.coreboot.org/c/coreboot/+/85681?usp=email )
(
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: soc/mediatek/common: Rename GPT_MHZ to TIMER_MHZ for readability ......................................................................
soc/mediatek/common: Rename GPT_MHZ to TIMER_MHZ for readability
Update timer macro name for common.
The new ICs (e.g. mt8196, mt8189) will no longer use GPT. In order to improve code readability, replace GPT_MHZ with TIMER_MHZ for existing SoCs.
BUG=b:379008996 BRANCH=none TEST=Build pass, Macro name is correct.
Change-Id: I02f18bfa5b5912f28e322d40cd46823a0095bbf4 Signed-off-by: Ke Zheng ot_ke.zheng@mediatek.corp-partner.google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/85681 Reviewed-by: Yidi Lin yidilin@google.com Reviewed-by: Yu-Ping Wu yupingso@google.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/mediatek/common/include/soc/timer_v1.h M src/soc/mediatek/common/include/soc/timer_v2.h M src/soc/mediatek/common/timer.c M src/soc/mediatek/mt8173/timer.c M src/soc/mediatek/mt8196/timer.c 5 files changed, 5 insertions(+), 5 deletions(-)
Approvals: build bot (Jenkins): Verified Yu-Ping Wu: Looks good to me, approved Yidi Lin: Looks good to me, approved
diff --git a/src/soc/mediatek/common/include/soc/timer_v1.h b/src/soc/mediatek/common/include/soc/timer_v1.h index 8d64b5d..d71d270 100644 --- a/src/soc/mediatek/common/include/soc/timer_v1.h +++ b/src/soc/mediatek/common/include/soc/timer_v1.h @@ -7,7 +7,7 @@ #include <soc/timer_common.h> #include <types.h>
-#define GPT_MHZ 13 +#define TIMER_MHZ 13
struct mtk_gpt_regs { u32 reserved1[24]; diff --git a/src/soc/mediatek/common/include/soc/timer_v2.h b/src/soc/mediatek/common/include/soc/timer_v2.h index 2305928..d4f854c 100644 --- a/src/soc/mediatek/common/include/soc/timer_v2.h +++ b/src/soc/mediatek/common/include/soc/timer_v2.h @@ -7,7 +7,7 @@ #include <soc/timer_common.h> #include <types.h>
-#define GPT_MHZ 13 +#define TIMER_MHZ 13
enum { TIE_0_EN = 1 << 3, diff --git a/src/soc/mediatek/common/timer.c b/src/soc/mediatek/common/timer.c index 5feed34..5412a9e 100644 --- a/src/soc/mediatek/common/timer.c +++ b/src/soc/mediatek/common/timer.c @@ -27,7 +27,7 @@
void timer_monotonic_get(struct mono_time *mt) { - mono_time_set_usecs(mt, timer_raw_value() / GPT_MHZ); + mono_time_set_usecs(mt, timer_raw_value() / TIMER_MHZ); }
void init_timer(void) diff --git a/src/soc/mediatek/mt8173/timer.c b/src/soc/mediatek/mt8173/timer.c index 0a9de6b..fc71877 100644 --- a/src/soc/mediatek/mt8173/timer.c +++ b/src/soc/mediatek/mt8173/timer.c @@ -18,5 +18,5 @@ */ write32(&mt8173_mcucfg->xgpt_idx, 0); /* Set clock mode to 13Mhz and enable XGPT */ - write32(&mt8173_mcucfg->xgpt_ctl, (0x1 | ((26 / GPT_MHZ) << 8))); + write32(&mt8173_mcucfg->xgpt_ctl, (0x1 | ((26 / TIMER_MHZ) << 8))); } diff --git a/src/soc/mediatek/mt8196/timer.c b/src/soc/mediatek/mt8196/timer.c index bf3f3ce..5db5c4a 100644 --- a/src/soc/mediatek/mt8196/timer.c +++ b/src/soc/mediatek/mt8196/timer.c @@ -9,5 +9,5 @@ { timer_prepare();
- raw_write_cntfrq_el0(GPT_MHZ * MHz); + raw_write_cntfrq_el0(TIMER_MHZ * MHz); }