Attention is currently required from: Arthur Heymans, Christian Walter, Jincheng Li, Johnny Lin, Jonathan Zhang, Lean Sheng Tan, Patrick Rudolph, Shuo Liu, Tim Chu.
Angel Pons has posted comments on this change by Shuo Liu. ( https://review.coreboot.org/c/coreboot/+/83325?usp=email )
Change subject: soc/intel/xeon_sp: Share save_dimm_info among Xeon-SP SoCs ......................................................................
Patch Set 3:
(5 comments)
File src/soc/intel/xeon_sp/cpx/romstage.c:
https://review.coreboot.org/c/coreboot/+/83325/comment/cfcb05bf_3b26dede?usp... : PS3, Line 126: MEMORY_TYPE_DDR4 Note to self: it's equivalent `MEMORY_TYPE_DDR4 = 0x1a`
File src/soc/intel/xeon_sp/gnr/romstage.c:
https://review.coreboot.org/c/coreboot/+/83325/comment/b7afc921_8dfdf134?usp... : PS3, Line 90: uint8_t get_dram_type(void) : { : const struct SystemMemoryMapHob *hob = get_system_memory_map(); : if (hob && hob->DramType == SPD_MEMORY_TYPE_DDR5_SDRAM) The code that has been factored out (made shared) uses `struct SystemMemoryMapHob` already. So, instead of getting it here, why not do:
```suggestion uint8_t get_dram_type(const struct SystemMemoryMapHob *hob) { if (hob->DramType == SPD_MEMORY_TYPE_DDR5_SDRAM) ```
I intentionally removed the NULL check: `save_dimm_info()` already checks that the pointer is non-NULL.
File src/soc/intel/xeon_sp/romstage.c:
https://review.coreboot.org/c/coreboot/+/83325/comment/09fbdc56_b1680f28?usp... : PS3, Line 43: #if CONFIG(SOC_INTEL_SKYLAKE_SP) Hmmm, instead of this, why not place `save_dimm_info()` in a separate `dimm_info.c` file, and compile it only for platforms that use it?
https://review.coreboot.org/c/coreboot/+/83325/comment/56e8081e_c50c18d7?usp... : PS3, Line 69: : for (int skt = 0; skt < CONFIG_MAX_SOCKET; skt++) { : for (int ch = 0; ch < MAX_CH; ch++) { : for (int dimm = 0; dimm < get_max_dimm_count(); dimm++) { nit: if `get_max_dimm_count()` always returns the same value, I would add a helper constant:
```suggestion const int max_dimm_count = get_max_dimm_count(); int dimm_num = 0; for (int skt = 0; skt < CONFIG_MAX_SOCKET; skt++) { for (int ch = 0; ch < MAX_CH; ch++) { for (int dimm = 0; dimm < max_dimm_count; dimm++) { ```
File src/soc/intel/xeon_sp/spr/romstage.c:
https://review.coreboot.org/c/coreboot/+/83325/comment/7a821cc4_e41bf4a9?usp... : PS3, Line 132: uint32_t get_max_capacity_mib(void) Move this next to the other functions?