Attention is currently required from: Furquan Shaikh, Martin Roth, Subrata Banik, Meera Ravindranath, Aamir Bohra, Tim Wawrzynczak, Andrey Petrov, Patrick Rudolph. Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/49474 )
Change subject: drivers/intel/fsp2_0: Add support for MP PPI services2 APIs ......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4: Aamir, I think I have some ideas here, let me know what you think.
It looks like the difference between MPServices 1 & 2 is: 1) A new callback StartupAllCPUs 2) Change from EFI_PEI_MP_SERVICES_PPI to EDKII_PEI_MP_SERVICES2_PPI 3) Dropped the EFI_PEI_SERVICES** parameter from all of the callbacks
Therefore, the underlying implementations of each callback, from coreboot's POV, is identical.
So, I propose to change the driver to look more like the following:
Keep just one mp_service_ppi.c file, but instead of directly installing each function, organize like the following:
``` static efi_return_status_t mp_get_number_of_processors( efi_uintn_t *number_of_processors, efi_uintn_t *number_of_enabled_processors) { if (number_of_processors == NULL || number_of_enabled_processors == NULL) return FSP_INVALID_PARAMETER;
*number_of_processors = get_cpu_count(); *number_of_enabled_processors = get_cpu_count(); } efi_return_status_t mps2_get_number_of_processors( efi_pei_mp_services_ppi *ignored1, efi_uintn_t *number_of_processors, efi_uintn_t *number_of_enabled_processors) { return mp_get_number_of_processors(number_of_processors, number_of_enabled_processors); }
efi_return_status_t mps1_get_number_of_processors(const efi_pei_services **ignored1, efi_pei_mp_services_ppi *ignored2, efi_uintn_t *number_of_processors, efi_uintn_t *number_of_enabled_processors) { return mp_get_number_of_processors(number_of_processors, number_of_enabled_processors); }
/* similarly for each callback that is shared... */
```
then add prototypes for the mps1_ and mps2_ functions to a local header file, and add an mps1.c and mps2.c (or similar) which have the appropriate ``` static efi_pei_mp_services_ppi mp_service_ppi = { ... };
efi_pei_mp_services_ppi *mp_fill_ppi_services_data(void) { return mp_service_ppi; } ```
section for each type.
WDYT Aamir?