aboutsummaryrefslogtreecommitdiff
path: root/src/mainboard/google/volteer/variants
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2021-09-16 16:54:04 -0700
committerFurquan Shaikh <furquan@google.com>2021-09-20 23:08:42 +0000
commit522174ba382c4a75a49fe1116b320efbe9faa122 (patch)
treeec3fdfa775ebbf56397c71700c664ebb83dc4658 /src/mainboard/google/volteer/variants
parent4aba7395b705725c5e441cce2fd269e734994939 (diff)
mb/google/volteer: Switch to using device pointers using alias names
This change replaces the device tree walks with device pointers by using alias names for the following devices: 1. PMC MUX connector 2. SPI TPM 3. I2C TPM Change-Id: I38f87d3a90a7253f2a29aba7db9a9f9744985494 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57740 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/mainboard/google/volteer/variants')
-rw-r--r--src/mainboard/google/volteer/variants/baseboard/devicetree.cb2
-rw-r--r--src/mainboard/google/volteer/variants/volteer2/overridetree.cb2
-rw-r--r--src/mainboard/google/volteer/variants/volteer2/variant.c12
3 files changed, 4 insertions, 12 deletions
diff --git a/src/mainboard/google/volteer/variants/baseboard/devicetree.cb b/src/mainboard/google/volteer/variants/baseboard/devicetree.cb
index 0d067e6573..b4c4f6a41f 100644
--- a/src/mainboard/google/volteer/variants/baseboard/devicetree.cb
+++ b/src/mainboard/google/volteer/variants/baseboard/devicetree.cb
@@ -508,7 +508,7 @@ chip soc/intel/tigerlake
register "hid" = "ACPI_DT_NAMESPACE_HID"
register "compat_string" = ""google,cr50""
register "irq" = "ACPI_IRQ_EDGE_LOW(GPP_C21_IRQ)"
- device spi 0 on end
+ device spi 0 alias spi_tpm on end
end
end
device ref gspi1 on
diff --git a/src/mainboard/google/volteer/variants/volteer2/overridetree.cb b/src/mainboard/google/volteer/variants/volteer2/overridetree.cb
index 2654bd7a69..7fe38a93d4 100644
--- a/src/mainboard/google/volteer/variants/volteer2/overridetree.cb
+++ b/src/mainboard/google/volteer/variants/volteer2/overridetree.cb
@@ -207,7 +207,7 @@ chip soc/intel/tigerlake
chip drivers/i2c/tpm
register "hid" = ""GOOG0005""
register "irq" = "ACPI_IRQ_EDGE_LOW(GPP_C21_IRQ)"
- device i2c 50 off end
+ device i2c 50 alias i2c_tpm off end
end
end
device ref i2c2 on
diff --git a/src/mainboard/google/volteer/variants/volteer2/variant.c b/src/mainboard/google/volteer/variants/volteer2/variant.c
index 057bb8ad65..442402779d 100644
--- a/src/mainboard/google/volteer/variants/volteer2/variant.c
+++ b/src/mainboard/google/volteer/variants/volteer2/variant.c
@@ -4,22 +4,14 @@
#include <soc/pci_devs.h>
#include <acpi/acpi_device.h>
-extern struct chip_operations drivers_i2c_tpm_ops;
-
-static bool match_i2c_tpm(DEVTREE_CONST struct device *dev)
-{
- return dev->chip_ops == &drivers_i2c_tpm_ops;
-}
-
/*
* This function runs only on the volteer_ti50 variant, which has the GSC on a
* reworked I2C bus.
*/
static void devtree_enable_i2c_tpm(void)
{
- struct device *spi_tpm = pcidev_path_on_root(PCH_DEVFN_GSPI0)->link_list->children;
- struct device *i2c_tpm = dev_find_matching_device_on_bus(
- pcidev_path_on_root(PCH_DEVFN_I2C1)->link_list, match_i2c_tpm);
+ struct device *spi_tpm = DEV_PTR(spi_tpm);
+ struct device *i2c_tpm = DEV_PTR(i2c_tpm);
if (!i2c_tpm || !spi_tpm)
return;
spi_tpm->enabled = 0;