]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/PeiSmbusLibSmbus2Ppi/InternalSmbusLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Library / PeiSmbusLibSmbus2Ppi / InternalSmbusLib.h
CommitLineData
dd51a993 1/** @file\r
2Internal header file for Smbus library.\r
3\r
9095d37b 4Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5SPDX-License-Identifier: BSD-2-Clause-Patent\r
dd51a993 6\r
7\r
8**/\r
9\r
42eedea9 10#ifndef __INTERNAL_SMBUS_LIB_H_\r
11#define __INTERNAL_SMBUS_LIB_H_\r
dd51a993 12\r
bad46384 13#include <PiPei.h>\r
c892d846 14\r
bad46384 15#include <Ppi/Smbus2.h>\r
c892d846 16\r
bad46384 17#include <Library/SmbusLib.h>\r
18#include <Library/DebugLib.h>\r
1c280088 19#include <Library/PeiServicesLib.h>\r
bad46384 20#include <Library/BaseMemoryLib.h>\r
21\r
dd51a993 22//\r
23// Declaration for internal functions\r
24//\r
25\r
26/**\r
27 Gets Smbus PPIs.\r
28\r
29 This internal function retrieves Smbus PPI from PPI database.\r
30\r
1c280088 31 @param VOID\r
dd51a993 32\r
33 @return The pointer to Smbus PPI.\r
34\r
35**/\r
36EFI_PEI_SMBUS2_PPI *\r
37InternalGetSmbusPpi (\r
1c280088 38 VOID\r
dd51a993 39 );\r
40\r
41/**\r
bad46384 42 Executes an SMBus operation to an SMBus controller.\r
dd51a993 43\r
44 This function provides a standard way to execute Smbus script\r
45 as defined in the SmBus Specification. The data can either be of\r
46 the Length byte, word, or a block of data.\r
47\r
9095d37b 48 @param SmbusOperation Signifies which particular SMBus hardware protocol\r
58380e9c 49 instance that it will use to execute the SMBus transactions.\r
2fc59a00 50 @param SmBusAddress The address that encodes the SMBUS Slave Address,\r
dd51a993 51 SMBUS Command, SMBUS Data Length, and PEC.\r
9095d37b
LG
52 @param Length Signifies the number of bytes that this operation will\r
53 do. The maximum number of bytes can be revision specific\r
58380e9c 54 and operation specific.\r
9095d37b
LG
55 @param Buffer Contains the value of data to execute to the SMBus slave\r
56 device. Not all operations require this argument. The\r
58380e9c 57 length of this buffer is identified by Length.\r
dd51a993 58 @param Status Return status for the executed command.\r
59 This is an optional parameter and may be NULL.\r
60\r
61 @return The actual number of bytes that are executed for this operation.\r
62\r
63**/\r
64UINTN\r
65InternalSmBusExec (\r
2f88bd3a
MK
66 IN EFI_SMBUS_OPERATION SmbusOperation,\r
67 IN UINTN SmBusAddress,\r
68 IN UINTN Length,\r
69 IN OUT VOID *Buffer,\r
70 OUT RETURN_STATUS *Status OPTIONAL\r
dd51a993 71 );\r
72\r
73#endif\r