Attention is currently required from: Hung-Te Lin, Shelley Chen, Paul Menzel, Yu-Ping Wu, Jianjun Wang. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/62359 )
Change subject: soc/mediatek: PCI: Assert PERST# at bootblock stage ......................................................................
Patch Set 9:
(1 comment)
Commit Message:
https://review.coreboot.org/c/coreboot/+/62359/comment/e220a00b_a842f9b2 PS9, Line 14: 100ms
Looking at a typical 8195 boot timeline: […]
Hmmm, I didn't know about `get_us_since_boot()`. Something to keep in mind is that it only works as expected if `COLLECT_TIMESTAMPS` is enabled, but it's only `default y if ARCH_X86`. I think an implementation of `timestamp_get()` is needed for this to work.
We just need to store a timestamp just after asserting PCIe reset somewhere that persists across stages, then read the value and delay (if needed) before de-asserting PCIe reset. This value can be put in the linker script as a symbol and then migrated to CBMEM in romstage using a `CBMEM_INIT` hook.
If `COLLECT_TIMESTAMPS` can be used on Mediatek platforms, it already implements a list of timestamps that persists across stages and is available in CBMEM after coreboot is done. Using this, it's just a matter of adding a function to the timestamp.h API to get a timestamp by ID, and make sure timestamps are added with `timestamp_add_now()`. If we assert PCIe reset in bootblock, we can use the `End of bootblock` timestamp to calculate the elapsed time.