2 * This file is part of the coreboot project.
4 * Copyright (C) 2011 The Chromium OS Authors. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 #ifndef INTEL_BD82X6X_GPIO_H
21 #define INTEL_BD82X6X_GPIO_H
23 #define GPIO_MODE_NATIVE 0
24 #define GPIO_MODE_GPIO 1
25 #define GPIO_MODE_NONE 1
27 #define GPIO_DIR_OUTPUT 0
28 #define GPIO_DIR_INPUT 1
30 #define GPIO_NO_INVERT 0
33 #define GPIO_LEVEL_LOW 0
34 #define GPIO_LEVEL_HIGH 1
36 #define GPIO_NO_BLINK 0
39 #define GPIO_RESET_PWROK 0
40 #define GPIO_RESET_RSMRST 1
42 struct pch_gpio_set1 {
75 } __attribute__ ((packed));
77 struct pch_gpio_set2 {
110 } __attribute__ ((packed));
112 struct pch_gpio_set3 {
125 } __attribute__ ((packed));
127 struct pch_gpio_map {
129 const struct pch_gpio_set1 *mode;
130 const struct pch_gpio_set1 *direction;
131 const struct pch_gpio_set1 *level;
132 const struct pch_gpio_set1 *reset;
133 const struct pch_gpio_set1 *invert;
134 const struct pch_gpio_set1 *blink;
137 const struct pch_gpio_set2 *mode;
138 const struct pch_gpio_set2 *direction;
139 const struct pch_gpio_set2 *level;
140 const struct pch_gpio_set2 *reset;
143 const struct pch_gpio_set3 *mode;
144 const struct pch_gpio_set3 *direction;
145 const struct pch_gpio_set3 *level;
146 const struct pch_gpio_set3 *reset;
150 /* Configure GPIOs with mainboard provided settings */
151 void setup_pch_gpios(const struct pch_gpio_map *gpio);