Skip to content

Commit

Permalink
ManageabilityPkg: Add serial protocol in IPMI driver
Browse files Browse the repository at this point in the history
This introduces serial protocol in IPMI driver.

Signed-off-by: John Chung <[email protected]>
  • Loading branch information
gtossk2 committed Dec 9, 2024
1 parent ca3f2eb commit 3e28a2e
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ SetupIpmiTransportHardwareInformation (
OUT MANAGEABILITY_TRANSPORT_HARDWARE_INFORMATION *HardwareInformation
)
{
MANAGEABILITY_TRANSPORT_KCS_HARDWARE_INFO *KcsHardwareInfo;
MANAGEABILITY_TRANSPORT_SSIF_HARDWARE_INFO *SsifHardwareInfo;
MANAGEABILITY_TRANSPORT_KCS_HARDWARE_INFO *KcsHardwareInfo;
MANAGEABILITY_TRANSPORT_SSIF_HARDWARE_INFO *SsifHardwareInfo;
MANAGEABILITY_TRANSPORT_SERIAL_HARDWARE_INFO *SerialHardwareInfo;

if (CompareGuid (&gManageabilityTransportKcsGuid, TransportToken->Transport->ManageabilityTransportSpecification)) {
// This is KCS transport interface.
Expand Down Expand Up @@ -67,6 +68,20 @@ SetupIpmiTransportHardwareInformation (
SsifHardwareInfo->BmcSlaveAddress = IPMI_SSIF_BMC_SLAVE_ADDRESS;
HardwareInformation->Ssif = SsifHardwareInfo;
return EFI_SUCCESS;
} else if (CompareGuid (&gManageabilityTransportSerialGuid, TransportToken->Transport->ManageabilityTransportSpecification)) {
// This is Serial transport interface.
SerialHardwareInfo = AllocatePool (sizeof (MANAGEABILITY_TRANSPORT_SERIAL_HARDWARE_INFO));
if (SerialHardwareInfo == NULL) {
DEBUG ((DEBUG_ERROR, "%a: Not enough memory for MANAGEABILITY_TRANSPORT_SERIAL_HARDWARE_INFO.\n", __func__));
return EFI_OUT_OF_RESOURCES;
}

SerialHardwareInfo->IpmiRequesterAddress = IPMI_SERIAL_REQUESTER_ADDRESS;
SerialHardwareInfo->IpmiResponderAddress = IPMI_SERIAL_RESPONDER_ADDRESS;
SerialHardwareInfo->IpmiRequesterLUN = IPMI_SERIAL_REQUESTER_LUN;
SerialHardwareInfo->IpmiResponderLUN = IPMI_SERIAL_RESPONDER_LUN;
HardwareInformation->Serial = SerialHardwareInfo;
return EFI_SUCCESS;
} else {
DEBUG ((DEBUG_ERROR, "%a: No implementation of setting hardware information.", __func__));
ASSERT (FALSE);
Expand Down Expand Up @@ -117,7 +132,8 @@ SetupIpmiRequestTransportPacket (
MANAGEABILITY_IPMI_TRANSPORT_HEADER *IpmiHeader;

if ( CompareGuid (&gManageabilityTransportKcsGuid, TransportToken->Transport->ManageabilityTransportSpecification)
|| CompareGuid (&gManageabilityTransportSmbusI2cGuid, TransportToken->Transport->ManageabilityTransportSpecification))
|| CompareGuid (&gManageabilityTransportSmbusI2cGuid, TransportToken->Transport->ManageabilityTransportSpecification)
|| CompareGuid (&gManageabilityTransportSerialGuid, TransportToken->Transport->ManageabilityTransportSpecification))
{
IpmiHeader = AllocateZeroPool (sizeof (MANAGEABILITY_IPMI_TRANSPORT_HEADER));
if (IpmiHeader == NULL) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
///
#define IPMI_SSIF_BMC_SLAVE_ADDRESS FixedPcdGet8 (PcdIpmiSsifSmbusSlaveAddr)

///
/// IPMI Serial hardware information.
///
#define IPMI_SERIAL_REQUESTER_ADDRESS FixedPcdGet8 (PcdIpmiSerialRequesterAddress)
#define IPMI_SERIAL_RESPONDER_ADDRESS FixedPcdGet8 (PcdIpmiSerialResponderAddress)
#define IPMI_SERIAL_REQUESTER_LUN FixedPcdGet8 (PcdIpmiSerialRequesterLun)
#define IPMI_SERIAL_RESPONDER_LUN FixedPcdGet8 (PcdIpmiSerialResponderLun)

/**
This functions setup the IPMI transport hardware information according
to the specification of transport token acquired from transport library.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@
gManageabilityProtocolIpmiGuid
gManageabilityTransportKcsGuid
gManageabilityTransportSmbusI2cGuid
gManageabilityTransportSerialGuid

[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress # Used as default KCS I/O base adddress
gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifSmbusSlaveAddr
gEfiMdePkgTokenSpaceGuid.PcdIpmiSerialRequesterAddress
gEfiMdePkgTokenSpaceGuid.PcdIpmiSerialResponderAddress
gEfiMdePkgTokenSpaceGuid.PcdIpmiSerialRequesterLun
gEfiMdePkgTokenSpaceGuid.PcdIpmiSerialResponderLun

[Depex]
TRUE

0 comments on commit 3e28a2e

Please sign in to comment.