Rizwan Qureshi (rizwan.qureshi(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17578
-gerrit
commit 46b13d85e45e6c33cd55b9f5892d9ee7d94198bf
Author: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Date: Wed Nov 23 15:25:19 2016 +0530
soc/intel/skylake: Use SendVrMbxCmd1 for FSP 2.0
In FSP 2.0 the UPD to send extra VR Mailbox commands is switched from
SendVrMbxCmd to SendVrMbxCmd1. Use the same in silicon initialization.
Change-Id: I46bd50c9acc0456e2483f20ccb5e9ec2a0de232a
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
---
src/soc/intel/skylake/chip_fsp20.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/soc/intel/skylake/chip_fsp20.c b/src/soc/intel/skylake/chip_fsp20.c
index 582cdbf..a8aad37 100644
--- a/src/soc/intel/skylake/chip_fsp20.c
+++ b/src/soc/intel/skylake/chip_fsp20.c
@@ -218,7 +218,14 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd)
dev = dev_find_slot(0, PCH_DEVFN_SPI);
params->ShowSpiController = dev->enabled;
- params->SendVrMbxCmd = config->SendVrMbxCmd;
+ /*
+ * Send VR specific mailbox commands:
+ * 000b - no VR specific command sent
+ * 001b - VR mailbox command specifically for the MPS IMPV8 VR will be sent
+ * 010b - VR specific command sent for PS4 exit issue
+ * 100b - VR specific command sent for MPS VR decay issue
+ */
+ params->SendVrMbxCmd1 = config->SendVrMbxCmd;
soc_irq_settings(params);
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17628
-gerrit
commit b02c66a82d452a22109224d2c69ab2bb7ae34525
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
---
src/mainboard/google/gru/mainboard.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index 7e360e7..dd986c4 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -15,9 +15,11 @@
*/
#include <boardid.h>
+#include <console/console.h>
#include <delay.h>
#include <device/device.h>
#include <device/i2c.h>
+#include <ec/google/chromeec/ec.h>
#include <gpio.h>
#include <soc/bl31_plat_params.h>
#include <soc/clock.h>
@@ -230,6 +232,17 @@ static void configure_display(void)
gpio_output(GPIO(4, D, 3), 1); /* CPU3_EDP_VDDEN for P3.3V_DISP */
}
+static void usb_power_cycle(int port)
+{
+ if (google_chromeec_set_usb_pd_role(port, USB_PD_CTRL_ROLE_FORCE_SINK))
+ printk(BIOS_ERR, "ERROR: Cannot force USB%d PD sink\n", port);
+
+ mdelay(10); /* Make sure USB stick is fully depowered. */
+
+ if (google_chromeec_set_usb_pd_role(port, USB_PD_CTRL_ROLE_TOGGLE_ON))
+ printk(BIOS_ERR, "ERROR: Cannot restore USB%d PD mode\n", port);
+}
+
static void setup_usb(void)
{
/* A few magic PHY tuning values that improve eye diagram amplitude
@@ -269,6 +282,17 @@ static void setup_usb(void)
setup_usb_otg0();
setup_usb_otg1();
+
+ /*
+ * Need to power-cycle USB ports for use in firmware, since some devices
+ * can't fall back to USB 2.0 after they saw SuperSpeed terminations.
+ * This takes about a dozen milliseconds, so only do it in boot modes
+ * that have firmware UI (which one could select USB boot from).
+ */
+ if (display_init_required()) {
+ usb_power_cycle(0);
+ usb_power_cycle(1);
+ }
}
static void mainboard_init(device_t dev)
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17627
-gerrit
commit c34a5665a46fa1c3f9970fe730db22bec7b9c50e
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>
---
src/ec/google/chromeec/ec.c | 22 ++++++++++++++++++++++
src/ec/google/chromeec/ec.h | 1 +
2 files changed, 23 insertions(+)
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index 1308c3d..d0648f7 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -497,6 +497,28 @@ int google_chromeec_set_usb_charge_mode(u8 port_id, enum usb_charge_mode mode)
return google_chromeec_command(&cmd);
}
+int google_chromeec_set_usb_pd_role(u8 port, enum usb_pd_control_role role)
+{
+ struct ec_params_usb_pd_control req = {
+ .port = port,
+ .role = role,
+ .mux = USB_PD_CTRL_MUX_NO_CHANGE,
+ .swap = USB_PD_CTRL_SWAP_NONE,
+ };
+ struct ec_response_usb_pd_control rsp;
+ struct chromeec_command cmd = {
+ .cmd_code = EC_CMD_USB_PD_CONTROL,
+ .cmd_version = 0,
+ .cmd_data_in = &req,
+ .cmd_size_in = sizeof(req),
+ .cmd_data_out = &rsp,
+ .cmd_size_out = sizeof(rsp),
+ .cmd_dev_index = 0,
+ };
+
+ return google_chromeec_command(&cmd);
+}
+
#ifndef __SMM__
static
diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h
index f765fe4..71cea7e 100644
--- a/src/ec/google/chromeec/ec.h
+++ b/src/ec/google/chromeec/ec.h
@@ -76,6 +76,7 @@ enum usb_charge_mode {
USB_CHARGE_MODE_DOWNSTREAM_1500MA,
};
int google_chromeec_set_usb_charge_mode(u8 port_id, enum usb_charge_mode mode);
+int google_chromeec_set_usb_pd_role(u8 port, enum usb_pd_control_role role);
/* internal structure to send a command to the EC and wait for response. */
struct chromeec_command {
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17566
-gerrit
commit 4763fc19c8fa6439b9d4ef8d0361b93c27dd8532
Author: William wu <wulf(a)rock-chips.com>
Date: Thu Nov 10 19:34:45 2016 +0800
google/gru: Tuning USB 2.0 PHY to increase compatibility
When test USB 2.0 compatibility with different kinds
of USB 2.0 devices on Kevin board, we find that some
USB HDDs (e.g. seagate SRD00F1 1TB HDD) and some smart
phones (e.g. galaxy A5 smart phone) can't be detected.
And according to the error log, this issue is related
to USB 2.0 PHY signal problem.
For the USB HDD, error log is:
[ 592.557724] usb 5-1: new high-speed USB device number 2 using xhci-hcd
[ 592.847735] usb 5-1: new high-speed USB device number 3 using xhci-hcd
[ 593.473720] usb 5-1: new high-speed USB device number 6 using xhci-hcd
[ 594.187717] usb 5-1: new high-speed USB device number 9 using xhci-hcd
[ 595.020717] usb 5-1: new high-speed USB device number 13 using xhci-hcd
[ 595.284730] usb 5-1: new high-speed USB device number 14 using xhci-hcd
[ 595.574816] usb 5-1: new high-speed USB device number 15 using xhci-hcd
The log shows that HDD failed to high-speed handshake.
For the smart phone, error log is:
[ 1145.661625] usb 5-1: new high-speed USB device number 2 using xhci-hcd
[ 1145.771674] usb 5-1: device descriptor read/64, error -71
[ 1145.979752] usb 5-1: device descriptor read/64, error -71
[ 1146.187721] usb 5-1: new high-speed USB device number 3 using xhci-hcd
[ 1146.301754] usb 5-1: device descriptor read/64, error -71
[ 1146.509750] usb 5-1: device descriptor read/64, error -71
[ 1146.717722] usb 5-1: new high-speed USB device number 4 using xhci-hcd
[ 1146.724393] usb 5-1: Device not responding to setup address.
[ 1146.930795] usb 5-1: Device not responding to setup address.
[ 1147.137720] usb 5-1: device not accepting address 4, error -71
[ 1147.246644] usb 5-1: new high-speed USB device number 5 using xhci-hcd
[ 1147.253336] usb 5-1: Device not responding to setup address.
[ 1147.459786] usb 5-1: Device not responding to setup address.
[ 1147.665712] usb 5-1: device not accepting address 5, error -71
[ 1147.671789] usb usb5-port1: unable to enumerate USB device
The log shows that smart phone failed to read device
descriptor, error -71 maybe caused by PHY signal problem.
This patch aims to tuning USB 2.0 PHY with the following
parameters to support USB HDD, smart phone and some other
potential USB 2.0 devices.
1. Disable the pre-emphasize in chirp state to avoid
high-speed handshake failure.
2. Bypass ODT auto compensation to enable set max driver
strength manually. (Bit[42] of usbphy_ctrl register is
1'b1 for bypass, and Bit[41:37] of usbphy_ctrl register
is 5'b10000 for max driver strength).
3. Bypass ODT auto refresh, and set the max bias current
tuning reference. (Bit[57] of usbphy_ctrl register is
1'b1 for bypass, and Bit[52:50] of usbphy_ctrl register
is 3b'100 for max bias current tuning reference).
We have done USB 2.0 compliance test and compatibility test
with this patch, it works well.
BRANCH=gru
BUG=chrome-os-partner:59623
TEST=plug/unplug USB HDD or smart phone in Type-C port,
check if they can be detected successfully.
Change-Id: I275c2236b8e469bfd04e9184d007eb095657225e
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 7735c514d4136978133c2299f2f58da8320bb89f
Original-Change-Id: I4e6c10faa1c03af9880a89afe4731a7065eb1e4e
Original-Signed-off-by: William wu <wulf(a)rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/409856
Original-Commit-Ready: Eddie Cai <eddie.cai.rk(a)gmail.com>
Original-Tested-by: Cindy Han <cindy.han(a)samsung.com>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/mainboard/google/gru/mainboard.c | 40 ++++++++++++++++++++++++++----------
1 file changed, 29 insertions(+), 11 deletions(-)
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index d34a9f7..7e360e7 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -235,18 +235,36 @@ static void setup_usb(void)
/* A few magic PHY tuning values that improve eye diagram amplitude
* and make it extra sure we get reliable communication in firmware. */
/* Set max ODT compensation voltage and current tuning reference. */
- write32(&rk3399_grf->usbphy0_ctrl[3], 0x0fff02e3);
- write32(&rk3399_grf->usbphy1_ctrl[3], 0x0fff02e3);
- /* Set max pre-emphasis level, only on Kevin PHY0 and PHY1,
- * and disable the pre-emphasize in eop state to avoid
- * mis-trigger the disconnect detection. */
+ write32(&rk3399_grf->usbphy0_ctrl[3], RK_CLRSETBITS(0xfff, 0x2e3));
+ write32(&rk3399_grf->usbphy1_ctrl[3], RK_CLRSETBITS(0xfff, 0x2e3));
+
if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN)) {
- write32(&rk3399_grf->usbphy0_ctrl[12], 0xffff00a7);
- write32(&rk3399_grf->usbphy1_ctrl[12], 0xffff00a7);
- write32(&rk3399_grf->usbphy0_ctrl[0], 0x00010000);
- write32(&rk3399_grf->usbphy1_ctrl[0], 0x00010000);
- write32(&rk3399_grf->usbphy0_ctrl[13], 0x00010000);
- write32(&rk3399_grf->usbphy1_ctrl[13], 0x00010000);
+ /* Set max pre-emphasis level, only on Kevin PHY0 and PHY1 */
+ write32(&rk3399_grf->usbphy0_ctrl[12],
+ RK_CLRSETBITS(0xffff, 0xa7));
+ write32(&rk3399_grf->usbphy1_ctrl[12],
+ RK_CLRSETBITS(0xffff, 0xa7));
+
+ /* Disable the pre-emphasize in eop state and chirp
+ * state to avoid mis-trigger the disconnect detection
+ * and also avoid high-speed handshake fail */
+ write32(&rk3399_grf->usbphy0_ctrl[0], RK_CLRBITS(0x3));
+ write32(&rk3399_grf->usbphy1_ctrl[0], RK_CLRBITS(0x3));
+ write32(&rk3399_grf->usbphy0_ctrl[13], RK_CLRBITS(0x3));
+ write32(&rk3399_grf->usbphy1_ctrl[13], RK_CLRBITS(0x3));
+
+ /* ODT auto compensation bypass, set max driver strength */
+ write32(&rk3399_grf->usbphy0_ctrl[2],
+ RK_CLRSETBITS(0x7e << 4, 0x60 << 4));
+ write32(&rk3399_grf->usbphy1_ctrl[2],
+ RK_CLRSETBITS(0x7e << 4, 0x60 << 4));
+
+ /* ODT auto refresh bypass, and set the max
+ * bias current tuning reference */
+ write32(&rk3399_grf->usbphy0_ctrl[3],
+ RK_CLRSETBITS(0x21c, 1 << 4));
+ write32(&rk3399_grf->usbphy1_ctrl[3],
+ RK_CLRSETBITS(0x21c, 1 << 4));
}
setup_usb_otg0();
Naresh Solanki (naresh.solanki(a)intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17554
-gerrit
commit 5b9c8c929dc63d268b5fe483aa0137a02b51ba69
Author: Naresh G Solanki <naresh.solanki(a)intel.com>
Date: Wed Nov 16 21:32:04 2016 +0530
soc/intel/skylake: Fix top_of_ram calculation
FSP 2.0 implementation conditionally sets PMRR base based on
EnableC6Dram UPD. Therefore, handle the case of the PMRR base not being
set since FSP 2.0 changed behavior from FSP 1.1 implementation.
If prmrr base is non-zero value, then top_of_ram is prmrr base.
If Probeless trace is enabled, then deduct trace memory size from
calculated top_of_ram.
Change-Id: I2633bf78705e36b241668a313d215d0455fba607
Signed-off-by: Rizwan Qureshi <rizwan.qureshi(a)intel.com>
Signed-off-by: Naresh G Solanki <naresh.solanki(a)intel.com>
---
src/soc/intel/skylake/memmap.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/soc/intel/skylake/memmap.c b/src/soc/intel/skylake/memmap.c
index 96debfd..17dbc32 100644
--- a/src/soc/intel/skylake/memmap.c
+++ b/src/soc/intel/skylake/memmap.c
@@ -150,7 +150,8 @@ u32 top_of_32bit_ram(void)
* PRMMR_BASE MSR. The system hangs if PRMRR_BASE MSR is read before
* PRMRR_MASK MSR lock bit is set.
*/
- if (smm_region_start() == 0)
+ top_of_ram = smm_region_start();
+ if (top_of_ram == 0)
return 0;
dev = dev_find_slot(0, PCI_DEVFN(SA_DEV_SLOT_ROOT, 0));
@@ -163,7 +164,8 @@ u32 top_of_32bit_ram(void)
* Refer to Fsp Integration Guide for the memory mapping layout.
*/
prmrr_base = rdmsr(UNCORE_PRMRR_PHYS_BASE_MSR);
- top_of_ram = prmrr_base.lo;
+ if (prmrr_base.lo)
+ top_of_ram = prmrr_base.lo;
if (config->ProbelessTrace)
top_of_ram -= TRACE_MEMORY_SIZE;