summaryrefslogtreecommitdiff
path: root/src/mainboard/google/parrot/ec.c
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@chromium.org>2012-12-11 16:00:47 -0800
committerRonald G. Minnich <rminnich@gmail.com>2012-12-12 06:03:06 +0100
commita7198b34ccf120df2a9e5b9f104812e96916ad08 (patch)
treee2d6f704f4f9d1a5b1060febe4c9463d8811fc24 /src/mainboard/google/parrot/ec.c
parent0e81b62638bbc7ee1731034dd041f9756a5bd0fb (diff)
downloadcoreboot-a7198b34ccf120df2a9e5b9f104812e96916ad08.tar.xz
Add support for Google Parrot Chromebook
AKA Acer C7 Chromebook See http://www.google.com/intl/en/chrome/devices/acer-c7-chromebook.html for more information. Thank you to Sage Electronic Engineering, LLC for making this possible! http://www.se-eng.com/ Change-Id: Ic4e4d50045a82cbb82e1dea3cd5a04525a648612 Signed-off-by: Stefan Reinauer <reinauer@google.com> Reviewed-on: http://review.coreboot.org/2026 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'src/mainboard/google/parrot/ec.c')
-rw-r--r--src/mainboard/google/parrot/ec.c82
1 files changed, 82 insertions, 0 deletions
diff --git a/src/mainboard/google/parrot/ec.c b/src/mainboard/google/parrot/ec.c
new file mode 100644
index 0000000000..e6d2d38b13
--- /dev/null
+++ b/src/mainboard/google/parrot/ec.c
@@ -0,0 +1,82 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2012 The Chromium OS Authors. All rights reserved.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <arch/acpi.h>
+#include <vendorcode/google/chromeos/chromeos.h>
+#include <types.h>
+#include <console/console.h>
+#include <device/device.h>
+#include <arch/io.h>
+#include <ec/compal/ene932/ec.h>
+#include "ec.h"
+
+
+void parrot_ec_init(void)
+{
+ printk(BIOS_DEBUG, "Parrot EC Init\n");
+
+ /* Clean up the buffers. We don't know the initial condition. */
+ kbc_cleanup_buffers();
+
+ /* Report EC info */
+ /* EC version: cmd 0x51 - returns three bytes */
+ ec_kbc_write_cmd(0x51);
+ printk(BIOS_DEBUG," EC version %x.%x.%x\n",
+ ec_kbc_read_ob(), ec_kbc_read_ob(), ec_kbc_read_ob());
+
+ /* EC Project name: cmd 0x52, 0xA0 - returns five bytes */
+ ec_kbc_write_cmd(0x52);
+ ec_kbc_write_ib(0xA0);
+ printk(BIOS_DEBUG," EC Project: %c%c%c%c%c\n",
+ ec_kbc_read_ob(),ec_kbc_read_ob(),ec_kbc_read_ob(),
+ ec_kbc_read_ob(), ec_kbc_read_ob());
+
+ /* Print the hardware revision */
+ printk(BIOS_DEBUG," Parrot Revision %x\n", parrot_rev());
+
+ /* US Keyboard */
+ ec_kbc_write_cmd(0x59);
+ ec_kbc_write_ib(0xE5);
+
+ /* Enable IRQ1 */
+ ec_kbc_write_cmd(0x59);
+ ec_kbc_write_ib(0xD1);
+
+ /* TODO - Do device detection and device maintain state (nvs) */
+ /* Enable Wireless and Bluetooth */
+ ec_kbc_write_cmd(0x45);
+ ec_kbc_write_ib(0xAD);
+
+ /* Set Wireless and Bluetooth Available */
+ ec_kbc_write_cmd(0x45);
+ ec_kbc_write_ib(0xA8);
+
+ /* Set Wireless and Bluetooth Enable */
+ ec_kbc_write_cmd(0x45);
+ ec_kbc_write_ib(0xA2);
+}
+
+
+/* Parrot Hardware Revision */
+u8 parrot_rev(void)
+{
+ ec_kbc_write_cmd(0x45);
+ ec_kbc_write_ib(0x40);
+ return ec_kbc_read_ob();
+}