usb: dwc3-msm: Fix SuperSpeed when SuperSpeedPlus is supported

On DWC 3.1 IP, maximum_speed may be USB_SPEED_SUPER_PLUS. There
are several places where this value is using an equals comparison
with USB_SPEED_SUPER, which will fail when speed is SSP, hence
avoiding sequence needed to allow SuperSpeed operation. The
comparisons should be changed from == to >=.

Change-Id: Id43290379f1977ef181756ca77f43b3bb5d277d7
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: Mayank Rana <mrana@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 783bfc4..0fc5788 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -158,12 +158,8 @@
 	int		retries = 1000;
 	int		ret;
 
-	/* Reset PHYs */
+	/* Reset and initialize PHYs */
 	usb_phy_reset(dwc->usb2_phy);
-
-	if (dwc->maximum_speed == USB_SPEED_SUPER)
-		usb_phy_reset(dwc->usb3_phy);
-
 	ret = usb_phy_init(dwc->usb2_phy);
 	if (ret) {
 		pr_err("%s: usb_phy_init(dwc->usb2_phy) returned %d\n",
@@ -171,9 +167,10 @@
 		return ret;
 	}
 
-	if (dwc->maximum_speed == USB_SPEED_HIGH)
+	if (dwc->maximum_speed <= USB_SPEED_HIGH)
 		goto generic_phy_init;
 
+	usb_phy_reset(dwc->usb3_phy);
 	ret = usb_phy_init(dwc->usb3_phy);
 	if (ret == -EBUSY) {
 		/*
@@ -796,7 +793,7 @@
 	/* Handle USB2.0-only core configuration */
 	if (DWC3_GHWPARAMS3_SSPHY_IFC(dwc->hwparams.hwparams3) ==
 			DWC3_GHWPARAMS3_SSPHY_IFC_DIS) {
-		if (dwc->maximum_speed == USB_SPEED_SUPER)
+		if (dwc->maximum_speed >= USB_SPEED_SUPER)
 			dwc->maximum_speed = USB_SPEED_HIGH;
 	}