Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18462
-gerrit
commit 45149471af8c6e1053c273583020d0ad4322bb10
Author: William wu <wulf(a)rock-chips.com>
Date: Mon Jan 23 20:54:22 2017 +0800
google/gru: Tuning USB 2.0 PHY0 and PHY1 squelch detection threshold
According to USB 2.0 Spec Table 7-7, the High-speed squelch
detection threshold Min 100mV and Max 150mV, and we set USB
2.0 PHY0 and PHY1 squelch detection threshold to 150mV by
default, so if the amplitude of differential voltage envelope
is < 150 mV, the USB 2.0 PHYs envelope detector will indicate
it as squelch.
On Kevin board, if we connect usb device with Samsung U2 cable,
we can see that the impedance of U2 cable is too big according
to the eye-diagram test report, and this cause serious signal
attenuation at the end of receiver, the amplitude of differential
voltage falls below 150mV.
This patch aims to reduce the PHY0 and PHY1 otg-ports squelch
detection threshold to 125mV (host-ports still use 150mV by
default), this is helpful to increase USB 2.0 PHY compatibility.
BRANCH=gru
BUG=chrome-os-partner:62320
TEST=Plug Samsung U2 cable + SEC P3 HDD 500GB/Galaxy S3 into
Type-C port, check if the USB device can be detected.
Change-Id: Ia0a2d354781c2ac757938409490f7c4eecdffe61
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 7d74311c25762668386061234df0562f84b7203e
Original-Change-Id: Ib20772f8fc2484d34c69f5938818aaa81ded7ed8
Original-Signed-off-by: William wu <wulf(a)rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/431015
Original-Commit-Ready: Caesar Wang <wxt(a)rock-chips.com>
Original-Tested-by: Inno Park <ih.yoo.park(a)samsung.com>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/mainboard/google/gru/mainboard.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index 5926e49..bb9b6fc 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -260,15 +260,20 @@ static void setup_usb(void)
RK_CLRSETBITS(0xffff, 0xa7));
/*
- * Disable the pre-emphasize in eop state and chirp
+ * 1. Disable the pre-emphasize in eop state and chirp
* state to avoid mis-trigger the disconnect detection
* and also avoid high-speed handshake fail for PHY0
* and PHY1 consist of otg-port and host-port.
+ *
+ * 2. Configure PHY0 and PHY1 otg-ports squelch detection
+ * threshold to 125mV (default is 150mV).
*/
- 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));
+ write32(&rk3399_grf->usbphy0_ctrl[0],
+ RK_CLRSETBITS(7 << 13 | 3 << 0, 6 << 13));
+ write32(&rk3399_grf->usbphy1_ctrl[0],
+ RK_CLRSETBITS(7 << 13 | 3 << 0, 6 << 13));
+ write32(&rk3399_grf->usbphy0_ctrl[13], RK_CLRBITS(3 << 0));
+ write32(&rk3399_grf->usbphy1_ctrl[13], RK_CLRBITS(3 << 0));
/*
* ODT auto compensation bypass, and set max driver
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18461
-gerrit
commit 58b9d30d5ff971efd4be5e7c03036d8eec0b0d4c
Author: Caesar Wang <wxt(a)rock-chips.com>
Date: Fri Feb 10 11:16:13 2017 +0800
google/gru: improve eye diagram for passing the test
The children of Gru should share the benefits. In the real world, Bob can't
pass the eye diagram tests.
BUG=chrome-os-partner:62714
BRANCH=firmware-gru-8785.B
TEST=build coreboot
Change-Id: I2470bbc81acdaf2458d660dca5dc307cc3038f83
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: d0cb3e718a7571f602a00c08a42019851634e7fd
Original-Change-Id: I0ccb48bb52eb770ccc9c8c265b07df46b0308dd3
Original-Signed-off-by: Caesar Wang <wxt(a)rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/440745
Original-Reviewed-by: Douglas Anderson <dianders(a)chromium.org>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/441468
---
src/mainboard/google/gru/mainboard.c | 92 ++++++++++++++++++------------------
1 file changed, 45 insertions(+), 47 deletions(-)
diff --git a/src/mainboard/google/gru/mainboard.c b/src/mainboard/google/gru/mainboard.c
index 4dc677c..5926e49 100644
--- a/src/mainboard/google/gru/mainboard.c
+++ b/src/mainboard/google/gru/mainboard.c
@@ -253,53 +253,51 @@ static void setup_usb(void)
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)) {
- /* 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 for PHY0
- * and PHY1 consist of otg-port and host-port.
- */
- 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, and set max driver
- * strength only for PHY0 and PHY1 otg-port.
- */
- 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 only for PHY0 and PHY1 otg-port.
- */
- write32(&rk3399_grf->usbphy0_ctrl[3],
- RK_CLRSETBITS(0x21c, 1 << 4));
- write32(&rk3399_grf->usbphy1_ctrl[3],
- RK_CLRSETBITS(0x21c, 1 << 4));
-
- /*
- * ODT auto compensation bypass, and set default driver
- * strength only for PHY0 and PHY1 host-port.
- */
- write32(&rk3399_grf->usbphy0_ctrl[15], RK_SETBITS(1 << 10));
- write32(&rk3399_grf->usbphy1_ctrl[15], RK_SETBITS(1 << 10));
-
- /* ODT auto refresh bypass only for PHY0 and PHY1 host-port. */
- write32(&rk3399_grf->usbphy0_ctrl[16], RK_CLRBITS(1 << 9));
- write32(&rk3399_grf->usbphy1_ctrl[16], RK_CLRBITS(1 << 9));
- }
+ /* Set max pre-emphasis level on 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 for PHY0
+ * and PHY1 consist of otg-port and host-port.
+ */
+ 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, and set max driver
+ * strength only for PHY0 and PHY1 otg-port.
+ */
+ 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 only for PHY0 and PHY1 otg-port.
+ */
+ write32(&rk3399_grf->usbphy0_ctrl[3],
+ RK_CLRSETBITS(0x21c, 1 << 4));
+ write32(&rk3399_grf->usbphy1_ctrl[3],
+ RK_CLRSETBITS(0x21c, 1 << 4));
+
+ /*
+ * ODT auto compensation bypass, and set default driver
+ * strength only for PHY0 and PHY1 host-port.
+ */
+ write32(&rk3399_grf->usbphy0_ctrl[15], RK_SETBITS(1 << 10));
+ write32(&rk3399_grf->usbphy1_ctrl[15], RK_SETBITS(1 << 10));
+
+ /* ODT auto refresh bypass only for PHY0 and PHY1 host-port. */
+ write32(&rk3399_grf->usbphy0_ctrl[16], RK_CLRBITS(1 << 9));
+ write32(&rk3399_grf->usbphy1_ctrl[16], RK_CLRBITS(1 << 9));
setup_usb_otg0();
setup_usb_otg1();
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/18460
-gerrit
commit 2b10d8c46c7264d11f45dbc8ee53c7f5fca69fe6
Author: Caesar Wang <wxt(a)rock-chips.com>
Date: Wed Jan 4 18:26:04 2017 +0800
google/gru: update the pwm regulator
As David commented the "Bob and other follow-ons match Gru, Kevin should
be the special case here", and update the calculations value for gru/bob
board.
From the actual tests, some regulator voltage than the actual set of less
than 20mv on bob board. (e.g: little-cpus and Center-logic) Update the
{min, max} regulator voltage for Bob board. Make sure we get the accurate
voltage.
BUG=chrome-os-partner:61497
BRANCH=none
TEST=boot up Bob, measure the voltage for little cpu and C-logic.
Change-Id: Iad881b41d67708776bfb681487cf8cec8518064e
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 25e133815f49018e7496c75077b8559c207350a4
Original-Change-Id: I3098c742c7ec355c88f45bd1d93f878a7976a6b4
Original-Signed-off-by: Caesar Wang <wxt(a)rock-chips.com>
Original-Signed-off-by: Shasha Zhao <Sarah_Zhao(a)asus.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/424523
Original-Reviewed-by: David Schneider <dnschneid(a)chromium.org>
Original-Reviewed-by: Brian Norris <briannorris(a)chromium.org>
Original-Signed-off-by: Shasha Zhao <Sarah_Zhao(a)asus.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/430403
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
---
src/mainboard/google/gru/pwm_regulator.c | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git a/src/mainboard/google/gru/pwm_regulator.c b/src/mainboard/google/gru/pwm_regulator.c
index a81480a..426b989 100644
--- a/src/mainboard/google/gru/pwm_regulator.c
+++ b/src/mainboard/google/gru/pwm_regulator.c
@@ -28,29 +28,39 @@
* board design / resistors / capacitors / regulators but due to
* clock dividers we actually get 3337.
*/
-#define PWM_PERIOD 3337
-#define PWM_DESIGN_VOLTAGE_MIN 8000
-#define PWM_DESIGN_VOLTAGE_MAX 15000
+#define PWM_PERIOD 3337
+#define PWM_DESIGN_VOLTAGE_MIN_OUTDATED 8000
+#define PWM_DESIGN_VOLTAGE_MAX_OUTDATED 15000
/* Later boards (Kevin rev6+, Gru rev2+) use different regulator ranges. */
-int pwm_design_voltage_later[][2] = {
+int kevin6_pwm_design_voltage[][2] = {
[PWM_REGULATOR_GPU] = {7858, 12177},
[PWM_REGULATOR_BIG] = {7987, 13022},
[PWM_REGULATOR_LIT] = {7991, 13037},
[PWM_REGULATOR_CENTERLOG] = {8001, 10497}
};
+int pwm_design_voltage[][2] = {
+ [PWM_REGULATOR_GPU] = {7864, 12177},
+ [PWM_REGULATOR_BIG] = {8001, 13022},
+ [PWM_REGULATOR_LIT] = {7977, 13078},
+ [PWM_REGULATOR_CENTERLOG] = {7994, 10499}
+};
+
void pwm_regulator_configure(enum pwm_regulator pwm, int millivolt)
{
int duty_ns, voltage_max, voltage_min;
int voltage = millivolt * 10; /* for higer calculation accuracy */
- voltage_min = PWM_DESIGN_VOLTAGE_MIN;
- voltage_max = PWM_DESIGN_VOLTAGE_MAX;
- if (!(IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN) && board_id() < 6) &&
- !(IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU) && board_id() < 2)) {
- voltage_min = pwm_design_voltage_later[pwm][0];
- voltage_max = pwm_design_voltage_later[pwm][1];
+ voltage_min = pwm_design_voltage[pwm][0];
+ voltage_max = pwm_design_voltage[pwm][1];
+ if ((IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN) && board_id() < 6) ||
+ (IS_ENABLED(CONFIG_BOARD_GOOGLE_GRU) && board_id() < 2)) {
+ voltage_min = PWM_DESIGN_VOLTAGE_MIN_OUTDATED;
+ voltage_max = PWM_DESIGN_VOLTAGE_MAX_OUTDATED;
+ } else if (IS_ENABLED(CONFIG_BOARD_GOOGLE_KEVIN) && board_id() >= 6){
+ voltage_min = kevin6_pwm_design_voltage[pwm][0];
+ voltage_max = kevin6_pwm_design_voltage[pwm][1];
}
assert(voltage <= voltage_max && voltage >= voltage_min);