summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorRobert Zieba <robertzieba@google.com>2022-11-18 18:06:28 +0000
committerMartin L Roth <gaumless@gmail.com>2023-03-05 15:32:34 +0000
commit219cb952f8f27552be7a997c608efd46cf28992e (patch)
tree562616dd0c1fd1885765487fb4e3e8267c850d17 /src/include
parentac8c378777d861000d82eea1c7439f16dcd45797 (diff)
device/xhci: Add functions to work with resource pointers
The XHCI device functions currently use functions that require a access to the device tree. Create variant of these functions that can operate with a resource* as an argument and refactor the existing device*-based functions to operate by calling the resource*-based variants. This is useful for stages like SMM that may not have access to the device tree. BRANCH=guybrush BUG=b:186792595 TEST=Ran on skyrim device, verified that XHCI ACPI tables are still generated correctly. Change-Id: If5a74f9529d5dc6031ec968ef5f40a9cad5ffbc4 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/69914 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/device/xhci.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/include/device/xhci.h b/src/include/device/xhci.h
index b9c784ee91..861bf22d42 100644
--- a/src/include/device/xhci.h
+++ b/src/include/device/xhci.h
@@ -97,6 +97,9 @@ struct xhci_usb_info {
/**
* Iterates over the xHCI Extended Capabilities List.
*/
+enum cb_err xhci_resource_for_each_ext_cap(const struct resource *res, void *context,
+ void (*callback)(void *context,
+ const struct xhci_ext_cap *cap));
enum cb_err xhci_for_each_ext_cap(const struct device *device, void *context,
void (*callback)(void *context,
const struct xhci_ext_cap *cap));
@@ -108,6 +111,9 @@ enum cb_err xhci_for_each_ext_cap(const struct device *device, void *context,
enum cb_err xhci_for_each_supported_usb_cap(
const struct device *device, void *context,
void (*callback)(void *context, const struct xhci_supported_protocol *data));
+enum cb_err xhci_resource_for_each_supported_usb_cap(
+ const struct resource *res, void *context,
+ void (*callback)(void *context, const struct xhci_supported_protocol *data));
void xhci_print_supported_protocol(const struct xhci_supported_protocol *supported_protocol);