From 6704049fc911eba9f4e6dc36a916eccffd04a15e Mon Sep 17 00:00:00 2001 From: Maxim Polyakov Date: Sun, 16 Feb 2020 11:51:57 +0300 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/38815 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/soc/intel/apollolake/include/soc/usb.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/soc/intel/apollolake/include') diff --git a/src/soc/intel/apollolake/include/soc/usb.h b/src/soc/intel/apollolake/include/soc/usb.h index 28cad37f58..11dec48eb6 100644 --- a/src/soc/intel/apollolake/include/soc/usb.h +++ b/src/soc/intel/apollolake/include/soc/usb.h @@ -21,6 +21,12 @@ #include #define APOLLOLAKE_USB2_PORT_MAX 8 +#define APOLLOLAKE_USB3_PORT_MAX 6 + +struct usb_port_config { + uint8_t enable; + uint8_t oc_pin; +}; struct usb2_eye_per_port { uint8_t Usb20PerPortTxPeHalf; @@ -33,4 +39,21 @@ struct usb2_eye_per_port { uint8_t Usb20OverrideEn; }; +/* USB overcurrent pins definition */ +enum { + OC0 = 0, + OC1 = 1, + OC_SKIP = 2, +}; + +#define PORT_EN(pin) { \ + .enable = 1, \ + .oc_pin = (pin), \ +} + +#define PORT_DIS { \ + .enable = 0, \ + .oc_pin = OC_SKIP, \ +} + #endif /* _SOC_APOLLOLAKE_USB_H_ */ -- cgit v1.2.3