From d1c096a5b91855243b455e0eae5fa106930ed3db Mon Sep 17 00:00:00 2001 From: Vince Liu Date: Fri, 18 Jul 2025 14:14:18 +0800 Subject: [PATCH] src/soc/mt8196: Correct systimer register offset A recent datasheet review finds that the previously used offset for the `cnttval` register is incorrect. Since the relevant bits used by `clear_timer()` have default values of 0, the functionality is not affected before this fix. BUG=b:430211678 BRANCH=rauru TEST=check the timestamp order of depthcharge is correct in `cbmem` 16:finished LZMA decompress (ignore for x86) 895,082 (526) 1000:depthcharge start 941,621 (46,539) 1002:RO vboot init 942,644 (1,023) 1020:vboot select&load kernel 942,645 (1) 1030:finished EC verification 980,005 (37,360) 1060:finished AuxFW Sync 997,302 (17,297) 1040:finished storage device initialization 1,025,910 (28,608) 1050:finished reading kernel from disk 2,174,931 (1,149,021) 1100:finished vboot kernel verification 2,229,874 (54,943) 1102:starting kernel decompression/relocation 2,249,121 (19,247) 1101:jumping to kernel 2,284,317 (35,196) Total Time: 2,020,762 Change-Id: I018d81de79d6896a31972f925d5a26f41cf942a0 Signed-off-by: Vince Liu Signed-off-by: Zhanzhan Ge Reviewed-on: https://review.coreboot.org/c/coreboot/+/88480 Reviewed-by: Yidi Lin Reviewed-by: Yu-Ping Wu Tested-by: build bot (Jenkins) --- src/soc/mediatek/mt8196/include/soc/timer.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/soc/mediatek/mt8196/include/soc/timer.h b/src/soc/mediatek/mt8196/include/soc/timer.h index f6841fc250..fbc18a9b69 100644 --- a/src/soc/mediatek/mt8196/include/soc/timer.h +++ b/src/soc/mediatek/mt8196/include/soc/timer.h @@ -31,7 +31,7 @@ struct systimer { u32 reserved; u32 cntcv_l; u32 cntcv_h; - u32 reserved1[0x30]; + u32 reserved1[12]; struct { u32 con; u32 val; @@ -40,6 +40,8 @@ struct systimer { check_member(systimer, cntcr, 0x0); check_member(systimer, cntcv_l, 0x0008); -check_member(systimer, cntcv_h, 0x000c); +check_member(systimer, cntcv_h, 0x000C); +check_member(systimer, cnttval[0].con, 0x0040); +check_member(systimer, cnttval[0].val, 0x0044); #endif