summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/apollolake/chip.c7
-rw-r--r--src/soc/intel/apollolake/xdci.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c
index cac2f1134b..1dd6daf16c 100644
--- a/src/soc/intel/apollolake/chip.c
+++ b/src/soc/intel/apollolake/chip.c
@@ -30,6 +30,7 @@
#include <intelblocks/fast_spi.h>
#include <intelblocks/p2sb.h>
#include <intelblocks/msr.h>
+#include <intelblocks/xdci.h>
#include <fsp/api.h>
#include <fsp/util.h>
#include <intelblocks/cpulib.h>
@@ -585,6 +586,12 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *silupd)
glk_fsp_silicon_init_params_cb(cfg, silconfig);
else
apl_fsp_silicon_init_params_cb(cfg, silconfig);
+
+ /* Enable xDCI controller if enabled in devicetree and allowed */
+ dev = dev_find_slot(0, PCH_DEVFN_XDCI);
+ if (!xdci_can_enable())
+ dev->enabled = 0;
+ silconfig->UsbOtg = dev->enabled;
}
struct chip_operations soc_intel_apollolake_ops = {
diff --git a/src/soc/intel/apollolake/xdci.c b/src/soc/intel/apollolake/xdci.c
index 4c3047c41b..07207b3bbb 100644
--- a/src/soc/intel/apollolake/xdci.c
+++ b/src/soc/intel/apollolake/xdci.c
@@ -54,7 +54,7 @@ static void configure_host_mode_port0(struct device *dev)
* enabled. If it's disabled assume the switch was already done
* in FSP.
*/
- if (!dev->enabled || !xdci_dev->enabled)
+ if (!dev->enabled || !xdci_dev->enabled || !xdci_can_enable())
return;
printk(BIOS_INFO, "Putting port 0 into host mode.\n");