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