Hung-Te Lin has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/35164 )
Change subject: soc/mediatek/mt8183: Use cached calibration result for faster bootup ......................................................................
Patch Set 35:
(1 comment)
https://review.coreboot.org/c/coreboot/+/35164/35/src/soc/mediatek/mt8183/in... File src/soc/mediatek/mt8183/include/soc/emi.h:
https://review.coreboot.org/c/coreboot/+/35164/35/src/soc/mediatek/mt8183/in... PS35, Line 24: DRAMC_PARAM_SOURCE_SDRAM_CONFIG = 0, : DRAMC_PARAM_SOURCE_FLASH,
I've thought about it, but then we would have to deal with the _invalid_ case every time. […]
Since you are declaring this as u16, you already need to consider any unexpected values.
In fact I think we don't need to care about invalid case every time, it should be fine to only handle that in where the param is loaded, and the entry of some functions.
And it helps to make sure we won't fail when adding new sources, if we do a switch-case (and default: assert) when different logic is needed.