Duncan Laurie (dlaurie(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17213
-gerrit
commit 5f73db4eeda585178f11734e91d8b07cb67cd567
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Thu Nov 3 10:43:14 2016 -0700
lpss_i2c: Increase transaction timeout
When doing long transcations on an I2C bus at standard speed we saw
that long transactions could go over the 4ms limit while waiting for
the it to complete on the bus.
Increase this so we can use standard speed for testing and debug in
firmware. (as there is no way to force standard speed in the kernel)
BUG=chrome-os-partner:58666
TEST=boot eve board with cr50 TPM and I2C bus at 100khz
Change-Id: I2987ae6a5aa024b373eb088767194c70b0918b6f
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/soc/intel/common/lpss_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/soc/intel/common/lpss_i2c.c b/src/soc/intel/common/lpss_i2c.c
index 0174792..58d44b8 100644
--- a/src/soc/intel/common/lpss_i2c.c
+++ b/src/soc/intel/common/lpss_i2c.c
@@ -73,8 +73,8 @@ struct lpss_i2c_regs {
uint32_t comp_type;
} __attribute__((packed));
-/* Use a ~4ms timeout for various operations */
-#define LPSS_I2C_TIMEOUT_US 4000
+/* Use a ~10ms timeout for various operations */
+#define LPSS_I2C_TIMEOUT_US 10000
/* High and low times in different speed modes (in ns) */
enum {
Duncan Laurie (dlaurie(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17213
-gerrit
commit e8facd4e07b5ab41813d37e3980179b602b9fcf7
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Thu Nov 3 10:43:14 2016 -0700
lpss_i2c: Increase transaction timeout
When doing long transcations on an I2C bus at standard speed we saw
that long transactions could go over the 4ms limit while waiting for
the it to complete on the bus.
Increase this so we can use standard speed for testing and debug in
firmware. (as there is no way to force standard speed in the kernel)
BUG=chrome-os-partner:58666
TEST=boot eve board with cr50 TPM and I2C bus at 100khz
Change-Id: I2987ae6a5aa024b373eb088767194c70b0918b6f
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/soc/intel/common/lpss_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/soc/intel/common/lpss_i2c.c b/src/soc/intel/common/lpss_i2c.c
index 0174792..58d44b8 100644
--- a/src/soc/intel/common/lpss_i2c.c
+++ b/src/soc/intel/common/lpss_i2c.c
@@ -73,8 +73,8 @@ struct lpss_i2c_regs {
uint32_t comp_type;
} __attribute__((packed));
-/* Use a ~4ms timeout for various operations */
-#define LPSS_I2C_TIMEOUT_US 4000
+/* Use a ~10ms timeout for various operations */
+#define LPSS_I2C_TIMEOUT_US 10000
/* High and low times in different speed modes (in ns) */
enum {
Duncan Laurie (dlaurie(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17212
-gerrit
commit fb9bf06842c406f01ecbaf9494f31abe806003e1
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Thu Nov 3 10:33:43 2016 -0700
soc/intel/{sky,apollo}lake: Wait until GPE is clear when reading
When reading+clearing a GPE for use as an interrupt we need to
re-read the status register and keep setting the clear bit until
it actually reads back clear. Also add a 1ms timeout in case the
status never clears.
This is needed if a device sends a longer interrupt pulse and it
is still asserted when the "ISR" goes to clear the status.
BUG=chrome-os-partner:59299
TEST=test cr50 TPM with 20us pulse to ensure it can successfully
communicate with the TPM and does not get confused due to seeing
interrupts that it should not.
Change-Id: I384f484a1728038d3a355586146deee089b22dd9
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/soc/intel/apollolake/pmutil.c | 20 +++++++++++++++-----
src/soc/intel/skylake/pmutil.c | 23 +++++++++++++++++------
2 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/src/soc/intel/apollolake/pmutil.c b/src/soc/intel/apollolake/pmutil.c
index 80aaf71..d479b95 100644
--- a/src/soc/intel/apollolake/pmutil.c
+++ b/src/soc/intel/apollolake/pmutil.c
@@ -29,6 +29,7 @@
#include <soc/pm.h>
#include <device/device.h>
#include <device/pci.h>
+#include <timer.h>
#include <vboot/vboot_common.h>
#include "chip.h"
@@ -306,6 +307,8 @@ int acpi_get_gpe(int gpe)
{
int bank;
uint32_t mask, sts;
+ struct stopwatch sw;
+ int rc = 0;
if (gpe < 0 || gpe > GPE0_DW3_31)
return -1;
@@ -313,11 +316,18 @@ int acpi_get_gpe(int gpe)
bank = gpe / 32;
mask = 1 << (gpe % 32);
- sts = inl(ACPI_PMIO_BASE + GPE0_STS(bank));
- if (sts & mask) {
- outl(mask, ACPI_PMIO_BASE + GPE0_STS(bank));
- return 1;
- }
+ /* Wait up to 1ms for GPE status to clear */
+ stopwatch_init_msecs_expire(&sw, 1);
+ do {
+ if (stopwatch_expired(&sw))
+ return rc;
+
+ sts = inl(ACPI_PMIO_BASE + GPE0_STS(bank));
+ if (sts & mask) {
+ outl(mask, ACPI_PMIO_BASE + GPE0_STS(bank));
+ rc = 1;
+ }
+ } while (sts & mask);
return 0;
}
diff --git a/src/soc/intel/skylake/pmutil.c b/src/soc/intel/skylake/pmutil.c
index 203a430..73dc117 100644
--- a/src/soc/intel/skylake/pmutil.c
+++ b/src/soc/intel/skylake/pmutil.c
@@ -37,6 +37,7 @@
#include <soc/pm.h>
#include <soc/pmc.h>
#include <soc/smbus.h>
+#include <timer.h>
#include "chip.h"
/* Print status bits with descriptive names */
@@ -361,6 +362,8 @@ int acpi_get_gpe(int gpe)
{
int bank;
uint32_t mask, sts;
+ struct stopwatch sw;
+ int rc = 0;
if (gpe < 0 || gpe > GPE0_WADT)
return -1;
@@ -368,12 +371,20 @@ int acpi_get_gpe(int gpe)
bank = gpe / 32;
mask = 1 << (gpe % 32);
- sts = inl(ACPI_BASE_ADDRESS + GPE0_STS(bank));
- if (sts & mask) {
- outl(mask, ACPI_BASE_ADDRESS + GPE0_STS(bank));
- return 1;
- }
- return 0;
+ /* Wait up to 1ms for GPE status to clear */
+ stopwatch_init_msecs_expire(&sw, 1);
+ do {
+ if (stopwatch_expired(&sw))
+ return rc;
+
+ sts = inl(ACPI_BASE_ADDRESS + GPE0_STS(bank));
+ if (sts & mask) {
+ outl(mask, ACPI_BASE_ADDRESS + GPE0_STS(bank));
+ rc = 1;
+ }
+ } while (sts & mask);
+
+ return rc;
}
/* Enable all requested GPE */
Duncan Laurie (dlaurie(a)chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17204
-gerrit
commit f577d3dd104d11f0e73353c28158a84b513ffec7
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Tue Nov 1 15:03:13 2016 -0700
drivers/i2c/tpm/cr50: Increase IRQ timeout
Increase the IRQ timeout to prevent issues if there is a delay
in the TPM responding to a command. Split the no-IRQ case out
so it doesn't suffer unnecessarily.
BUG=chrome-os-partner:59191
TEST=suspend/resume testing on eve board
Change-Id: I1ea7859bc7a056a450b2b0ee32153ae43ee8699f
Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
---
src/drivers/i2c/tpm/cr50.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/drivers/i2c/tpm/cr50.c b/src/drivers/i2c/tpm/cr50.c
index f7e667b..0877de0 100644
--- a/src/drivers/i2c/tpm/cr50.c
+++ b/src/drivers/i2c/tpm/cr50.c
@@ -48,6 +48,8 @@
#define CR50_MAX_BUFSIZE 63
#define CR50_TIMEOUT_LONG_MS 2000 /* Long timeout while waiting for TPM */
#define CR50_TIMEOUT_SHORT_MS 2 /* Short timeout during transactions */
+#define CR50_TIMEOUT_NOIRQ_MS 20 /* Timeout for TPM ready without IRQ */
+#define CR50_TIMEOUT_IRQ_MS 100 /* Timeout for TPM ready with IRQ */
#define CR50_DID_VID 0x00281ae0L
struct tpm_inf_dev {
@@ -65,11 +67,11 @@ static int cr50_i2c_wait_tpm_ready(struct tpm_chip *chip)
if (!chip->vendor.irq_status) {
/* Fixed delay if interrupt not supported */
- mdelay(CR50_TIMEOUT_SHORT_MS);
+ mdelay(CR50_TIMEOUT_NOIRQ_MS);
return 0;
}
- stopwatch_init_msecs_expire(&sw, 5 * CR50_TIMEOUT_SHORT_MS);
+ stopwatch_init_msecs_expire(&sw, CR50_TIMEOUT_IRQ_MS);
while (!chip->vendor.irq_status(chip->vendor.irq))
if (stopwatch_expired(&sw))
@@ -429,6 +431,11 @@ static void cr50_vendor_init(struct tpm_chip *chip)
chip->vendor.irq = -1;
#endif
}
+
+ if (chip->vendor.irq <= 0)
+ printk(BIOS_WARNING,
+ "%s: No IRQ, will use %ums delay for TPM ready\n",
+ __func__, CR50_TIMEOUT_NOIRQ_MS);
}
int tpm_vendor_probe(unsigned bus, uint32_t addr)
the following patch was just integrated into master:
commit cebf64592702185be0eba4e4b44f1a9c258751fc
Author: Naresh G Solanki <naresh.solanki(a)intel.com>
Date: Thu Oct 27 20:28:23 2016 +0530
mainboard/intel/kblrvp: Update gpio.h, spd.h & mainboard.c
1. Update gpio.h to set proper pad config for Kaby Lake RVP3.
2. Set spd index to zero.
3. Remove nhlt specific init.
Change-Id: I41a312d92acd2c111465a5e8f1771158e3f33e2b
Signed-off-by: Naresh G Solanki <naresh.solanki(a)intel.com>
Reviewed-on: https://review.coreboot.org/17161
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/17161 for details.
-gerrit
the following patch was just integrated into master:
commit f4401eb997dab0690261e0e42eab52131815d949
Author: ZhengShunQian <zhengsq(a)rock-chips.com>
Date: Fri Oct 28 16:16:04 2016 +0800
google/veyron*: change .ddrconfig from 14 to 3
There are two configs, sdram-lpddr3-hynix-2GB.inc and
sdram-lpddr3-samsung-2GB-24EB.inc that use .ddrconfig = 14.
Changing .ddrconfig from 14 to 3 improves performance
especially on contiguous memory accesses. Comparing the .ddrconfig:
- if .ddrconfig = 3,
C RDRR RRRR RRRR RRRR RBBB CCCC CCCC C---
- if .ddrconfig = 14,
C DRBB BRRR RRRR RRRR RRRR CCCC CCCC C---
where
- R: indicates Row bits
- B: indicates Bank bits
- C: indicates Column bits
- D: indicates Chip selects bits
.ddrconfig = 3 has multiple banks switching which improves DDR timing.
BUG=chrome-os-partner:57321
TEST=Boot from fievel and play video
BRANCH=veyron
Change-Id: Ifdcedc28e84429b8b79c7553b38b667631d29c09
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 93882e4f2000d93c9dae5e6d4b2e1f4b7bc9489e
Original-Change-Id: Ic98ebae48609a7604ec678b6bd14dd2b29b669c4
Original-Signed-off-by: ZhengShunQian <zhengsq(a)rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/404691
Original-Commit-Ready: Shunqian Zheng <zhengsq(a)rock-chips.com>
Original-Tested-by: Shunqian Zheng <zhengsq(a)rock-chips.com>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
Reviewed-on: https://review.coreboot.org/17210
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/17210 for details.
-gerrit
the following patch was just integrated into master:
commit 8859afdb44194cacf0bc1c694b09eb94d568dab9
Author: ZhengShunQian <zhengsq(a)rock-chips.com>
Date: Fri Oct 28 15:58:51 2016 +0800
google/veyron*: add DDR configs for new samsung DDR
Add the new samsung DDR configs for all veyron except veyron_rialto:
* K4E6E304EB-EGCE, ramid = 0010, 4GB
* K4E8E324EB-EGCF, ramid = 1100, 2GB
BRANCH=veyron
BUG=none
TEST=boot fievel board
Change-Id: I747aa86f8c93174651a28face63b3386e22b23b3
Signed-off-by: Patrick Georgi <pgeorgi(a)chromium.org>
Original-Commit-Id: 5f55462e71bd481eda85af3d582cfe5b9873cc9c
Original-Change-Id: I19123634c994f685683323f7d85cc4d35814e2ab
Original-Signed-off-by: ZhengShunQian <zhengsq(a)rock-chips.com>
Original-Reviewed-on: https://chromium-review.googlesource.com/345748
Original-Commit-Queue: Ren Kuo <ren.kuo(a)quantatw.com>
Original-Reviewed-by: Philip Chen <philipchen(a)chromium.org>
Original-(cherry-pick from cc990f27024255a326fd9fa9644deb28b01a31a7)
Original-Reviewed-on: https://chromium-review.googlesource.com/404690
Original-Commit-Ready: Shunqian Zheng <zhengsq(a)rock-chips.com>
Original-Tested-by: Shunqian Zheng <zhengsq(a)rock-chips.com>
Original-Reviewed-by: Julius Werner <jwerner(a)chromium.org>
Reviewed-on: https://review.coreboot.org/17209
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter(a)users.sourceforge.net>
Reviewed-by: Martin Roth <martinroth(a)google.com>
See https://review.coreboot.org/17209 for details.
-gerrit