coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
gpio.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef LINK_GPIO_H
4 #define LINK_GPIO_H
5 
7 
8 static const struct pch_gpio_set1 pch_gpio_set1_mode = {
9  .gpio0 = GPIO_MODE_GPIO, /* NMI_DBG# */
10  .gpio3 = GPIO_MODE_GPIO, /* ALS_INT# */
11  .gpio5 = GPIO_MODE_GPIO, /* SIM_DET */
12  .gpio7 = GPIO_MODE_GPIO, /* EC_SCI# */
13  .gpio8 = GPIO_MODE_GPIO, /* EC_SMI# */
14  .gpio9 = GPIO_MODE_GPIO, /* RECOVERY# */
15  .gpio10 = GPIO_MODE_GPIO, /* SPD vector D3 */
16  .gpio11 = GPIO_MODE_GPIO, /* smbalert#, let's keep it initialized */
17  .gpio12 = GPIO_MODE_GPIO, /* TP_INT# */
18  .gpio14 = GPIO_MODE_GPIO, /* Touch_INT_L */
19  .gpio15 = GPIO_MODE_GPIO, /* EC_LID_OUT# (EC_WAKE#) */
20  .gpio21 = GPIO_MODE_GPIO, /* EC_IN_RW */
21  .gpio24 = GPIO_MODE_GPIO, /* DDR3L_EN */
22  .gpio28 = GPIO_MODE_GPIO, /* SLP_ME_CSW_DEV# */
23 };
24 
25 static const struct pch_gpio_set1 pch_gpio_set1_direction = {
27  .gpio3 = GPIO_DIR_INPUT,
28  .gpio5 = GPIO_DIR_INPUT,
29  .gpio7 = GPIO_DIR_INPUT,
30  .gpio8 = GPIO_DIR_INPUT,
31  .gpio9 = GPIO_DIR_INPUT,
32  .gpio10 = GPIO_DIR_INPUT,
33  .gpio11 = GPIO_DIR_INPUT,
34  .gpio12 = GPIO_DIR_INPUT,
35  .gpio14 = GPIO_DIR_INPUT,
36  .gpio15 = GPIO_DIR_INPUT,
37  .gpio21 = GPIO_DIR_INPUT,
38  .gpio24 = GPIO_DIR_OUTPUT,
39  .gpio28 = GPIO_DIR_INPUT,
40 };
41 
42 static const struct pch_gpio_set1 pch_gpio_set1_level = {
44  .gpio6 = GPIO_LEVEL_HIGH,
45  .gpio24 = GPIO_LEVEL_LOW,
46 };
47 
48 static const struct pch_gpio_set1 pch_gpio_set1_invert = {
49  .gpio7 = GPIO_INVERT,
50  .gpio8 = GPIO_INVERT,
51  .gpio12 = GPIO_INVERT,
52  .gpio14 = GPIO_INVERT,
53  .gpio15 = GPIO_INVERT,
54 };
55 
56 static const struct pch_gpio_set2 pch_gpio_set2_mode = {
57  .gpio36 = GPIO_MODE_GPIO, /* W_DISABLE_L */
58  .gpio41 = GPIO_MODE_GPIO, /* SPD vector D0 */
59  .gpio42 = GPIO_MODE_GPIO, /* SPD vector D1 */
60  .gpio43 = GPIO_MODE_GPIO, /* SPD vector D2 */
61  .gpio57 = GPIO_MODE_GPIO, /* PCH_SPI_WP_D */
62  .gpio60 = GPIO_MODE_GPIO, /* DRAMRST_CNTRL_PCH */
63 };
64 
65 static const struct pch_gpio_set2 pch_gpio_set2_direction = {
67  .gpio41 = GPIO_DIR_INPUT,
68  .gpio42 = GPIO_DIR_INPUT,
69  .gpio43 = GPIO_DIR_INPUT,
70  .gpio57 = GPIO_DIR_INPUT,
71  .gpio60 = GPIO_DIR_OUTPUT,
72 };
73 
74 static const struct pch_gpio_set2 pch_gpio_set2_level = {
76  .gpio60 = GPIO_LEVEL_HIGH,
77 };
78 
79 static const struct pch_gpio_set3 pch_gpio_set3_mode = {
80 };
81 
82 static const struct pch_gpio_set3 pch_gpio_set3_direction = {
83 };
84 
85 static const struct pch_gpio_set3 pch_gpio_set3_level = {
86 };
87 
88 const struct pch_gpio_map mainboard_gpio_map = {
89  .set1 = {
91  .direction = &pch_gpio_set1_direction,
92  .level = &pch_gpio_set1_level,
93  .invert = &pch_gpio_set1_invert,
94  },
95  .set2 = {
96  .mode = &pch_gpio_set2_mode,
97  .direction = &pch_gpio_set2_direction,
98  .level = &pch_gpio_set2_level,
99  },
100  .set3 = {
101  .mode = &pch_gpio_set3_mode,
102  .direction = &pch_gpio_set3_direction,
103  .level = &pch_gpio_set3_level,
104  },
105 };
106 #endif
const struct pch_gpio_map mainboard_gpio_map
Definition: gpio.c:87
#define GPIO_LEVEL_HIGH
Definition: gpio.h:54
#define GPIO_LEVEL_LOW
Definition: gpio.h:53
#define GPIO_DIR_INPUT
Definition: gpio.h:51
#define GPIO_DIR_OUTPUT
Definition: gpio.h:50
@ GPIO_MODE_GPIO
Definition: gpio.h:20
#define GPIO_INVERT
Definition: gpio.h:32
const struct pch_gpio_set1 * mode
Definition: gpio.h:130
struct pch_gpio_map::@1669 set1
u32 gpio0
Definition: gpio.h:44
u32 gpio7
Definition: gpio.h:51
u32 gpio1
Definition: gpio.h:45
u32 gpio36
Definition: gpio.h:83