Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
Split U540 SMBIOS out of PlatformPei
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAZoidberg committed May 13, 2021
1 parent 36bcc51 commit 1442441
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 42 deletions.
17 changes: 1 addition & 16 deletions Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,22 +252,7 @@ BuildCoreInformationHob (
VOID
)
{
EFI_STATUS Status;
RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr;

// TODO: Create SMBIOS libs for non-U540 platforms
Status = CreateU5MCCoreplexProcessorSpecificDataHob (0);
if (EFI_ERROR (Status)) {
ASSERT(FALSE);
}
Status = CreateU5MCProcessorSmbiosDataHob (0, &SmbiosHobPtr);
if (EFI_ERROR (Status)) {
ASSERT(FALSE);
}

DEBUG ((DEBUG_INFO, "U5 MC Coreplex SMBIOS DATA HOB at address 0x%x\n", SmbiosHobPtr));

return EFI_SUCCESS;
return BuildRiscVSmbiosHobs ();
}

/**
Expand Down
31 changes: 5 additions & 26 deletions Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,14 @@
#define SIFIVE_U5MC_COREPLEX_MC_HART_ID 0

/**
Build up U5MC coreplex processor core-specific information.
Build processor and platform information for the U540 platform
@param UniqueId U5MC unique ID.
@return EFI_STATUS
@return EFI_SUCCESS Status.
**/
EFI_STATUS
EFIAPI
CreateU5MCCoreplexProcessorSpecificDataHob (
IN UINTN UniqueId
);

/**
Function to build processor related SMBIOS information. RISC-V SMBIOS DXE driver collect
this information and build SMBIOS Type4 and Type7 record.
@param ProcessorUid Unique ID of pysical processor which owns this core.
@param SmbiosDataHobPtr Pointer to receive RISC_V_PROCESSOR_SMBIOS_DATA_HOB. The pointers
maintained in this structure is only valid before memory is discovered.
Access to those pointers after memory is installed will cause unexpected issues.
BuildRiscVSmbiosHobs (
VOID
);

@return EFI_SUCCESS The PEIM initialized successfully.
**/
EFI_STATUS
EFIAPI
CreateU5MCProcessorSmbiosDataHob (
IN UINTN ProcessorUid,
OUT RISC_V_PROCESSOR_SMBIOS_HOB_DATA **SmbiosDataHobPtr
);
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
@return EFI_SUCCESS The PEIM initialized successfully.
**/
STATIC
EFI_STATUS
EFIAPI
CreateU5MCCoreplexProcessorSpecificDataHob (
Expand Down Expand Up @@ -99,6 +100,7 @@ CreateU5MCCoreplexProcessorSpecificDataHob (
@return EFI_SUCCESS The SMBIOS Hobs were created successfully.
**/
STATIC
EFI_STATUS
EFIAPI
CreateU5MCProcessorSmbiosDataHob (
Expand Down Expand Up @@ -169,3 +171,31 @@ CreateU5MCProcessorSmbiosDataHob (
return EFI_SUCCESS;
#endif
}

/**
Build processor and platform information for the U540 platform
@return EFI_SUCCESS Status.
**/
EFI_STATUS
BuildRiscVSmbiosHobs (
VOID
)
{
EFI_STATUS Status;
RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr;

Status = CreateU5MCCoreplexProcessorSpecificDataHob (0);
if (EFI_ERROR (Status)) {
ASSERT(FALSE);
}
Status = CreateU5MCProcessorSmbiosDataHob (0, &SmbiosHobPtr);
if (EFI_ERROR (Status)) {
ASSERT(FALSE);
}

DEBUG ((DEBUG_INFO, "U5 MC Coreplex SMBIOS DATA HOB at address 0x%x\n", SmbiosHobPtr));

return EFI_SUCCESS;
}

0 comments on commit 1442441

Please sign in to comment.