summaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake/chip.c
diff options
context:
space:
mode:
authorMaxim Polyakov <max.senia.poliak@gmail.com>2020-02-16 11:51:57 +0300
committerPatrick Georgi <pgeorgi@google.com>2020-03-06 07:58:00 +0000
commit6704049fc911eba9f4e6dc36a916eccffd04a15e (patch)
treeb0f244a10cd3ba6e03c46a2ebb9085bea753c020 /src/soc/intel/apollolake/chip.c
parent44fc40e09186cd24df873df6ca4d82af46efc0f4 (diff)
soc/apl: add options to override USB port config
Allows to override the PortUsb20Enable and PortUsb30Enable FSP options (which are set to 1 by default) to enable/disable USB ports if the usb_config_override flag is set to "1". Therefore, these changes will not affect other boards with an Apollo Lake processor. Change-Id: Ia94a2be1647f7743ef0c918ae3b34437a179261c Signed-off-by: Maxim Polyakov <max.senia.poliak@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/38815 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/intel/apollolake/chip.c')
-rw-r--r--src/soc/intel/apollolake/chip.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/soc/intel/apollolake/chip.c b/src/soc/intel/apollolake/chip.c
index 37fdfff90b..4eabf8a012 100644
--- a/src/soc/intel/apollolake/chip.c
+++ b/src/soc/intel/apollolake/chip.c
@@ -558,11 +558,18 @@ static void parse_devicetree(FSP_S_CONFIG *silconfig)
static void apl_fsp_silicon_init_params_cb(struct soc_intel_apollolake_config
*cfg, FSP_S_CONFIG *silconfig)
{
-#if !CONFIG(SOC_INTEL_GLK) /* GLK FSP does not have these
- fields in FspsUpd.h yet */
+#if !CONFIG(SOC_INTEL_GLK) /* GLK FSP does not have these fields in FspsUpd.h yet */
uint8_t port;
for (port = 0; port < APOLLOLAKE_USB2_PORT_MAX; port++) {
+ if (cfg->usb_config_override) {
+ if (!cfg->usb2_port[port].enable)
+ continue;
+
+ silconfig->PortUsb20Enable[port] = 1;
+ silconfig->PortUs20bOverCurrentPin[port] = cfg->usb2_port[port].oc_pin;
+ }
+
if (cfg->usb2eye[port].Usb20PerPortTxPeHalf != 0)
silconfig->PortUsb20PerPortTxPeHalf[port] =
cfg->usb2eye[port].Usb20PerPortTxPeHalf;
@@ -591,6 +598,16 @@ static void apl_fsp_silicon_init_params_cb(struct soc_intel_apollolake_config
silconfig->PortUsb20HsNpreDrvSel[port] =
cfg->usb2eye[port].Usb20HsNpreDrvSel;
}
+
+ if (cfg->usb_config_override) {
+ for (port = 0; port < APOLLOLAKE_USB3_PORT_MAX; port++) {
+ if (!cfg->usb3_port[port].enable)
+ continue;
+
+ silconfig->PortUsb30Enable[port] = 1;
+ silconfig->PortUs30bOverCurrentPin[port] = cfg->usb3_port[port].oc_pin;
+ }
+ }
#endif
}