public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* How to Enable I2c configuration in edk2
@ 2022-09-06  7:39 gordontcp
  0 siblings, 0 replies; only message in thread
From: gordontcp @ 2022-09-06  7:39 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1411 bytes --]

Hi all,
I use the \MdeModulePkg\Bus\I2c\I2cDxe driver and load the driver with the following command:
load I2cDxe.efi
As a result, both I2cHostDriverSupported and I2cBusDriverSupported get the returned value Unsupported. The code is as follows:

I2cHostDriverSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
...
Status = gBS->OpenProtocol (
Controller,
&gEfiI2cBusConfigurationManagementProtocolGuid,
(VOID **)&I2cBusConfigurationManagement,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);
...

I2cBusDriverSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
)
{
..
Status = gBS->OpenProtocol (
Controller,
&gEfiI2cEnumerateProtocolGuid,
(VOID**)&I2cEnumerate,
This->DriverBindingHandle,
Controller,
EFI_OPEN_PROTOCOL_BY_DRIVER
);

My system is as follows:

Platform: Minnowboard Max
pkg : edk2-platform\ Vlv2TbltDevicePkgX64

My questions are as follows:

* Before I2cHostDriverSupported, should I need to enable the host configuratoin, such as setting slave address or frequency? Is there a more complete example?
* For the Minnowboard platform, how to set I2cHostDriverSupported and I2cBusDriverSupported to get the return value of EFI_SUCCESS?

Any suggestion is highly appreciated!

[-- Attachment #2: Type: text/html, Size: 6179 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-06  7:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-06  7:39 How to Enable I2c configuration in edk2 gordontcp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox