Tristan Hsieh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32245 )
Change subject: mediatek: Using a 64 bits timer ......................................................................
Patch Set 1:
Patch Set 1:
one question, so why did this work for 8173? shouldn't it also overflow?
GPT6 regs have the same address on both 8183 and 8173. I've tested this patch on both 8183 and 8173.
This issue happens on both 8183 and 8173. I guess usually we finish all jobs before overflow (330 seconds) and didn't get any trouble. Recently, we are doing some memory test overnight and get trapped in this. (If we can finish all the jobs in 330 seconds, probably this patch is not necessary.)
It only make delay and stopwatch fail if we start a delay() or stopwatch_init_usecs_expire() before (and close to) the overflow and end up with a timeout value bigger than the maximum. Since the timer warps around to a small value, it will never return from delay() or get true from stopwatch_expired().