2 * This file is part of the coreboot project.
4 * Copyright (C) 2013 Google Inc.
5 * Copyright (C) 2015 Intel Corporation.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
19 #include <vendorcode/google/chromeos/chromeos.h>
24 #include <boot/coreboot_tables.h>
26 void fill_lb_gpios(struct lb_gpios
*gpios
)
28 struct lb_gpio chromeos_gpios
[] = {
29 {-1, ACTIVE_HIGH
, get_write_protect_state(), "write protect"},
30 {-1, ACTIVE_HIGH
, get_lid_switch(), "lid"},
31 {-1, ACTIVE_HIGH
, 0, "power"},
32 {-1, ACTIVE_HIGH
, gfx_get_init_done(), "oprom"},
33 {GPIO_EC_IN_RW
, ACTIVE_HIGH
,
34 gpio_get(GPIO_EC_IN_RW
), "EC in RW"},
36 lb_add_gpios(gpios
, chromeos_gpios
, ARRAY_SIZE(chromeos_gpios
));
38 #endif /* ENV_RAMSTAGE */
40 int get_write_protect_state(void)
42 /* Read PCH_WP GPIO. */
43 return gpio_get(GPIO_PCH_WP
);
46 static const struct cros_gpio cros_gpios
[] = {
47 CROS_GPIO_REC_AL(CROS_GPIO_VIRTUAL
, CROS_GPIO_DEVICE_NAME
),
48 CROS_GPIO_WP_AH(GPIO_PCH_WP
, CROS_GPIO_DEVICE_NAME
),
51 void mainboard_chromeos_acpi_generate(void)
53 chromeos_acpi_gpio_generate(cros_gpios
, ARRAY_SIZE(cros_gpios
));