Tim Wawrzynczak has submitted this change. ( https://review.coreboot.org/c/coreboot/+/52590 )
Change subject: soc/intel/common: Add CPU Port ID field to GPIO communities
......................................................................
soc/intel/common: Add CPU Port ID field to GPIO communities
The CPU can have its own Port IDs when addressing GPIO communities, which
differ from the PCH PCR IDs.
1) Add a field to `struct pad_community` that can hold this value when
known.
2) Add a function to return this value for a given GPIO pad.
Change-Id: I007c01758ae3026fe4dfef07b6a3a269ee3f9e33
Signed-off-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52590
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
---
M src/soc/intel/common/block/gpio/gpio.c
M src/soc/intel/common/block/include/intelblocks/gpio.h
2 files changed, 10 insertions(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Furquan Shaikh: Looks good to me, approved
diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c
index db76545..8dc92ff 100644
--- a/src/soc/intel/common/block/gpio/gpio.c
+++ b/src/soc/intel/common/block/gpio/gpio.c
@@ -787,3 +787,9 @@
return true;
}
+
+unsigned int gpio_get_pad_cpu_portid(gpio_t pad)
+{
+ const struct pad_community *comm = gpio_get_community(pad);
+ return comm->cpu_port;
+}
diff --git a/src/soc/intel/common/block/include/intelblocks/gpio.h b/src/soc/intel/common/block/include/intelblocks/gpio.h
index eab2573..86a36d5 100644
--- a/src/soc/intel/common/block/include/intelblocks/gpio.h
+++ b/src/soc/intel/common/block/include/intelblocks/gpio.h
@@ -124,6 +124,7 @@
uint8_t gpi_status_offset; /* specifies offset in struct
gpi_status */
uint8_t port; /* PCR Port ID */
+ uint8_t cpu_port; /* CPU Port ID */
const struct reset_mapping *reset_map; /* PADRSTCFG logical to
chipset mapping */
size_t num_reset_vals;
@@ -256,5 +257,8 @@
*/
bool gpio_get_vw_info(gpio_t pad, unsigned int *vw_index, unsigned int *vw_bit);
+/* Returns PCR port ID for this pad for the CPU; will be 0 if not available */
+unsigned int gpio_get_pad_cpu_portid(gpio_t pad);
+
#endif
#endif /* _SOC_INTELBLOCKS_GPIO_H_ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/52590
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I007c01758ae3026fe4dfef07b6a3a269ee3f9e33
Gerrit-Change-Number: 52590
Gerrit-PatchSet: 6
Gerrit-Owner: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: merged
Tim Wawrzynczak has submitted this change. ( https://review.coreboot.org/c/coreboot/+/52588 )
Change subject: soc/intel/common: Add virtual wire mapping entries to GPIO communities
......................................................................
soc/intel/common: Add virtual wire mapping entries to GPIO communities
Some SoCs may define virtual wire entries for certain GPIOs. This patch
allows SoC code to provide the mappings from GPIO pads to virtual wire
indexes and bits when they are provided. Also a function
`gpio_get_vw_info` is added to return this information.
Change-Id: I87adf0ca06cb5b7969bb2c258d6daebd44bb9748
Signed-off-by: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52588
Reviewed-by: Furquan Shaikh <furquan(a)google.com>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M src/soc/intel/common/block/gpio/gpio.c
M src/soc/intel/common/block/include/intelblocks/gpio.h
2 files changed, 43 insertions(+), 0 deletions(-)
Approvals:
build bot (Jenkins): Verified
Furquan Shaikh: Looks good to me, approved
diff --git a/src/soc/intel/common/block/gpio/gpio.c b/src/soc/intel/common/block/gpio/gpio.c
index 4398c9f..db76545 100644
--- a/src/soc/intel/common/block/gpio/gpio.c
+++ b/src/soc/intel/common/block/gpio/gpio.c
@@ -763,3 +763,27 @@
BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_EXIT, snapshot_cleanup, NULL);
BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_LOAD, BS_ON_EXIT, snapshot_cleanup, NULL);
+
+bool gpio_get_vw_info(gpio_t pad, unsigned int *vw_index, unsigned int *vw_bit)
+{
+ const struct pad_community *comm;
+ unsigned int offset = 0;
+ size_t i;
+
+ comm = gpio_get_community(pad);
+ for (i = 0; i < comm->num_vw_entries; i++) {
+ if (pad >= comm->vw_entries[i].first_pad && pad <= comm->vw_entries[i].last_pad)
+ break;
+
+ offset += 1 + comm->vw_entries[i].last_pad - comm->vw_entries[i].first_pad;
+ }
+
+ if (i == comm->num_vw_entries)
+ return false;
+
+ offset += pad - comm->vw_entries[i].first_pad;
+ *vw_index = comm->vw_base + offset / 8;
+ *vw_bit = offset % 8;
+
+ return true;
+}
diff --git a/src/soc/intel/common/block/include/intelblocks/gpio.h b/src/soc/intel/common/block/include/intelblocks/gpio.h
index a7419dc..eab2573 100644
--- a/src/soc/intel/common/block/include/intelblocks/gpio.h
+++ b/src/soc/intel/common/block/include/intelblocks/gpio.h
@@ -96,6 +96,12 @@
int acpi_pad_base;
};
+/* A range of consecutive virtual-wire entries in a community */
+struct vw_entries {
+ gpio_t first_pad;
+ gpio_t last_pad;
+};
+
/* This structure will be used to describe a community or each group within a
* community when multiple groups exist inside a community
*/
@@ -123,6 +129,13 @@
size_t num_reset_vals;
const struct pad_group *groups;
size_t num_groups;
+ unsigned int vw_base;
+ /*
+ * Note: The entries must be in the same order here as the order in
+ * which they map to VW indexes (beginning with VW base)
+ */
+ const struct vw_entries *vw_entries;
+ size_t num_vw_entries;
};
/*
@@ -237,5 +250,11 @@
size_t gpio_get_index_in_group(gpio_t pad);
+/*
+ * Returns true and stuffs out params for virtual-wire index and bit position
+ * for the given GPIO, otherwise false if there is no VW index for the pad.
+ */
+bool gpio_get_vw_info(gpio_t pad, unsigned int *vw_index, unsigned int *vw_bit);
+
#endif
#endif /* _SOC_INTELBLOCKS_GPIO_H_ */
--
To view, visit https://review.coreboot.org/c/coreboot/+/52588
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I87adf0ca06cb5b7969bb2c258d6daebd44bb9748
Gerrit-Change-Number: 52588
Gerrit-PatchSet: 6
Gerrit-Owner: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-MessageType: merged
Attention is currently required from: Shaunak Saha, Martin Roth, Angel Pons, Subrata Banik, Michael Niewöhner, Patrick Rudolph.
Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/51649 )
Change subject: soc/intel/tgl,mb/google/volteer: Add API for Type-C aux bias pads
......................................................................
Patch Set 23:
(1 comment)
File src/soc/intel/common/block/tcss/tcss.c:
https://review.coreboot.org/c/coreboot/+/51649/comment/406cbc45_9de99dca
PS22, Line 333: MAX_TYPE_C_PORTS
> If this ever needs to be changed, I'd prefer a Kconfig option. […]
That'd work
--
To view, visit https://review.coreboot.org/c/coreboot/+/51649
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I70e36a41e760f4a435511c147cc5744a77dbccc0
Gerrit-Change-Number: 51649
Gerrit-PatchSet: 23
Gerrit-Owner: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Reviewer: Furquan Shaikh <furquan(a)google.com>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-Reviewer: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Reviewer: Shaunak Saha <shaunak.saha(a)intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>
Gerrit-Attention: Shaunak Saha <shaunak.saha(a)intel.com>
Gerrit-Attention: Martin Roth <martinroth(a)google.com>
Gerrit-Attention: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-Attention: Subrata Banik <subrata.banik(a)intel.com>
Gerrit-Attention: Michael Niewöhner <foss(a)mniewoehner.de>
Gerrit-Attention: Patrick Rudolph <siro(a)das-labor.org>
Gerrit-Comment-Date: Thu, 06 May 2021 04:11:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Furquan Shaikh <furquan(a)google.com>
Comment-In-Reply-To: Tim Wawrzynczak <twawrzynczak(a)chromium.org>
Comment-In-Reply-To: Angel Pons <th3fanbus(a)gmail.com>
Gerrit-MessageType: comment