Attention is currently required from: Furquan Shaikh, Tim Wawrzynczak, Subrata Banik, Patrick Rudolph, EricR Lai. Angel Pons has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/51683 )
Change subject: soc/intel/alderlake: Add provision to override DDR config ......................................................................
Patch Set 4:
(3 comments)
File src/soc/intel/alderlake/meminit.c:
https://review.coreboot.org/c/coreboot/+/51683/comment/5b06cfa9_ddf122de PS4, Line 17: override_ddr_config Maybe `set_rcomp_config`?
https://review.coreboot.org/c/coreboot/+/51683/comment/a160ec69_0694c25a PS4, Line 233: override_ddr_config(mem_cfg, &mb_cfg->ddr_config); Do we need the `OVERRIDE_DDR_CONFIG` Kconfig symbol, though?
As I understand it, the values for RCOMP resistors and RCOMP targets can never be zero. Then, if I'm not mistaken, we can simply check if the mainboard config has a non-zero value, and overwrite the FSP UPDs if so:
if (mb_cfg->ddr_config.rcomp_resistor != 0) mem_cfg->RcompResistor = mb_cfg->ddr_config.rcomp_resistor;
for (size_t i = 0; i < ARRAY_SIZE(mem_cfg->RcompTarget); i++) { if (mb_cfg->ddr_config.rcomp_targets[i] != 0) mem_cfg->RcompTarget[i] = mb_cfg->ddr_config.rcomp_targets[i]; }
With this approach, it is possible to have a mainboard config that only overrides one Rcomp target, and leaves the other Rcomp settings untouched.
https://review.coreboot.org/c/coreboot/+/51683/comment/1b129d75_f124ce76 PS4, Line 238: mb_cfg->ddr_config `mb_cfg->ddr_config` is aliased with `mb_cfg->lp5x_config`, so this will not work. If Rcomp settings also apply to LP5X, I would move the Rcomp fields out of the `ddr_config` struct, and place them in the `mb_cfg` struct.