aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/google/chromeos/acpi.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-07-25 21:31:41 -0500
committerDuncan Laurie <dlaurie@chromium.org>2016-07-30 01:36:32 +0200
commitb0f81518b5c17466bc95ebdef292e82c4b76bc88 (patch)
tree7174d0006c9a8450ada5aeb7c6fe6377407e96a6 /src/vendorcode/google/chromeos/acpi.c
parent212820c8d728c59fa3228ce92bc1d549b232e35a (diff)
chromeos mainboards: remove chromeos.asl
Use the ACPI generator for creating the Chrome OS gpio package. Each mainboard has its own list of Chrome OS gpios that are fed into a helper to generate the ACPI external OIPG package. Additionally, the common chromeos.asl is now conditionally included based on CONFIG_CHROMEOS. Change-Id: I1d3d951964374a9d43521879d4c265fa513920d2 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/15909 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Diffstat (limited to 'src/vendorcode/google/chromeos/acpi.c')
-rw-r--r--src/vendorcode/google/chromeos/acpi.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/acpi.c b/src/vendorcode/google/chromeos/acpi.c
new file mode 100644
index 0000000000..6605809023
--- /dev/null
+++ b/src/vendorcode/google/chromeos/acpi.c
@@ -0,0 +1,43 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2016 Google Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+#include <arch/acpigen.h>
+#include "chromeos.h"
+
+void chromeos_acpi_gpio_generate(const struct cros_gpio *gpios, size_t num)
+{
+ size_t i;
+
+ acpigen_write_scope("\\");
+ acpigen_write_name("OIPG");
+
+ acpigen_write_package(num);
+ for (i = 0; i < num; i++) {
+ acpigen_write_package(4);
+ acpigen_write_integer(gpios[i].type);
+ acpigen_write_integer(gpios[i].polarity);
+ acpigen_write_integer(gpios[i].gpio_num);
+ acpigen_write_string(gpios[i].device);
+ acpigen_pop_len();
+ }
+ acpigen_pop_len();
+
+ acpigen_pop_len();
+}
+
+void chromeos_dsdt_generator(struct device *dev)
+{
+ mainboard_chromeos_acpi_generate();
+}