> > Leif, > Please understand that the concern of this change is all the platforms that > uses > this serial port lib must be changed otherwise build breaks. > > Ard, > Using Guided HOB sounds a good idea to me: ) > The benefits of using HOB is: > Length field in the HOB header can be used for extension if more parameters > are needed.
This sounds really appealing to me as well. Because in the past we had received request from our customers about changing the UART baud rate in production system, without having to recompile the firmware. Up until now, the only method we have is UEFI shell, whose changes would take effect after BDS phase. With GUID HOB, we can update the baud rate as early as PEI phase. > DXE can have the HOB access as well. > > EFI_SEC_HOB_DATA_PPI can be used to return the new Guided HOB from SEC > phase if needed. So I made changes that pass EFI_SEC_HOB_DATA_PPI from SEC to PEI core. I had to remove SerialPortInitialize call from SEC phase, as in SEC phase we don't have HOB support. I am able to get the clock in PEI phase. However this fails in DXE phase. This is happening because the dependency of SerialPortConstructor on HobLibConstructor. This is the Autogen.h file of PcdDxe: VOID EFIAPI ProcessLibraryConstructorList ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { EFI_STATUS Status; Status = BaseDebugLibSerialPortConstructor (); ASSERT_RETURN_ERROR (Status); Status = UefiBootServicesTableLibConstructor (ImageHandle, SystemTable); ASSERT_EFI_ERROR (Status); Status = UefiRuntimeServicesTableLibConstructor (ImageHandle, SystemTable); ASSERT_EFI_ERROR (Status); Status = UefiLibConstructor (ImageHandle, SystemTable); ASSERT_EFI_ERROR (Status); Status = HobLibConstructor (ImageHandle, SystemTable); ASSERT_EFI_ERROR (Status); } As you can see, the SerialPortConstructor is called first, which tries to retrieve the Guided HOB. This in turn calls the EfiGetSystemConfigurationTable(&gEfiHobListGuid, &mHobList), Which relies on gST pointer being set. Which would be set in UefiBootServicesTableLibConstructor. How can we ensure that the SerialPortConstructor is called after HobLibConstructor ? > > Thanks, > Ray > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#57254): https://edk2.groups.io/g/devel/message/57254 Mute This Topic: https://groups.io/mt/71393886/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-