summaryrefslogtreecommitdiff
path: root/Silicon/Intel/PurleySktPkg/Library/ProcMemInit/Chip/Include/CpuPciAccessCommon.h
blob: 2b8c367f5ed22be6c137ae2ac4f7fa39e218d90d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/** @file

Copyright (c) 2018, 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 that 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.

**/

#ifndef  _CPU_PCI_ACCESS_COMMON_H_
#define  _CPU_PCI_ACCESS_COMMON_H_

#include <SysHost.h>

/**

  Indetifies the bus number for given SocId & BoxType

  @param host            - Pointer to sysHost, the system host (root) structure
  @param SocId           - CPU Socket Node number (Socket ID)
  @param BoxType         - Box Type; values come from CpuPciAccess.h
  @param BoxInst         - IIO PCIE Box Instance
  @param FuncBlk         - Function Block within IIO
  @param CpuCsrAccessVar - Pointer to CSR access data

  @retval (UINT32) PCI bus number

**/
UINT32
GetBusNumber (
  PSYSHOST host,
  UINT8    SocId,
  UINT8    BoxType,
  UINT8    BoxInst,
  UINT8    FuncBlk,
  CPU_CSR_ACCESS_VAR *CpuCsrAccessVar
  );

/**

  Indetifies the device number for given SocId & BoxType

  @param host            - Pointer to sysHost, the system host (root) structure
  @param BoxType         - Box Type; values come from CpuPciAccess.h
  @param BoxInst         - IIO PCIE Box Instance
  @param FuncBlk         - Function Block within IIO
  @param CpuCsrAccessVar - Pointer to CSR access data

  @retval (UINT32) PCI device number

**/
UINT32
GetDeviceNumber (
  PSYSHOST host,
  UINT8    BoxType,
  UINT8    BoxInst,
  UINT8    FuncBlk,
  CPU_CSR_ACCESS_VAR *CpuCsrAccessVar
  );

/**

  Indetifies the function number for given SocId & BoxType

  @param host            - Pointer to sysHost, the system host (root) structure
  @param BoxType         - Box Type; values come from CpuPciAccess.h
  @param BoxInst         - IIO PCIE Box Instance
  @param FuncBlk         - Function Block within IIO
  @param CpuCsrAccessVar - Pointer to CSR access data

  @retval (UINT32) PCI function number

**/
UINT32
GetFunctionNumber (
  PSYSHOST host,
  UINT8    BoxType,
  UINT8    BoxInst,
  UINT8    FuncBlk,
  CPU_CSR_ACCESS_VAR *CpuCsrAccessVar
  );

#endif   // _CPU_PCI_ACCESS_COMMON_H_