summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/common/block')
-rw-r--r--src/soc/intel/common/block/include/intelblocks/xdci.h2
-rw-r--r--src/soc/intel/common/block/xdci/xdci.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/soc/intel/common/block/include/intelblocks/xdci.h b/src/soc/intel/common/block/include/intelblocks/xdci.h
index 4610590363..32d9212edb 100644
--- a/src/soc/intel/common/block/include/intelblocks/xdci.h
+++ b/src/soc/intel/common/block/include/intelblocks/xdci.h
@@ -4,6 +4,6 @@
#define SOC_INTEL_COMMON_BLOCK_XDCI_H
void soc_xdci_init(struct device *dev);
-int xdci_can_enable(void);
+bool xdci_can_enable(unsigned int xdci_devfn);
#endif /* SOC_INTEL_COMMON_BLOCK_XDCI_H */
diff --git a/src/soc/intel/common/block/xdci/xdci.c b/src/soc/intel/common/block/xdci/xdci.c
index 9f15ac1d6e..e1d880975f 100644
--- a/src/soc/intel/common/block/xdci/xdci.c
+++ b/src/soc/intel/common/block/xdci/xdci.c
@@ -8,9 +8,14 @@
__weak void soc_xdci_init(struct device *dev) { /* no-op */ }
-int xdci_can_enable(void)
+bool xdci_can_enable(unsigned int xdci_devfn)
{
- return vboot_can_enable_udc();
+ /* Enable xDCI controller if enabled in devicetree and allowed */
+ if (!vboot_can_enable_udc()) {
+ devfn_disable(pci_root_bus(), xdci_devfn);
+ return false;
+ }
+ return is_devfn_enabled(xdci_devfn);
}
static struct device_operations usb_xdci_ops = {