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-or-later */
2 
4 
5 static const struct pch_gpio_set1 pch_gpio_set1_mode = {
7  .gpio1 = GPIO_MODE_GPIO,
8  .gpio6 = GPIO_MODE_GPIO,
9  .gpio7 = GPIO_MODE_GPIO,
10  .gpio8 = GPIO_MODE_GPIO,
11  .gpio12 = GPIO_MODE_GPIO,
12  .gpio13 = GPIO_MODE_GPIO,
13  .gpio15 = GPIO_MODE_GPIO,
14  .gpio16 = GPIO_MODE_GPIO,
15  .gpio17 = GPIO_MODE_GPIO,
16  .gpio24 = GPIO_MODE_GPIO,
17  .gpio27 = GPIO_MODE_GPIO,
18  .gpio28 = GPIO_MODE_GPIO,
19  .gpio29 = GPIO_MODE_GPIO,
20  .gpio31 = GPIO_MODE_GPIO,
21 };
22 
23 static const struct pch_gpio_set1 pch_gpio_set1_direction = {
25  .gpio1 = GPIO_DIR_INPUT,
26  .gpio6 = GPIO_DIR_INPUT,
27  .gpio7 = GPIO_DIR_INPUT,
28  .gpio8 = GPIO_DIR_INPUT,
29  .gpio12 = GPIO_DIR_INPUT,
30  .gpio13 = GPIO_DIR_INPUT,
31  .gpio15 = GPIO_DIR_OUTPUT,
32  .gpio16 = GPIO_DIR_INPUT,
33  .gpio17 = GPIO_DIR_INPUT,
34  .gpio24 = GPIO_DIR_OUTPUT,
35  .gpio27 = GPIO_DIR_INPUT,
36  .gpio28 = GPIO_DIR_OUTPUT,
37  .gpio29 = GPIO_DIR_INPUT,
38  .gpio31 = GPIO_DIR_OUTPUT,
39 };
40 
41 static const struct pch_gpio_set1 pch_gpio_set1_level = {
43  .gpio15 = GPIO_LEVEL_LOW,
44  .gpio24 = GPIO_LEVEL_LOW,
45  .gpio28 = GPIO_LEVEL_LOW,
46  .gpio31 = GPIO_LEVEL_LOW,
47 };
48 
49 static const struct pch_gpio_set1 pch_gpio_set1_reset = {
50 };
51 
52 static const struct pch_gpio_set1 pch_gpio_set1_invert = {
53  .gpio1 = GPIO_INVERT,
54  .gpio6 = GPIO_INVERT,
55  .gpio13 = GPIO_INVERT,
56 };
57 
58 static const struct pch_gpio_set1 pch_gpio_set1_blink = {
59 };
60 
61 static const struct pch_gpio_set2 pch_gpio_set2_mode = {
63  .gpio33 = GPIO_MODE_GPIO,
64  .gpio34 = GPIO_MODE_GPIO,
65  .gpio46 = GPIO_MODE_GPIO,
66  .gpio49 = GPIO_MODE_GPIO,
67  .gpio57 = GPIO_MODE_GPIO,
68 };
69 
70 static const struct pch_gpio_set2 pch_gpio_set2_direction = {
72  .gpio33 = GPIO_DIR_OUTPUT,
73  .gpio34 = GPIO_DIR_INPUT,
74  .gpio46 = GPIO_DIR_INPUT,
75  .gpio49 = GPIO_DIR_INPUT,
76  .gpio57 = GPIO_DIR_INPUT,
77 };
78 
79 static const struct pch_gpio_set2 pch_gpio_set2_level = {
81  .gpio33 = GPIO_LEVEL_HIGH,
82 };
83 
84 static const struct pch_gpio_set2 pch_gpio_set2_reset = {
85 };
86 
87 static const struct pch_gpio_set3 pch_gpio_set3_mode = {
89  .gpio69 = GPIO_MODE_GPIO,
90  .gpio72 = GPIO_MODE_GPIO,
91 };
92 
93 static const struct pch_gpio_set3 pch_gpio_set3_direction = {
95  .gpio69 = GPIO_DIR_INPUT,
96  .gpio72 = GPIO_DIR_INPUT,
97 };
98 
99 static const struct pch_gpio_set3 pch_gpio_set3_level = {
100 };
101 
102 static const struct pch_gpio_set3 pch_gpio_set3_reset = {
103 };
104 
105 const struct pch_gpio_map mainboard_gpio_map = {
106  .set1 = {
108  .direction = &pch_gpio_set1_direction,
109  .level = &pch_gpio_set1_level,
110  .blink = &pch_gpio_set1_blink,
111  .invert = &pch_gpio_set1_invert,
112  .reset = &pch_gpio_set1_reset,
113  },
114  .set2 = {
115  .mode = &pch_gpio_set2_mode,
116  .direction = &pch_gpio_set2_direction,
117  .level = &pch_gpio_set2_level,
118  .reset = &pch_gpio_set2_reset,
119  },
120  .set3 = {
121  .mode = &pch_gpio_set3_mode,
122  .direction = &pch_gpio_set3_direction,
123  .level = &pch_gpio_set3_level,
124  .reset = &pch_gpio_set3_reset,
125  },
126 };
const struct pch_gpio_map mainboard_gpio_map
Definition: gpio.c:87
static const struct pch_gpio_set1 pch_gpio_set1_direction
Definition: gpio.c:23
static const struct pch_gpio_set1 pch_gpio_set1_reset
Definition: gpio.c:49
static const struct pch_gpio_set2 pch_gpio_set2_reset
Definition: gpio.c:84
static const struct pch_gpio_set2 pch_gpio_set2_level
Definition: gpio.c:79
static const struct pch_gpio_set1 pch_gpio_set1_level
Definition: gpio.c:41
static const struct pch_gpio_set3 pch_gpio_set3_direction
Definition: gpio.c:93
static const struct pch_gpio_set2 pch_gpio_set2_mode
Definition: gpio.c:61
static const struct pch_gpio_set1 pch_gpio_set1_invert
Definition: gpio.c:52
static const struct pch_gpio_set3 pch_gpio_set3_reset
Definition: gpio.c:102
static const struct pch_gpio_set1 pch_gpio_set1_blink
Definition: gpio.c:58
static const struct pch_gpio_set1 pch_gpio_set1_mode
Definition: gpio.c:5
static const struct pch_gpio_set3 pch_gpio_set3_mode
Definition: gpio.c:87
static const struct pch_gpio_set3 pch_gpio_set3_level
Definition: gpio.c:99
static const struct pch_gpio_set2 pch_gpio_set2_direction
Definition: gpio.c:70
#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 gpio1
Definition: gpio.h:45
u32 gpio32
Definition: gpio.h:79
u32 gpio68
Definition: gpio.h:118