Hello Karthikeyan Ramasubramanian,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/30451
to review the following change.
Change subject: drivers/generic/gpio_keys: Add trigger for wakeup event action
......................................................................
drivers/generic/gpio_keys: Add trigger for wakeup event action
Currently without any trigger the wakeup event is generated on both the
rising and falling edges of the GPIO input. Add support to specify the
trigger explicitly so that the configuration can be passed to the
kernel.
BRANCH=octopus
BUG=b:117953118
TEST=Ensure that the system boots to ChromeOS. Ensure that the stylus tools
open on pen eject. Ensure that the system wakes on Pen Eject. Ensure that
the system enters S0ix and S3 states after the pen is ejected. Ensure that
the system enters S0ix and S3 states when the pen remains inserted in its
holder. Ensured that the system does not wake when the pen is inserted.
Ensure that the suspend_stress_test runs successfully for 25 iterations
with the pen placed in its holder and ejected from its holder.
Change-Id: Ifb08ba01106031aa2655c1ae2faab284926f1ceb
Signed-off-by: Karthikeyan Ramasubramanian <kramasub(a)chromium.org>
---
M src/drivers/generic/gpio_keys/chip.h
M src/drivers/generic/gpio_keys/gpio_keys.c
2 files changed, 13 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/51/30451/1
diff --git a/src/drivers/generic/gpio_keys/chip.h b/src/drivers/generic/gpio_keys/chip.h
index 818f14c..88a3b35 100644
--- a/src/drivers/generic/gpio_keys/chip.h
+++ b/src/drivers/generic/gpio_keys/chip.h
@@ -30,6 +30,13 @@
SW_PEN_INSERTED = 0xf,
};
+/* Trigger for wakeup event action */
+enum {
+ EV_ACT_ANY,
+ EV_ACT_ASSERTED,
+ EV_ACT_DEASSERTED,
+};
+
/* Details of the child node defining key */
struct key_info {
/* Device name of the child node - Mandatory */
@@ -47,6 +54,8 @@
bool is_wakeup_source;
/* Wake GPE */
unsigned int wake;
+ /* Trigger for Wakeup Event Action */
+ unsigned int wakeup_event_action;
/* Can this key be disabled? */
bool can_be_disabled;
/* Debounce interval time in milliseconds */
diff --git a/src/drivers/generic/gpio_keys/gpio_keys.c b/src/drivers/generic/gpio_keys/gpio_keys.c
index 5ecb63e..63f53fe 100644
--- a/src/drivers/generic/gpio_keys/gpio_keys.c
+++ b/src/drivers/generic/gpio_keys/gpio_keys.c
@@ -45,6 +45,10 @@
key->is_wakeup_source);
if (key->wake)
acpigen_write_PRW(key->wake, 3);
+ if (key->wakeup_event_action)
+ acpi_dp_add_integer(dsd, "wakeup-event-action",
+ key->wakeup_event_action);
+
if (key->can_be_disabled)
acpi_dp_add_integer(dsd, "linux,can-disable",
key->can_be_disabled);
--
To view, visit https://review.coreboot.org/c/coreboot/+/30451
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ifb08ba01106031aa2655c1ae2faab284926f1ceb
Gerrit-Change-Number: 30451
Gerrit-PatchSet: 1
Gerrit-Owner: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Karthikeyan Ramasubramanian <kramasub(a)chromium.org>
Gerrit-MessageType: newchange
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/30609
Change subject: [WIP]cbmem_top: Fix comment and remove upper limit
......................................................................
[WIP]cbmem_top: Fix comment and remove upper limit
There's no such limit on 64bit coreboot builds.
* Fix comment
* Remove 4 GiB limit on Cavium SoCs
Change-Id: I8c9c6a5ff81bee48311e8bf8e383d1a032ea3a6d
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M src/include/cbmem.h
M src/soc/cavium/cn81xx/cbmem.c
2 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/09/30609/1
diff --git a/src/include/cbmem.h b/src/include/cbmem.h
index ad48e35..66a8fbe 100644
--- a/src/include/cbmem.h
+++ b/src/include/cbmem.h
@@ -71,7 +71,8 @@
/* Return the top address for dynamic cbmem. The address returned needs to
* be consistent across romstage and ramstage, and it is required to be
- * below 4GiB.
+ * below 4GiB for 32bit coreboot builds. On 64bit coreboot builds there's no
+ * upper limit.
* x86 boards or chipsets must return NULL before the cbmem backing store has
* been initialized. */
void *cbmem_top(void);
diff --git a/src/soc/cavium/cn81xx/cbmem.c b/src/soc/cavium/cn81xx/cbmem.c
index 397fd26..9a52de3 100644
--- a/src/soc/cavium/cn81xx/cbmem.c
+++ b/src/soc/cavium/cn81xx/cbmem.c
@@ -22,6 +22,5 @@
void *cbmem_top(void)
{
/* Make sure not to overlap with reserved ATF scratchpad */
- return (void *)min((uintptr_t)_dram + (sdram_size_mb() - 1) * MiB,
- 4ULL * GiB);
+ return (void *)((uintptr_t)_dram + (sdram_size_mb() - 1) * MiB);
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/30609
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I8c9c6a5ff81bee48311e8bf8e383d1a032ea3a6d
Gerrit-Change-Number: 30609
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
You-Cheng Syu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/31024
Change subject: mediatek/mt8183: Add option MT8183_MINIMIZE_BOOTBLOCK
......................................................................
mediatek/mt8183: Add option MT8183_MINIMIZE_BOOTBLOCK
MT8183 only allows booting from eMMC, so we have to do eMMC emulation
from an external source, for example EC, which makes the size of
bootblock very important.
This CL adds a new option MT8183_MINIMIZE_BOOTBLOCK in Kconfig. When
enabled, initializations that be can postponed in bootblock will be
removed.
Change-Id: I35d7ab875395da913b967ae1f7b72359be3e744a
Signed-off-by: You-Cheng Syu <youcheng(a)google.com>
---
M src/soc/mediatek/mt8183/Kconfig
M src/soc/mediatek/mt8183/bootblock.c
2 files changed, 7 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/24/31024/1
diff --git a/src/soc/mediatek/mt8183/Kconfig b/src/soc/mediatek/mt8183/Kconfig
index 6582e4e..b8c4dc0 100644
--- a/src/soc/mediatek/mt8183/Kconfig
+++ b/src/soc/mediatek/mt8183/Kconfig
@@ -28,4 +28,8 @@
bool
default y
+config MT8183_MINIMIZE_BOOTBLOCK
+ bool
+ default n
+
endif
diff --git a/src/soc/mediatek/mt8183/bootblock.c b/src/soc/mediatek/mt8183/bootblock.c
index d7d5c2d..809826f 100644
--- a/src/soc/mediatek/mt8183/bootblock.c
+++ b/src/soc/mediatek/mt8183/bootblock.c
@@ -20,5 +20,7 @@
void bootblock_soc_init(void)
{
mt_pll_init();
- mtk_wdt_init();
+ if (!IS_ENABLED(CONFIG_MT8183_MINIMIZE_BOOTBLOCK)) {
+ mtk_wdt_init();
+ }
}
--
To view, visit https://review.coreboot.org/c/coreboot/+/31024
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I35d7ab875395da913b967ae1f7b72359be3e744a
Gerrit-Change-Number: 31024
Gerrit-PatchSet: 1
Gerrit-Owner: You-Cheng Syu <youcheng(a)google.com>
Gerrit-MessageType: newchange
Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/30295 )
Change subject: cr50: Add probe command to poll Cr50 until DID VID is valid
......................................................................
cr50: Add probe command to poll Cr50 until DID VID is valid
Added new routine cr50_i2c_probe() which ensures that communication
with the Cr50 over I2C is good prior to attempting other initialization
of the Cr50 and TPM state. This avoids a race condition when the Cr50
is first booting that it may reset it's I2C slave interface during the
first few I2C transactions initiated from coreboot.
BUG=b:120009037
BRANCH=none
TEST=Run the Cr50 factory update against Careena board. Confirm that
I2C reads are retried until the DID VID is valid. Tested against debug
Cr50 firmware that forced failure of cr50_i2c_probe() and verfied that
coreboot shows recovery screen.
Change-Id: I47c59a32378ad00336277e111e81ba8d2d63e69a
Signed-off-by: Keith Short <keithshort(a)chromium.org>
Reviewed-on: https://review.coreboot.org/c/30295
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Raul Rangel <rrangel(a)chromium.org>
Reviewed-by: Martin Roth <martinroth(a)google.com>
Reviewed-by: Daniel Kurtz <djkurtz(a)google.com>
---
M src/drivers/i2c/tpm/cr50.c
1 file changed, 39 insertions(+), 11 deletions(-)
Approvals:
build bot (Jenkins): Verified
Martin Roth: Looks good to me, approved
Daniel Kurtz: Looks good to me, approved
Raul Rangel: Looks good to me, approved
diff --git a/src/drivers/i2c/tpm/cr50.c b/src/drivers/i2c/tpm/cr50.c
index b0d3b29..19c8f6b 100644
--- a/src/drivers/i2c/tpm/cr50.c
+++ b/src/drivers/i2c/tpm/cr50.c
@@ -456,10 +456,44 @@
return 0;
}
+static int cr50_i2c_probe(struct tpm_chip *chip, uint32_t *did_vid)
+{
+ int retries;
+
+ /*
+ * 150 ms should be enough to synchronize with the TPM even under the
+ * worst nested reset request conditions. In vast majority of cases
+ * there would be no wait at all.
+ */
+ printk(BIOS_INFO, "Probing TPM I2C: ");
+
+ for (retries = 15; retries > 0; retries--) {
+ int rc;
+
+ rc = cr50_i2c_read(chip, TPM_DID_VID(0), (uint8_t *)did_vid, 4);
+
+ /* Exit once DID and VID verified */
+ if (!rc && (*did_vid == CR50_DID_VID)) {
+ printk(BIOS_INFO, "done! DID_VID 0x%08x\n", *did_vid);
+ return 0;
+ }
+
+ /* TPM might be resetting, let's retry in a bit. */
+ mdelay(10);
+ printk(BIOS_INFO, ".");
+ }
+
+ /*
+ * I2C reads failed, or the DID and VID didn't match
+ */
+ printk(BIOS_ERR, "DID_VID 0x%08x not recognized\n", *did_vid);
+ return -1;
+}
+
int tpm_vendor_init(struct tpm_chip *chip, unsigned int bus, uint32_t dev_addr)
{
struct tpm_inf_dev *tpm_dev = car_get_var_ptr(&g_tpm_dev);
- uint32_t vendor;
+ uint32_t did_vid = 0;
if (dev_addr == 0) {
printk(BIOS_ERR, "%s: missing device address\n", __func__);
@@ -471,6 +505,9 @@
cr50_vendor_init(chip);
+ if (cr50_i2c_probe(chip, &did_vid))
+ return -1;
+
if (ENV_VERSTAGE || ENV_BOOTBLOCK)
if (process_reset(chip))
return -1;
@@ -478,17 +515,8 @@
if (claim_locality(chip))
return -1;
- /* Read four bytes from DID_VID register */
- if (cr50_i2c_read(chip, TPM_DID_VID(0), (uint8_t *)&vendor, 4) < 0)
- return -1;
-
- if (vendor != CR50_DID_VID) {
- printk(BIOS_DEBUG, "Vendor ID 0x%08x not recognized\n", vendor);
- return -1;
- }
-
printk(BIOS_DEBUG, "cr50 TPM 2.0 (i2c %u:0x%02x id 0x%x)\n",
- bus, dev_addr, vendor >> 16);
+ bus, dev_addr, did_vid >> 16);
chip->is_open = 1;
return 0;
--
To view, visit https://review.coreboot.org/c/coreboot/+/30295
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I47c59a32378ad00336277e111e81ba8d2d63e69a
Gerrit-Change-Number: 30295
Gerrit-PatchSet: 5
Gerrit-Owner: Edward Hill <ecgh(a)chromium.org>
Gerrit-Reviewer: Daniel Kurtz <djkurtz(a)chromium.org>
Gerrit-Reviewer: Daniel Kurtz <djkurtz(a)google.com>
Gerrit-Reviewer: Edward Hill <ecgh(a)chromium.org>
Gerrit-Reviewer: Keith Short <keithshort(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Philipp Deppenwiese <zaolin.daisuki(a)gmail.com>
Gerrit-Reviewer: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Vadim Bendebury <vbendeb(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Jett Rink <jettrink(a)chromium.org>
Gerrit-MessageType: merged