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
/** @file
  Switchable Graphics policy definitions
 
  Copyright (c) 2019 Intel Corporation. All rights reserved. <BR>
 
  SPDX-License-Identifier: BSD-2-Clause-Patent
**/
 
#ifndef _SWITCHABLE_GRAPHICS_CONFIG_H_
#define _SWITCHABLE_GRAPHICS_CONFIG_H_
 
#define SWITCHABLE_GRAPHICS_CONFIG_REVISION 1
 
#define GP_ENABLE   1
#define GP_DISABLE  0
 
#pragma pack(push, 1)
///
/// GPIO Support
///
typedef enum {
  NotSupported = 0,
  PchGpio,
  I2CGpio,
} GPIO_SUPPORT;
 
///
/// SA GPIO Data Structure
///
typedef struct {
  UINT8   ExpanderNo; ///< Offset 0 Expander No For I2C based GPIO
  BOOLEAN Active;     ///< Offset 1 0=Active Low; 1=Active High
  UINT8 Rsvd0[2];     ///< Offset 2 Reserved
  UINT32  GpioNo;     ///< Offset 4 GPIO pad
} SA_GPIO_INFO;
 
/**
 SA PCIE RTD3 GPIO Data Structure
**/
typedef struct {
  SA_GPIO_INFO  HoldRst;      ///< Offset 0 This field contain PCIe HLD RESET GPIO value and level information
  SA_GPIO_INFO  PwrEnable;    ///< Offset 8 This field contain PCIe PWR Enable GPIO value and level information
  UINT32        WakeGpioNo;   ///< Offset 16 This field contain PCIe RTD3 Device Wake GPIO Number
  UINT8         GpioSupport;  ///< Offset 20 Depends on board design the GPIO configuration may be different: <b>0=Not Supported</b>, 1=PCH Based, 2=I2C based
  UINT8         Rsvd0[3];     ///< Offset 21
} SA_PCIE_RTD3_GPIO;
 
/**
  This Configuration block configures SA PCI Express 0/1/2 RTD3 GPIOs & Root Port.
  Swithable Gfx/Hybrid Gfx uses the same GPIOs & Root port as PCI Express 0/1/2 RTD3.
  <b>Revision 1</b>:
  - Initial version.
**/
typedef struct {
  CONFIG_BLOCK_HEADER Header;             ///< Offset 0-27 Config Block Header
  SA_PCIE_RTD3_GPIO   SaRtd3Pcie0Gpio;    ///< Offset 28 RTD3 GPIOs used for PCIe0
  SA_PCIE_RTD3_GPIO   SaRtd3Pcie1Gpio;    ///< Offset 52 RTD3 GPIOs used for PCIe1
  SA_PCIE_RTD3_GPIO   SaRtd3Pcie2Gpio;    ///< Offset 76 RTD3 GPIOs used for PCIe2
  UINT8               RootPortIndex;      ///< Offset 124 Root Port Index number used for SG
  UINT8               Rsvd0[3];           ///< Offset 125 Reserved for DWORD Alignment
} SWITCHABLE_GRAPHICS_CONFIG;
#pragma pack(pop)
#endif // _SWITCHABLE_GRAPHICS_CONFIG_H_