2 * This file is part of the coreboot project.
4 * Copyright (C) 2016 Google Inc.
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.
16 #include <arch/acpi.h>
17 #include <baseboard/variants.h>
23 #include <vendorcode/google/chromeos/chromeos.h>
25 #include <variant/gpio.h>
28 #include <boot/coreboot_tables.h>
30 void fill_lb_gpios(struct lb_gpios
*gpios
)
32 struct lb_gpio chromeos_gpios
[] = {
33 {-1, ACTIVE_HIGH
, get_write_protect_state(), "write protect"},
34 {-1, ACTIVE_HIGH
, get_recovery_mode_switch(), "recovery"},
35 {-1, ACTIVE_HIGH
, get_lid_switch(), "lid"},
36 {-1, ACTIVE_HIGH
, 0, "power"},
37 {-1, ACTIVE_HIGH
, gfx_get_init_done(), "oprom"},
38 {GPIO_EC_IN_RW
, ACTIVE_HIGH
, gpio_get(GPIO_EC_IN_RW
),
41 lb_add_gpios(gpios
, chromeos_gpios
, ARRAY_SIZE(chromeos_gpios
));
43 #endif /* ENV_RAMSTAGE */
45 int get_write_protect_state(void)
47 /* Read PCH_WP GPIO. */
48 return gpio_get(GPIO_PCH_WP
);
51 void mainboard_chromeos_acpi_generate(void)
53 const struct cros_gpio
*gpios
;
56 gpios
= variant_cros_gpios(&num
);
57 chromeos_acpi_gpio_generate(gpios
, num
);
60 int tis_plat_irq_status(void)
62 return acpi_get_gpe(GPE0_DW2_00
);