You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is has an example of I2cDxe driver in edk2, the path is \MdeModulePkg\Bus\I2c\I2cDxe.
However, I can't find an I2C example related to the app.
I use the following function, try to get the I2C handle:
EFI_STATUS LocateI2CIO(void)
{
EFI_STATUS Status;
EFI_HANDLE* I2CIOHandleBuffer = NULL;
UINTNHandleIndex = 0;
UINTNHandleCount = 0;
//get the handles which supports
Status = gBS->LocateHandleBuffer(
ByProtocol,
&gEfiI2cIoProtocolGuid,
NULL,
&HandleCount,
&I2CIOHandleBuffer
);
But the return value is EFI_NOT_FOUND. My system : Minnowboard Max.
By the way, I also loaded I2CDxe.efi, Command : load I2CDxe.efi
The result is as follows:
EFI_STATUS
EFIAPI
I2cBusDriverSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
EFI_STATUS Status;
EFI_I2C_ENUMERATE_PROTOCOL *I2cEnumerate;
EFI_I2C_HOST_PROTOCOL *I2cHost;
EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath;
EFI_DEVICE_PATH_PROTOCOL *DevPathNode;
BOOLEAN RemainingHasControllerNode;
UINT32 RemainingControllerNumber;
RemainingHasControllerNode = FALSE;
RemainingControllerNumber = 0;
//
// Determine if the I2c Enumerate Protocol is available
//
Status = gBS->OpenProtocol (
Controller,
&gEfiI2cEnumerateProtocolGuid,
(VOID**)&I2cEnumerate,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
The above function return value: Status : EFI_UNSUPPORTED
My questions are as follows:
Is there edk2 any full example with I2C operation?
Do I need to load I2CDxe.efi before I2c operation?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
There is has an example of I2cDxe driver in edk2, the path is
\MdeModulePkg\Bus\I2c\I2cDxe
.However, I can't find an I2C example related to the app.
I use the following function, try to get the I2C handle:
But the return value is
EFI_NOT_FOUND
.My system : Minnowboard Max.
By the way, I also loaded I2CDxe.efi,
Command : load I2CDxe.efi
The result is as follows:
The above function return value:
Status : EFI_UNSUPPORTED
My questions are as follows:
Any suggestion is greatly appreciated.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions