Tim Wawrzynczak has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47260 )
Change subject: device: Add pci_s_dev_is_wake_source function
......................................................................
device: Add pci_s_dev_is_wake_source function
This function is the SIMPLE_DEVICE equivalent of
`pci_dev_is_wake_source`, which is required so that elog can use this
function, which since it runs in SMM as well, it uses the simple device
model.
Signed-off-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Change-Id: Ie5583c04366c9a16bc1b00a6892d39eeafe5da49
---
M src/device/pci_ops.c
M src/include/device/pci_ops.h
2 files changed, 23 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/60/47260/1
diff --git a/src/device/pci_ops.c b/src/device/pci_ops.c
index 90f45bf..cb833f8 100644
--- a/src/device/pci_ops.c
+++ b/src/device/pci_ops.c
@@ -78,3 +78,18 @@
{
die("PCI: dev is NULL!\n");
}
+
+bool pci_s_dev_is_wake_source(pci_devfn_t dev)
+{
+ unsigned int pm_cap;
+ uint16_t pmcs;
+
+ pm_cap = pci_s_find_capability(dev, PCI_CAP_ID_PM);
+ if (!pm_cap)
+ return false;
+
+ pmcs = pci_s_read_config16(dev, pm_cap + PCI_PM_CTRL);
+
+ /* PCI Device is a wake source if PME_ENABLE and PME_STATUS are set in PMCS register. */
+ return (pmcs & PCI_PM_CTRL_PME_ENABLE) && (pmcs & PCI_PM_CTRL_PME_STATUS);
+}
diff --git a/src/include/device/pci_ops.h b/src/include/device/pci_ops.h
index cdf02d6..1738cd1 100644
--- a/src/include/device/pci_ops.h
+++ b/src/include/device/pci_ops.h
@@ -209,4 +209,12 @@
return pci_s_find_capability(PCI_BDF(dev), cap);
}
+/*
+ * Determine if the given PCI device is the source of wake from sleep by checking PME_STATUS and
+ * PME_ENABLE bits in PM control and status register.
+ *
+ * Returns true if PCI device is wake source, false otherwise.
+ */
+bool pci_s_dev_is_wake_source(pci_devfn_t dev);
+
#endif /* PCI_OPS_H */
--
To view, visit https://review.coreboot.org/c/coreboot/+/47260
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ie5583c04366c9a16bc1b00a6892d39eeafe5da49
Gerrit-Change-Number: 47260
Gerrit-PatchSet: 1
Gerrit-Owner: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-MessageType: newchange
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/44587 )
Change subject: mb/google/dedede: Add support for variant specific SMI sleep flow
......................................................................
mb/google/dedede: Add support for variant specific SMI sleep flow
This support is required to power off certain components that exist only
in certain variants.
BUG=None
TEST=Build and boot Boten to OS.
Change-Id: Ib43ada784666919a4d26246a683dad7f3546fabb
Signed-off-by: Karthikeyan Ramasubramanian <kramasub(a)google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/44587
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Peichao Wang <pwang12(a)lenovo.corp-partner.google.com>
Reviewed-by: Marco Chen <marcochen(a)google.com>
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
---
M src/mainboard/google/dedede/smihandler.c
M src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h
2 files changed, 9 insertions(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Furquan Shaikh: Looks good to me, approved
Marco Chen: Looks good to me, approved
Peichao Wang: Looks good to me, approved
diff --git a/src/mainboard/google/dedede/smihandler.c b/src/mainboard/google/dedede/smihandler.c
index 20f0207..c50578d 100644
--- a/src/mainboard/google/dedede/smihandler.c
+++ b/src/mainboard/google/dedede/smihandler.c
@@ -21,6 +21,8 @@
pads = variant_sleep_gpio_table(&num);
gpio_configure_pads(pads, num);
+ variant_smi_sleep(slp_typ);
+
chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS,
MAINBOARD_EC_S5_WAKE_EVENTS);
}
@@ -41,3 +43,7 @@
{
chromeec_smi_process_events();
}
+
+void __weak variant_smi_sleep(u8 slp_typ)
+{
+}
diff --git a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h
index bb41e45..e7bfd86 100644
--- a/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/dedede/variants/baseboard/include/baseboard/variants.h
@@ -36,4 +36,7 @@
*/
bool variant_mem_is_half_populated(void);
+/* Allow each variants to customize SMI sleep flow. */
+void variant_smi_sleep(u8 slp_typ);
+
#endif /*__BASEBOARD_VARIANTS_H__ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/44587
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ib43ada784666919a4d26246a683dad7f3546fabb
Gerrit-Change-Number: 44587
Gerrit-PatchSet: 8
Gerrit-Owner: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Henry Sun <henrysun(a)google.com>
Gerrit-Reviewer: Marco Chen <marcochen(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Peichao Wang <pwang12(a)lenovo.corp-partner.google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Rasheed Hsueh <rasheed.hsueh(a)lcfc.corp-partner.google.com>
Gerrit-CC: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-MessageType: merged
Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/46713 )
Change subject: driver/usb/acpi: Add power resources for devices on USB ports
......................................................................
driver/usb/acpi: Add power resources for devices on USB ports
Allow a USB device to define PowerResource in its SSDT AML code.
PowerResouce ACPI generation expects SoC to define the callbacks for
generating AML code for GPIO manipulation.
Device requiring PowerResource needs to define following parameters:
* Reset GPIO - Optional, GPIO to put device into reset or take it out
of reset.
* Reset delay - Delay after reset GPIO is asserted (default 0).
* Reset off delay - Delay after reset GPIO is de-asserted (default 0).
* Enable GPIO - Optional, GPIO to enable device.
* Enable delay - Delay after enable GPIO is asserted (default 0).
* Enable off delay - Delay after enable GPIO is de-asserted (default 0).
BUG=b:163100335
TEST=Ensure that the Power Resource ACPI object is added under the
concerned USB device.
Change-Id: Icc1aebfb9e3e646a7f608f0cd391079fd30dd1c0
Signed-off-by: Karthikeyan Ramasubramanian <kramasub(a)google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46713
Reviewed-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Reviewed-by: Peichao Wang <pwang12(a)lenovo.corp-partner.google.com>
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M src/drivers/usb/acpi/chip.h
M src/drivers/usb/acpi/usb_acpi.c
2 files changed, 32 insertions(+), 2 deletions(-)
Approvals:
build bot (Jenkins): Verified
Furquan Shaikh: Looks good to me, approved
Tim Wawrzynczak: Looks good to me, approved
Peichao Wang: Looks good to me, approved
diff --git a/src/drivers/usb/acpi/chip.h b/src/drivers/usb/acpi/chip.h
index 8cd9268..8afdf6f 100644
--- a/src/drivers/usb/acpi/chip.h
+++ b/src/drivers/usb/acpi/chip.h
@@ -44,7 +44,21 @@
bool use_custom_pld;
struct acpi_pld custom_pld;
+ /* Does the device have a power resource? */
+ bool has_power_resource;
+
+ /* GPIO used to take device out of reset or to put it into reset. */
struct acpi_gpio reset_gpio;
+ /* Delay to be inserted after device is taken out of reset. */
+ unsigned int reset_delay_ms;
+ /* Delay to be inserted after device is put into reset. */
+ unsigned int reset_off_delay_ms;
+ /* GPIO used to enable device. */
+ struct acpi_gpio enable_gpio;
+ /* Delay to be inserted after device is enabled. */
+ unsigned int enable_delay_ms;
+ /* Delay to be inserted after device is disabled. */
+ unsigned int enable_off_delay_ms;
};
#endif /* __USB_ACPI_CHIP_H__ */
diff --git a/src/drivers/usb/acpi/usb_acpi.c b/src/drivers/usb/acpi/usb_acpi.c
index 55ef1d3..8a597e3 100644
--- a/src/drivers/usb/acpi/usb_acpi.c
+++ b/src/drivers/usb/acpi/usb_acpi.c
@@ -11,9 +11,10 @@
static bool usb_acpi_add_gpios_to_crs(struct drivers_usb_acpi_config *cfg)
{
/*
- * Return false if reset GPIO is not provided.
+ * Return false if reset GPIO is not provided or is provided as part of power
+ * resource.
*/
- if (cfg->reset_gpio.pin_count == 0)
+ if (cfg->has_power_resource || cfg->reset_gpio.pin_count == 0)
return false;
return true;
@@ -61,6 +62,21 @@
acpi_dp_write(dsd);
}
+ if (config->has_power_resource) {
+ const struct acpi_power_res_params power_res_params = {
+ &config->reset_gpio,
+ config->reset_delay_ms,
+ config->reset_off_delay_ms,
+ &config->enable_gpio,
+ config->enable_delay_ms,
+ config->enable_off_delay_ms,
+ NULL,
+ 0,
+ 0
+ };
+ acpi_device_add_power_res(&power_res_params);
+ }
+
acpigen_pop_len();
printk(BIOS_INFO, "%s: %s at %s\n", path,
--
To view, visit https://review.coreboot.org/c/coreboot/+/46713
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Icc1aebfb9e3e646a7f608f0cd391079fd30dd1c0
Gerrit-Change-Number: 46713
Gerrit-PatchSet: 5
Gerrit-Owner: Karthik Ramasubramanian <kramasub(a)google.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Peichao Wang <pwang12(a)lenovo.corp-partner.google.com>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Rasheed Hsueh <rasheed.hsueh(a)lcfc.corp-partner.google.com>
Gerrit-MessageType: merged
David Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47228 )
Change subject: mb/google/volteer/var/voema: Add memory parts and generate DRAM IDs
......................................................................
mb/google/volteer/var/voema: Add memory parts and generate DRAM IDs
This change adds memory parts used by variant voema to
mem_parts_used.txt and generates DRAM IDs allocated to these parts.
Added memory
1. MT53E512M64D4NW-046 WT:E
2. MT53E1G64D8NW-046 WT:E
BUG=b:171755775
TEST=emerge-volteer coreboot chromeos-bootimage
Signed-off-by: David Wu <david_wu(a)quanta.corp-partner.google.com>
Change-Id: I24d466f92a7e0fa3ab2f6241f0b5af025c53ed98
---
M src/mainboard/google/volteer/variants/voema/memory/Makefile.inc
M src/mainboard/google/volteer/variants/voema/memory/dram_id.generated.txt
M src/mainboard/google/volteer/variants/voema/memory/mem_parts_used.txt
3 files changed, 7 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/28/47228/1
diff --git a/src/mainboard/google/volteer/variants/voema/memory/Makefile.inc b/src/mainboard/google/volteer/variants/voema/memory/Makefile.inc
index b0ca222..3c8ea48 100644
--- a/src/mainboard/google/volteer/variants/voema/memory/Makefile.inc
+++ b/src/mainboard/google/volteer/variants/voema/memory/Makefile.inc
@@ -1,5 +1,6 @@
## SPDX-License-Identifier: GPL-2.0-or-later
## This is an auto-generated file. Do not edit!!
-## Add memory parts in mem_parts_used.txt and run spd_tools to regenerate.
-SPD_SOURCES = placeholder.spd.hex
+SPD_SOURCES =
+SPD_SOURCES += lp4x-spd-1.hex # ID = 0(0b0000) Parts = MT53E512M64D4NW-046 WT:E
+SPD_SOURCES += lp4x-spd-3.hex # ID = 1(0b0001) Parts = MT53E1G64D8NW-046 WT:E
diff --git a/src/mainboard/google/volteer/variants/voema/memory/dram_id.generated.txt b/src/mainboard/google/volteer/variants/voema/memory/dram_id.generated.txt
index fa24790..02e7443 100644
--- a/src/mainboard/google/volteer/variants/voema/memory/dram_id.generated.txt
+++ b/src/mainboard/google/volteer/variants/voema/memory/dram_id.generated.txt
@@ -1 +1,3 @@
DRAM Part Name ID to assign
+MT53E512M64D4NW-046 WT:E 0 (0000)
+MT53E1G64D8NW-046 WT:E 1 (0001)
diff --git a/src/mainboard/google/volteer/variants/voema/memory/mem_parts_used.txt b/src/mainboard/google/volteer/variants/voema/memory/mem_parts_used.txt
index f51b3af..b74da4a 100644
--- a/src/mainboard/google/volteer/variants/voema/memory/mem_parts_used.txt
+++ b/src/mainboard/google/volteer/variants/voema/memory/mem_parts_used.txt
@@ -1,4 +1,2 @@
-# This is a CSV file containing a list of memory parts used by this variant.
-# Generate an updated Makefile.inc and dram_id.generated.txt by running the
-# gen_part_id tool from util/spd_tools/ddr4 or util/spd_tools/lp4x
-# See util/spd_tools/{ddr4,lp4x}/README.md for more details and instructions.
+MT53E512M64D4NW-046 WT:E
+MT53E1G64D8NW-046 WT:E
--
To view, visit https://review.coreboot.org/c/coreboot/+/47228
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I24d466f92a7e0fa3ab2f6241f0b5af025c53ed98
Gerrit-Change-Number: 47228
Gerrit-PatchSet: 1
Gerrit-Owner: David Wu <david_wu(a)quanta.corp-partner.google.com>
Gerrit-MessageType: newchange