Attention is currently required from: Paul Menzel, Rex-BC Chen, Angel Pons, Yu-Ping Wu, Jianjun Wang. Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/62934 )
Change subject: soc/mediatek/mt8195: Reserve memory to store PCIe timestamp ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1: In comparison to a single region with 8 bytes only, I'd rather make it a generic feature for passing data across sessions, especially for early init. This can be useful if someday we have to build up a general framework for eMMC, NVMe, and UFS.
What about
struct mtk_early_init { u64 pcie_timestamp; } *mtk_early_init;
And REGION(MTK_EARLY_INIT)
In bootblock, initialize that to all empty;
struct mtk_early_init *find_early_init() { static_assert(sizeof(struct mtk_early_init) <= REGION_SIZE(mtk_early_init)); return _mtk_early_init; }
void reset_early_init() { struct mtk_early_init *p = find_early_init(); if (!p) return; memset(mtk_early_init, 0, sizeof(*mtk_early_init)); }
There can even be a general early_init.c in common for reset_early_init(); , in pcie_preinit do find_early_init() then update pcie_timestamp to a timestamp, and in NVMe driver, find_early_init(), check if pcie_timestamp is non-zero (if zero, sleep enough time assuming the pre_init was never done), and sleep() by calculating pcie_timestamp.