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 
4 
5 static const struct pch_gpio_set1 pch_gpio_set1_mode = {
7  .gpio7 = GPIO_MODE_GPIO,
8  .gpio8 = GPIO_MODE_GPIO,
9  .gpio9 = GPIO_MODE_GPIO,
10  .gpio10 = GPIO_MODE_GPIO,
11  .gpio12 = GPIO_MODE_GPIO,
12  .gpio13 = GPIO_MODE_GPIO,
13  .gpio14 = GPIO_MODE_GPIO,
14  .gpio15 = GPIO_MODE_GPIO,
15  .gpio16 = GPIO_MODE_GPIO,
16  .gpio17 = GPIO_MODE_GPIO,
17  .gpio18 = GPIO_MODE_GPIO,
18  .gpio19 = GPIO_MODE_GPIO,
19  .gpio20 = GPIO_MODE_GPIO,
20  .gpio24 = GPIO_MODE_GPIO,
21  .gpio25 = GPIO_MODE_GPIO,
22  .gpio26 = GPIO_MODE_GPIO,
23  .gpio27 = GPIO_MODE_GPIO,
24  .gpio28 = GPIO_MODE_GPIO,
25 };
26 
27 static const struct pch_gpio_set1 pch_gpio_set1_direction = {
29  .gpio7 = GPIO_DIR_INPUT,
30  .gpio8 = GPIO_DIR_INPUT,
31  .gpio9 = GPIO_DIR_INPUT,
32  .gpio10 = GPIO_DIR_INPUT,
33  .gpio12 = GPIO_DIR_OUTPUT,
34  .gpio13 = GPIO_DIR_INPUT,
35  .gpio14 = GPIO_DIR_INPUT,
36  .gpio15 = GPIO_DIR_INPUT,
37  .gpio16 = GPIO_DIR_OUTPUT,
38  .gpio17 = GPIO_DIR_OUTPUT,
39  .gpio18 = GPIO_DIR_OUTPUT,
40  .gpio19 = GPIO_DIR_INPUT,
41  .gpio20 = GPIO_DIR_OUTPUT,
42  .gpio24 = GPIO_DIR_OUTPUT,
43  .gpio25 = GPIO_DIR_OUTPUT,
44  .gpio26 = GPIO_DIR_OUTPUT,
45  .gpio27 = GPIO_DIR_OUTPUT,
46  .gpio28 = GPIO_DIR_OUTPUT,
47 };
48 
49 static const struct pch_gpio_set1 pch_gpio_set1_level = {
51  .gpio16 = GPIO_LEVEL_HIGH,
52  .gpio17 = GPIO_LEVEL_HIGH,
53  .gpio18 = GPIO_LEVEL_HIGH,
54  .gpio20 = GPIO_LEVEL_HIGH,
55  .gpio24 = GPIO_LEVEL_HIGH,
56  .gpio25 = GPIO_LEVEL_HIGH,
57  .gpio26 = GPIO_LEVEL_LOW,
58  .gpio27 = GPIO_LEVEL_HIGH,
59  .gpio28 = GPIO_LEVEL_LOW,
60 };
61 
62 static const struct pch_gpio_set1 pch_gpio_set1_invert = {
63  .gpio7 = GPIO_INVERT,
64  .gpio8 = GPIO_INVERT,
65  .gpio13 = GPIO_INVERT,
66 };
67 
68 static const struct pch_gpio_set1 pch_gpio_set1_blink = {
69 };
70 
71 static const struct pch_gpio_set2 pch_gpio_set2_mode = {
73  .gpio33 = GPIO_MODE_GPIO,
74  .gpio34 = GPIO_MODE_GPIO,
75  .gpio35 = GPIO_MODE_GPIO,
76  .gpio36 = GPIO_MODE_GPIO,
77  .gpio37 = GPIO_MODE_GPIO,
78  .gpio38 = GPIO_MODE_GPIO,
79  .gpio39 = GPIO_MODE_GPIO,
80  .gpio48 = GPIO_MODE_GPIO,
81 };
82 
83 static const struct pch_gpio_set2 pch_gpio_set2_direction = {
85  .gpio33 = GPIO_DIR_OUTPUT,
86  .gpio34 = GPIO_DIR_OUTPUT,
87  .gpio35 = GPIO_DIR_OUTPUT,
88  .gpio36 = GPIO_DIR_INPUT,
89  .gpio37 = GPIO_DIR_INPUT,
90  .gpio38 = GPIO_DIR_OUTPUT,
91  .gpio39 = GPIO_DIR_OUTPUT,
92  .gpio48 = GPIO_DIR_OUTPUT,
93 };
94 
95 static const struct pch_gpio_set2 pch_gpio_set2_level = {
97  .gpio33 = GPIO_LEVEL_LOW,
98  .gpio34 = GPIO_LEVEL_HIGH,
99  .gpio35 = GPIO_LEVEL_LOW,
100  .gpio38 = GPIO_LEVEL_LOW,
101  .gpio39 = GPIO_LEVEL_LOW,
102  .gpio48 = GPIO_LEVEL_HIGH,
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  },
113  .set2 = {
114  .mode = &pch_gpio_set2_mode,
115  .direction = &pch_gpio_set2_direction,
116  .level = &pch_gpio_set2_level,
117  },
118 };
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:27
static const struct pch_gpio_set2 pch_gpio_set2_level
Definition: gpio.c:95
static const struct pch_gpio_set1 pch_gpio_set1_level
Definition: gpio.c:49
static const struct pch_gpio_set2 pch_gpio_set2_mode
Definition: gpio.c:71
static const struct pch_gpio_set1 pch_gpio_set1_invert
Definition: gpio.c:62
static const struct pch_gpio_set1 pch_gpio_set1_blink
Definition: gpio.c:68
static const struct pch_gpio_set1 pch_gpio_set1_mode
Definition: gpio.c:5
static const struct pch_gpio_set2 pch_gpio_set2_direction
Definition: gpio.c:83
#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 gpio7
Definition: gpio.h:51
u32 gpio6
Definition: gpio.h:50
u32 gpio12
Definition: gpio.h:56
u32 gpio32
Definition: gpio.h:79