Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42826 )
Change subject: gpio_keys: Allows boards to configure different wakeup routes
......................................................................
gpio_keys: Allows boards to configure different wakeup routes
This change allows mainboard to configure different wakeup routes that
can be used by a GPIO key:
1. SCI: This is selected when SCI route is used to wake the system. It
results in _PRW property being exposed in ACPI tables.
2. GPIO IRQ: This is selected when GPIO controller wake is used to
wake the system. It is typically used when the input signal is not
dual routed and the GPIO controller block is not capable of applying
filters for IRQ and wake separately. In this case, _PRW is not exposed
in ACPI tables for the key device.
3. Disabled: No wakeup supported.
Based on these wakeup routes, gpio_keys_add_child_node() is updated to
expose _PRW and _DSD properties for wakeup appropriately.
Additionally, the change updates mainboards that were already using
gpio_keys to set wakeup_route attribute correctly.
BUG=b:159942427
Change-Id: Ib32b866b5f0ca559ed680b46218454bdfd8c6457
Signed-off-by: Furquan Shaikh <furquan(a)google.com>
---
M src/drivers/generic/gpio_keys/chip.h
M src/drivers/generic/gpio_keys/gpio_keys.c
M src/mainboard/google/hatch/variants/hatch/overridetree.cb
M src/mainboard/google/hatch/variants/helios/overridetree.cb
M src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb
M src/mainboard/google/hatch/variants/kindred/overridetree.cb
M src/mainboard/google/hatch/variants/kohaku/overridetree.cb
M src/mainboard/google/hatch/variants/mushu/overridetree.cb
M src/mainboard/google/octopus/variants/bobba/overridetree.cb
M src/mainboard/google/octopus/variants/garg/overridetree.cb
M src/mainboard/google/poppy/variants/baseboard/devicetree.cb
M src/mainboard/google/poppy/variants/nami/devicetree.cb
M src/mainboard/google/poppy/variants/nautilus/devicetree.cb
13 files changed, 41 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/26/42826/1
diff --git a/src/drivers/generic/gpio_keys/chip.h b/src/drivers/generic/gpio_keys/chip.h
index 7bc5007..900d21c 100644
--- a/src/drivers/generic/gpio_keys/chip.h
+++ b/src/drivers/generic/gpio_keys/chip.h
@@ -24,6 +24,28 @@
EV_ACT_DEASSERTED,
};
+enum {
+ /*
+ * GPIO key uses SCI route to wake the system from suspend state. This is typically used
+ * when the input line is dual routed i.e. one for IRQ and other for SCI or if the GPIO
+ * controller is capable of handling the filtering for IRQ and SCI separately. This
+ * requires "wake" property to be provided by the board which represents the GPE # for
+ * wake. It is exposed as _PRW in ACPI tables.
+ */
+ WAKEUP_ROUTE_SCI,
+ /*
+ * GPIO key uses GPIO controller IRQ route for wake. This is used when IRQ and wake are
+ * routed to the same pad and the GPIO controller is not capable of handling the trigger
+ * filtering separately for IRQ and wake. Kernel driver for gpio-keys takes care of
+ * reconfiguring the IRQ trigger as both edges when used in S0 and the edge requested by
+ * BIOS (as per wakeup_event_action) when entering suspend. In this case, _PRW is not
+ * exposed for the key device.
+ */
+ WAKEUP_ROUTE_GPIO_IRQ,
+ /* GPIO key does not support wake. */
+ WAKEUP_ROUTE_DISABLED,
+};
+
/* Details of the child node defining key */
struct key_info {
/* Device name of the child node - Mandatory */
@@ -37,7 +59,9 @@
uint32_t linux_input_type;
/* Descriptive name of the key */
const char *label;
- /* Wake GPE */
+ /* Wakeup route (if any) for the key. See WAKEUP_ROUTE_* macros above. */
+ unsigned int wakeup_route;
+ /* Wake GPE -- SCI GPE # for wake. Required for WAKEUP_ROUTE_SCI. */
unsigned int wake;
/* Trigger for Wakeup Event Action as defined in EV_ACT_* enum */
unsigned int wakeup_event_action;
diff --git a/src/drivers/generic/gpio_keys/gpio_keys.c b/src/drivers/generic/gpio_keys/gpio_keys.c
index 693fbb5..2bdf023 100644
--- a/src/drivers/generic/gpio_keys/gpio_keys.c
+++ b/src/drivers/generic/gpio_keys/gpio_keys.c
@@ -26,9 +26,12 @@
key->linux_input_type);
if (key->label)
acpi_dp_add_string(dsd, "label", key->label);
- if (key->wake) {
- acpi_dp_add_integer(dsd, "wakeup-source", 1);
+
+ if (key->wakeup_route == WAKEUP_ROUTE_SCI)
acpigen_write_PRW(key->wake, 3);
+
+ if (key->wakeup_route != WAKEUP_ROUTE_DISABLED) {
+ acpi_dp_add_integer(dsd, "wakeup-source", 1);
acpi_dp_add_integer(dsd, "wakeup-event-action",
key->wakeup_event_action);
}
diff --git a/src/mainboard/google/hatch/variants/hatch/overridetree.cb b/src/mainboard/google/hatch/variants/hatch/overridetree.cb
index a92ef9b..d9e00f3 100644
--- a/src/mainboard/google/hatch/variants/hatch/overridetree.cb
+++ b/src/mainboard/google/hatch/variants/hatch/overridetree.cb
@@ -110,6 +110,7 @@
register "name" = ""PENH""
register "gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_A8)"
register "key.wake" = "GPE0_DW0_08"
+ register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_DEASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
diff --git a/src/mainboard/google/hatch/variants/helios/overridetree.cb b/src/mainboard/google/hatch/variants/helios/overridetree.cb
index 0d73814..c587dc0 100644
--- a/src/mainboard/google/hatch/variants/helios/overridetree.cb
+++ b/src/mainboard/google/hatch/variants/helios/overridetree.cb
@@ -123,6 +123,7 @@
register "name" = ""PENH""
register "gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_A8)"
register "key.wake" = "GPE0_DW0_08"
+ register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_ASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
diff --git a/src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb b/src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb
index 0422a57..e2991cd 100644
--- a/src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb
+++ b/src/mainboard/google/hatch/variants/helios_diskswap/overridetree.cb
@@ -135,6 +135,7 @@
register "name" = ""PENH""
register "gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_A8)"
register "key.wake" = "GPE0_DW0_08"
+ register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_ASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
diff --git a/src/mainboard/google/hatch/variants/kindred/overridetree.cb b/src/mainboard/google/hatch/variants/kindred/overridetree.cb
index 43fdfbf..7893684 100644
--- a/src/mainboard/google/hatch/variants/kindred/overridetree.cb
+++ b/src/mainboard/google/hatch/variants/kindred/overridetree.cb
@@ -173,6 +173,7 @@
register "name" = ""PENH""
register "gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_A8)"
register "key.wake" = "GPE0_DW0_08"
+ register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_ASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
diff --git a/src/mainboard/google/hatch/variants/kohaku/overridetree.cb b/src/mainboard/google/hatch/variants/kohaku/overridetree.cb
index df18277..51a8454 100644
--- a/src/mainboard/google/hatch/variants/kohaku/overridetree.cb
+++ b/src/mainboard/google/hatch/variants/kohaku/overridetree.cb
@@ -219,6 +219,7 @@
# GPP_A16 is the IRQ source, and GPP_A8 is the wake source
register "gpio" = "ACPI_GPIO_INPUT_ACTIVE_LOW(GPP_A16)"
register "key.wake" = "GPE0_DW0_08"
+ register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_DEASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
diff --git a/src/mainboard/google/hatch/variants/mushu/overridetree.cb b/src/mainboard/google/hatch/variants/mushu/overridetree.cb
index 100f7d5..28e3add 100644
--- a/src/mainboard/google/hatch/variants/mushu/overridetree.cb
+++ b/src/mainboard/google/hatch/variants/mushu/overridetree.cb
@@ -130,6 +130,7 @@
register "name" = ""PENH""
register "gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_A8)"
register "key.wake" = "GPE0_DW0_08"
+ register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_DEASSERTED"
register "key.dev_name" = ""EJCT""
register "key.linux_code" = "SW_PEN_INSERTED"
diff --git a/src/mainboard/google/octopus/variants/bobba/overridetree.cb b/src/mainboard/google/octopus/variants/bobba/overridetree.cb
index c786a5d..c678ec8 100644
--- a/src/mainboard/google/octopus/variants/bobba/overridetree.cb
+++ b/src/mainboard/google/octopus/variants/bobba/overridetree.cb
@@ -111,6 +111,7 @@
register "key.linux_input_type" = "EV_SW"
register "key.label" = ""pen_eject""
register "key.wake" = "GPE0_DW2_04"
+ register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_DEASSERTED"
device generic 0 on end
end
diff --git a/src/mainboard/google/octopus/variants/garg/overridetree.cb b/src/mainboard/google/octopus/variants/garg/overridetree.cb
index a91a730..c3ab98b 100644
--- a/src/mainboard/google/octopus/variants/garg/overridetree.cb
+++ b/src/mainboard/google/octopus/variants/garg/overridetree.cb
@@ -105,6 +105,7 @@
register "key.linux_input_type" = "EV_SW"
register "key.label" = ""pen_eject""
register "key.wake" = "GPE0_DW2_04"
+ register "key.wakeup_route" = "WAKEUP_ROUTE_SCI"
register "key.wakeup_event_action" = "EV_ACT_DEASSERTED"
device generic 0 on end
end
diff --git a/src/mainboard/google/poppy/variants/baseboard/devicetree.cb b/src/mainboard/google/poppy/variants/baseboard/devicetree.cb
index 0f3cc04..d57070e 100644
--- a/src/mainboard/google/poppy/variants/baseboard/devicetree.cb
+++ b/src/mainboard/google/poppy/variants/baseboard/devicetree.cb
@@ -335,6 +335,7 @@
register "key.linux_code" = "SW_PEN_INSERTED"
register "key.linux_input_type" = "EV_SW"
register "key.label" = ""pen_eject""
+ register "key.wakeup_route" = "WAKEUP_ROUTE_DISABLED"
device generic 0 on end
end
end # I2C #3
diff --git a/src/mainboard/google/poppy/variants/nami/devicetree.cb b/src/mainboard/google/poppy/variants/nami/devicetree.cb
index 4fa41c5..a4dcad0 100644
--- a/src/mainboard/google/poppy/variants/nami/devicetree.cb
+++ b/src/mainboard/google/poppy/variants/nami/devicetree.cb
@@ -401,6 +401,7 @@
register "key.linux_code" = "SW_PEN_INSERTED"
register "key.linux_input_type" = "EV_SW"
register "key.label" = ""pen_insert""
+ register "key.wakeup_route" = "WAKEUP_ROUTE_DISABLED"
device generic 0 on end
end
end # I2C #2
diff --git a/src/mainboard/google/poppy/variants/nautilus/devicetree.cb b/src/mainboard/google/poppy/variants/nautilus/devicetree.cb
index c55562d..a5f997a 100644
--- a/src/mainboard/google/poppy/variants/nautilus/devicetree.cb
+++ b/src/mainboard/google/poppy/variants/nautilus/devicetree.cb
@@ -358,6 +358,7 @@
register "key.linux_code" = "SW_PEN_INSERTED"
register "key.linux_input_type" = "EV_SW"
register "key.label" = ""pen_eject""
+ register "key.wakeup_route" = "WAKEUP_ROUTE_DISABLED"
device generic 0 on end
end
end # I2C #3
--
To view, visit https://review.coreboot.org/c/coreboot/+/42826
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib32b866b5f0ca559ed680b46218454bdfd8c6457
Gerrit-Change-Number: 42826
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan(a)google.com>
Gerrit-MessageType: newchange
Hello build bot (Jenkins), Justin TerAvest, Ronak Kanabar, Andrey Petrov, Patrick Rudolph, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42745
to look at the new patch set (#5).
Change subject: soc/intel: Configure PAVP at compile-time
......................................................................
soc/intel: Configure PAVP at compile-time
Expose configuration of Intel's PAVP (Protected Audio-Video Path, a
digital rights protection technology for multimedia content) to Kconfig.
Change-Id: I2aae741bb30e3be3c64324cd6334778bd271a903
Signed-off-by: Benjamin Doron <benjamin.doron00(a)gmail.com>
---
M src/soc/intel/apollolake/chip.c
M src/soc/intel/cannonlake/fsp_params.c
M src/soc/intel/common/Kconfig.common
M src/soc/intel/jasperlake/fsp_params.c
M src/soc/intel/skylake/chip.c
5 files changed, 16 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/42745/5
--
To view, visit https://review.coreboot.org/c/coreboot/+/42745
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2aae741bb30e3be3c64324cd6334778bd271a903
Gerrit-Change-Number: 42745
Gerrit-PatchSet: 5
Gerrit-Owner: Benjamin Doron <benjamin.doron00(a)gmail.com>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Reviewer: Justin TerAvest <teravest(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Hello build bot (Jenkins), Justin TerAvest, Ronak Kanabar, Andrey Petrov, Patrick Rudolph, Karthik Ramasubramanian,
I'd like you to reexamine a change. Please visit
https://review.coreboot.org/c/coreboot/+/42745
to look at the new patch set (#4).
Change subject: soc/intel: Configure PAVP at compile-time
......................................................................
soc/intel: Configure PAVP at compile-time
Expose configuration of Intel's PAVP (Protected Audio-Video Path, a
digital rights protection technology for multimedia content) to Kconfig.
Change-Id: I2aae741bb30e3be3c64324cd6334778bd271a903
Signed-off-by: Benjamin Doron <benjamin.doron00(a)gmail.com>
---
M src/soc/intel/apollolake/chip.c
M src/soc/intel/common/Kconfig.common
M src/soc/intel/jasperlake/fsp_params.c
M src/soc/intel/skylake/chip.c
4 files changed, 14 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/45/42745/4
--
To view, visit https://review.coreboot.org/c/coreboot/+/42745
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2aae741bb30e3be3c64324cd6334778bd271a903
Gerrit-Change-Number: 42745
Gerrit-PatchSet: 4
Gerrit-Owner: Benjamin Doron <benjamin.doron00(a)gmail.com>
Gerrit-Reviewer: Andrey Petrov <andrey.petrov(a)gmail.com>
Gerrit-Reviewer: Justin TerAvest <teravest(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-MessageType: newpatchset
Benjamin Doron has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/42745 )
Change subject: soc/intel: Configure PAVP at compile-time
......................................................................
Patch Set 3:
This change is ready for review.
--
To view, visit https://review.coreboot.org/c/coreboot/+/42745
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I2aae741bb30e3be3c64324cd6334778bd271a903
Gerrit-Change-Number: 42745
Gerrit-PatchSet: 3
Gerrit-Owner: Benjamin Doron <benjamin.doron00(a)gmail.com>
Gerrit-Reviewer: Justin TerAvest <teravest(a)chromium.org>
Gerrit-Reviewer: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Ronak Kanabar <ronak.kanabar(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-Comment-Date: Sun, 28 Jun 2020 03:08:42 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment