]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Remove the instance of BaseSmbusLib
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 23 Jul 2006 12:55:55 +0000 (12:55 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Sun, 23 Jul 2006 12:55:55 +0000 (12:55 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1076 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/BaseSmbusLib/BaseSmbusLib.msa [deleted file]
MdePkg/Library/BaseSmbusLib/SmbusLib.c [deleted file]
MdePkg/Library/BaseSmbusLib/SmbusLibRegisters.h [deleted file]

diff --git a/MdePkg/Library/BaseSmbusLib/BaseSmbusLib.msa b/MdePkg/Library/BaseSmbusLib/BaseSmbusLib.msa
deleted file mode 100644 (file)
index ab20f69..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-<!--\r
-Copyright (c) 2006, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
--->\r
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0">\r
-  <MsaHeader>\r
-    <ModuleName>BaseSmbusLib</ModuleName>\r
-    <ModuleType>BASE</ModuleType>\r
-    <GuidValue>4c38a173-b317-4f29-a7bf-1cc7e10ccb10</GuidValue>\r
-    <Version>1.0</Version>\r
-    <Abstract>Component description file for Base Smbus Library.</Abstract>\r
-    <Description>SMBUS Library that layers on top of the I/O Library to directly\r
-      access a standard SMBUS host controller.</Description>\r
-    <Copyright>Copyright (c) 2006, Intel Corporation.</Copyright>\r
-    <License>All rights reserved. This program and the accompanying materials\r
-      are licensed and made available under the terms and conditions of the BSD License\r
-      which accompanies this distribution.  The full text of the license may be found at\r
-      http://opensource.org/licenses/bsd-license.php\r
-      THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-      WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.</License>\r
-    <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION   0x00000052</Specification>\r
-  </MsaHeader>\r
-  <ModuleDefinitions>\r
-    <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>\r
-    <BinaryModule>false</BinaryModule>\r
-    <OutputFileBasename>BaseSmbusLib</OutputFileBasename>\r
-  </ModuleDefinitions>\r
-  <LibraryClassDefinitions>\r
-    <LibraryClass Usage="ALWAYS_PRODUCED">\r
-      <Keyword>SmbusLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>BaseLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>IoLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>PciLib</Keyword>\r
-    </LibraryClass>\r
-    <LibraryClass Usage="ALWAYS_CONSUMED">\r
-      <Keyword>DebugLib</Keyword>\r
-    </LibraryClass>\r
-  </LibraryClassDefinitions>\r
-  <SourceFiles>\r
-    <Filename>SmbusLibRegisters.h</Filename>\r
-    <Filename>SmbusLib.c</Filename>\r
-  </SourceFiles>\r
-  <PackageDependencies>\r
-    <Package PackageGuid="5e0e9358-46b6-4ae2-8218-4ab8b9bbdcec"/>\r
-  </PackageDependencies>\r
-  <Externs>\r
-    <Specification>EFI_SPECIFICATION_VERSION 0x00020000</Specification>\r
-    <Specification>EDK_RELEASE_VERSION 0x00020000</Specification>\r
-  </Externs>\r
-</ModuleSurfaceArea>
\ No newline at end of file
diff --git a/MdePkg/Library/BaseSmbusLib/SmbusLib.c b/MdePkg/Library/BaseSmbusLib/SmbusLib.c
deleted file mode 100644 (file)
index 16ae2fa..0000000
+++ /dev/null
@@ -1,833 +0,0 @@
-/** @file\r
-  Base SMBUS library implementation built upon I/O library.\r
-\r
-  Copyright (c) 2006, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  SmbusLib.c\r
-\r
-**/\r
-\r
-#include "SmbusLibRegisters.h"\r
-\r
-#define SMBUS_LIB_SLAVE_ADDRESS(SmBusAddress)      (((SmBusAddress) >> 1)  & 0x7f)\r
-#define SMBUS_LIB_COMMAND(SmBusAddress)            (((SmBusAddress) >> 8)  & 0xff)\r
-#define SMBUS_LIB_LENGTH(SmBusAddress)             (((SmBusAddress) >> 16) & 0x3f)\r
-#define SMBUS_LIB_PEC(SmBusAddress)     ((BOOLEAN) (((SmBusAddress) & SMBUS_LIB_PEC_BIT) != 0))\r
-#define SMBUS_LIB_RESEARVED(SmBusAddress)          ((SmBusAddress) & ~(((1 << 22) - 2) | SMBUS_LIB_PEC_BIT))\r
-\r
-//\r
-// Replaced by PCD\r
-//\r
-#define ICH_SMBUS_IO_BASE_ADDRESS               0xEFA0\r
-\r
-/**\r
-  Reads an 8-bit register on ICH SMBUS controller.\r
-\r
-  This internal function reads an SMBUS register specified by Offset.\r
-\r
-  @param  Offset  The offset of SMBUS register.\r
-\r
-  @return The value read.\r
-\r
-**/\r
-UINT8\r
-InternalSmBusIoRead8 (\r
-  IN UINTN      Offset\r
-  )\r
-{\r
-  return IoRead8 (ICH_SMBUS_IO_BASE_ADDRESS + Offset);\r
-}\r
-\r
-/**\r
-  Writes an 8-bit register on ICH SMBUS controller.\r
-\r
-  This internal function writes an SMBUS register specified by Offset.\r
-\r
-  @param  Offset  The offset of SMBUS register.\r
-  @param  Value   The value to write to SMBUS register.\r
-\r
-  @return The value written the SMBUS register.\r
-\r
-**/\r
-UINT8\r
-InternalSmBusIoWrite8 (\r
-  IN UINTN      Offset,\r
-  IN UINT8      Value\r
-  )\r
-{\r
-  return IoWrite8 (ICH_SMBUS_IO_BASE_ADDRESS + Offset, Value);\r
-}\r
-\r
-/**\r
-  Acquires the ownership of SMBUS.\r
-\r
-  This internal function reads the host state register.\r
-  If the SMBUS is not available, RETURN_TIMEOUT is returned;\r
-  Otherwise, it performs some basic initializations and returns\r
-  RETURN_SUCCESS. \r
-\r
-  @retval RETURN_SUCCESS    The SMBUS command was executed successfully.\r
-  @retval RETURN_TIMEOUT    A timeout occurred while executing the SMBUS command.\r
-\r
-**/\r
-RETURN_STATUS\r
-InternalSmBusAcquire (\r
-  VOID \r
-  )\r
-{\r
-  UINT8   HostStatus;\r
-\r
-  HostStatus = InternalSmBusIoRead8 (SMBUS_R_HST_STS);\r
-  if ((HostStatus & SMBUS_B_INUSE_STS) != 0) {\r
-    return RETURN_TIMEOUT;\r
-  } else if ((HostStatus & SMBUS_B_HOST_BUSY) != 0) {\r
-    //\r
-    // Clear host status register and exit.\r
-    //\r
-    InternalSmBusIoWrite8 (SMBUS_R_HST_STS, SMBUS_B_HSTS_ALL);\r
-    return RETURN_TIMEOUT;\r
-  }\r
-  //\r
-  // Clear out any odd status information (Will Not Clear In Use).\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_HST_STS, HostStatus);\r
-  \r
-  return RETURN_SUCCESS;\r
-}\r
-\r
-/**\r
-  Starts the SMBUS transaction and waits until the end.\r
-\r
-  This internal function start the SMBUS transaction and waits until the transaction\r
-  of SMBUS is over by polling the INTR bit of Host status register.\r
-  If the SMBUS is not available, RETURN_TIMEOUT is returned;\r
-  Otherwise, it performs some basic initializations and returns\r
-  RETURN_SUCCESS.\r
-  \r
-  @param  HostControl         The Host control command to start SMBUS transaction.\r
-\r
-  @retval RETURN_SUCCESS      The SMBUS command was executed successfully.\r
-  @retval RETURN_CRC_ERROR    The checksum is not correct (PEC is incorrect).\r
-  @retval RETURN_DEVICE_ERROR The request was not completed because a failure reflected\r
-                              in the Host Status Register bit.  Device errors are\r
-                              a result of a transaction collision, illegal command field,\r
-                              unclaimed cycle (host initiated), or bus errors (collisions).\r
-\r
-**/\r
-RETURN_STATUS\r
-InternalSmBusStart (\r
-  IN  UINT8                   HostControl\r
-  )\r
-{\r
-  UINT8   HostStatus;\r
-  UINT8   AuxiliaryStatus;\r
-\r
-  //\r
-  // Set Host Control Register (Initiate Operation, Interrupt disabled).\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_HST_CTL, HostControl + SMBUS_B_START);\r
-\r
-  do {\r
-    //\r
-    // Poll INTR bit of Host Status Register.\r
-    //\r
-    HostStatus = InternalSmBusIoRead8 (SMBUS_R_HST_STS);\r
-  } while ((HostStatus & (SMBUS_B_INTR | SMBUS_B_ERROR | SMBUS_B_BYTE_DONE_STS)) == 0);\r
-  \r
-  if ((HostStatus & SMBUS_B_ERROR) == 0) {\r
-    return RETURN_SUCCESS;\r
-  }\r
-  //\r
-  // Clear error bits of Host Status Register.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_HST_STS, SMBUS_B_ERROR);\r
-  //\r
-  // Read Auxiliary Status Register to judge CRC error.\r
-  //\r
-  AuxiliaryStatus = InternalSmBusIoRead8 (SMBUS_R_AUX_STS);\r
-  if ((AuxiliaryStatus & SMBUS_B_CRCE) != 0) {\r
-    return RETURN_CRC_ERROR;\r
-  }\r
-\r
-  return RETURN_DEVICE_ERROR;\r
-}\r
-\r
-/**\r
-  Executes an SMBUS quick, byte or word command.\r
-\r
-  This internal function executes an SMBUS quick, byte or word commond.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-\r
-  @param  HostControl     The value of Host Control Register to set.  \r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Value           The byte/word write to the SMBUS.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The byte/word read from the SMBUS.\r
-\r
-**/\r
-UINT16\r
-InternalSmBusNonBlock (\r
-  IN  UINT8                     HostControl,\r
-  IN  UINTN                     SmBusAddress,\r
-  IN  UINT16                    Value,\r
-  OUT RETURN_STATUS             *Status\r
-  )\r
-{\r
-  RETURN_STATUS                 ReturnStatus;\r
-  UINT8                         AuxiliaryControl;\r
-\r
-  //\r
-  // Try to acquire the ownership of ICH SMBUS.\r
-  //\r
-  ReturnStatus = InternalSmBusAcquire ();\r
-  if (RETURN_ERROR (ReturnStatus)) {\r
-    goto Done;\r
-  }\r
-  //\r
-  // Set the appropriate Host Control Register and auxiliary Control Register.\r
-  //\r
-  AuxiliaryControl = 0;\r
-  if (SMBUS_LIB_PEC (SmBusAddress)) {\r
-    AuxiliaryControl |= SMBUS_B_AAC;\r
-    HostControl      |= SMBUS_B_PEC_EN;\r
-  }\r
-  //\r
-  // Set Host Commond Register.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_HST_CMD, (UINT8) SMBUS_LIB_COMMAND (SmBusAddress));\r
-  //\r
-  // Write value to Host Data 0 and Host Data 1 Registers.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_HST_D0, (UINT8) Value);\r
-  InternalSmBusIoWrite8 (SMBUS_R_HST_D1, (UINT8) (Value >> 8));\r
-  //\r
-  // Set Auxiliary Control Regiester.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_AUX_CTL, AuxiliaryControl);\r
-  //\r
-  // Set SMBUS slave address for the device to send/receive from.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_XMIT_SLVA, (UINT8) SmBusAddress);\r
-  //\r
-  // Start the SMBUS transaction and wait for the end.\r
-  //\r
-  ReturnStatus = InternalSmBusStart (HostControl);\r
-  //\r
-  // Read value from Host Data 0 and Host Data 1 Registers.\r
-  //\r
-  Value  = InternalSmBusIoRead8 (SMBUS_R_HST_D1) << 8;\r
-  Value |= InternalSmBusIoRead8 (SMBUS_R_HST_D0);\r
-  //\r
-  // Clear Host Status Register and Auxiliary Status Register.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_HST_STS, SMBUS_B_HSTS_ALL);\r
-  InternalSmBusIoWrite8 (SMBUS_R_AUX_STS, SMBUS_B_CRCE);\r
-\r
-Done:\r
-  if (Status != NULL) {\r
-    *Status = ReturnStatus;\r
-  }\r
-\r
-  return Value;\r
-}\r
-\r
-/**\r
-  Executes an SMBUS quick read command.\r
-\r
-  Executes an SMBUS quick read command on the SMBUS device specified by SmBusAddress.\r
-  Only the SMBUS slave address field of SmBusAddress is required.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  If PEC is set in SmBusAddress, then ASSERT().\r
-  If Command in SmBusAddress is not zero, then ASSERT().\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-SmBusQuickRead (\r
-  IN  UINTN                     SmBusAddress,\r
-  OUT RETURN_STATUS             *Status       OPTIONAL\r
-  )\r
-{\r
-  ASSERT (!SMBUS_LIB_PEC (SmBusAddress));\r
-  ASSERT (SMBUS_LIB_COMMAND (SmBusAddress)   == 0);\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  InternalSmBusNonBlock (\r
-    SMBUS_V_SMB_CMD_QUICK,\r
-    SmBusAddress | SMBUS_B_READ,\r
-    0,\r
-    Status\r
-    );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS quick write command.\r
-\r
-  Executes an SMBUS quick write command on the SMBUS device specified by SmBusAddress.\r
-  Only the SMBUS slave address field of SmBusAddress is required.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  If PEC is set in SmBusAddress, then ASSERT().\r
-  If Command in SmBusAddress is not zero, then ASSERT().\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-SmBusQuickWrite (\r
-  IN  UINTN                     SmBusAddress,\r
-  OUT RETURN_STATUS             *Status       OPTIONAL\r
-  )\r
-{\r
-  ASSERT (!SMBUS_LIB_PEC (SmBusAddress));\r
-  ASSERT (SMBUS_LIB_COMMAND (SmBusAddress)   == 0);\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  InternalSmBusNonBlock (\r
-    SMBUS_V_SMB_CMD_QUICK,\r
-    SmBusAddress | SMBUS_B_WRITE,\r
-    0,\r
-    Status\r
-    );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS receive byte command.\r
-\r
-  Executes an SMBUS receive byte command on the SMBUS device specified by SmBusAddress.\r
-  Only the SMBUS slave address field of SmBusAddress is required.\r
-  The byte received from the SMBUS is returned.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  If Command in SmBusAddress is not zero, then ASSERT().\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The byte received from the SMBUS.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-SmBusReceiveByte (\r
-  IN  UINTN          SmBusAddress,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (SMBUS_LIB_COMMAND (SmBusAddress)   == 0);\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return (UINT8) InternalSmBusNonBlock (\r
-                   SMBUS_V_SMB_CMD_BYTE,\r
-                   SmBusAddress | SMBUS_B_READ,\r
-                   0,\r
-                   Status\r
-                   );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS send byte command.\r
-\r
-  Executes an SMBUS send byte command on the SMBUS device specified by SmBusAddress.\r
-  The byte specified by Value is sent.\r
-  Only the SMBUS slave address field of SmBusAddress is required.  Value is returned.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  If Command in SmBusAddress is not zero, then ASSERT().\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Value           The 8-bit value to send.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The parameter of Value.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-SmBusSendByte (\r
-  IN  UINTN          SmBusAddress,\r
-  IN  UINT8          Value,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (SMBUS_LIB_COMMAND (SmBusAddress)   == 0);\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return (UINT8) InternalSmBusNonBlock (\r
-                   SMBUS_V_SMB_CMD_BYTE,\r
-                   SmBusAddress | SMBUS_B_WRITE,\r
-                   Value,\r
-                   Status\r
-                   );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS read data byte command.\r
-\r
-  Executes an SMBUS read data byte command on the SMBUS device specified by SmBusAddress.\r
-  Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r
-  The 8-bit value read from the SMBUS is returned.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The byte read from the SMBUS.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-SmBusReadDataByte (\r
-  IN  UINTN          SmBusAddress,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return (UINT8) InternalSmBusNonBlock (\r
-                   SMBUS_V_SMB_CMD_BYTE_DATA,\r
-                   SmBusAddress | SMBUS_B_READ,\r
-                   0,\r
-                   Status\r
-                   );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS write data byte command.\r
-\r
-  Executes an SMBUS write data byte command on the SMBUS device specified by SmBusAddress.\r
-  The 8-bit value specified by Value is written.\r
-  Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r
-  Value is returned.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Value           The 8-bit value to write.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The parameter of Value.\r
-\r
-**/\r
-UINT8\r
-EFIAPI\r
-SmBusWriteDataByte (\r
-  IN  UINTN          SmBusAddress,\r
-  IN  UINT8          Value,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return (UINT8) InternalSmBusNonBlock (\r
-                   SMBUS_V_SMB_CMD_BYTE_DATA,\r
-                   SmBusAddress | SMBUS_B_WRITE,\r
-                   Value,\r
-                   Status\r
-                   );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS read data word command.\r
-\r
-  Executes an SMBUS read data word command on the SMBUS device specified by SmBusAddress.\r
-  Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r
-  The 16-bit value read from the SMBUS is returned.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-  \r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The byte read from the SMBUS.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-SmBusReadDataWord (\r
-  IN  UINTN          SmBusAddress,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return InternalSmBusNonBlock (\r
-           SMBUS_V_SMB_CMD_WORD_DATA,\r
-           SmBusAddress | SMBUS_B_READ,\r
-           0,\r
-           Status\r
-           );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS write data word command.\r
-\r
-  Executes an SMBUS write data word command on the SMBUS device specified by SmBusAddress.\r
-  The 16-bit value specified by Value is written.\r
-  Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r
-  Value is returned.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Value           The 16-bit value to write.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The parameter of Value.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-SmBusWriteDataWord (\r
-  IN  UINTN          SmBusAddress,\r
-  IN  UINT16         Value,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return InternalSmBusNonBlock (\r
-           SMBUS_V_SMB_CMD_WORD_DATA,\r
-           SmBusAddress | SMBUS_B_WRITE,\r
-           Value,\r
-           Status\r
-           );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS process call command.\r
-\r
-  Executes an SMBUS process call command on the SMBUS device specified by SmBusAddress.\r
-  The 16-bit value specified by Value is written.\r
-  Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r
-  The 16-bit value returned by the process call command is returned.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Value           The 16-bit value to write.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The 16-bit value returned by the process call command.\r
-\r
-**/\r
-UINT16\r
-EFIAPI\r
-SmBusProcessCall (\r
-  IN  UINTN          SmBusAddress,\r
-  IN  UINT16         Value,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress)    == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return InternalSmBusNonBlock (\r
-           SMBUS_V_SMB_CMD_PROCESS_CALL,\r
-           SmBusAddress | SMBUS_B_WRITE,\r
-           Value,\r
-           Status\r
-           );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS block command.\r
-\r
-  Executes an SMBUS block read, block write and block write-block read command\r
-  on the SMBUS device specified by SmBusAddress.\r
-  Bytes are read from the SMBUS and stored in Buffer.\r
-  The number of bytes read is returned, and will never return a value larger than 32-bytes.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  It is the caller's responsibility to make sure Buffer is large enough for the total number of bytes read.\r
-  SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.\r
-\r
-  @param  HostControl     The value of Host Control Register to set.  \r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  WriteBuffer     Pointer to the buffer of bytes to write to the SMBUS.\r
-  @param  ReadBuffer      Pointer to the buffer of bytes to read from the SMBUS.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The number of bytes read from the SMBUS.\r
-\r
-**/\r
-UINTN\r
-InternalSmBusBlock (\r
-  IN  UINT8                     HostControl,\r
-  IN  UINTN                     SmBusAddress,\r
-  IN  UINT8                     *WriteBuffer,\r
-  OUT UINT8                     *ReadBuffer,\r
-  OUT RETURN_STATUS             *Status\r
-  )\r
-{\r
-  RETURN_STATUS                 ReturnStatus;\r
-  UINTN                         Index;\r
-  UINTN                         BytesCount;\r
-  UINT8                         AuxiliaryControl;\r
-  \r
-  BytesCount = SMBUS_LIB_LENGTH (SmBusAddress);\r
-  //\r
-  // Try to acquire the ownership of ICH SMBUS.\r
-  //\r
-  ReturnStatus = InternalSmBusAcquire ();\r
-  if (RETURN_ERROR (ReturnStatus)) {\r
-    goto Done;\r
-  }\r
-  //\r
-  // Set the appropriate Host Control Register and auxiliary Control Register.\r
-  //\r
-  AuxiliaryControl = SMBUS_B_E32B;\r
-  if (SMBUS_LIB_PEC (SmBusAddress)) {\r
-    AuxiliaryControl |= SMBUS_B_AAC;\r
-    HostControl      |= SMBUS_B_PEC_EN;\r
-  }\r
-  //\r
-  // Set Host Command Register.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_HST_CMD, (UINT8) SMBUS_LIB_COMMAND (SmBusAddress));\r
-  //\r
-  // Set Auxiliary Control Regiester.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_AUX_CTL, AuxiliaryControl);\r
-  //\r
-  // Clear byte pointer of 32-byte buffer.\r
-  //\r
-  InternalSmBusIoRead8 (SMBUS_R_HST_CTL);\r
-\r
-  if (WriteBuffer != NULL) {\r
-    //\r
-    // Write the number of block to Host Block Data Byte Register.\r
-    //\r
-    InternalSmBusIoWrite8 (SMBUS_R_HST_D0, (UINT8) BytesCount);\r
-    //\r
-    // Write data block to Host Block Data Register.\r
-    //\r
-    for (Index = 0; Index < BytesCount; Index++) {\r
-      InternalSmBusIoWrite8 (SMBUS_R_HOST_BLOCK_DB, WriteBuffer[Index]);\r
-    }\r
-  }\r
-  //\r
-  // Set SMBUS slave address for the device to send/receive from.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_XMIT_SLVA, (UINT8) SmBusAddress);\r
-  //\r
-  // Start the SMBUS transaction and wait for the end.\r
-  //\r
-  ReturnStatus = InternalSmBusStart (HostControl);\r
-  if (RETURN_ERROR (ReturnStatus)) {\r
-    goto Done;\r
-  }\r
-\r
-  if (ReadBuffer != NULL) {\r
-    //\r
-    // Read the number of block from host block data byte register.\r
-    //\r
-    BytesCount = InternalSmBusIoRead8 (SMBUS_R_HST_D0);\r
-    //\r
-    // Write data block from Host Block Data Register.\r
-    //\r
-    for (Index = 0; Index < BytesCount; Index++) {\r
-      ReadBuffer[Index] = InternalSmBusIoRead8 (SMBUS_R_HOST_BLOCK_DB);\r
-    }\r
-  }\r
-  //\r
-  // Clear Host Status Register and Auxiliary Status Register.\r
-  //\r
-  InternalSmBusIoWrite8 (SMBUS_R_HST_STS, SMBUS_B_HSTS_ALL);\r
-  InternalSmBusIoWrite8 (SMBUS_R_AUX_STS, SMBUS_B_CRCE);\r
-\r
-Done:\r
-  if (Status != NULL) {\r
-    *Status = ReturnStatus;\r
-  }\r
-\r
-  return BytesCount;\r
-}\r
-\r
-/**\r
-  Executes an SMBUS read block command.\r
-\r
-  Executes an SMBUS read block command on the SMBUS device specified by SmBusAddress.\r
-  Only the SMBUS slave address and SMBUS command fields of SmBusAddress are required.\r
-  Bytes are read from the SMBUS and stored in Buffer.\r
-  The number of bytes read is returned, and will never return a value larger than 32-bytes.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  It is the caller's responsibility to make sure Buffer is large enough for the total number of bytes read.\r
-  SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.\r
-  If Length in SmBusAddress is not zero, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Buffer          Pointer to the buffer to store the bytes read from the SMBUS.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The number of bytes read.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-SmBusReadBlock (\r
-  IN  UINTN          SmBusAddress,\r
-  OUT VOID           *Buffer,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) == 0);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return InternalSmBusBlock (\r
-           SMBUS_V_SMB_CMD_BLOCK,\r
-           SmBusAddress | SMBUS_B_READ,\r
-           NULL,\r
-           Buffer,\r
-           Status\r
-           );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS write block command.\r
-\r
-  Executes an SMBUS write block command on the SMBUS device specified by SmBusAddress.\r
-  The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.\r
-  Bytes are written to the SMBUS from Buffer.\r
-  The number of bytes written is returned, and will never return a value larger than 32-bytes.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.  \r
-  If Length in SmBusAddress is zero or greater than 32, then ASSERT().\r
-  If Buffer is NULL, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  Buffer          Pointer to the buffer to store the bytes read from the SMBUS.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The number of bytes written.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-SmBusWriteBlock (\r
-  IN  UINTN          SmBusAddress,\r
-  OUT VOID           *Buffer,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (Buffer != NULL);\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) >= 1);\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) <= 32);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return InternalSmBusBlock (\r
-           SMBUS_V_SMB_CMD_BLOCK,\r
-           SmBusAddress | SMBUS_B_WRITE,\r
-           Buffer,\r
-           NULL,\r
-           Status\r
-           );\r
-}\r
-\r
-/**\r
-  Executes an SMBUS block process call command.\r
-\r
-  Executes an SMBUS block process call command on the SMBUS device specified by SmBusAddress.\r
-  The SMBUS slave address, SMBUS command, and SMBUS length fields of SmBusAddress are required.\r
-  Bytes are written to the SMBUS from WriteBuffer.  Bytes are then read from the SMBUS into ReadBuffer.\r
-  If Status is not NULL, then the status of the executed command is returned in Status.\r
-  It is the caller's responsibility to make sure ReadBuffer is large enough for the total number of bytes read.\r
-  SMBUS supports a maximum transfer size of 32 bytes, so Buffer does not need to be any larger than 32 bytes.\r
-  If Length in SmBusAddress is zero or greater than 32, then ASSERT().\r
-  If WriteBuffer is NULL, then ASSERT().\r
-  If ReadBuffer is NULL, then ASSERT().\r
-  If any reserved bits of SmBusAddress are set, then ASSERT().\r
-\r
-  @param  SmBusAddress    Address that encodes the SMBUS Slave Address,\r
-                          SMBUS Command, SMBUS Data Length, and PEC.\r
-  @param  WriteBuffer     Pointer to the buffer of bytes to write to the SMBUS.\r
-  @param  ReadBuffer      Pointer to the buffer of bytes to read from the SMBUS.\r
-  @param  Status          Return status for the executed command.\r
-                          This is an optional parameter and may be NULL.\r
-\r
-  @return The number of bytes written.\r
-\r
-**/\r
-UINTN\r
-EFIAPI\r
-SmBusBlockProcessCall (\r
-  IN  UINTN          SmBusAddress,\r
-  IN  VOID           *WriteBuffer,\r
-  OUT VOID           *ReadBuffer,\r
-  OUT RETURN_STATUS  *Status        OPTIONAL\r
-  )\r
-{\r
-  ASSERT (WriteBuffer != NULL);\r
-  ASSERT (ReadBuffer  != NULL);\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) >= 1);\r
-  ASSERT (SMBUS_LIB_LENGTH (SmBusAddress) <= 32);\r
-  ASSERT (SMBUS_LIB_RESEARVED (SmBusAddress) == 0);\r
-\r
-  return InternalSmBusBlock (\r
-           SMBUS_V_SMB_CMD_BLOCK_PROCESS,\r
-           SmBusAddress | SMBUS_B_WRITE,\r
-           WriteBuffer,\r
-           ReadBuffer,\r
-           Status\r
-           );\r
-}\r
diff --git a/MdePkg/Library/BaseSmbusLib/SmbusLibRegisters.h b/MdePkg/Library/BaseSmbusLib/SmbusLibRegisters.h
deleted file mode 100644 (file)
index 6eb14fa..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/** @file\r
-  Base SMBUS library implementation built upon I/O library.\r
-\r
-  Copyright (c) 2006, Intel Corporation<BR>\r
-  All rights reserved. This program and the accompanying materials\r
-  are licensed and made available under the terms and conditions of the BSD License\r
-  which accompanies this distribution.  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-  Module Name:  SmbusLib.h\r
-\r
-**/\r
-\r
-#ifndef __SMBUS_LIB_REGISTER_H\r
-#define __SMBUS_LIB_REGISTER_H\r
-\r
-#define SMBUS_R_HST_STS               0x00  // Host Status Register\r
-#define SMBUS_B_HOST_BUSY             0x01  // RO\r
-#define SMBUS_B_INTR                  0x02  // R/WC\r
-#define SMBUS_B_DEV_ERR               0x04  // R/WC\r
-#define SMBUS_B_BUS_ERR               0x08  // R/WC\r
-#define SMBUS_B_FAILED                0x10  // R/WC\r
-#define SMBUS_B_SMBALERT_STS          0x20  // R/WC\r
-#define SMBUS_B_INUSE_STS             0x40  // R/WC\r
-#define SMBUS_B_BYTE_DONE_STS         0x80  // R/WC\r
-#define SMBUS_B_ERROR                 (SMBUS_B_DEV_ERR | SMBUS_B_BUS_ERR | SMBUS_B_FAILED)\r
-#define SMBUS_B_HSTS_ALL              0xFF  // R/WC\r
-\r
-\r
-#define SMBUS_R_HST_CTL               0x02  // Host Control Register R/W\r
-#define SMBUS_B_INTREN                0x01  // RW\r
-#define SMBUS_B_KILL                  0x02  // RW\r
-#define SMBUS_B_CMD                   (7 << 2) // RW\r
-#define SMBUS_V_SMB_CMD_QUICK         (0 << 2)\r
-#define SMBUS_V_SMB_CMD_BYTE          (1 << 2)\r
-#define SMBUS_V_SMB_CMD_BYTE_DATA     (2 << 2)\r
-#define SMBUS_V_SMB_CMD_WORD_DATA     (3 << 2)\r
-#define SMBUS_V_SMB_CMD_PROCESS_CALL  (4 << 2)\r
-#define SMBUS_V_SMB_CMD_BLOCK         (5 << 2)\r
-#define SMBUS_V_SMB_CMD_IIC_READ      (6 << 2)\r
-#define SMBUS_V_SMB_CMD_BLOCK_PROCESS (7 << 2)\r
-#define SMBUS_B_LAST_BYTE             0x20  // WO\r
-#define SMBUS_B_START                 0x40  // WO\r
-#define SMBUS_B_PEC_EN                0x80  // RW\r
-\r
-\r
-#define SMBUS_R_HST_CMD               0x03  // Host Command Register R/W\r
-\r
-\r
-#define SMBUS_R_XMIT_SLVA             0x04  // Transmit Slave Address Register R/W\r
-#define SMBUS_B_RW                    0x01  // RW\r
-#define SMBUS_B_READ                  0x01  // RW\r
-#define SMBUS_B_WRITE                 0x00  // RW\r
-#define SMBUS_B_ADDRESS               0xFE  // RW\r
-\r
-\r
-#define SMBUS_R_HST_D0                0x05  // Data 0 Register R/W\r
-\r
-\r
-#define SMBUS_R_HST_D1                0x06  // Data 1 Register R/W\r
-\r
-\r
-#define SMBUS_R_HOST_BLOCK_DB         0x07  // Host Block Data Register R/W\r
-\r
-\r
-#define SMBUS_R_PEC                   0x08  // Packet Error Check Data Register R/W\r
-\r
-\r
-#define SMBUS_R_RCV_SLVA              0x09  // Receive Slave Address Register R/W\r
-#define SMBUS_B_SLAVE_ADDR            0x7F  // RW\r
-\r
-\r
-#define SMBUS_R_SLV_DATA              0x0A  // Receive Slave Data Register R/W\r
-\r
-\r
-#define SMBUS_R_AUX_STS               0x0C  // Auxiliary Status Register R/WC\r
-#define SMBUS_B_CRCE                  0x01  // R/WC\r
-\r
-\r
-#define SMBUS_R_AUX_CTL               0x0D  // Auxiliary Control Register R/W\r
-#define SMBUS_B_AAC                   0x01  // R/W\r
-#define SMBUS_B_E32B                  0x02  // R/W\r
-\r
-\r
-#define SMBUS_R_SMLINK_PIN_CTL        0x0E  // SMLINK Pin Control Register R/W\r
-#define SMBUS_B_SMLINK0_CUR_STS       0x01  // RO\r
-#define SMBUS_B_SMLINK1_CUR_STS       0x02  // RO\r
-#define SMBUS_B_SMLINK_CLK_CTL        0x04  // RW\r
-\r
-\r
-#define SMBUS_R_SMBUS_PIN_CTL         0x0F  // SMBus Pin Control Register R/W\r
-#define SMBUS_B_SMBCLK_CUR_STS        0x01  // RO\r
-#define SMBUS_B_SMBDATA_CUR_STS       0x02  // RO\r
-#define SMBUS_B_SMBCLK_CTL            0x04  // RW\r
-\r
-\r
-#define SMBUS_R_SLV_STS               0x10  // Slave Status Register R/WC\r
-#define SMBUS_B_HOST_NOTIFY_STS       0x01  // R/WC\r
-\r
-\r
-#define SMBUS_R_SLV_CMD               0x11  // Slave Command Register R/W\r
-#define SMBUS_B_HOST_NOTIFY_INTREN    0x01  // R/W\r
-#define SMBUS_B_HOST_NOTIFY_WKEN      0x02  // R/W\r
-#define SMBUS_B_SMBALERT_DIS          0x04  // R/W\r
-\r
-\r
-#define SMBUS_R_NOTIFY_DADDR          0x14  // Notify Device Address Register RO\r
-#define SMBUS_B_DEVICE_ADDRESS        0xFE  // RO\r
-\r
-\r
-#define SMBUS_R_NOTIFY_DLOW           0x16  // Notify Data Low Byte Register RO\r
-\r
-\r
-#define SMBUS_R_NOTIFY_DHIGH          0x17  // Notify Data High Byte Register RO   \r
-\r
-\r
-#endif\r