hc
2024-03-25 edb30157bad0c0001c32b854271ace01d3b9a16a
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/** @file
  Macros to simplify and abstract the interface to PCI configuration.
 
  Copyright (c) 2019 Intel Corporation. All rights reserved. <BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#ifndef _SAACCESS_H_
#define _SAACCESS_H_
 
#include "SaRegs.h"
#include "SaCommonDefinitions.h"
 
///
/// SystemAgent Base Address definition
///
#ifndef STALL_ONE_MICRO_SECOND
#define STALL_ONE_MICRO_SECOND  1
#endif
#ifndef STALL_ONE_MILLI_SECOND
#define STALL_ONE_MILLI_SECOND  1000
#endif
 
//
// SA Segement Number
//
#define SA_SEG_NUM         0x00
 
#define V_SA_DEVICE_ID_INVALID 0xFFFF
 
 
///
/// The value before AutoConfig match the setting of PCI Express Base Specification 1.1, please be careful for adding new feature
///
typedef enum {
  PcieAspmDisabled,
  PcieAspmL0s,
  PcieAspmL1,
  PcieAspmL0sL1,
  PcieAspmAutoConfig,
  PcieAspmMax
} SA_PCIE_ASPM_CONFIG;
 
///
/// SgMode settings
///
typedef enum {
  SgModeDisabled = 0,
  SgModeReserved,
  SgModeMuxless,
  SgModeDgpu,
  SgModeMax
} SG_MODE;
 
//
// Macros that judge which type a device ID belongs to
//
#define IS_SA_DEVICE_ID_MOBILE(DeviceId) \
    ( \
      (DeviceId == V_SA_DEVICE_ID_KBL_MB_ULT_1) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_ULT_1) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_ULT_2) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_ULT_3) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_ULT_4) \
    )
 
///
/// Device IDs that are Desktop specific B0:D0:F0
///
#define IS_SA_DEVICE_ID_DESKTOP(DeviceId) \
    ( \
      (DeviceId == V_SA_DEVICE_ID_KBL_DT_2) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_DT_1) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_DT_2) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_DT_3) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_DT_4) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_WS_1) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_WS_2) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_WS_3) \
    )
 
///
/// Device IDS that are Server specific B0:D0:F0
///
#define IS_SA_DEVICE_ID_SERVER(DeviceId) \
    ( \
      (DeviceId == V_SA_DEVICE_ID_KBL_SVR_2) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_SVR_1) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_SVR_2) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_SVR_3) \
    )
 
///
/// Device IDs that are Halo specific B0:D0:F0
///
#define IS_SA_DEVICE_ID_HALO(DeviceId) \
    ( \
      (DeviceId == V_SA_DEVICE_ID_KBL_HALO_2) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_HALO_1) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_HALO_2) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_HALO_3) || \
      (DeviceId == V_SA_DEVICE_ID_CFL_HALO_IOT_1) \
    )
 
#endif