summaryrefslogtreecommitdiff
path: root/src/mainboard/google/brya/chromeos.c
diff options
context:
space:
mode:
authorEric Lai <ericr_lai@compal.corp-partner.google.com>2020-11-27 13:50:02 +0800
committerTim Wawrzynczak <twawrzynczak@chromium.org>2020-12-04 21:09:37 +0000
commitb052c4b368313a5269494c776e395fb29bcdea76 (patch)
tree87041cdbe9cc1113d2ff6a02bdd7e704bae6e909 /src/mainboard/google/brya/chromeos.c
parent812f36425e79e202d38c1bab16eef261ea2fb417 (diff)
mb/google/brya: Enable building for Chrome OS
Enable building for Chrome OS and add associated ACPI configuration. BUG=b:174266035 TEST=Build Test Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com> Change-Id: I5311879a127a2c8da1bbb086449019d932d57b72 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48111 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/mainboard/google/brya/chromeos.c')
-rw-r--r--src/mainboard/google/brya/chromeos.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/chromeos.c b/src/mainboard/google/brya/chromeos.c
new file mode 100644
index 0000000000..2e6ea3e27d
--- /dev/null
+++ b/src/mainboard/google/brya/chromeos.c
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <baseboard/gpio.h>
+#include <baseboard/variants.h>
+#include <boot/coreboot_tables.h>
+#include <gpio.h>
+#include <vendorcode/google/chromeos/chromeos.h>
+
+void fill_lb_gpios(struct lb_gpios *gpios)
+{
+ struct lb_gpio chromeos_gpios[] = {
+ {-1, ACTIVE_HIGH, get_lid_switch(), "lid"},
+ {-1, ACTIVE_HIGH, 0, "power"},
+ {-1, ACTIVE_HIGH, gfx_get_init_done(), "oprom"},
+ };
+ lb_add_gpios(gpios, chromeos_gpios, ARRAY_SIZE(chromeos_gpios));
+}
+
+int get_lid_switch(void)
+{
+ /* TODO: use Chrome EC switches when EC support is added */
+ return 1;
+}
+
+int get_recovery_mode_switch(void)
+{
+ /* TODO: use Chrome EC switches when EC support is added */
+ return 0;
+}
+
+int get_write_protect_state(void)
+{
+ /* No write protect */
+ return 0;
+}
+
+void mainboard_chromeos_acpi_generate(void)
+{
+ const struct cros_gpio *gpios;
+ size_t num;
+ gpios = variant_cros_gpios(&num);
+ chromeos_acpi_gpio_generate(gpios, num);
+}