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