
Kyösti Mälkki has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/33797 ) Change subject: arch/riscv: Fix arch timer timebase ...................................................................... Patch Set 1: (2 comments) https://review.coreboot.org/#/c/33797/1/src/arch/riscv/arch_timer.c File src/arch/riscv/arch_timer.c: https://review.coreboot.org/#/c/33797/1/src/arch/riscv/arch_timer.c@31 PS1, Line 31: die("time not set in HLS");
does this HAVE to be a die? Can we somehow stumble along with bad values? Well 'die()' is just another 'printk()' called before 'console_init()' here that would not show up, even on UART TX line.
With 'printk()' called after 'console_init()', and if UART code hits 'udelay()', we have infinite recursion here, possibly a silent reset loop is what you will see. It's possibly me who put 'udelay()' there in the UART_MEM code, ideas are welcome on how to get it removed while still having some controlled timeouts there. Timeouts don't have to be accurate but reasonable. https://review.coreboot.org/#/c/33797/1/src/arch/riscv/arch_timer.c@36 PS1, Line 36: mono_time_set_usecs(mt, (long)(raw / clocks_per_usec)); unsigned long ? There is a fair amount of loss in accuracy should you want to support timebases that are not multiples of 1 MHz. HW timer running at 1.999 MHz would be evil. Consider leaving a comment about that or improve the math. -- To view, visit https://review.coreboot.org/c/coreboot/+/33797 To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings Gerrit-Project: coreboot Gerrit-Branch: master Gerrit-Change-Id: I2588149e2ee32130a2c41695c4c723b57d4fa827 Gerrit-Change-Number: 33797 Gerrit-PatchSet: 1 Gerrit-Owner: Patrick Rudolph <patrick.rudolph@9elements.com> Gerrit-Reviewer: Jonathan Neuschäfer <j.neuschaefer@gmx.net> Gerrit-Reviewer: Kyösti Mälkki <kyosti.malkki@gmail.com> Gerrit-Reviewer: Patrick Rudolph <patrick.rudolph@9elements.com> Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki@gmail.com> Gerrit-Reviewer: Philipp Hug <philipp@hug.cx> Gerrit-Reviewer: Xiang Wang <wxjstz@126.com> Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org> Gerrit-Reviewer: ron minnich <rminnich@gmail.com> Gerrit-Comment-Date: Wed, 26 Jun 2019 23:52:35 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: ron minnich <rminnich@gmail.com> Gerrit-MessageType: comment