the following patch was just integrated into master:
commit c49782cbe7a79cca03c3c20c647211367bb0a03e
Author: Julius Werner <jwerner(a)chromium.org>
Date: Mon Nov 21 20:14:18 2016 -0800
google/gru: Power-cycle USB ports in developer/recovery modes
Gru only uses USB 2.0 in firmware to avoid all the madness associated
with Type-C port orientation and USB 3.0 tuning. We do this by isolating
the SuperSpeed lines in the Type-C PHY so it looks like they aren't
connected to the device.
Unfortunately, some devices seem to already get "locked" into SuperSpeed
mode as soon as they detect Rx terminations once, and can never snap out
again on their own. Since the terminations are already connected during
power-on reset we cannot disable them fast enough to prevent this, and
the only solution we found to date is to power-cycle the whole USB port.
Now, Gru's USB port power is controlled by the EC, and unfortunately we
have no direct host command to control it. We do however have a command
to force a certain USB PD "role", and forcing our host into "sink" mode
makes it stop sourcing power to the port. So for lack of a saner
solution we'll use this to work around our problem.
BRANCH=gru
BUG=chrome-os-partner:59346
TEST=Booted Kevin in recovery mode, confirmed that my "problem stick"
gets detected immediately (whereas previously I had to unplug/replug
it). Booted Kevin to OS in both developer and normal mode and confirmed
that USB still seems to work.
Change-Id: Ib3cceba9baa170b13f01bd5c01bd413be5b441ba
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: cd695eda33299e50362f1096c46f2f5260c49036
Original-Change-Id: I2db3d6d3710d18a8b8030e94eb1ac2e931f22638
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/413031
Reviewed-on: https://review.coreboot.org/17628
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/17628 for details.
-gerrit
the following patch was just integrated into master:
commit ea79d2b3a3ddcb7909ac2862ebfda19c6b8823ae
Author: Julius Werner <jwerner(a)chromium.org>
Date: Mon Nov 21 20:14:07 2016 -0800
google/chromeec: Add command to control USB PD role
Normally firmware should have no business messing with the USB PD role
(source/sink/whatever) in the EC. But, as so often happens, ugly issues
crop up that require weird work-arounds, and before you know it you need
to do this for some reason that only makes sense in context. I do now,
so add this function to send the necessary host command in the simplest
possible fashion.
BRANCH=gru
BUG=chrome-os-partner:59346
TEST=Used it in a follow-up patch.
Change-Id: I07d40feafd6a8387a633d6384efb205baf578d76
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 8b71767caccff9b77d458182ce8066f7abf6321c
Original-Change-Id: Ie8d0be98f6b703f4db062fe2f728cd2588347202
Original-Signed-off-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/413030
Original-Reviewed-by: Vincent Palatin <vpalatin(a)chromium.org>
Reviewed-on: https://review.coreboot.org/17627
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/17627 for details.
-gerrit
Marty Plummer (ntzrmtthihu777(a)gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17669
-gerrit
commit 7a51aaba69673aedc66e70f1c5916d915d4362a9
Author: Marty Plummer <ntzrmtthihu777(a)gmail.com>
Date: Thu Dec 1 02:14:39 2016 -0600
superio/fintek: Add support for Fintek F71889A.
Datasheet: F71889A rev V0.21P
Change-Id: I91c60a3b48cd4872ae7a27de8f49faa40e877a27
Signed-off-by: Marty Plummer <ntzrmtthihu777(a)gmail.com>
---
src/superio/fintek/Makefile.inc | 1 +
src/superio/fintek/f71889a/Kconfig | 20 +++++++++
src/superio/fintek/f71889a/Makefile.inc | 18 ++++++++
src/superio/fintek/f71889a/f71889a.h | 33 +++++++++++++++
src/superio/fintek/f71889a/superio.c | 73 +++++++++++++++++++++++++++++++++
5 files changed, 145 insertions(+)
diff --git a/src/superio/fintek/Makefile.inc b/src/superio/fintek/Makefile.inc
index 0d0ae66..d70fc99 100644
--- a/src/superio/fintek/Makefile.inc
+++ b/src/superio/fintek/Makefile.inc
@@ -21,6 +21,7 @@ subdirs-y += f71859
subdirs-y += f71863fg
subdirs-y += f71869ad
subdirs-y += f71872
+subdirs-y += f71889a
subdirs-y += f81216h
subdirs-y += f81865f
subdirs-y += f81866d
diff --git a/src/superio/fintek/f71889a/Kconfig b/src/superio/fintek/f71889a/Kconfig
new file mode 100644
index 0000000..96366d9
--- /dev/null
+++ b/src/superio/fintek/f71889a/Kconfig
@@ -0,0 +1,20 @@
+#
+# This file is part of the coreboot project.
+#
+# Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+# Copyright (C) 2016 Marty Plummer <ntzrmtthihu777(a)gmail.com>
+#
+# 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, either version 3 of the License, or
+# (at your option) any later version.
+#
+# 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.
+#
+
+config SUPERIO_FINTEK_F71889A
+ bool
+ select SUPERIO_FINTEK_COMMON_ROMSTAGE
diff --git a/src/superio/fintek/f71889a/Makefile.inc b/src/superio/fintek/f71889a/Makefile.inc
new file mode 100644
index 0000000..06fcff9
--- /dev/null
+++ b/src/superio/fintek/f71889a/Makefile.inc
@@ -0,0 +1,18 @@
+##
+## This file is part of the coreboot project.
+##
+## Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+## Copyright (C) 2016 Marty Plummer <ntzrmtthihu777(a)gmail.com>
+##
+## 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, either version 3 of the License, or
+## (at your option) any later version.
+##
+## 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.
+##
+
+ramstage-$(CONFIG_SUPERIO_FINTEK_F71889A) += superio.c
diff --git a/src/superio/fintek/f71889a/f71889a.h b/src/superio/fintek/f71889a/f71889a.h
new file mode 100644
index 0000000..4a272a6
--- /dev/null
+++ b/src/superio/fintek/f71889a/f71889a.h
@@ -0,0 +1,33 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+ * Copyright (C) 2016 Marty Plummer <ntzrmtthihu777(a)gmail.com>
+ *
+ * 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, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * 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.
+ */
+
+#ifndef SUPERIO_FINTEK_F71889A_H
+#define SUPERIO_FINTEK_F71889A_H
+
+/* Logical Device Numbers (LDN). */
+#define F71889A_SP1 0x01 /* UART1 */
+#define F71889A_SP2 0x02 /* UART2 */
+#define F71889A_PP 0x03 /* Parallel Port */
+#define F71889A_HWM 0x04 /* Hardware Monitor */
+#define F71889A_KBC 0x05 /* Keyboard/Mouse */
+#define F71889A_GPIO 0x06 /* GPIO */
+#define F71889A_WDT 0x07 /* WDT */
+#define F71889A_CIR 0x08 /* CIR */
+#define F71889A_PM 0x0a /* ACPI/PME */
+#define F71889A_VREF 0x0b /* VREF */
+
+#endif /* SUPERIO_FINTEK_F71889A_H */
diff --git a/src/superio/fintek/f71889a/superio.c b/src/superio/fintek/f71889a/superio.c
new file mode 100644
index 0000000..c25c3f3
--- /dev/null
+++ b/src/superio/fintek/f71889a/superio.c
@@ -0,0 +1,73 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2014 Edward O'Callaghan <eocallaghan(a)alterapraxis.com>
+ * Copyright (C) 2016 Marty Plummer <ntzrmtthihu777(a)gmail.com>
+ *
+ * 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, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * 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/io.h>
+#include <device/device.h>
+#include <device/pnp.h>
+#include <superio/conf_mode.h>
+#include <console/console.h>
+#include <stdlib.h>
+#include <pc80/keyboard.h>
+#include "f71889a.h"
+
+static void f71889a_init(struct device *dev)
+{
+ if (!dev->enabled)
+ return;
+
+ switch (dev->path.pnp.device) {
+
+ case F71889A_KBC:
+ pc_keyboard_init(NO_AUX_DEVICE);
+ break;
+ }
+}
+
+static struct device_operations ops = {
+ .read_resources = pnp_read_resources,
+ .set_resources = pnp_set_resources,
+ .enable_resources = pnp_enable_resources,
+ .enable = pnp_alt_enable,
+ .init = f71889a_init,
+ .ops_pnp_mode = &pnp_conf_mode_8787_aa,
+};
+
+static struct pnp_info pnp_dev_info[] = {
+ /* TODO: Some of the 0x07f8 etc. values may not be correct.
+ * double check bitmasks
+ */
+ { &ops, F71889A_SP1, PNP_IO0 | PNP_IRQ0, {0x07f8, 0}, },
+ { &ops, F71889A_SP2, PNP_IO0 | PNP_IRQ0, {0x07f8, 0}, },
+ { &ops, F71889A_PP, PNP_IO0 | PNP_IRQ0 | PNP_DRQ0, {0x07f8, 0}, },
+ { &ops, F71889A_HWM, PNP_IO0 | PNP_IRQ0, {0x07f8, 0}, },
+ { &ops, F71889A_KBC, PNP_IO0 | PNP_IRQ0 | PNP_IRQ1, {0x07f8, 0}, },
+ { &ops, F71889A_GPIO, },
+ { &ops, F71889A_WDT, PNP_IO0, {0x0ff8, 0}, },
+ { &ops, F71889A_CIR, PNP_IO0 | PNP_IRQ0, },
+ { &ops, F71889A_PM, },
+ { &ops, F71889A_VREF, },
+};
+
+static void enable_dev(struct device *dev)
+{
+ pnp_enable_devices(dev, &ops, ARRAY_SIZE(pnp_dev_info), pnp_dev_info);
+}
+
+struct chip_operations superio_fintek_f71889a_ops = {
+ CHIP_NAME("Fintek F71889A Super I/O")
+ .enable_dev = enable_dev
+};