EasyManuals Logo

Cypress EZ-USB FX3 User Manual

Cypress EZ-USB FX3
660 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #94 background imageLoading...
Page #94 background image
EZ-USB FX3 Technical Reference Manual, Document Number: 001-76074 Rev. *F 94
Universal Serial Bus (USB)
6.9.3 USB 3.0 Fallback to USB 2.0
When the USB 3.0 termination detection or link training fails, the FX3 UIB can fall back to USB 2.0 mode. The following
function implements this fallback mechanism.
static void
CyU3PUsbFallBackToUsb2 (
void)
{
CyFx3UsbWritePhyReg (0x1005, 0x0000);
/* Force the link state machine into SS.Disabled. */
USB3LNK->lnk_ltssm_state = (CY_U3P_UIB_LNK_STATE_SSDISABLED <<
CY_U3P_UIB_LTSSM_OVERRIDE_VALUE_POS) |
CY_U3P_UIB_LTSSM_OVERRIDE_EN;
/* Keep track of the number of times the 3.0 link training has failed. */
glUibDeviceInfo.tDisabledCount++;
/* Change EPM config to full speed */
CyU3PBusyWait (2);
CyU3PSetUsbCoreClock (2, 2);
CyU3PBusyWait (2);
/* Switch the EPM to USB 2.0 mode, turn off USB 3.0 PHY and remove Rx Termination. */
UIB->otg_ctrl &= ~CY_U3P_UIB_SSDEV_ENABLE;
CyU3PBusyWait (2);
UIB->otg_ctrl &= ~CY_U3P_UIB_SSEPM_ENABLE;
UIB->intr_mask &= ~(CY_U3P_UIB_DEV_CTL_INT | CY_U3P_UIB_DEV_EP_INT | CY_U3P_UIB_LNK_INT
|
CY_U3P_UIB_PROT_INT | CY_U3P_UIB_PROT_EP_INT | CY_U3P_UIB_EPM_URUN);
USB3LNK->lnk_phy_conf &= 0x1FFFFFFF;
USB3LNK->lnk_phy_mpll_status = glUsbMpllDefault;
/* Power cycle the PHY blocks. */
GCTLAON->control &= ~CY_U3P_GCTL_USB_POWER_EN;
CyU3PBusyWait (5);
GCTLAON->control |= CY_U3P_GCTL_USB_POWER_EN;
CyU3PBusyWait (10);
/* Clear USB 2.0 interrupts. */
UIB->dev_ctl_intr = 0xFFFFFFFF;
UIB->dev_ep_intr = 0xFFFFFFFF;
UIB->otg_intr = 0xFFFFFFFF;
/* Reset the EP-0 DMA channels. */
CyU3PDmaChannelReset (&glUibChHandle);
CyU3PDmaChannelReset (&glUibChHandleOut);
/* Clear and disable USB 3.0 interrupts. */
USB3LNK->lnk_intr_mask = 0x00000000;
USB3LNK->lnk_intr = 0xFFFFFFFF;
USB3PROT->prot_intr_mask = 0x00000000;
USB3PROT->prot_intr = 0xFFFFFFFF;
UIB->intr_mask |= (CY_U3P_UIB_DEV_CTL_INT | CY_U3P_UIB_DEV_EP_INT |

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Cypress EZ-USB FX3 and is the answer not in the manual?

Cypress EZ-USB FX3 Specifications

General IconGeneral
BrandCypress
ModelEZ-USB FX3
CategoryController
LanguageEnglish

Related product manuals