1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright 2019 Google LLC
4  *
5  * Taken from coreboot file of the same name
6  */
7 
8 #ifndef BASEBOARD_GPIO_H
9 #define BASEBOARD_GPIO_H
10 
11 #include <asm/arch/gpio.h>
12 #include <ec_commands.h>
13 
14 /*
15  * GPIO_11 for SCI is routed to GPE0_DW1 and maps to group GPIO_GPE_N_31_0
16  * which is North community
17  */
18 #define EC_SCI_GPI	GPE0_DW1_11
19 
20 /* EC SMI */
21 #define EC_SMI_GPI	GPIO_49
22 
23 /*
24  * On lidopen/lidclose GPIO_22 from North Community gets toggled and
25  * is used in _PRW to wake up device from sleep. GPIO_22 maps to
26  * group GPIO_GPE_N_31_0 and the pad is configured as SCI with
27  * EDGE_SINGLE and INVERT.
28  */
29 #define GPE_EC_WAKE	GPE0_DW1_22
30 
31 /* Write Protect and indication if EC is in RW code. */
32 #define GPIO_PCH_WP	GPIO_75
33 #define GPIO_EC_IN_RW	GPIO_41
34 /* Determine if board is in final shipping mode. */
35 #define GPIO_SHIP_MODE	GPIO_10
36 
37 /* DMIC_CONFIG_PIN: High for 1-DMIC and low for 4-DMIC's */
38 #define DMIC_CONFIG_PIN	GPIO_17
39 
40 #ifndef __ASSEMBLY__
41 
42 enum cros_gpio_t {
43 	CROS_GPIO_REC = 1,	 /* Recovery */
44 
45 	/* Developer; * deprecated (chromium:942901) */
46 	CROS_GPIO_DEPRECATED_DEV = 2,
47 	CROS_GPIO_WP = 3,	/* Write Protect */
48 	CROS_GPIO_PE = 4,	/* Phase enforcement for final product */
49 
50 	CROS_GPIO_ACTIVE_LOW = 0,
51 	CROS_GPIO_ACTIVE_HIGH = 1,
52 
53 	CROS_GPIO_VIRTUAL = -1,
54 };
55 #endif
56 
57 #endif /* BASEBOARD_GPIO_H */
58