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
In addition, use the following methods to obtain gI2CIO in the app,
Status = gBS->LocateHandleBuffer(
ByProtocol,
&gEfiI2cIoProtocolGuid,
NULL,
&HandleCount,
&I2CIOHandleBuffer
);
for (HandleIndex = 0; HandleIndex < HandleCount; HandleIndex++)
{
Status = gBS->HandleProtocol(
I2CIOHandleBuffer[HandleIndex],
&gEfiI2cIoProtocolGuid,
(VOID**)&gI2CIO);
}
Then use the following methods to perform I2C IO operations. I2cIo->QueueRequest(I2cIo, 0, NULL, RequestPacket, NULL);
But finally I saw the following message, and measured by LA, I2C IO did not send data: MvI2cDxe: wrong I2cStatus (00) after sending START condition
message from
MvI2cLockedStart (
IN I2C_MASTER_CONTEXT *I2cMasterContext,
IN INT32 Mask,
IN UINT8 Slave,
IN UINTN Timeout
)
{
…
I2cStatus = I2C_READ(I2cMasterContext, I2C_STATUS);
if ((INT32)I2cStatus != Mask) {
DEBUG((DEBUG_ERROR, "MvI2cDxe: wrong I2cStatus (%02x) after sending %sSTART condition\n", I2cStatus, Mask == I2C_STATUS_START ? "" : "repeated "));
return EFI_DEVICE_ERROR;
}
Where I2C_READ is defined as follows:
STATIC
UINT32
I2C_READ(
IN I2C_MASTER_CONTEXT *I2cMasterContext,
IN UINTN off)
{
return MmioRead32 (I2cMasterContext->BaseAddress + off);
}
My environment is as follows
Platform: MinnowBoard max
Code: edk2-platforms\Platform\Intel\Vlv2TbltDevicePkg
My questions are as follows:
In MinnowBoard, can MmioRead32 (I2cMasterContext->BaseAddress + off) IO operations be performed directly like MvI2cDxe?
How to set BaseAddress(host controller address) in MinnowBoard?
How to set Controller’s input clock frequency?
Are there other examples of the I2C master protocol for reference?
Any advice is greatly appreciated!
Thanks!
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
-
In 'MdeModulePkg\Bus\I2c\I2cDxe', since the following protocol is not installed:
So I refer to the example of
\edk2-platforms\Silicon\Marvell\Drivers\I2c\MvI2cDxe
and add the following related itemsIn addition, use the following methods to obtain gI2CIO in the app,
Then use the following methods to perform I2C IO operations.
I2cIo->QueueRequest(I2cIo, 0, NULL, RequestPacket, NULL);
But finally I saw the following message, and measured by LA, I2C IO did not send data:
MvI2cDxe: wrong I2cStatus (00) after sending START condition
message from
Where I2C_READ is defined as follows:
My environment is as follows
My questions are as follows:
Any advice is greatly appreciated!
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions