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 static const struct pch_gpio_set1 pch_gpio_set1_mode = {
5  .gpio1 = GPIO_MODE_GPIO, /* HDD_PRESENCE# */
6  .gpio6 = GPIO_MODE_GPIO, /* Unknown (Pulled high by R215 to VCC3B) */
7  .gpio7 = GPIO_MODE_GPIO, /* BDC_PRESENCE# */
8  .gpio8 = GPIO_MODE_GPIO, /* H8_WAKE# */
9  .gpio9 = GPIO_MODE_GPIO, /* RTC_BAT_IN# */
10  .gpio10 = GPIO_MODE_GPIO, /* Unknown (Pulled high by R700 to VCC3M) */
11  .gpio12 = GPIO_MODE_GPIO, /* H8SCI# */
12  .gpio13 = GPIO_MODE_GPIO, /* SLICE_ON_3M# */
13  .gpio14 = GPIO_MODE_GPIO, /* Unknown (Pulled high by R321 to VCC3) */
14  .gpio15 = GPIO_MODE_GPIO, /* Unknown (Pulled high by R258 to VCC3) */
15  .gpio22 = GPIO_MODE_GPIO, /* FWH_WP# */
16  .gpio24 = GPIO_MODE_GPIO,
17  .gpio25 = GPIO_MODE_GPIO, /* MDC_KILL# */
18  .gpio26 = GPIO_MODE_GPIO,
19  .gpio27 = GPIO_MODE_GPIO,
20  .gpio28 = GPIO_MODE_GPIO,
21 };
22 
23 static const struct pch_gpio_set1 pch_gpio_set1_direction = {
25  .gpio6 = GPIO_DIR_INPUT,
26  .gpio7 = GPIO_DIR_INPUT,
27  .gpio8 = GPIO_DIR_INPUT,
28  .gpio9 = GPIO_DIR_INPUT,
29  .gpio10 = GPIO_DIR_INPUT,
30  .gpio12 = GPIO_DIR_INPUT,
31  .gpio13 = GPIO_DIR_INPUT,
32  .gpio14 = GPIO_DIR_INPUT,
33  .gpio15 = GPIO_DIR_INPUT,
34  .gpio22 = GPIO_DIR_INPUT,
35  .gpio24 = GPIO_DIR_OUTPUT,
36  .gpio25 = GPIO_DIR_OUTPUT,
37  .gpio26 = GPIO_DIR_OUTPUT,
38  .gpio27 = GPIO_DIR_OUTPUT,
39  .gpio28 = GPIO_DIR_OUTPUT,
40 };
41 
42 static const struct pch_gpio_set1 pch_gpio_set1_level = {
44  .gpio25 = GPIO_LEVEL_HIGH,
45  .gpio26 = GPIO_LEVEL_LOW,
46  .gpio27 = GPIO_LEVEL_HIGH,
47  .gpio28 = GPIO_LEVEL_HIGH,
48 };
49 
50 static const struct pch_gpio_set1 pch_gpio_set1_invert = {
51  .gpio1 = GPIO_INVERT,
52  .gpio6 = GPIO_INVERT,
53  .gpio7 = GPIO_INVERT,
54  .gpio8 = GPIO_INVERT,
55  .gpio12 = GPIO_INVERT,
56  .gpio13 = GPIO_INVERT,
57 };
58 
59 static const struct pch_gpio_set1 pch_gpio_set1_blink = {
60 };
61 
62 static const struct pch_gpio_set2 pch_gpio_set2_mode = {
63  .gpio33 = GPIO_MODE_GPIO, /* HDD_PRESENCE_2# */
64  .gpio36 = GPIO_MODE_GPIO, /* PLANARID0 */
65  .gpio37 = GPIO_MODE_GPIO, /* PLANARID1 */
66  .gpio38 = GPIO_MODE_GPIO, /* PLANARID2 */
67  .gpio39 = GPIO_MODE_GPIO, /* PLANARID3 */
68  .gpio48 = GPIO_MODE_GPIO, /* FWH_TBL# */
69 };
70 
71 static const struct pch_gpio_set2 pch_gpio_set2_direction = {
73  .gpio36 = GPIO_DIR_INPUT,
74  .gpio37 = GPIO_DIR_INPUT,
75  .gpio38 = GPIO_DIR_INPUT,
76  .gpio39 = GPIO_DIR_INPUT,
77  .gpio48 = GPIO_DIR_OUTPUT,
78 };
79 
80 static const struct pch_gpio_set2 pch_gpio_set2_level = {
82  .gpio48 = GPIO_LEVEL_HIGH,
83 };
84 
85 const struct pch_gpio_map mainboard_gpio_map = {
86  .set1 = {
88  .direction = &pch_gpio_set1_direction,
89  .level = &pch_gpio_set1_level,
90  .blink = &pch_gpio_set1_blink,
91  .invert = &pch_gpio_set1_invert,
92  },
93  .set2 = {
94  .mode = &pch_gpio_set2_mode,
95  .direction = &pch_gpio_set2_direction,
96  .level = &pch_gpio_set2_level,
97  },
98 };
const struct pch_gpio_map mainboard_gpio_map
Definition: gpio.c:87
const struct pch_gpio_set1 pch_gpio_set1_direction
Definition: gpio.c:40
const struct pch_gpio_set2 pch_gpio_set2_level
Definition: gpio.c:157
const struct pch_gpio_set1 pch_gpio_set1_level
Definition: gpio.c:75
const struct pch_gpio_set2 pch_gpio_set2_mode
Definition: gpio.c:87
const struct pch_gpio_set1 pch_gpio_set1_invert
Definition: gpio.c:84
const struct pch_gpio_set1 pch_gpio_set1_mode
Definition: gpio.c:5
const struct pch_gpio_set2 pch_gpio_set2_direction
Definition: gpio.c:122
static const struct pch_gpio_set1 pch_gpio_set1_blink
Definition: gpio.c:59
#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 gpio24
Definition: gpio.h:68
u32 gpio1
Definition: gpio.h:45
u32 gpio33
Definition: gpio.h:80