Add I2C bus DXE driver and I2C host DXE driver following PI 1.3 spec.

Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Leahy Leroy P <leroy.p.leahy@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14549 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Elvin Li 2013-08-14 01:16:06 +00:00 committed by li-elvin
parent 4006b0b550
commit 43e543bcaa
8 changed files with 3975 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,54 @@
## @file
# This driver enumerates I2C devices on I2C bus and produce I2C
# IO Protocol on I2C devices.
#
# Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = I2cBusDxe
FILE_GUID = 0C34B372-2622-4A13-A46E-BFD0DEB48BFF
MODULE_TYPE = UEFI_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = InitializeI2cBus
UNLOAD_IMAGE = I2cBusUnload
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
[Sources.common]
I2cDxe.h
I2cBus.c
[LibraryClasses]
BaseMemoryLib
DebugLib
DevicePathLib
MemoryAllocationLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiLib
[Packages]
MdePkg/MdePkg.dec
[Protocols]
gEfiI2cIoProtocolGuid ## BY_START
gEfiI2cHostProtocolGuid ## BY_START
gEfiI2cMasterProtocolGuid ## TO_START
gEfiI2cEnumerateProtocolGuid ## TO_START
gEfiI2cBusConfigurationManagementProtocolGuid ## TO_START
gEfiI2cHostProtocolGuid ## TO_START

View File

@ -0,0 +1,75 @@
/** @file
This file implements the entrypoint and unload function for I2C DXE module.
Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "I2cDxe.h"
/**
The user Entry Point for I2C module. The user code starts with this function.
@param[in] ImageHandle The firmware allocated handle for the EFI image.
@param[in] SystemTable A pointer to the EFI System Table.
@retval EFI_SUCCESS The entry point is executed successfully.
@retval other Some error occurs when executing this entry point.
**/
EFI_STATUS
EFIAPI
InitializeI2c(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
//
// Install driver model protocol(s).
//
Status = InitializeI2cHost ( ImageHandle, SystemTable );
if ( !EFI_ERROR ( Status ))
{
Status = InitializeI2cBus ( ImageHandle, SystemTable );
}
return Status;
}
/**
This is the unload handle for I2C module.
Disconnect the driver specified by ImageHandle from all the devices in the handle database.
Uninstall all the protocols installed in the driver entry point.
@param[in] ImageHandle The drivers' driver image.
@retval EFI_SUCCESS The image is unloaded.
@retval Others Failed to unload the image.
**/
EFI_STATUS
EFIAPI
I2cUnload (
IN EFI_HANDLE ImageHandle
)
{
EFI_STATUS Status;
//
// Disconnect the drivers
//
Status = I2cBusUnload ( ImageHandle );
if ( !EFI_ERROR ( Status )) {
Status = I2cHostUnload ( ImageHandle );
}
return Status;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,56 @@
## @file
# This driver produce I2C Host Protocol on I2C controller handle, enumerate I2C
# devices on I2C bus and produce I2C IO Protocol on I2C devices.
#
# Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = I2cDxe
FILE_GUID = ECA2AE9E-7594-4901-871C-449DA1A11660
MODULE_TYPE = UEFI_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = InitializeI2c
UNLOAD_IMAGE = I2cUnload
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
[Sources.common]
I2cDxe.c
I2cDxe.h
I2cHost.c
I2cBus.c
[LibraryClasses]
BaseMemoryLib
DebugLib
DevicePathLib
MemoryAllocationLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiLib
[Packages]
MdePkg/MdePkg.dec
[Protocols]
gEfiI2cIoProtocolGuid ## BY_START
gEfiI2cHostProtocolGuid ## BY_START
gEfiI2cMasterProtocolGuid ## TO_START
gEfiI2cEnumerateProtocolGuid ## TO_START
gEfiI2cBusConfigurationManagementProtocolGuid ## TO_START
gEfiI2cHostProtocolGuid ## TO_START

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,53 @@
## @file
# This driver produce I2C Host Protocol on I2C controller handle.
#
# Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
# http://opensource.org/licenses/bsd-license.php
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
#
##
[Defines]
INF_VERSION = 0x00010005
BASE_NAME = I2cHostDxe
FILE_GUID = CDEC3671-816E-43DC-A002-DCD645229338
MODULE_TYPE = UEFI_DRIVER
VERSION_STRING = 1.0
ENTRY_POINT = InitializeI2cHost
UNLOAD_IMAGE = I2cHostUnload
#
# The following information is for reference only and not required by the build tools.
#
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
[Sources.common]
I2cDxe.h
I2cHost.c
[LibraryClasses]
BaseMemoryLib
DebugLib
DevicePathLib
MemoryAllocationLib
UefiBootServicesTableLib
UefiDriverEntryPoint
UefiLib
[Packages]
MdePkg/MdePkg.dec
[Protocols]
gEfiI2cIoProtocolGuid ## BY_START
gEfiI2cHostProtocolGuid ## BY_START
gEfiI2cMasterProtocolGuid ## TO_START
gEfiI2cEnumerateProtocolGuid ## TO_START
gEfiI2cBusConfigurationManagementProtocolGuid ## TO_START
gEfiI2cHostProtocolGuid ## TO_START

View File

@ -214,6 +214,9 @@
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf MdeModulePkg/Bus/Usb/UsbMouseAbsolutePointerDxe/UsbMouseAbsolutePointerDxe.inf
MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
MdeModulePkg/Bus/I2c/I2cDxe/I2cBusDxe.inf
MdeModulePkg/Bus/I2c/I2cDxe/I2cHostDxe.inf
MdeModulePkg/Bus/I2c/I2cDxe/I2cDxe.inf
MdeModulePkg/Core/Dxe/DxeMain.inf { MdeModulePkg/Core/Dxe/DxeMain.inf {
<LibraryClasses> <LibraryClasses>