+++ /dev/null
-/** @file\r
-Implementation for SMBus DXE driver entry point and SMBus Host\r
-Controller protocol.\r
-\r
-Copyright (c) 2013-2015 Intel Corporation.\r
-\r
-SPDX-License-Identifier: BSD-2-Clause-Patent\r
-\r
-**/\r
-#include "CommonHeader.h"\r
-\r
-#include "DxeQNCSmbus.h"\r
-\r
-//\r
-// Interface defintion of SMBUS Host Controller Protocol.\r
-//\r
-EFI_SMBUS_HC_PROTOCOL mSmbusHc = {\r
- SmbusExecute,\r
- SmbusArpDevice,\r
- SmbusGetArpMap,\r
- SmbusNotify\r
-};\r
-\r
-//\r
-// Handle to install SMBus Host Controller protocol.\r
-//\r
-EFI_HANDLE mSmbusHcHandle = NULL;\r
-UINT8 mDeviceMapEntries = 0;\r
-EFI_SMBUS_DEVICE_MAP mDeviceMap[MAX_SMBUS_DEVICES];\r
-UINT8 mPlatformNumRsvd = 0;\r
-UINT8 *mPlatformAddrRsvd = NULL;\r
-\r
-//\r
-// These addresses are reserved by the SMBus 2.0 specification\r
-//\r
-UINT8 mReservedAddress[SMBUS_NUM_RESERVED] = {\r
- 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x18, 0x50, 0x6E, 0xC2,\r
- 0xF0, 0xF2, 0xF4, 0xF6, 0xF8, 0xFA, 0xFC, 0xFE\r
-};\r
-\r
-\r
-/**\r
- Gets Io port base address of Smbus Host Controller.\r
-\r
- This internal function depends on a feature flag named PcdIchSmbusFixedIoPortBaseAddress\r
- to retrieve Smbus Io port base. If that feature flag is true, it will get Smbus Io port base\r
- address from a preset Pcd entry named PcdIchSmbusIoPortBaseAddress; otherwise, it will always\r
- read Pci configuration space to get that value in each Smbus bus transaction.\r
-\r
- @return The Io port base address of Smbus host controller.\r
-\r
-**/\r
-UINTN\r
-GetSmbusIoPortBaseAddress (\r
- VOID\r
- )\r
-{\r
- UINTN IoPortBaseAddress;\r
-\r
- if (FeaturePcdGet (PcdSmbaIoBaseAddressFixed)) {\r
- IoPortBaseAddress = (UINTN) PcdGet16 (PcdSmbaIoBaseAddress);\r
- } else {\r
- IoPortBaseAddress = (UINTN) LpcPciCfg32 (R_QNC_LPC_SMBUS_BASE) & B_QNC_LPC_SMBUS_BASE_MASK;\r
- }\r
-\r
- //\r
- // Make sure that the IO port base address has been properly set.\r
- //\r
- ASSERT (IoPortBaseAddress != 0);\r
-\r
- return IoPortBaseAddress;\r
-}\r
-\r
-\r
-VOID\r
-InitializeInternal (\r
- )\r
-{\r
- UINTN IoPortBaseAddress;\r
-\r
- IoPortBaseAddress = GetSmbusIoPortBaseAddress ();\r
-\r
- //\r
- // Step1: Enable QNC SMBUS I/O space.\r
- //\r
- LpcPciCfg32Or(R_QNC_LPC_SMBUS_BASE, B_QNC_LPC_SMBUS_BASE_EN);\r
-\r
- //\r
- // Step2: Clear Status Register before anyone uses the interfaces.\r
- //\r
- IoWrite8 (IoPortBaseAddress + R_QNC_SMBUS_HSTS, B_QNC_SMBUS_HSTS_ALL);\r
-\r
- //\r
- // Step3: Program the correct smbus clock\r
- //\r
- IoWrite8 (IoPortBaseAddress + R_QNC_SMBUS_HCLK, V_QNC_SMBUS_HCLK_100KHZ);\r
-}\r
-\r
-\r
-\r
-\r
-BOOLEAN\r
-IsAddressAvailable (\r
- IN EFI_SMBUS_DEVICE_ADDRESS SlaveAddress\r
- )\r
-{\r
- UINT8 Index;\r
-\r
- //\r
- // See if we have already assigned this address to a device\r
- //\r
- for (Index = 0; Index < mDeviceMapEntries; Index++) {\r
- if (SlaveAddress.SmbusDeviceAddress ==\r
- mDeviceMap[Index].SmbusDeviceAddress.SmbusDeviceAddress) {\r
- return FALSE;\r
- }\r
- }\r
-\r
- //\r
- // See if this address is claimed by a platform non-ARP-capable device\r
- //\r
- for (Index = 0; Index < mPlatformNumRsvd; Index++) {\r
- if ((SlaveAddress.SmbusDeviceAddress << 1) == mPlatformAddrRsvd[Index]) {\r
- return FALSE;\r
- }\r
- }\r
-\r
- //\r
- // See if this is a reserved address\r
- //\r
- for (Index = 0; Index < SMBUS_NUM_RESERVED; Index++) {\r
- if (SlaveAddress.SmbusDeviceAddress == (UINTN) mReservedAddress[Index]) {\r
- return FALSE;\r
- }\r
- }\r
-\r
- return TRUE;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-GetNextAvailableAddress (\r
- IN EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress\r
- )\r
-{\r
- for (SlaveAddress->SmbusDeviceAddress = 0x03;\r
- SlaveAddress->SmbusDeviceAddress < 0x7F;\r
- SlaveAddress->SmbusDeviceAddress++\r
- ) {\r
- if (IsAddressAvailable (*SlaveAddress)) {\r
- return EFI_SUCCESS;\r
- }\r
- }\r
-\r
- return EFI_OUT_OF_RESOURCES;\r
-}\r
-\r
-EFI_STATUS\r
-SmbusPrepareToArp (\r
- )\r
-{\r
- EFI_SMBUS_DEVICE_ADDRESS SlaveAddress;\r
- EFI_STATUS Status;\r
- UINTN Length;\r
- UINT8 Buffer;\r
-\r
- SlaveAddress.SmbusDeviceAddress = SMBUS_ADDRESS_ARP;\r
- Length = 1;\r
- Buffer = SMBUS_DATA_PREPARE_TO_ARP;\r
-\r
- Status = Execute (\r
- SlaveAddress,\r
- 0,\r
- EfiSmbusSendByte,\r
- TRUE,\r
- &Length,\r
- &Buffer\r
- );\r
- return Status;\r
-}\r
-\r
-EFI_STATUS\r
-SmbusGetUdidGeneral (\r
- IN OUT EFI_SMBUS_DEVICE_MAP *DeviceMap\r
- )\r
-{\r
- EFI_SMBUS_DEVICE_ADDRESS SlaveAddress;\r
- EFI_STATUS Status;\r
- UINTN Length;\r
- UINT8 Buffer[SMBUS_GET_UDID_LENGTH];\r
-\r
- SlaveAddress.SmbusDeviceAddress = SMBUS_ADDRESS_ARP;\r
- Length = SMBUS_GET_UDID_LENGTH;\r
-\r
- Status = Execute (\r
- SlaveAddress,\r
- SMBUS_DATA_GET_UDID_GENERAL,\r
- EfiSmbusReadBlock,\r
- TRUE,\r
- &Length,\r
- Buffer\r
- );\r
-\r
- if (!EFI_ERROR(Status)) {\r
- if (Length == SMBUS_GET_UDID_LENGTH) {\r
- DeviceMap->SmbusDeviceUdid.DeviceCapabilities = Buffer[0];\r
- DeviceMap->SmbusDeviceUdid.VendorRevision = Buffer[1];\r
- DeviceMap->SmbusDeviceUdid.VendorId = (UINT16)((Buffer[2] << 8) + Buffer[3]);\r
- DeviceMap->SmbusDeviceUdid.DeviceId = (UINT16)((Buffer[4] << 8) + Buffer[5]);\r
- DeviceMap->SmbusDeviceUdid.Interface = (UINT16)((Buffer[6] << 8) + Buffer[7]);\r
- DeviceMap->SmbusDeviceUdid.SubsystemVendorId = (UINT16)((Buffer[8] << 8) + Buffer[9]);\r
- DeviceMap->SmbusDeviceUdid.SubsystemDeviceId = (UINT16)((Buffer[10] << 8) + Buffer[11]);\r
- DeviceMap->SmbusDeviceUdid.VendorSpecificId = (UINT32)((Buffer[12] << 24) + (Buffer[13] << 16) + (Buffer[14] << 8) + Buffer[15]);\r
- DeviceMap->SmbusDeviceAddress.SmbusDeviceAddress = (UINT8)(Buffer[16] >> 1);\r
- } else {\r
- Status = EFI_DEVICE_ERROR;\r
- }\r
- }\r
-\r
- return Status;\r
-}\r
-\r
-EFI_STATUS\r
-SmbusAssignAddress (\r
- IN OUT EFI_SMBUS_DEVICE_MAP *DeviceMap\r
- )\r
-{\r
- EFI_SMBUS_DEVICE_ADDRESS SlaveAddress;\r
- EFI_STATUS Status;\r
- UINTN Length;\r
- UINT8 Buffer[SMBUS_GET_UDID_LENGTH];\r
-\r
- Buffer[0] = DeviceMap->SmbusDeviceUdid.DeviceCapabilities;\r
- Buffer[1] = DeviceMap->SmbusDeviceUdid.VendorRevision;\r
- Buffer[2] = (UINT8)(DeviceMap->SmbusDeviceUdid.VendorId >> 8);\r
- Buffer[3] = (UINT8)(DeviceMap->SmbusDeviceUdid.VendorId);\r
- Buffer[4] = (UINT8)(DeviceMap->SmbusDeviceUdid.DeviceId >> 8);\r
- Buffer[5] = (UINT8)(DeviceMap->SmbusDeviceUdid.DeviceId);\r
- Buffer[6] = (UINT8)(DeviceMap->SmbusDeviceUdid.Interface >> 8);\r
- Buffer[7] = (UINT8)(DeviceMap->SmbusDeviceUdid.Interface);\r
- Buffer[8] = (UINT8)(DeviceMap->SmbusDeviceUdid.SubsystemVendorId >> 8);\r
- Buffer[9] = (UINT8)(DeviceMap->SmbusDeviceUdid.SubsystemVendorId);\r
- Buffer[10] = (UINT8)(DeviceMap->SmbusDeviceUdid.SubsystemDeviceId >> 8);\r
- Buffer[11] = (UINT8)(DeviceMap->SmbusDeviceUdid.SubsystemDeviceId);\r
- Buffer[12] = (UINT8)(DeviceMap->SmbusDeviceUdid.VendorSpecificId >> 24);\r
- Buffer[13] = (UINT8)(DeviceMap->SmbusDeviceUdid.VendorSpecificId >> 16);\r
- Buffer[14] = (UINT8)(DeviceMap->SmbusDeviceUdid.VendorSpecificId >> 8);\r
- Buffer[15] = (UINT8)(DeviceMap->SmbusDeviceUdid.VendorSpecificId);\r
- Buffer[16] = (UINT8)(DeviceMap->SmbusDeviceAddress.SmbusDeviceAddress << 1);\r
-\r
- SlaveAddress.SmbusDeviceAddress = SMBUS_ADDRESS_ARP;\r
- Length = SMBUS_GET_UDID_LENGTH;\r
-\r
- Status = Execute (\r
- SlaveAddress,\r
- SMBUS_DATA_ASSIGN_ADDRESS,\r
- EfiSmbusWriteBlock,\r
- TRUE,\r
- &Length,\r
- Buffer\r
- );\r
- return Status;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-SmbusFullArp (\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_SMBUS_DEVICE_MAP *CurrentDeviceMap;\r
-\r
- Status = SmbusPrepareToArp ();\r
- if (EFI_ERROR(Status)) {\r
- if (Status == EFI_DEVICE_ERROR) {\r
- //\r
- // ARP is complete\r
- //\r
- return EFI_SUCCESS;\r
- } else {\r
- return Status;\r
- }\r
- }\r
-\r
- //\r
- // Main loop to ARP all ARP-capable devices\r
- //\r
- do {\r
- CurrentDeviceMap = &mDeviceMap[mDeviceMapEntries];\r
- Status = SmbusGetUdidGeneral (CurrentDeviceMap);\r
- if (EFI_ERROR(Status)) {\r
- break;\r
- }\r
-\r
- if (CurrentDeviceMap->SmbusDeviceAddress.SmbusDeviceAddress == (0xFF >> 1)) {\r
- //\r
- // If address is unassigned, assign it\r
- //\r
- Status = GetNextAvailableAddress (\r
- &CurrentDeviceMap->SmbusDeviceAddress\r
- );\r
- if (EFI_ERROR(Status)) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
- } else if (((CurrentDeviceMap->SmbusDeviceUdid.DeviceCapabilities) & 0xC0) != 0) {\r
- //\r
- // if address is not fixed, check if the current address is available\r
- //\r
- if (!IsAddressAvailable (\r
- CurrentDeviceMap->SmbusDeviceAddress\r
- )) {\r
- //\r
- // if currently assigned address is already used, get a new one\r
- //\r
- Status = GetNextAvailableAddress (\r
- &CurrentDeviceMap->SmbusDeviceAddress\r
- );\r
- if (EFI_ERROR(Status)) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
- }\r
- }\r
-\r
- Status = SmbusAssignAddress (CurrentDeviceMap);\r
- if (EFI_ERROR(Status)) {\r
- //\r
- // If there was a device error, just continue on and try again.\r
- // Other errors should be reported.\r
- //\r
- if (Status != EFI_DEVICE_ERROR) {\r
- return Status;\r
- }\r
- } else {\r
- //\r
- // If there was no error, the address was assigned and we must update our\r
- // records.\r
- //\r
- mDeviceMapEntries++;\r
- }\r
-\r
- } while (mDeviceMapEntries < MAX_SMBUS_DEVICES);\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-\r
-EFI_STATUS\r
-SmbusDirectedArp (\r
- IN EFI_SMBUS_UDID *SmbusUdid,\r
- IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_SMBUS_DEVICE_MAP *CurrentDeviceMap;\r
-\r
- if (mDeviceMapEntries >= MAX_SMBUS_DEVICES) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
-\r
- CurrentDeviceMap = &mDeviceMap[mDeviceMapEntries];\r
-\r
- //\r
- // Find an available address to assign\r
- //\r
- Status = GetNextAvailableAddress (\r
- &CurrentDeviceMap->SmbusDeviceAddress\r
- );\r
- if (EFI_ERROR(Status)) {\r
- return EFI_OUT_OF_RESOURCES;\r
- }\r
-\r
- CurrentDeviceMap->SmbusDeviceUdid.DeviceCapabilities = SmbusUdid->DeviceCapabilities;\r
- CurrentDeviceMap->SmbusDeviceUdid.DeviceId = SmbusUdid->DeviceId;\r
- CurrentDeviceMap->SmbusDeviceUdid.Interface = SmbusUdid->Interface;\r
- CurrentDeviceMap->SmbusDeviceUdid.SubsystemDeviceId = SmbusUdid->SubsystemDeviceId;\r
- CurrentDeviceMap->SmbusDeviceUdid.SubsystemVendorId = SmbusUdid->SubsystemVendorId;\r
- CurrentDeviceMap->SmbusDeviceUdid.VendorId = SmbusUdid->VendorId;\r
- CurrentDeviceMap->SmbusDeviceUdid.VendorRevision = SmbusUdid->VendorRevision;\r
- CurrentDeviceMap->SmbusDeviceUdid.VendorSpecificId = SmbusUdid->VendorSpecificId;\r
-\r
- Status = SmbusAssignAddress (CurrentDeviceMap);\r
- if (EFI_ERROR(Status)) {\r
- return Status;\r
- }\r
-\r
- mDeviceMapEntries++;\r
- SlaveAddress->SmbusDeviceAddress = CurrentDeviceMap->SmbusDeviceAddress.SmbusDeviceAddress;\r
-\r
- return EFI_SUCCESS;\r
-}\r
-\r
-\r
-\r
-/**\r
- Executes an SMBus operation to an SMBus controller. Returns when either the command has been\r
- executed or an error is encountered in doing the operation.\r
-\r
- The Execute() function provides a standard way to execute an operation as defined in the System\r
- Management Bus (SMBus) Specification. The resulting transaction will be either that the SMBus\r
- slave devices accept this transaction or that this function returns with error.\r
-\r
- @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
- @param SlaveAddress The SMBus slave address of the device with which to communicate.\r
- @param Command This command is transmitted by the SMBus host controller to the\r
- SMBus slave device and the interpretation is SMBus slave device\r
- specific. It can mean the offset to a list of functions inside an\r
- SMBus slave device. Not all operations or slave devices support\r
- this command's registers.\r
- @param Operation Signifies which particular SMBus hardware protocol instance that\r
- it will use to execute the SMBus transactions. This SMBus\r
- hardware protocol is defined by the SMBus Specification and is\r
- not related to EFI.\r
- @param PecCheck Defines if Packet Error Code (PEC) checking is required for this\r
- operation.\r
- @param Length Signifies the number of bytes that this operation will do. The\r
- maximum number of bytes can be revision specific and operation\r
- specific. This field will contain the actual number of bytes that\r
- are executed for this operation. Not all operations require this\r
- argument.\r
- @param Buffer Contains the value of data to execute to the SMBus slave device.\r
- Not all operations require this argument. The length of this\r
- buffer is identified by Length.\r
-\r
- @retval EFI_SUCCESS The last data that was returned from the access matched the poll\r
- exit criteria.\r
- @retval EFI_CRC_ERROR Checksum is not correct (PEC is incorrect).\r
- @retval EFI_TIMEOUT Timeout expired before the operation was completed. Timeout is\r
- determined by the SMBus host controller device.\r
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
- @retval EFI_DEVICE_ERROR The request was not completed because a failure that was\r
- reflected in the Host Status Register bit. Device errors are a\r
- result of a transaction collision, illegal command field,\r
- unclaimed cycle (host initiated), or bus errors (collisions).\r
- @retval EFI_INVALID_PARAMETER Operation is not defined in EFI_SMBUS_OPERATION.\r
- @retval EFI_INVALID_PARAMETER Length/Buffer is NULL for operations except for EfiSmbusQuickRead\r
- and EfiSmbusQuickWrite. Length is outside the range of valid\r
- values.\r
- @retval EFI_UNSUPPORTED The SMBus operation or PEC is not supported.\r
- @retval EFI_BUFFER_TOO_SMALL Buffer is not sufficient for this operation.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmbusExecute (\r
- IN CONST EFI_SMBUS_HC_PROTOCOL *This,\r
- IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r
- IN CONST EFI_SMBUS_DEVICE_COMMAND Command,\r
- IN CONST EFI_SMBUS_OPERATION Operation,\r
- IN CONST BOOLEAN PecCheck,\r
- IN OUT UINTN *Length,\r
- IN OUT VOID *Buffer\r
- )\r
-{\r
- InitializeInternal ();\r
- return Execute (\r
- SlaveAddress,\r
- Command,\r
- Operation,\r
- PecCheck,\r
- Length,\r
- Buffer\r
- );\r
-}\r
-\r
-/**\r
- Sets the SMBus slave device addresses for the device with a given unique ID or enumerates the\r
- entire bus.\r
-\r
- The ArpDevice() function provides a standard way for a device driver to enumerate the entire\r
- SMBus or specific devices on the bus.\r
-\r
- @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
- @param ArpAll A Boolean expression that indicates if the host drivers need to\r
- enumerate all the devices or enumerate only the device that is\r
- identified by SmbusUdid. If ArpAll is TRUE, SmbusUdid and\r
- SlaveAddress are optional. If ArpAll is FALSE, ArpDevice will\r
- enumerate SmbusUdid and the address will be at SlaveAddress.\r
- @param SmbusUdid The Unique Device Identifier (UDID) that is associated with this\r
- device.\r
- @param SlaveAddress The SMBus slave address that is associated with an SMBus UDID.\r
-\r
- @retval EFI_SUCCESS The last data that was returned from the access matched the poll\r
- exit criteria.\r
- @retval EFI_CRC_ERROR Checksum is not correct (PEC is incorrect).\r
- @retval EFI_TIMEOUT Timeout expired before the operation was completed. Timeout is\r
- determined by the SMBus host controller device.\r
- @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
- @retval EFI_DEVICE_ERROR The request was not completed because a failure that was\r
- reflected in the Host Status Register bit. Device errors are a\r
- result of a transaction collision, illegal command field,\r
- unclaimed cycle (host initiated), or bus errors (collisions).\r
- @retval EFI_UNSUPPORTED The corresponding SMBus operation is not supported.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmbusArpDevice (\r
- IN CONST EFI_SMBUS_HC_PROTOCOL *This,\r
- IN BOOLEAN ArpAll,\r
- IN EFI_SMBUS_UDID *SmbusUdid, OPTIONAL\r
- IN OUT EFI_SMBUS_DEVICE_ADDRESS *SlaveAddress OPTIONAL\r
- )\r
-{\r
- InitializeInternal ();\r
-\r
- if (ArpAll) {\r
- return SmbusFullArp ();\r
- } else {\r
- if ((SmbusUdid == NULL) || (SlaveAddress == NULL)) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
- return SmbusDirectedArp ((EFI_SMBUS_UDID *)SmbusUdid, SlaveAddress);\r
- }\r
-}\r
-\r
-/**\r
- Returns a pointer to the Address Resolution Protocol (ARP) map that contains the ID/address pair\r
- of the slave devices that were enumerated by the SMBus host controller driver.\r
-\r
- The GetArpMap() function returns the mapping of all the SMBus devices that were enumerated by the\r
- SMBus host driver.\r
-\r
- @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
- @param Length Size of the buffer that contains the SMBus device map.\r
- @param SmbusDeviceMap The pointer to the device map as enumerated by the SMBus\r
- controller driver.\r
-\r
- @retval EFI_SUCCESS The SMBus returned the current device map.\r
- @retval EFI_UNSUPPORTED The corresponding operation is not supported.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmbusGetArpMap (\r
- IN CONST EFI_SMBUS_HC_PROTOCOL *This,\r
- IN OUT UINTN *Length,\r
- IN OUT EFI_SMBUS_DEVICE_MAP **SmbusDeviceMap\r
- )\r
-{\r
- *Length = mDeviceMapEntries;\r
- *SmbusDeviceMap = mDeviceMap;\r
- return EFI_SUCCESS;\r
-}\r
-\r
-\r
-/**\r
- Allows a device driver to register for a callback when the bus driver detects a state that it\r
- needs to propagate to other drivers that are registered for a callback.\r
-\r
- The Notify() function registers all the callback functions to allow the bus driver to call these\r
- functions when the SlaveAddress/Data pair happens.\r
- If NotifyFunction is NULL, then ASSERT ().\r
-\r
- @param This A pointer to the EFI_SMBUS_HC_PROTOCOL instance.\r
- @param SlaveAddress The SMBUS hardware address to which the SMBUS device is\r
- preassigned or allocated.\r
- @param Data Data of the SMBus host notify command that the caller wants to be\r
- called.\r
- @param NotifyFunction The function to call when the bus driver detects the SlaveAddress\r
- and Data pair.\r
-\r
- @retval EFI_SUCCESS NotifyFunction was registered.\r
- @retval EFI_UNSUPPORTED The corresponding operation is not supported.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-SmbusNotify (\r
- IN CONST EFI_SMBUS_HC_PROTOCOL *This,\r
- IN CONST EFI_SMBUS_DEVICE_ADDRESS SlaveAddress,\r
- IN CONST UINTN Data,\r
- IN CONST EFI_SMBUS_NOTIFY_FUNCTION NotifyFunction\r
- )\r
-{\r
- return EFI_UNSUPPORTED;\r
-}\r
-\r
-/**\r
- Entry point to the DXE Driver that produces the SMBus Host Controller Protocol.\r
-\r
- @param ImageHandle ImageHandle of the loaded driver.\r
- @param SystemTable Pointer to the EFI System Table.\r
-\r
- @retval EFI_SUCCESS The entry point of SMBus DXE driver is executed successfully.\r
- @retval !EFI_SUCESS Some error occurs in the entry point of SMBus DXE driver.\r
-\r
-**/\r
-EFI_STATUS\r
-EFIAPI\r
-InitializeQNCSmbus (\r
- IN EFI_HANDLE ImageHandle,\r
- IN EFI_SYSTEM_TABLE *SystemTable\r
- )\r
-{\r
- EFI_STATUS Status;\r
-\r
- mPlatformNumRsvd = (UINT8)PcdGet32 (PcdPlatformSmbusAddrNum);\r
- mPlatformAddrRsvd = (UINT8 *)(UINTN) PcdGet64 (PcdPlatformSmbusAddrTable);\r
-\r
- //\r
- // Install SMBus Host Controller protocol interface.\r
- //\r
- Status = gBS->InstallMultipleProtocolInterfaces (\r
- &mSmbusHcHandle,\r
- &gEfiSmbusHcProtocolGuid,\r
- &mSmbusHc,\r
- NULL\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- return Status;\r
-}\r