blob: f43d9d1a3e615ee60542bdbd9a750584bb1997c5 [file] [log] [blame]
Patrick Georgiac959032020-05-05 22:49:26 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Nicola Corna1bea5b72017-03-03 18:04:48 +01002
3#include <southbridge/intel/common/gpio.h>
4
5static const struct pch_gpio_set1 pch_gpio_set1_mode = {
6 .gpio6 = GPIO_MODE_GPIO,
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 .gpio22 = GPIO_MODE_GPIO,
16 .gpio23 = GPIO_MODE_GPIO,
17 .gpio24 = GPIO_MODE_GPIO,
18 .gpio25 = GPIO_MODE_GPIO,
19 .gpio26 = GPIO_MODE_GPIO,
20 .gpio27 = GPIO_MODE_GPIO,
21 .gpio28 = GPIO_MODE_GPIO,
22 .gpio29 = GPIO_MODE_GPIO,
23};
24
25static const struct pch_gpio_set1 pch_gpio_set1_direction = {
26 .gpio6 = GPIO_DIR_OUTPUT,
27 .gpio7 = GPIO_DIR_INPUT,
28 .gpio8 = GPIO_DIR_INPUT,
29 .gpio9 = GPIO_DIR_OUTPUT,
30 .gpio10 = GPIO_DIR_INPUT,
31 .gpio12 = GPIO_DIR_INPUT,
32 .gpio13 = GPIO_DIR_INPUT,
33 .gpio14 = GPIO_DIR_INPUT,
34 .gpio15 = GPIO_DIR_OUTPUT,
35 .gpio22 = GPIO_DIR_OUTPUT,
36 .gpio23 = GPIO_DIR_INPUT,
37 .gpio24 = GPIO_DIR_OUTPUT,
38 .gpio25 = GPIO_DIR_OUTPUT,
39 .gpio26 = GPIO_DIR_OUTPUT,
40 .gpio27 = GPIO_DIR_OUTPUT,
41 .gpio28 = GPIO_DIR_INPUT,
42 .gpio29 = GPIO_DIR_INPUT,
43};
44
45static const struct pch_gpio_set1 pch_gpio_set1_level = {
46 .gpio6 = GPIO_LEVEL_LOW,
47 .gpio9 = GPIO_LEVEL_LOW,
48 .gpio15 = GPIO_LEVEL_LOW,
49 .gpio22 = GPIO_LEVEL_HIGH,
50 .gpio24 = GPIO_LEVEL_HIGH,
51 .gpio25 = GPIO_LEVEL_LOW,
52 .gpio26 = GPIO_LEVEL_LOW,
53 .gpio27 = GPIO_LEVEL_LOW,
54};
55
56static const struct pch_gpio_set1 pch_gpio_set1_blink = {
57 .gpio6 = GPIO_NO_BLINK,
58 .gpio9 = GPIO_NO_BLINK,
59 .gpio15 = GPIO_NO_BLINK,
60 .gpio22 = GPIO_NO_BLINK,
61 .gpio24 = GPIO_NO_BLINK,
62 .gpio25 = GPIO_NO_BLINK,
63 .gpio26 = GPIO_NO_BLINK,
64 .gpio27 = GPIO_NO_BLINK,
65};
66
67static const struct pch_gpio_set1 pch_gpio_set1_invert = {
68 .gpio7 = GPIO_INVERT,
69 .gpio8 = GPIO_INVERT,
70 .gpio10 = GPIO_NO_INVERT,
71 .gpio12 = GPIO_NO_INVERT,
72 .gpio13 = GPIO_INVERT,
73 .gpio14 = GPIO_NO_INVERT,
74 .gpio28 = GPIO_NO_INVERT,
75 .gpio29 = GPIO_NO_INVERT,
76};
77
Peter Lemenkov6752b6152019-06-15 21:39:32 +020078static const struct pch_gpio_set1 pch_gpio_set1_reset = {
Nicola Corna1bea5b72017-03-03 18:04:48 +010079 .gpio6 = GPIO_RESET_PWROK,
80 .gpio7 = GPIO_RESET_PWROK,
81 .gpio8 = GPIO_RESET_PWROK,
82 .gpio9 = GPIO_RESET_PWROK,
83 .gpio10 = GPIO_RESET_PWROK,
84 .gpio12 = GPIO_RESET_PWROK,
85 .gpio13 = GPIO_RESET_PWROK,
86 .gpio14 = GPIO_RESET_PWROK,
87 .gpio15 = GPIO_RESET_PWROK,
88 .gpio22 = GPIO_RESET_PWROK,
89 .gpio23 = GPIO_RESET_PWROK,
90 .gpio24 = GPIO_RESET_PWROK,
91 .gpio25 = GPIO_RESET_PWROK,
92 .gpio26 = GPIO_RESET_PWROK,
93 .gpio27 = GPIO_RESET_PWROK,
94 .gpio28 = GPIO_RESET_PWROK,
95 .gpio29 = GPIO_RESET_PWROK,
96};
97
98static const struct pch_gpio_set2 pch_gpio_set2_mode = {
99 .gpio35 = GPIO_MODE_GPIO,
100 .gpio37 = GPIO_MODE_GPIO,
101 .gpio38 = GPIO_MODE_GPIO,
102 .gpio39 = GPIO_MODE_GPIO,
103 .gpio48 = GPIO_MODE_GPIO,
104 .gpio60 = GPIO_MODE_GPIO,
105};
106
107static const struct pch_gpio_set2 pch_gpio_set2_direction = {
108 .gpio35 = GPIO_DIR_OUTPUT,
109 .gpio37 = GPIO_DIR_INPUT,
110 .gpio38 = GPIO_DIR_OUTPUT,
111 .gpio39 = GPIO_DIR_OUTPUT,
112 .gpio48 = GPIO_DIR_OUTPUT,
113 .gpio60 = GPIO_DIR_OUTPUT,
114};
115
116static const struct pch_gpio_set2 pch_gpio_set2_level = {
117 .gpio35 = GPIO_LEVEL_LOW,
118 .gpio38 = GPIO_LEVEL_LOW,
119 .gpio39 = GPIO_LEVEL_LOW,
120 .gpio48 = GPIO_LEVEL_HIGH,
121 .gpio60 = GPIO_LEVEL_HIGH,
122};
123
Peter Lemenkov6752b6152019-06-15 21:39:32 +0200124static const struct pch_gpio_set2 pch_gpio_set2_reset = {
Nicola Corna1bea5b72017-03-03 18:04:48 +0100125 .gpio35 = GPIO_RESET_PWROK,
126 .gpio37 = GPIO_RESET_PWROK,
127 .gpio38 = GPIO_RESET_PWROK,
128 .gpio39 = GPIO_RESET_PWROK,
129 .gpio48 = GPIO_RESET_PWROK,
130 .gpio60 = GPIO_RESET_PWROK,
131};
132
Peter Lemenkov6752b6152019-06-15 21:39:32 +0200133static const struct pch_gpio_set3 pch_gpio_set3_mode = {
Nicola Corna1bea5b72017-03-03 18:04:48 +0100134 .gpio68 = GPIO_MODE_GPIO,
135 .gpio69 = GPIO_MODE_GPIO,
136 .gpio72 = GPIO_MODE_GPIO,
137};
138
Peter Lemenkov6752b6152019-06-15 21:39:32 +0200139static const struct pch_gpio_set3 pch_gpio_set3_direction = {
Nicola Corna1bea5b72017-03-03 18:04:48 +0100140 .gpio68 = GPIO_DIR_INPUT,
141 .gpio69 = GPIO_DIR_INPUT,
142 .gpio72 = GPIO_DIR_INPUT,
143};
144
Peter Lemenkov6752b6152019-06-15 21:39:32 +0200145static const struct pch_gpio_set3 pch_gpio_set3_level = {
Nicola Corna1bea5b72017-03-03 18:04:48 +0100146};
147
Peter Lemenkov6752b6152019-06-15 21:39:32 +0200148static const struct pch_gpio_set3 pch_gpio_set3_reset = {
Nicola Corna1bea5b72017-03-03 18:04:48 +0100149 .gpio68 = GPIO_RESET_PWROK,
150 .gpio69 = GPIO_RESET_PWROK,
151 .gpio72 = GPIO_RESET_PWROK,
152};
153
154const struct pch_gpio_map mainboard_gpio_map = {
155 .set1 = {
156 .mode = &pch_gpio_set1_mode,
157 .direction = &pch_gpio_set1_direction,
158 .level = &pch_gpio_set1_level,
159 .blink = &pch_gpio_set1_blink,
160 .invert = &pch_gpio_set1_invert,
161 .reset = &pch_gpio_set1_reset,
162 },
163 .set2 = {
164 .mode = &pch_gpio_set2_mode,
165 .direction = &pch_gpio_set2_direction,
166 .level = &pch_gpio_set2_level,
167 .reset = &pch_gpio_set2_reset,
168 },
169 .set3 = {
170 .mode = &pch_gpio_set3_mode,
171 .direction = &pch_gpio_set3_direction,
172 .level = &pch_gpio_set3_level,
173 .reset = &pch_gpio_set3_reset,
174 },
175};