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:
(3 comments)
https://review.coreboot.org/c/coreboot/+/35164/35/src/soc/mediatek/mt8183/dr... File src/soc/mediatek/mt8183/dramc_pi_calibration_api.c:
https://review.coreboot.org/c/coreboot/+/35164/35/src/soc/mediatek/mt8183/dr... PS35, Line 1011: if (params->source == DRAMC_PARAM_SOURCE_FLASH) { : dramc_dbg("[bypass Gating]\n"); : } else { if (param->source == DRAMC_PARAM_SOURCE_SDRAM_CONFIG) { .... }
https://review.coreboot.org/c/coreboot/+/35164/29/src/soc/mediatek/mt8183/em... File src/soc/mediatek/mt8183/emi.c:
https://review.coreboot.org/c/coreboot/+/35164/29/src/soc/mediatek/mt8183/em... PS29, Line 365: const struct sdram_params *freq_params
Done
That's not a problem, as long as we don't need complete definition in emi.h.
In emi.h you can declare a struct without body:
struct dramc_param;
Then you can use "struct dramc_param *param" in the function prototypes.
And in the .c file you have to include dramc_param.h, then you can use the fields inside struct.
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, What about adding a DRAMC_PARAM_SOURCE_INVALID = 0 ?
Then we can make sure if people didn't load or set properly, the config won't work.