2 * Copyright (C) 2014 Google, Inc
4 * SPDX-License-Identifier: GPL-2.0+
10 int arch_early_init_r(void)
15 int board_early_init_r(void)
20 static const struct pch_gpio_set1 pch_gpio_set1_mode
= {
21 .gpio0
= GPIO_MODE_GPIO
, /* NMI_DBG# */
22 .gpio3
= GPIO_MODE_GPIO
, /* ALS_INT# */
23 .gpio5
= GPIO_MODE_GPIO
, /* SIM_DET */
24 .gpio7
= GPIO_MODE_GPIO
, /* EC_SCI# */
25 .gpio8
= GPIO_MODE_GPIO
, /* EC_SMI# */
26 .gpio9
= GPIO_MODE_GPIO
, /* RECOVERY# */
27 .gpio10
= GPIO_MODE_GPIO
, /* SPD vector D3 */
28 .gpio11
= GPIO_MODE_GPIO
, /* smbalert#, let's keep it initialized */
29 .gpio12
= GPIO_MODE_GPIO
, /* TP_INT# */
30 .gpio14
= GPIO_MODE_GPIO
, /* Touch_INT_L */
31 .gpio15
= GPIO_MODE_GPIO
, /* EC_LID_OUT# (EC_WAKE#) */
32 .gpio21
= GPIO_MODE_GPIO
, /* EC_IN_RW */
33 .gpio24
= GPIO_MODE_GPIO
, /* DDR3L_EN */
34 .gpio28
= GPIO_MODE_GPIO
, /* SLP_ME_CSW_DEV# */
37 static const struct pch_gpio_set1 pch_gpio_set1_direction
= {
38 .gpio0
= GPIO_DIR_INPUT
,
39 .gpio3
= GPIO_DIR_INPUT
,
40 .gpio5
= GPIO_DIR_INPUT
,
41 .gpio7
= GPIO_DIR_INPUT
,
42 .gpio8
= GPIO_DIR_INPUT
,
43 .gpio9
= GPIO_DIR_INPUT
,
44 .gpio10
= GPIO_DIR_INPUT
,
45 .gpio11
= GPIO_DIR_INPUT
,
46 .gpio12
= GPIO_DIR_INPUT
,
47 .gpio14
= GPIO_DIR_INPUT
,
48 .gpio15
= GPIO_DIR_INPUT
,
49 .gpio21
= GPIO_DIR_INPUT
,
50 .gpio24
= GPIO_DIR_OUTPUT
,
51 .gpio28
= GPIO_DIR_INPUT
,
54 static const struct pch_gpio_set1 pch_gpio_set1_level
= {
55 .gpio1
= GPIO_LEVEL_HIGH
,
56 .gpio6
= GPIO_LEVEL_HIGH
,
57 .gpio24
= GPIO_LEVEL_LOW
,
60 static const struct pch_gpio_set1 pch_gpio_set1_invert
= {
63 .gpio12
= GPIO_INVERT
,
64 .gpio14
= GPIO_INVERT
,
65 .gpio15
= GPIO_INVERT
,
68 static const struct pch_gpio_set2 pch_gpio_set2_mode
= {
69 .gpio36
= GPIO_MODE_GPIO
, /* W_DISABLE_L */
70 .gpio41
= GPIO_MODE_GPIO
, /* SPD vector D0 */
71 .gpio42
= GPIO_MODE_GPIO
, /* SPD vector D1 */
72 .gpio43
= GPIO_MODE_GPIO
, /* SPD vector D2 */
73 .gpio57
= GPIO_MODE_GPIO
, /* PCH_SPI_WP_D */
74 .gpio60
= GPIO_MODE_GPIO
, /* DRAMRST_CNTRL_PCH */
77 static const struct pch_gpio_set2 pch_gpio_set2_direction
= {
78 .gpio36
= GPIO_DIR_OUTPUT
,
79 .gpio41
= GPIO_DIR_INPUT
,
80 .gpio42
= GPIO_DIR_INPUT
,
81 .gpio43
= GPIO_DIR_INPUT
,
82 .gpio57
= GPIO_DIR_INPUT
,
83 .gpio60
= GPIO_DIR_OUTPUT
,
86 static const struct pch_gpio_set2 pch_gpio_set2_level
= {
87 .gpio36
= GPIO_LEVEL_HIGH
,
88 .gpio60
= GPIO_LEVEL_HIGH
,
91 static const struct pch_gpio_set3 pch_gpio_set3_mode
= {
94 static const struct pch_gpio_set3 pch_gpio_set3_direction
= {
97 static const struct pch_gpio_set3 pch_gpio_set3_level
= {
100 static const struct pch_gpio_map link_gpio_map
= {
102 .mode
= &pch_gpio_set1_mode
,
103 .direction
= &pch_gpio_set1_direction
,
104 .level
= &pch_gpio_set1_level
,
105 .invert
= &pch_gpio_set1_invert
,
108 .mode
= &pch_gpio_set2_mode
,
109 .direction
= &pch_gpio_set2_direction
,
110 .level
= &pch_gpio_set2_level
,
113 .mode
= &pch_gpio_set3_mode
,
114 .direction
= &pch_gpio_set3_direction
,
115 .level
= &pch_gpio_set3_level
,
119 int board_early_init_f(void)
121 ich_gpio_set_gpio_map(&link_gpio_map
);