summaryrefslogtreecommitdiffstats
path: root/src/ec/google/wilco/acpi/ec_dev.asl
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2018-10-15 15:01:15 -0700
committerDuncan Laurie <dlaurie@chromium.org>2018-10-31 18:30:29 +0000
commita802be2910735c73f1b3c21dc837ce7750ed4ff7 (patch)
treeae5efab331802d2d4f1156d93226e1822315bf1c /src/ec/google/wilco/acpi/ec_dev.asl
parentea98b40efe0ae6d514ebc1d797e564abe79ea34d (diff)
downloadcoreboot-a802be2910735c73f1b3c21dc837ce7750ed4ff7.tar.gz
coreboot-a802be2910735c73f1b3c21dc837ce7750ed4ff7.tar.bz2
coreboot-a802be2910735c73f1b3c21dc837ce7750ed4ff7.zip
ec/google/wilco: Add ACPI EC infrastructure
Add the base ACPI support for the Wilco embedded controller, using ASL 2.0 syntax throughout. This includes the EC device and its resources, as well as the layout for the EC RAM and the functions needed to read and write to the EC RAM. The EC RAM address space is typically read/write, and so the ACPI EC device expects that a defined Field can be read and/or written. With this EC the read and write address spaces are different. For example, a read from address zero will return data that is unrelated to what a write to address zero expects. This makes using a typical OperationRegion to describe the EC RAM address space somewhat impracticle, since field definitions would overlap. Instead, methods are provided for reading and writing to an EC RAM offset, and the EC RAM layout is defined as a Package that describes offset+mask for read or write fields within the EC RAM. Change-Id: If8cfdf2633db1ccad4306fe877180ba197ee7414 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://review.coreboot.org/29122 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/ec/google/wilco/acpi/ec_dev.asl')
-rw-r--r--src/ec/google/wilco/acpi/ec_dev.asl61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/ec/google/wilco/acpi/ec_dev.asl b/src/ec/google/wilco/acpi/ec_dev.asl
new file mode 100644
index 000000000000..0519ff0cd91e
--- /dev/null
+++ b/src/ec/google/wilco/acpi/ec_dev.asl
@@ -0,0 +1,61 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright 2018 Google LLC
+ *
+ * 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.
+ */
+
+Device (WLCO)
+{
+ Name (_HID, "GOOG000C")
+ Name (_UID, 1)
+ Name (_DDN, "Wilco EC Command Device")
+
+ Method (_STA)
+ {
+ Return (0xf)
+ }
+
+ Name (_CRS, ResourceTemplate ()
+ {
+ IO (Decode16,
+ CONFIG_EC_BASE_HOST_DATA,
+ CONFIG_EC_BASE_HOST_DATA,
+ 4, 4)
+ IO (Decode16,
+ CONFIG_EC_BASE_HOST_COMMAND,
+ CONFIG_EC_BASE_HOST_COMMAND,
+ 4, 4)
+ IO (Decode16,
+ CONFIG_EC_BASE_PACKET,
+ CONFIG_EC_BASE_PACKET,
+ 16, 16)
+ })
+
+ Name (_PRS, ResourceTemplate ()
+ {
+ StartDependentFn (0, 0) {
+ IO (Decode16,
+ CONFIG_EC_BASE_HOST_DATA,
+ CONFIG_EC_BASE_HOST_DATA,
+ 4, 4)
+ IO (Decode16,
+ CONFIG_EC_BASE_HOST_COMMAND,
+ CONFIG_EC_BASE_HOST_COMMAND,
+ 4, 4)
+ IO (Decode16,
+ CONFIG_EC_BASE_PACKET,
+ CONFIG_EC_BASE_PACKET,
+ 16, 16)
+ }
+ EndDependentFn ()
+ })
+}