Lines Matching refs:ehciInstance
80 static void USB_HostBandwidthFslsHostComputeCurrent(usb_host_ehci_instance_t *ehciInstance,
92 static void USB_HostBandwidthHsHostComputeCurrentFsls(usb_host_ehci_instance_t *ehciInstance,
104 static void USB_HostBandwidthHsHostComputeCurrentHsAll(usb_host_ehci_instance_t *ehciInstance,
118 static usb_status_t USB_HostBandwidthHsHostAllocateHsCommon(usb_host_ehci_instance_t *ehciInstance,
131 static usb_status_t USB_HostBandwidthHsHostAllocateInterrupt(usb_host_ehci_instance_t *ehciInstance,
142 static usb_status_t USB_HostBandwidthFslsHostAllocate(usb_host_ehci_instance_t *ehciInstance,
173 static void USB_HostEhciStartAsync(usb_host_ehci_instance_t *ehciInstance);
180 static void USB_HostEhciStopAsync(usb_host_ehci_instance_t *ehciInstance);
187 static void USB_HostEhciStartPeriodic(usb_host_ehci_instance_t *ehciInstance);
194 static void USB_HostEhciStopPeriodic(usb_host_ehci_instance_t *ehciInstance);
205 static usb_status_t USB_HostEhciQhQtdListInit(usb_host_ehci_instance_t *ehciInstance,
218 static uint32_t USB_HostEhciQtdListRelease(usb_host_ehci_instance_t *ehciInstance,
231 static usb_status_t USB_HostEhciQhQtdListDeinit(usb_host_ehci_instance_t *ehciInstance,
245 static usb_status_t USB_HostEhciTransferQtdListDeinit(usb_host_ehci_instance_t *ehciInstance,
257 static usb_status_t USB_HostEhciQhInit(usb_host_ehci_instance_t *ehciInstance, usb_host_ehci_pipe_t…
267 static usb_status_t USB_HostEhciQhDeinit(usb_host_ehci_instance_t *ehciInstance, usb_host_ehci_pipe…
277 static void USB_HostEhciAddQhToFrame(usb_host_ehci_instance_t *ehciInstance,
289 static void USB_HostEhciRemoveFromFrame(usb_host_ehci_instance_t *ehciInstance,
301 static void USB_HostEhciLinkSitd(usb_host_ehci_instance_t *ehciInstance,
312 static usb_status_t USB_HostEhciSitdArrayInit(usb_host_ehci_instance_t *ehciInstance,
325 static uint32_t USB_HostEhciSitdArrayRelease(usb_host_ehci_instance_t *ehciInstance,
338 static usb_status_t USB_HostEhciSitdArrayDeinit(usb_host_ehci_instance_t *ehciInstance,
353 static uint32_t USB_HostEhciGetItdLinkFrame(usb_host_ehci_instance_t *ehciInstance,
368 static usb_status_t USB_HostEhciItdArrayInit(usb_host_ehci_instance_t *ehciInstance,
381 static uint32_t USB_HostEhciItdArrayRelease(usb_host_ehci_instance_t *ehciInstance,
394 static usb_status_t USB_HostEhciItdArrayDeinit(usb_host_ehci_instance_t *ehciInstance,
406 static usb_status_t USB_HostEhciOpenControlBulk(usb_host_ehci_instance_t *ehciInstance,
417 static usb_status_t USB_HostEhciCloseControlBulk(usb_host_ehci_instance_t *ehciInstance,
428 static usb_status_t USB_HostEhciOpenInterrupt(usb_host_ehci_instance_t *ehciInstance,
439 static usb_status_t USB_HostEhciCloseInterrupt(usb_host_ehci_instance_t *ehciInstance,
452 static usb_status_t USB_HostEhciOpenIso(usb_host_ehci_instance_t *ehciInstance, usb_host_ehci_pipe_…
462 static usb_status_t USB_HostEhciCloseIso(usb_host_ehci_instance_t *ehciInstance, usb_host_ehci_pipe…
472 static usb_status_t USB_HostBandwidthHsHostAllocateIso(usb_host_ehci_instance_t *ehciInstance,
484 static usb_status_t USB_HostEhciResetIP(usb_host_ehci_instance_t *ehciInstance);
493 static usb_status_t USB_HostEhciStartIP(usb_host_ehci_instance_t *ehciInstance);
504 static usb_status_t USB_HostEhciCancelPipe(usb_host_ehci_instance_t *ehciInstance,
516 static usb_status_t USB_HostEhciControlBus(usb_host_ehci_instance_t *ehciInstance, uint8_t busContr…
523 void USB_HostEhciTransactionDone(usb_host_ehci_instance_t *ehciInstance);
530 static void USB_HostEhciPortChange(usb_host_ehci_instance_t *ehciInstance);
538 static void USB_HostEhciTimer0(usb_host_ehci_instance_t *ehciInstance);
547 static void USB_HostEhciTimer1(usb_host_ehci_instance_t *ehciInstance);
556 static void USB_HostEhciSuspendBus(usb_host_ehci_instance_t *ehciInstance);
563 static void USB_HostEhciResumeBus(usb_host_ehci_instance_t *ehciInstance);
647 usb_status_t USB_HostEhciTestSetMode(usb_host_ehci_instance_t *ehciInstance, uint32_t testMode) in USB_HostEhciTestSetMode() argument
651 ehciPortSC = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciTestSetMode()
654 ehciInstance->ehciIpBase->PORTSC1 = ehciPortSC; in USB_HostEhciTestSetMode()
658 static void USB_HostEhciTestSuspendResume(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciTestSuspendResume() argument
664 USB_HostEhciDelay(ehciInstance->ehciIpBase, 1000U); in USB_HostEhciTestSuspendResume()
666 USB_HostEhciSuspendBus(ehciInstance); in USB_HostEhciTestSuspendResume()
670 USB_HostEhciDelay(ehciInstance->ehciIpBase, 1000U); in USB_HostEhciTestSuspendResume()
673 USB_HostEhciResumeBus(ehciInstance); in USB_HostEhciTestSuspendResume()
681 static void USB_HostEhciTestSingleStepGetDeviceDesc(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciTestSingleStepGetDeviceDesc() argument
690 USB_HostEhciStopPeriodic(ehciInstance); in USB_HostEhciTestSingleStepGetDeviceDesc()
696 USB_HostEhciDelay(ehciInstance->ehciIpBase, 1000U); in USB_HostEhciTestSingleStepGetDeviceDesc()
700 if (USB_HostMallocTransfer(ehciInstance->hostHandle, &transfer) != kStatus_USB_Success) in USB_HostEhciTestSingleStepGetDeviceDesc()
715 transfer->callbackParam = ehciInstance->hostHandle; in USB_HostEhciTestSingleStepGetDeviceDesc()
724 static usb_status_t USB_HostEhciSingleStepQtdListInit(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciSingleStepQtdListInit() argument
743 if (qtdNumber <= ehciInstance->ehciQtdNumber) in USB_HostEhciSingleStepQtdListInit()
745 ehciInstance->ehciQtdNumber -= qtdNumber; in USB_HostEhciSingleStepQtdListInit()
751 qtdPointer->nextQtdPointer = (uint32_t)ehciInstance->ehciQtdHead; in USB_HostEhciSingleStepQtdListInit()
753 qtdPointer = ehciInstance->ehciQtdHead; in USB_HostEhciSingleStepQtdListInit()
754 ehciInstance->ehciQtdHead = (usb_host_ehci_qtd_t *)qtdPointer->nextQtdPointer; in USB_HostEhciSingleStepQtdListInit()
851 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciSingleStepQtdListInit()
857 static void USB_HostEhciTestSingleStepGetDeviceDescData(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciTestSingleStepGetDeviceDescData() argument
865 USB_HostEhciStopPeriodic(ehciInstance); in USB_HostEhciTestSingleStepGetDeviceDescData()
868 if (USB_HostMallocTransfer(ehciInstance->hostHandle, &transfer) != kStatus_USB_Success) in USB_HostEhciTestSingleStepGetDeviceDescData()
873 transfer->callbackParam = ehciInstance->hostHandle; in USB_HostEhciTestSingleStepGetDeviceDescData()
879 …USB_HostEhciSingleStepQtdListInit(ehciInstance, (usb_host_ehci_pipe_t *)(deviceInstance->controlPi… in USB_HostEhciTestSingleStepGetDeviceDescData()
884 USB_HostEhciDelay(ehciInstance->ehciIpBase, 1000U); in USB_HostEhciTestSingleStepGetDeviceDescData()
887 if (USB_HostMallocTransfer(ehciInstance->hostHandle, &transfer) != kStatus_USB_Success) in USB_HostEhciTestSingleStepGetDeviceDescData()
892 transfer->callbackParam = ehciInstance->hostHandle; in USB_HostEhciTestSingleStepGetDeviceDescData()
895 …USB_HostEhciSingleStepQtdListInit(ehciInstance, (usb_host_ehci_pipe_t *)(deviceInstance->controlPi… in USB_HostEhciTestSingleStepGetDeviceDescData()
897 if (USB_HostMallocTransfer(ehciInstance->hostHandle, &transfer) != kStatus_USB_Success) in USB_HostEhciTestSingleStepGetDeviceDescData()
902 transfer->callbackParam = ehciInstance->hostHandle; in USB_HostEhciTestSingleStepGetDeviceDescData()
905 …USB_HostEhciSingleStepQtdListInit(ehciInstance, (usb_host_ehci_pipe_t *)(deviceInstance->controlPi… in USB_HostEhciTestSingleStepGetDeviceDescData()
910 USB_HostEhciDelay(ehciInstance->ehciIpBase, 1000U); in USB_HostEhciTestSingleStepGetDeviceDescData()
922 usb_host_ehci_instance_t *ehciInstance = in USB_HostEhciTestModeInit() local
932 USB_HostEhciTestSetMode(ehciInstance, USB_HOST_EHCI_PORTSC_PTC_SE0_NAK); in USB_HostEhciTestModeInit()
935 USB_HostEhciTestSetMode(ehciInstance, USB_HOST_EHCI_PORTSC_PTC_J_STATE); in USB_HostEhciTestModeInit()
938 USB_HostEhciTestSetMode(ehciInstance, USB_HOST_EHCI_PORTSC_PTC_K_STATE); in USB_HostEhciTestModeInit()
941 USB_HostEhciTestSetMode(ehciInstance, USB_HOST_EHCI_PORTSC_PTC_PACKET); in USB_HostEhciTestModeInit()
945 USB_HostEhciTestSetMode(ehciInstance, USB_HOST_EHCI_PORTSC_PTC_FORCE_ENABLE_HS); in USB_HostEhciTestModeInit()
948 USB_HostEhciTestSuspendResume(ehciInstance); in USB_HostEhciTestModeInit()
952 USB_HostEhciTestSingleStepGetDeviceDesc(ehciInstance, deviceHandle); in USB_HostEhciTestModeInit()
956 USB_HostEhciTestSingleStepGetDeviceDescData(ehciInstance, deviceHandle); in USB_HostEhciTestModeInit()
966 static void USB_HostEhciSuspendBus(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciSuspendBus() argument
971 ehciPortSC = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciSuspendBus()
974 ehciPortSC = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciSuspendBus()
976 ehciInstance->ehciIpBase->PORTSC1 = (ehciPortSC | USBHS_PORTSC1_SUSP_MASK); in USB_HostEhciSuspendBus()
981 static void USB_HostEhciResumeBus(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciResumeBus() argument
987 ehciPortSC = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciResumeBus()
991 ehciInstance->ehciIpBase->PORTSC1 = (ehciPortSC | USBHS_PORTSC1_FPR_MASK); in USB_HostEhciResumeBus()
1060 static void USB_HostBandwidthFslsHostComputeCurrent(usb_host_ehci_instance_t *ehciInstance, in USB_HostBandwidthFslsHostComputeCurrent() argument
1069 ehciPipePointer = ehciInstance->ehciRunningPipeList; in USB_HostBandwidthFslsHostComputeCurrent()
1089 static void USB_HostBandwidthHsHostComputeCurrentFsls(usb_host_ehci_instance_t *ehciInstance, in USB_HostBandwidthHsHostComputeCurrentFsls() argument
1104 ehciPipePointer = ehciInstance->ehciRunningPipeList; in USB_HostBandwidthHsHostComputeCurrentFsls()
1162 static void USB_HostBandwidthHsHostComputeCurrentHsAll(usb_host_ehci_instance_t *ehciInstance, in USB_HostBandwidthHsHostComputeCurrentHsAll() argument
1176 ehciPipePointer = ehciInstance->ehciRunningPipeList; in USB_HostBandwidthHsHostComputeCurrentHsAll()
1258 static usb_status_t USB_HostBandwidthHsHostAllocateHsCommon(usb_host_ehci_instance_t *ehciInstance, in USB_HostBandwidthHsHostAllocateHsCommon() argument
1274 …ehciInstance, frameIndex, frameTimes); /* compute the allocated bandwidths in the frameIndex frame… in USB_HostBandwidthHsHostAllocateHsCommon()
1285 ehciInstance, frameIndex, in USB_HostBandwidthHsHostAllocateHsCommon()
1314 static usb_status_t USB_HostBandwidthHsHostAllocateIso(usb_host_ehci_instance_t *ehciInstance, in USB_HostBandwidthHsHostAllocateIso() argument
1346 …status = USB_HostBandwidthHsHostAllocateHsCommon(ehciInstance, ehciPipePointer->ufram… in USB_HostBandwidthHsHostAllocateIso()
1411 … USB_HostBandwidthHsHostComputeCurrentHsAll(ehciInstance, frameIndex, frameTimes); in USB_HostBandwidthHsHostAllocateIso()
1451 … USB_HostBandwidthHsHostComputeCurrentFsls(ehciInstance, hubNumber, frameIndex, frameTimes); in USB_HostBandwidthHsHostAllocateIso()
1545 static usb_status_t USB_HostBandwidthHsHostAllocateInterrupt(usb_host_ehci_instance_t *ehciInstance, in USB_HostBandwidthHsHostAllocateInterrupt() argument
1577 …status = USB_HostBandwidthHsHostAllocateHsCommon(ehciInstance, ehciPipePointer->ufram… in USB_HostBandwidthHsHostAllocateInterrupt()
1640 … USB_HostBandwidthHsHostComputeCurrentFsls(ehciInstance, hubNumber, frameIndex, frameTimes); in USB_HostBandwidthHsHostAllocateInterrupt()
1655 … USB_HostBandwidthHsHostComputeCurrentHsAll(ehciInstance, frameIndex, frameTimes); in USB_HostBandwidthHsHostAllocateInterrupt()
1717 static usb_status_t USB_HostBandwidthFslsHostAllocate(usb_host_ehci_instance_t *ehciInstance, in USB_HostBandwidthFslsHostAllocate() argument
1743 USB_HostBandwidthFslsHostComputeCurrent(ehciInstance, frameIndex, &frameTime); in USB_HostBandwidthFslsHostAllocate()
1841 static void USB_HostEhciStartAsync(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciStartAsync() argument
1845 if (0U == (ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_AS_MASK)) in USB_HostEhciStartAsync()
1850 stateSync = ((ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_AS_MASK) | in USB_HostEhciStartAsync()
1851 (ehciInstance->ehciIpBase->USBCMD & USBHS_USBCMD_ASE_MASK)); in USB_HostEhciStartAsync()
1854 …ehciInstance->ehciIpBase->ASYNCLISTADDR = (uint32_t)USB_HOST_MEMORY_CPU_2_DMA(ehciInstance->shedFi… in USB_HostEhciStartAsync()
1856 ehciInstance->ehciIpBase->ASYNCLISTADDR = (uint32_t)(ehciInstance->shedFirstQh); in USB_HostEhciStartAsync()
1858 ehciInstance->ehciIpBase->USBCMD |= USBHS_USBCMD_ASE_MASK; in USB_HostEhciStartAsync()
1859 while (0U == (ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_AS_MASK)) in USB_HostEhciStartAsync()
1865 static void USB_HostEhciStopAsync(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciStopAsync() argument
1872 stateSync = ((ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_AS_MASK) | in USB_HostEhciStopAsync()
1873 (ehciInstance->ehciIpBase->USBCMD & USBHS_USBCMD_ASE_MASK)); in USB_HostEhciStopAsync()
1876 …ehciInstance->ehciIpBase->USBCMD &= (uint32_t)(~(uint32_t)USBHS_USBCMD_ASE_MASK); /* disable async… in USB_HostEhciStopAsync()
1877 while (0U != (ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_AS_MASK)) in USB_HostEhciStopAsync()
1882 static void USB_HostEhciStartPeriodic(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciStartPeriodic() argument
1886 if (0U == (ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_PS_MASK)) in USB_HostEhciStartPeriodic()
1891 stateSync = ((ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_PS_MASK) | in USB_HostEhciStartPeriodic()
1892 (ehciInstance->ehciIpBase->USBCMD & USBHS_USBCMD_PSE_MASK)); in USB_HostEhciStartPeriodic()
1895 …ehciInstance->ehciIpBase->PERIODICLISTBASE = (uint32_t)USB_HOST_MEMORY_CPU_2_DMA(ehciInstance->ehc… in USB_HostEhciStartPeriodic()
1897 ehciInstance->ehciIpBase->PERIODICLISTBASE = (uint32_t)(ehciInstance->ehciFrameList); in USB_HostEhciStartPeriodic()
1899 if (0U == (ehciInstance->ehciIpBase->USBCMD & USBHS_USBCMD_PSE_MASK)) in USB_HostEhciStartPeriodic()
1901 ehciInstance->ehciIpBase->USBCMD |= USBHS_USBCMD_PSE_MASK; /* start periodic schedule */ in USB_HostEhciStartPeriodic()
1903 while (0U == (ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_PS_MASK)) in USB_HostEhciStartPeriodic()
1910 static void USB_HostEhciStopPeriodic(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciStopPeriodic() argument
1917 stateSync = ((ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_PS_MASK) | in USB_HostEhciStopPeriodic()
1918 (ehciInstance->ehciIpBase->USBCMD & USBHS_USBCMD_PSE_MASK)); in USB_HostEhciStopPeriodic()
1921 ehciInstance->ehciIpBase->USBCMD &= (~USBHS_USBCMD_PSE_MASK); /* stop periodic schedule */ in USB_HostEhciStopPeriodic()
1922 while (0U != (ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_PS_MASK)) in USB_HostEhciStopPeriodic()
1927 static usb_status_t USB_HostEhciQhQtdListInit(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciQhQtdListInit() argument
1970 if (qtdNumber <= ehciInstance->ehciQtdNumber) in USB_HostEhciQhQtdListInit()
1972 ehciInstance->ehciQtdNumber -= (uint8_t)qtdNumber; in USB_HostEhciQhQtdListInit()
1973 BaseQtdPointer = ehciInstance->ehciQtdHead; in USB_HostEhciQhQtdListInit()
1980 … qtdPointer->nextQtdPointer = (uint32_t)USB_HOST_MEMORY_CPU_2_DMA(ehciInstance->ehciQtdHead); in USB_HostEhciQhQtdListInit()
1982 qtdPointer->nextQtdPointer = (uint32_t)ehciInstance->ehciQtdHead; in USB_HostEhciQhQtdListInit()
1985 qtdPointer = ehciInstance->ehciQtdHead; in USB_HostEhciQhQtdListInit()
1987 …ehciInstance->ehciQtdHead = (usb_host_ehci_qtd_t *)USB_HOST_MEMORY_DMA_2_CPU(qtdPointer->nextQtdPo… in USB_HostEhciQhQtdListInit()
1989 ehciInstance->ehciQtdHead = (usb_host_ehci_qtd_t *)qtdPointer->nextQtdPointer; in USB_HostEhciQhQtdListInit()
1994 if (ehciInstance->ehciQtdNumber == 0U) in USB_HostEhciQhQtdListInit()
1996 ehciInstance->ehciQtdTail = NULL; in USB_HostEhciQhQtdListInit()
2198 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciQhQtdListInit()
2204 static uint32_t USB_HostEhciQtdListRelease(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciQtdListRelease() argument
2230 if (ehciInstance->ehciQtdNumber == 0U) in USB_HostEhciQtdListRelease()
2232 ehciInstance->ehciQtdHead = ehciQtdStart; in USB_HostEhciQtdListRelease()
2233 ehciInstance->ehciQtdTail = ehciQtdEnd; in USB_HostEhciQtdListRelease()
2237 ehciInstance->ehciQtdTail->nextQtdPointer = (uint32_t)ehciQtdStart; in USB_HostEhciQtdListRelease()
2238 ehciInstance->ehciQtdTail = ehciQtdEnd; in USB_HostEhciQtdListRelease()
2243 ehciInstance->ehciQtdNumber++; in USB_HostEhciQtdListRelease()
2250 ehciInstance->ehciQtdNumber++; in USB_HostEhciQtdListRelease()
2256 static usb_status_t USB_HostEhciQhQtdListDeinit(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciQhQtdListDeinit() argument
2301 USB_HostEhciStopAsync(ehciInstance); in USB_HostEhciQhQtdListDeinit()
2308 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciQhQtdListDeinit()
2323 … USB_HostEhciQtdListRelease(ehciInstance, (usb_host_ehci_qtd_t *)(transfer->union1.unitHead), in USB_HostEhciQhQtdListDeinit()
2336 static usb_status_t USB_HostEhciTransferQtdListDeinit(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciTransferQtdListDeinit() argument
2367 USB_HostEhciStopAsync(ehciInstance); in USB_HostEhciTransferQtdListDeinit()
2373 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciTransferQtdListDeinit()
2427 USB_HostEhciQtdListRelease(ehciInstance, (usb_host_ehci_qtd_t *)(transfer->union1.unitHead), in USB_HostEhciTransferQtdListDeinit()
2445 static usb_status_t USB_HostEhciQhInit(usb_host_ehci_instance_t *ehciInstance, usb_host_ehci_pipe_t… in USB_HostEhciQhInit() argument
2458 if (ehciInstance->ehciQhList != NULL) in USB_HostEhciQhInit()
2460 qhPointer = (usb_host_ehci_qh_t *)ehciInstance->ehciQhList; in USB_HostEhciQhInit()
2461 ehciInstance->ehciQhList = in USB_HostEhciQhInit()
2462 …(usb_host_ehci_qh_t *)(ehciInstance->ehciQhList->horizontalLinkPointer & EHCI_HOST_POINTER_ADDRESS… in USB_HostEhciQhInit()
2550 static usb_status_t USB_HostEhciQhDeinit(usb_host_ehci_instance_t *ehciInstance, usb_host_ehci_pipe… in USB_HostEhciQhDeinit() argument
2556 (void)USB_HostEhciQhQtdListDeinit(ehciInstance, ehciPipePointer); in USB_HostEhciQhDeinit()
2560 qhPointer->horizontalLinkPointer = (uint32_t)ehciInstance->ehciQhList; in USB_HostEhciQhDeinit()
2561 ehciInstance->ehciQhList = qhPointer; in USB_HostEhciQhDeinit()
2567 static void USB_HostEhciAddQhToFrame(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciAddQhToFrame() argument
2580 temp = (void *)ehciInstance->ehciFrameList; in USB_HostEhciAddQhToFrame()
2629 static void USB_HostEhciRemoveFromFrame(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciRemoveFromFrame() argument
2637 temp = (void *)ehciInstance->ehciFrameList; in USB_HostEhciRemoveFromFrame()
2671 static void USB_HostEhciLinkSitd(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciLinkSitd() argument
2690 … currentFrame = ((ehciInstance->ehciIpBase->FRINDEX & USB_HOST_EHCI_MAX_MICRFRAME_VALUE) >> 3U); in USB_HostEhciLinkSitd()
2712 … currentFrame = ((ehciInstance->ehciIpBase->FRINDEX & USB_HOST_EHCI_MAX_MICRFRAME_VALUE) >> 3U); in USB_HostEhciLinkSitd()
2761 temp = (void *)ehciInstance->ehciFrameList; in USB_HostEhciLinkSitd()
2773 … sitdPointer = &(ehciInstance->ehciSitdIndexBase[sitdPointer->nextSitdIndex]); /* next sitd */ in USB_HostEhciLinkSitd()
2790 static usb_status_t USB_HostEhciSitdArrayInit(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciSitdArrayInit() argument
2814 if (ehciInstance->ehciSitdNumber >= sitdNumber) in USB_HostEhciSitdArrayInit()
2816 sitdPointer = ehciInstance->ehciSitdList; in USB_HostEhciSitdArrayInit()
2822 ehciInstance->ehciSitdIndexBase); in USB_HostEhciSitdArrayInit()
2827 … ehciInstance->ehciSitdList = (usb_host_ehci_sitd_t *)(sitdPointer->nextLinkPointer & 0xFFFFFFFEU); in USB_HostEhciSitdArrayInit()
2828 ehciInstance->ehciSitdNumber -= (uint8_t)sitdNumber; in USB_HostEhciSitdArrayInit()
2868 if (ehciInstance->firstDeviceSpeed == USB_SPEED_HIGH) in USB_HostEhciSitdArrayInit()
2887 sitdPointer = (ehciInstance->ehciSitdIndexBase + sitdPointer->nextSitdIndex); in USB_HostEhciSitdArrayInit()
2912 USB_HostEhciLinkSitd(ehciInstance, ehciPipePointer, (void *)temp); in USB_HostEhciSitdArrayInit()
2917 static uint32_t USB_HostEhciSitdArrayRelease(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciSitdArrayRelease() argument
2929 USB_HostEhciRemoveFromFrame(ehciInstance, (uint32_t)sitdPointer, in USB_HostEhciSitdArrayRelease()
2935 …sitdPointer->nextLinkPointer = (((uint32_t)ehciInstance->ehciSitdList) | EHCI_HOST_T_INVALID_VALUE… in USB_HostEhciSitdArrayRelease()
2936 ehciInstance->ehciSitdList = sitdPointer; in USB_HostEhciSitdArrayRelease()
2937 ehciInstance->ehciSitdNumber++; in USB_HostEhciSitdArrayRelease()
2945 sitdPointer = &(ehciInstance->ehciSitdIndexBase[sitdPointer->nextSitdIndex]); in USB_HostEhciSitdArrayRelease()
2951 static usb_status_t USB_HostEhciSitdArrayDeinit(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciSitdArrayDeinit() argument
2970 transfer->transferLength - USB_HostEhciSitdArrayRelease(ehciInstance, in USB_HostEhciSitdArrayDeinit()
2984 static uint32_t USB_HostEhciGetItdLinkFrame(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciGetItdLinkFrame() argument
3000 currentUframe = (ehciInstance->ehciIpBase->FRINDEX & USB_HOST_EHCI_MAX_MICRFRAME_VALUE); in USB_HostEhciGetItdLinkFrame()
3035 currentUframe = (ehciInstance->ehciIpBase->FRINDEX & USB_HOST_EHCI_MAX_MICRFRAME_VALUE); in USB_HostEhciGetItdLinkFrame()
3054 static usb_status_t USB_HostEhciItdArrayInit(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciItdArrayInit() argument
3088 if (maxItdNumber > ehciInstance->ehciItdNumber) in USB_HostEhciItdArrayInit()
3112 ehciInstance, isoPointer->lastLinkFrame, in USB_HostEhciItdArrayInit()
3122 itdHead = ehciInstance->ehciItdList; in USB_HostEhciItdArrayInit()
3126 tmpItdPointer = ehciInstance->ehciItdList; in USB_HostEhciItdArrayInit()
3131 ehciInstance->ehciItdList = (usb_host_ehci_itd_t *)tmpItdPointer->nextItdPointer; in USB_HostEhciItdArrayInit()
3132 ehciInstance->ehciItdNumber -= 1U; in USB_HostEhciItdArrayInit()
3208 void *temp = (void *)ehciInstance->ehciFrameList; in USB_HostEhciItdArrayInit()
3254 static uint32_t USB_HostEhciItdArrayRelease(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciItdArrayRelease() argument
3272 USB_HostEhciRemoveFromFrame(ehciInstance, (uint32_t)itdPointer, in USB_HostEhciItdArrayRelease()
3280 itdPointer->nextItdPointer = (usb_host_ehci_itd_t *)ehciInstance->ehciItdList; in USB_HostEhciItdArrayRelease()
3281 ehciInstance->ehciItdList = itdPointer; in USB_HostEhciItdArrayRelease()
3282 ehciInstance->ehciItdNumber++; in USB_HostEhciItdArrayRelease()
3295 static usb_status_t USB_HostEhciItdArrayDeinit(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciItdArrayDeinit() argument
3315 …doneLength = USB_HostEhciItdArrayRelease(ehciInstance, (usb_host_ehci_itd_t *)transfer->union1.uni… in USB_HostEhciItdArrayDeinit()
3335 static usb_status_t USB_HostEhciOpenControlBulk(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciOpenControlBulk() argument
3343 …if (USB_HostEhciQhInit(ehciInstance, ehciPipePointer) != kStatus_USB_Success) /* initialize contro… in USB_HostEhciOpenControlBulk()
3353 (uint32_t)USB_HOST_MEMORY_CPU_2_DMA(ehciInstance->shedFirstQh->horizontalLinkPointer); in USB_HostEhciOpenControlBulk()
3355 ehciInstance->shedFirstQh->horizontalLinkPointer = (convert_addr | EHCI_HOST_POINTER_TYPE_QH); in USB_HostEhciOpenControlBulk()
3357 …qhPointer->horizontalLinkPointer = ehciInstance->shedFirstQh->horizontalLinkPointe… in USB_HostEhciOpenControlBulk()
3358 …ehciInstance->shedFirstQh->horizontalLinkPointer = ((uint32_t)qhPointer | EHCI_HOST_POINTER_TYPE_Q… in USB_HostEhciOpenControlBulk()
3364 static usb_status_t USB_HostEhciCloseControlBulk(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciCloseControlBulk() argument
3377 …convert_addr = (uint32_t)USB_HOST_MEMORY_DMA_2_CPU(ehciInstance->shedFirstQh->horizontalLinkPointe… in USB_HostEhciCloseControlBulk()
3380 if ((ehciInstance->shedFirstQh->horizontalLinkPointer & EHCI_HOST_POINTER_ADDRESS_MASK) == in USB_HostEhciCloseControlBulk()
3385 USB_HostEhciStopAsync(ehciInstance); in USB_HostEhciCloseControlBulk()
3386 ehciInstance->shedFirstQh->horizontalLinkPointer = in USB_HostEhciCloseControlBulk()
3388 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciCloseControlBulk()
3394 vltPrevQhPointer = ehciInstance->shedFirstQh; in USB_HostEhciCloseControlBulk()
3404 … ((horizontalLinkValue & EHCI_HOST_POINTER_ADDRESS_MASK) == (uint32_t)ehciInstance->shedFirstQh)) in USB_HostEhciCloseControlBulk()
3419 USB_HostEhciStopAsync(ehciInstance); in USB_HostEhciCloseControlBulk()
3422 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciCloseControlBulk()
3428 … return USB_HostEhciQhDeinit(ehciInstance, ehciPipePointer); /* de-initialize qh and release qh */ in USB_HostEhciCloseControlBulk()
3431 static usb_status_t USB_HostEhciOpenInterrupt(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciOpenInterrupt() argument
3439 if (ehciInstance->firstDeviceSpeed == USB_SPEED_HIGH) in USB_HostEhciOpenInterrupt()
3441 …status = USB_HostBandwidthHsHostAllocateInterrupt(ehciInstance, ehciPipePointer); /* host works as… in USB_HostEhciOpenInterrupt()
3445 status = USB_HostBandwidthFslsHostAllocate(ehciInstance, in USB_HostEhciOpenInterrupt()
3453 if (USB_HostEhciQhInit(ehciInstance, ehciPipePointer) != kStatus_USB_Success) in USB_HostEhciOpenInterrupt()
3463 …USB_HostEhciAddQhToFrame(ehciInstance, (uint32_t)temp, (uint16_t)frameIndex, ehciPipePointer->ufra… in USB_HostEhciOpenInterrupt()
3469 static usb_status_t USB_HostEhciCloseInterrupt(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciCloseInterrupt() argument
3479 USB_HostEhciRemoveFromFrame(ehciInstance, (uint32_t)temp, (uint16_t)frameIndex); in USB_HostEhciCloseInterrupt()
3484 return USB_HostEhciQhDeinit(ehciInstance, ehciPipePointer); /* de-initilaze qh and release qh */ in USB_HostEhciCloseInterrupt()
3490 static usb_status_t USB_HostEhciOpenIso(usb_host_ehci_instance_t *ehciInstance, usb_host_ehci_pipe_… in USB_HostEhciOpenIso() argument
3495 if (ehciInstance->firstDeviceSpeed == USB_SPEED_HIGH) in USB_HostEhciOpenIso()
3498 … ehciInstance, ehciPipePointer); /* allocate iso bandwidth when host works as high-speed */ in USB_HostEhciOpenIso()
3503 …ehciInstance, ehciPipePointer); /* allocate iso bandwidth when host works as full-speed or low-spe… in USB_HostEhciOpenIso()
3512 if (ehciInstance->ehciIsoList == NULL) in USB_HostEhciOpenIso()
3517 isoPointer = ehciInstance->ehciIsoList; in USB_HostEhciOpenIso()
3518 ehciInstance->ehciIsoList = ehciInstance->ehciIsoList->next; in USB_HostEhciOpenIso()
3526 static usb_status_t USB_HostEhciCloseIso(usb_host_ehci_instance_t *ehciInstance, usb_host_ehci_pipe… in USB_HostEhciCloseIso() argument
3540 …(void)USB_HostEhciItdArrayDeinit(ehciInstance, ehciPipePointer); /* de-initialize itd list and fre… in USB_HostEhciCloseIso()
3546 (void)USB_HostEhciSitdArrayDeinit(ehciInstance, in USB_HostEhciCloseIso()
3554 isoPointer->next = ehciInstance->ehciIsoList; in USB_HostEhciCloseIso()
3555 ehciInstance->ehciIsoList = isoPointer; in USB_HostEhciCloseIso()
3562 static usb_status_t USB_HostEhciResetIP(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciResetIP() argument
3565 ehciInstance->ehciIpBase->USBCMD = USBHS_USBCMD_RST_MASK; in USB_HostEhciResetIP()
3566 while (0U != (ehciInstance->ehciIpBase->USBCMD & USBHS_USBCMD_RST_MASK)) in USB_HostEhciResetIP()
3571 ehciInstance->ehciIpBase->USBMODE |= 0x03U; in USB_HostEhciResetIP()
3573 ehciInstance->ehciIpBase->USBMODE |= (0x03U | (0x01U << USBHS_USBMODE_ES_SHIFT)); in USB_HostEhciResetIP()
3576 if (0U == (ehciInstance->ehciIpBase->HCCPARAMS & USBHS_HCCPARAMS_PFL_MASK)) in USB_HostEhciResetIP()
3588 static usb_status_t USB_HostEhciStartIP(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciStartIP() argument
3592 …if (0U != (ehciInstance->ehciIpBase->HCSPARAMS & USBHS_HCSPARAMS_PPC_MASK)) /* Ports have power po… in USB_HostEhciStartIP()
3595 tmp = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciStartIP()
3597 ehciInstance->ehciIpBase->PORTSC1 = (tmp | USBHS_PORTSC1_PP_MASK); /* turn on port power */ in USB_HostEhciStartIP()
3601 if (0U != (ehciInstance->ehciIpBase->HCCPARAMS & USBHS_HCCPARAMS_PFL_MASK)) in USB_HostEhciStartIP()
3604 ehciInstance->ehciIpBase->USBCMD |= (USBHS_USBCMD_FS2_MASK); in USB_HostEhciStartIP()
3606 ehciInstance->ehciIpBase->USBCMD |= (0x00U << USBHS_USBCMD_FS_SHIFT); in USB_HostEhciStartIP()
3608 ehciInstance->ehciIpBase->USBCMD |= (0x01U << USBHS_USBCMD_FS_SHIFT); in USB_HostEhciStartIP()
3610 ehciInstance->ehciIpBase->USBCMD |= (0x02U << USBHS_USBCMD_FS_SHIFT); in USB_HostEhciStartIP()
3612 ehciInstance->ehciIpBase->USBCMD |= (0x03U << USBHS_USBCMD_FS_SHIFT); in USB_HostEhciStartIP()
3616 ehciInstance->ehciIpBase->USBCMD |= (0x00U << USBHS_USBCMD_FS_SHIFT); in USB_HostEhciStartIP()
3618 ehciInstance->ehciIpBase->USBCMD |= (0x01U << USBHS_USBCMD_FS_SHIFT); in USB_HostEhciStartIP()
3620 ehciInstance->ehciIpBase->USBCMD |= (0x02U << USBHS_USBCMD_FS_SHIFT); in USB_HostEhciStartIP()
3622 ehciInstance->ehciIpBase->USBCMD |= (0x03U << USBHS_USBCMD_FS_SHIFT); in USB_HostEhciStartIP()
3627 ehciInstance->ehciIpBase->USBCMD &= ~USBHS_USBCMD_ITC_MASK; in USB_HostEhciStartIP()
3629 ehciInstance->ehciIpBase->USBCMD |= USBHS_USBCMD_RS_MASK; in USB_HostEhciStartIP()
3631 ehciInstance->ehciIpBase->GPTIMER0LD = (100U * 1000U - 1U); /* 100ms */ in USB_HostEhciStartIP()
3635 ehciInstance->ehciIpBase->USBINTR |= (0x1000037U); in USB_HostEhciStartIP()
3640 static usb_status_t USB_HostEhciCancelPipe(usb_host_ehci_instance_t *ehciInstance, in USB_HostEhciCancelPipe() argument
3680 … (void)USB_HostEhciQhQtdListDeinit(ehciInstance, ehciPipePointer); /* release all the qtd */ in USB_HostEhciCancelPipe()
3684 (void)USB_HostEhciTransferQtdListDeinit(ehciInstance, ehciPipePointer, transfer); in USB_HostEhciCancelPipe()
3702 … (void)USB_HostEhciItdArrayDeinit(ehciInstance, ehciPipePointer); /* de-initialize itd */ in USB_HostEhciCancelPipe()
3708 … (void)USB_HostEhciSitdArrayDeinit(ehciInstance, ehciPipePointer); /* de-initialize sitd */ in USB_HostEhciCancelPipe()
3722 static usb_status_t USB_HostEhciControlBus(usb_host_ehci_instance_t *ehciInstance, uint8_t busContr… in USB_HostEhciControlBus() argument
3731 portScRegister = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciControlBus()
3733 ehciInstance->ehciIpBase->PORTSC1 = (portScRegister | USBHS_PORTSC1_PR_MASK); in USB_HostEhciControlBus()
3734 while (0U != (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_PR_MASK)) in USB_HostEhciControlBus()
3740 ehciInstance->deviceAttached = (uint8_t)kEHCIDeviceDetached; in USB_HostEhciControlBus()
3741 …ehciInstance->ehciIpBase->USBINTR |= (USBHS_USBINTR_PCE_MASK); /* enable ehci port change interrup… in USB_HostEhciControlBus()
3745 if (ehciInstance->deviceAttached == (uint8_t)kEHCIDeviceDetached) in USB_HostEhciControlBus()
3747 …ehciInstance->ehciIpBase->USBINTR |= (USBHS_USBINTR_PCE_MASK); /* enable ehci port change interrup… in USB_HostEhciControlBus()
3752 …ehciInstance->ehciIpBase->USBINTR &= (~USBHS_USBINTR_PCE_MASK); /* disable ehci port change interr… in USB_HostEhciControlBus()
3756 if (0U != (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_CCS_MASK)) in USB_HostEhciControlBus()
3759 ehciInstance->ehciIpBase->GPTIMER1LD = (1 * 1000); /* 1ms */ in USB_HostEhciControlBus()
3760 ehciInstance->ehciIpBase->GPTIMER1CTL |= in USB_HostEhciControlBus()
3763 USB_HostEhciStopAsync(ehciInstance); in USB_HostEhciControlBus()
3764 USB_HostEhciStopPeriodic(ehciInstance); in USB_HostEhciControlBus()
3766 … while (0U != (ehciInstance->ehciIpBase->USBSTS & (USBHS_USBSTS_PS_MASK | USBHS_USBSTS_AS_MASK))) in USB_HostEhciControlBus()
3770 ehciInstance->ehciIpBase->PORTSC1 &= ~USBHS_PORTSC1_WKCN_MASK; in USB_HostEhciControlBus()
3771 ehciInstance->ehciIpBase->PORTSC1 |= USBHS_PORTSC1_WKDS_MASK; in USB_HostEhciControlBus()
3772 … ehciInstance->ehciIpBase->PORTSC1 |= (USBHS_PORTSC1_SUSP_MASK); /* Suspend the device */ in USB_HostEhciControlBus()
3776 ehciInstance->matchTick = 0U; in USB_HostEhciControlBus()
3777 ehciInstance->ehciIpBase->USBINTR |= (USBHS_USBINTR_TIE1_MASK); in USB_HostEhciControlBus()
3778 ehciInstance->busSuspendStatus = kBus_EhciStartSuspend; in USB_HostEhciControlBus()
3786 ehciInstance->ehciIpBase->PORTSC1 &= ~(USBHS_PORTSC1_SUSP_MASK); /* Clear Suspend bit */ in USB_HostEhciControlBus()
3787 ehciInstance->ehciIpBase->PORTSC1 &= ~USBHS_PORTSC1_PHCD_MASK; in USB_HostEhciControlBus()
3788 if (ehciInstance->deviceAttached != (uint8_t)kEHCIDeviceDetached) in USB_HostEhciControlBus()
3790 ehciInstance->busSuspendStatus = kBus_EhciStartResume; in USB_HostEhciControlBus()
3792 ehciInstance->registerNcBase->USB_OTGn_CTRL &= ~USBNC_USB_OTGn_CTRL_WIE_MASK; in USB_HostEhciControlBus()
3796 ehciInstance->ehciIpBase->USBGENCTRL &= ~USBHS_USBGENCTRL_WU_IE_MASK; in USB_HostEhciControlBus()
3799 ehciInstance->ehciIpBase->USBCMD |= (USBHS_USBCMD_RS_MASK); in USB_HostEhciControlBus()
3800 … ehciInstance->ehciIpBase->PORTSC1 |= (USBHS_PORTSC1_FPR_MASK); /* Resume the device */ in USB_HostEhciControlBus()
3815 void USB_HostEhciTransactionDone(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciTransactionDone() argument
3842 ehciPipePointer = ehciInstance->ehciRunningPipeList; /* check all the running pipes */ in USB_HostEhciTransactionDone()
3864 … USB_HostEhciQtdListRelease(ehciInstance, (usb_host_ehci_qtd_t *)(transfer->union1.unitHead), in USB_HostEhciTransactionDone()
3900 ehciClearPipePointer = ehciInstance->ehciRunningPipeList; in USB_HostEhciTransactionDone()
3984 ehciInstance, (usb_host_ehci_qtd_t *)(transfer->union1.unitHead), in USB_HostEhciTransactionDone()
4039 dataLength = USB_HostEhciItdArrayRelease(ehciInstance, in USB_HostEhciTransactionDone()
4065 ehciInstance, (usb_host_ehci_sitd_t *)transfer->union1.unitHead, in USB_HostEhciTransactionDone()
4098 static void USB_HostEhciPortChange(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciPortChange() argument
4101 uint32_t portScRegister = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciPortChange()
4108 sofStart = (ehciInstance->ehciIpBase->FRINDEX & EHCI_MAX_UFRAME_VALUE); in USB_HostEhciPortChange()
4113 portScRegister = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciPortChange()
4117 portScRegister = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciPortChange()
4119 ehciInstance->ehciIpBase->PORTSC1 = (portScRegister | USBHS_PORTSC1_CSC_MASK); in USB_HostEhciPortChange()
4121 sofCount = (ehciInstance->ehciIpBase->FRINDEX & EHCI_MAX_UFRAME_VALUE); in USB_HostEhciPortChange()
4131 portScRegister = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciPortChange()
4134 if ((ehciInstance->deviceAttached == (uint8_t)kEHCIDevicePhyAttached) || in USB_HostEhciPortChange()
4135 (ehciInstance->deviceAttached == (uint8_t)kEHCIDeviceAttached)) in USB_HostEhciPortChange()
4140 ehciInstance->busSuspendStatus = kBus_EhciIdle; in USB_HostEhciPortChange()
4141 ehciInstance->ehciIpBase->USBINTR &= ~(USBHS_USBINTR_TIE1_MASK); in USB_HostEhciPortChange()
4145 USB_HostEhciDelay(ehciInstance->ehciIpBase, 1); in USB_HostEhciPortChange()
4146 if (0U == (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_CCS_MASK)) in USB_HostEhciPortChange()
4153 ehciInstance->deviceAttached = (uint8_t)kEHCIDeviceDetached; in USB_HostEhciPortChange()
4157 portScRegister = ehciInstance->ehciIpBase->PORTSC1; in USB_HostEhciPortChange()
4159 ehciInstance->ehciIpBase->PORTSC1 = (portScRegister | USBHS_PORTSC1_PR_MASK); in USB_HostEhciPortChange()
4160 while (0U != (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_PR_MASK)) in USB_HostEhciPortChange()
4163 ehciInstance->firstDeviceSpeed = in USB_HostEhciPortChange()
4164 …(uint8_t)((ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_PSPD_MASK) >> USBHS_PORTSC1_PSPD_SHIF… in USB_HostEhciPortChange()
4167 if (ehciInstance->firstDeviceSpeed == USB_SPEED_HIGH) in USB_HostEhciPortChange()
4169 USB_EhcihostPhyDisconnectDetectCmd(ehciInstance->controllerId, 1); in USB_HostEhciPortChange()
4174 USB_HostEhciDelay(ehciInstance->ehciIpBase, USB_HOST_EHCI_PORT_RESET_DELAY); in USB_HostEhciPortChange()
4176 (void)OSA_EventSet(ehciInstance->taskEventHandle, EHCI_TASK_EVENT_DEVICE_ATTACH); in USB_HostEhciPortChange()
4178 ehciInstance->ehciIpBase->GPTIMER0CTL |= in USB_HostEhciPortChange()
4180 ehciInstance->deviceAttached = (uint8_t)kEHCIDevicePhyAttached; in USB_HostEhciPortChange()
4184 if ((ehciInstance->deviceAttached == (uint8_t)kEHCIDevicePhyAttached) || in USB_HostEhciPortChange()
4185 (ehciInstance->deviceAttached == (uint8_t)kEHCIDeviceAttached)) in USB_HostEhciPortChange()
4188 ehciInstance->busSuspendStatus = kBus_EhciIdle; in USB_HostEhciPortChange()
4189 ehciInstance->ehciIpBase->USBINTR &= ~(USBHS_USBINTR_TIE1_MASK); in USB_HostEhciPortChange()
4193 USB_EhcihostPhyDisconnectDetectCmd(ehciInstance->controllerId, 0); in USB_HostEhciPortChange()
4197 USB_HostEhciStopAsync(ehciInstance); in USB_HostEhciPortChange()
4198 USB_HostEhciStopPeriodic(ehciInstance); in USB_HostEhciPortChange()
4200 (void)OSA_EventSet(ehciInstance->taskEventHandle, EHCI_TASK_EVENT_DEVICE_DETACH); in USB_HostEhciPortChange()
4205 static void USB_HostEhciTimer0(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciTimer0() argument
4215 usb_host_ehci_pipe_t *ehciPipePointer = ehciInstance->ehciRunningPipeList; in USB_HostEhciTimer0()
4230 if (ehciInstance->deviceAttached != (uint8_t)kEHCIDeviceAttached) in USB_HostEhciTimer0()
4275 USB_HostEhciStopAsync(ehciInstance); in USB_HostEhciTimer0()
4279 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciTimer0()
4286 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciTimer0()
4326 … USB_HostEhciQtdListRelease(ehciInstance, (usb_host_ehci_qtd_t *)(transfer->union1.unitHead), in USB_HostEhciTimer0()
4349 static void USB_HostEhciTimer1(usb_host_ehci_instance_t *ehciInstance) in USB_HostEhciTimer1() argument
4351 if (ehciInstance->deviceAttached != (uint8_t)kEHCIDeviceDetached) in USB_HostEhciTimer1()
4353 if (kBus_EhciStartSuspend == ehciInstance->busSuspendStatus) in USB_HostEhciTimer1()
4355 usb_host_instance_t *hostPointer = (usb_host_instance_t *)ehciInstance->hostHandle; in USB_HostEhciTimer1()
4357 if (0U == ehciInstance->matchTick) in USB_HostEhciTimer1()
4359 ehciInstance->matchTick = hostPointer->hwTick; in USB_HostEhciTimer1()
4363 if ((hostPointer->hwTick - ehciInstance->matchTick) >= 5U) in USB_HostEhciTimer1()
4365 ehciInstance->ehciIpBase->USBCMD &= ~USBHS_USBCMD_RS_MASK; in USB_HostEhciTimer1()
4366 ehciInstance->ehciIpBase->USBSTS |= USBHS_USBSTS_SRI_MASK; in USB_HostEhciTimer1()
4369 ehciInstance->registerPhyBase->CTRL |= USBPHY_CTRL_ENVBUSCHG_WKUP_MASK in USB_HostEhciTimer1()
4377 ehciInstance->registerPhyBase->USB1_VBUS_DETECT_SET |= in USB_HostEhciTimer1()
4380 ehciInstance->ehciIpBase->PORTSC1 |= USBHS_PORTSC1_PHCD_MASK; in USB_HostEhciTimer1()
4382 ehciInstance->registerPhyBase->PWD = 0xFFFFFFFFU; in USB_HostEhciTimer1()
4384 … while (0U != (ehciInstance->registerPhyBase->CTRL & (USBPHY_CTRL_UTMI_SUSPENDM_MASK))) in USB_HostEhciTimer1()
4390 … ehciInstance->registerNcBase->USB_OTGn_CTRL |= USBNC_USB_OTGn_CTRL_WKUP_ID_EN_MASK | in USB_HostEhciTimer1()
4393 ehciInstance->registerNcBase->USB_OTGn_CTRL |= USBNC_USB_OTGn_CTRL_WIE_MASK; in USB_HostEhciTimer1()
4397 ehciInstance->ehciIpBase->USBGENCTRL = USBHS_USBGENCTRL_WU_IE_MASK; in USB_HostEhciTimer1()
4401 ehciInstance->registerPhyBase->CTRL |= USBPHY_CTRL_CLKGATE_MASK; in USB_HostEhciTimer1()
4405 ehciInstance->busSuspendStatus = kBus_EhciSuspended; in USB_HostEhciTimer1()
4409 else if (kBus_EhciStartResume == ehciInstance->busSuspendStatus) in USB_HostEhciTimer1()
4411 usb_host_instance_t *hostPointer = (usb_host_instance_t *)ehciInstance->hostHandle; in USB_HostEhciTimer1()
4412 if (0U == (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_FPR_MASK)) in USB_HostEhciTimer1()
4414 ehciInstance->ehciIpBase->PORTSC1 &= ~USBHS_PORTSC1_WKDS_MASK; in USB_HostEhciTimer1()
4415 if (0U != (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_CCS_MASK)) in USB_HostEhciTimer1()
4418 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciTimer1()
4419 USB_HostEhciStartPeriodic(ehciInstance); in USB_HostEhciTimer1()
4425 ehciInstance->busSuspendStatus = kBus_EhciIdle; in USB_HostEhciTimer1()
4426 ehciInstance->ehciIpBase->USBINTR &= ~(USBHS_USBINTR_TIE1_MASK); in USB_HostEhciTimer1()
4435 ehciInstance->busSuspendStatus = kBus_EhciIdle; in USB_HostEhciTimer1()
4436 ehciInstance->ehciIpBase->USBINTR &= ~(USBHS_USBINTR_TIE1_MASK); in USB_HostEhciTimer1()
4447 usb_host_ehci_instance_t *ehciInstance; in USB_HostEhciCreate() local
4464 ehciInstance = (usb_host_ehci_instance_t *)OSA_MemoryAllocate( in USB_HostEhciCreate()
4466 if (ehciInstance == NULL) in USB_HostEhciCreate()
4470 ehciInstance->controllerId = controllerId; in USB_HostEhciCreate()
4471 ehciInstance->hostHandle = upperLayerHandle; in USB_HostEhciCreate()
4472 ehciInstance->deviceAttached = (uint8_t)kEHCIDeviceDetached; in USB_HostEhciCreate()
4473 ehciInstance->ehciIpBase = (USBHS_Type *) in USB_HostEhciCreate()
4476 ehciInstance->busSuspendStatus = kBus_EhciIdle; in USB_HostEhciCreate()
4480 ehciInstance->registerPhyBase = (USBPHY_Type *)USB_EhciPhyGetBase(controllerId); in USB_HostEhciCreate()
4483 ehciInstance->registerNcBase = (USBNC_Type *)USB_EhciNCGetBase(controllerId); in USB_HostEhciCreate()
4490 if ((USB_HostEhciResetIP(ehciInstance) != kStatus_USB_Success) || in USB_HostEhciCreate()
4491 ((ehciInstance->controllerId < (uint8_t)kUSB_ControllerEhci0))) /* reset ehci ip */ in USB_HostEhciCreate()
4493 OSA_MemoryFree(ehciInstance); in USB_HostEhciCreate()
4502 ehciInstance->ehciFrameList = &s_UsbHostEhciFrameList1[0]; in USB_HostEhciCreate()
4509 ehciInstance->ehciFrameList = &s_UsbHostEhciFrameList1[0]; in USB_HostEhciCreate()
4515 ehciInstance->ehciFrameList = &s_UsbHostEhciFrameList2[0]; in USB_HostEhciCreate()
4522 if (ehciInstance->ehciFrameList == NULL) in USB_HostEhciCreate()
4524 OSA_MemoryFree(ehciInstance); in USB_HostEhciCreate()
4538 ehciInstance->ehciUnitBase = (uint32_t *)(temp); in USB_HostEhciCreate()
4540 ehciInstance->ehciQhList = (usb_host_ehci_qh_t *)((uint32_t)(ehciInstance->ehciUnitBase)); in USB_HostEhciCreate()
4541 ehciInstance->ehciQtdHead = (usb_host_ehci_qtd_t *)((uint32_t)ehciInstance->ehciQhList + in USB_HostEhciCreate()
4543 ehciInstance->ehciItdList = (usb_host_ehci_itd_t *)((uint32_t)ehciInstance->ehciQtdHead + in USB_HostEhciCreate()
4549 index = ((((((uint32_t)(ehciInstance->ehciItdList)) + 4095U) & 0xFFFFF000U) - in USB_HostEhciCreate()
4550 ((uint32_t)(ehciInstance->ehciItdList))) >> in USB_HostEhciCreate()
4554 …ehciInstance->ehciItdList = (usb_host_ehci_itd_t *)(((uint32_t)(ehciInstance->ehciItdList)) + 32U); in USB_HostEhciCreate()
4557 ehciInstance->ehciSitdIndexBase = in USB_HostEhciCreate()
4558 (usb_host_ehci_sitd_t *)((uint32_t)ehciInstance->ehciItdList + in USB_HostEhciCreate()
4560 ehciInstance->ehciSitdList = ehciInstance->ehciSitdIndexBase; in USB_HostEhciCreate()
4561 ehciInstance->ehciIsoList = (usb_host_ehci_iso_t *)((uint32_t)ehciInstance->ehciSitdList + in USB_HostEhciCreate()
4563 ehciInstance->ehciPipeIndexBase = in USB_HostEhciCreate()
4564 (usb_host_ehci_pipe_t *)((uint32_t)ehciInstance->ehciIsoList + in USB_HostEhciCreate()
4568 …ehciInstance->ehciQhList[index - 1U].horizontalLinkPointer = (uint32_t)(&ehciInstance->ehciQhList[… in USB_HostEhciCreate()
4570 ehciInstance->ehciQhList[USB_HOST_CONFIG_EHCI_MAX_QH - 1U].horizontalLinkPointer = 0U; in USB_HostEhciCreate()
4573 …ehciInstance->ehciQtdHead[index - 1U].nextQtdPointer = (uint32_t)(&ehciInstance->ehciQtdHead[index… in USB_HostEhciCreate()
4575 …ehciInstance->ehciQtdNumber = USB_HOST_CONFIG_EHCI… in USB_HostEhciCreate()
4576 ehciInstance->ehciQtdHead[USB_HOST_CONFIG_EHCI_MAX_QTD - 1U].nextQtdPointer = 0U; in USB_HostEhciCreate()
4577 ehciInstance->ehciQtdTail = &ehciInstance->ehciQtdHead[USB_HOST_CONFIG_EHCI_MAX_QTD - 1U]; in USB_HostEhciCreate()
4582 ehciInstance->ehciItdList[index - 1U].nextItdPointer = in USB_HostEhciCreate()
4583 (usb_host_ehci_itd_t *)(&ehciInstance->ehciItdList[index]); in USB_HostEhciCreate()
4585 …ehciInstance->ehciItdNumber = USB_HOST_CONFIG_EHCI… in USB_HostEhciCreate()
4586 ehciInstance->ehciItdList[USB_HOST_CONFIG_EHCI_MAX_ITD - 1U].nextItdPointer = NULL; in USB_HostEhciCreate()
4592 …ehciInstance->ehciSitdList[index - 1U].nextLinkPointer = (uint32_t)(&ehciInstance->ehciSitdList[in… in USB_HostEhciCreate()
4594 …ehciInstance->ehciSitdNumber = USB_HOST_CONFIG_E… in USB_HostEhciCreate()
4595 ehciInstance->ehciSitdList[USB_HOST_CONFIG_EHCI_MAX_SITD - 1U].nextLinkPointer = 0U; in USB_HostEhciCreate()
4601 ehciInstance->ehciIsoList[index - 1U].next = &ehciInstance->ehciIsoList[index]; in USB_HostEhciCreate()
4603 ehciInstance->ehciIsoList[USB_HOST_EHCI_ISO_NUMBER - 1U].next = NULL; in USB_HostEhciCreate()
4607 ehciInstance->ehciPipeList = ehciInstance->ehciPipeIndexBase; in USB_HostEhciCreate()
4610 …temp = (void *)&ehciInstance->ehciPipeList[index… in USB_HostEhciCreate()
4611 ehciInstance->ehciPipeList[index - 1U].pipeCommon.next = (usb_host_pipe_t *)temp; in USB_HostEhciCreate()
4614 ehciInstance->ehciMutex = (osa_mutex_handle_t)(&ehciInstance->mutexBuffer[0]); in USB_HostEhciCreate()
4615 osaStatus = OSA_MutexCreate(ehciInstance->ehciMutex); in USB_HostEhciCreate()
4621 OSA_MemoryFree(ehciInstance); in USB_HostEhciCreate()
4625 ehciInstance->taskEventHandle = (osa_event_handle_t)&ehciInstance->taskEventHandleBuffer[0]; in USB_HostEhciCreate()
4626 osaStatus = OSA_EventCreate(ehciInstance->taskEventHandle, 1); in USB_HostEhciCreate()
4632 (void)OSA_MutexDestroy(ehciInstance->ehciMutex); in USB_HostEhciCreate()
4633 OSA_MemoryFree(ehciInstance); in USB_HostEhciCreate()
4638 ehciInstance->shedFirstQh = ehciInstance->ehciQhList; in USB_HostEhciCreate()
4639 ehciInstance->ehciQhList = in USB_HostEhciCreate()
4640 …(usb_host_ehci_qh_t *)(ehciInstance->ehciQhList->horizontalLinkPointer & EHCI_HOST_POINTER_ADDRESS… in USB_HostEhciCreate()
4641 …ehciInstance->shedFirstQh->staticEndpointStates[0] |= (1UL << EHCI_HOST_QH_H_SHIFT); /* first qh */ in USB_HostEhciCreate()
4642 ehciInstance->shedFirstQh->horizontalLinkPointer = EHCI_HOST_T_INVALID_VALUE; in USB_HostEhciCreate()
4643 ehciInstance->shedFirstQh->currentQtdPointer = EHCI_HOST_T_INVALID_VALUE; in USB_HostEhciCreate()
4644 ehciInstance->shedFirstQh->nextQtdPointer = EHCI_HOST_T_INVALID_VALUE; in USB_HostEhciCreate()
4645 ehciInstance->shedFirstQh->alternateNextQtdPointer = EHCI_HOST_T_INVALID_VALUE; in USB_HostEhciCreate()
4646 ehciInstance->shedFirstQh->horizontalLinkPointer = in USB_HostEhciCreate()
4647 (uint32_t)((uint32_t)(ehciInstance->shedFirstQh) | EHCI_HOST_POINTER_TYPE_QH); in USB_HostEhciCreate()
4650 temp = (void *)ehciInstance->ehciFrameList; in USB_HostEhciCreate()
4657 (void)USB_HostEhciStartIP(ehciInstance); /* start ehci ip */ in USB_HostEhciCreate()
4659 *controllerHandle = ehciInstance; in USB_HostEhciCreate()
4666 usb_host_ehci_instance_t *ehciInstance = (usb_host_ehci_instance_t *)controllerHandle; in USB_HostEhciDestory() local
4669 ehciInstance->ehciIpBase->USBINTR = 0; in USB_HostEhciDestory()
4671 ehciInstance->ehciIpBase->USBCMD = 0; in USB_HostEhciDestory()
4674 if (ehciInstance->ehciFrameList == &s_UsbHostEhciFrameList1[0]) in USB_HostEhciDestory()
4679 if (ehciInstance->ehciFrameList == &s_UsbHostEhciFrameList1[0]) in USB_HostEhciDestory()
4683 else if (ehciInstance->ehciFrameList == &s_UsbHostEhciFrameList2[0]) in USB_HostEhciDestory()
4692 (void)OSA_MutexDestroy(ehciInstance->ehciMutex); in USB_HostEhciDestory()
4693 (void)OSA_EventDestroy(ehciInstance->taskEventHandle); in USB_HostEhciDestory()
4694 OSA_MemoryFree(ehciInstance); in USB_HostEhciDestory()
4706 usb_host_ehci_instance_t *ehciInstance = (usb_host_ehci_instance_t *)controllerHandle; in USB_HostEhciOpenPipe() local
4710 if (ehciInstance->ehciPipeList != NULL) in USB_HostEhciOpenPipe()
4712 ehciPipePointer = ehciInstance->ehciPipeList; in USB_HostEhciOpenPipe()
4714 ehciInstance->ehciPipeList = (usb_host_ehci_pipe_t *)temp; in USB_HostEhciOpenPipe()
4782 status = USB_HostEhciOpenControlBulk(ehciInstance, ehciPipePointer); in USB_HostEhciOpenPipe()
4788 status = USB_HostEhciOpenIso(ehciInstance, ehciPipePointer); in USB_HostEhciOpenPipe()
4793 status = USB_HostEhciOpenInterrupt(ehciInstance, ehciPipePointer); in USB_HostEhciOpenPipe()
4805 temp = (void *)ehciInstance->ehciPipeList; in USB_HostEhciOpenPipe()
4807 ehciInstance->ehciPipeList = ehciPipePointer; in USB_HostEhciOpenPipe()
4814 temp = (void *)ehciInstance->ehciRunningPipeList; in USB_HostEhciOpenPipe()
4816 ehciInstance->ehciRunningPipeList = ehciPipePointer; in USB_HostEhciOpenPipe()
4825 usb_host_ehci_instance_t *ehciInstance = (usb_host_ehci_instance_t *)controllerHandle; in USB_HostEhciClosePipe() local
4835 (void)USB_HostEhciCloseControlBulk(ehciInstance, ehciPipePointer); in USB_HostEhciClosePipe()
4839 (void)USB_HostEhciCloseInterrupt(ehciInstance, ehciPipePointer); in USB_HostEhciClosePipe()
4845 (void)USB_HostEhciCloseIso(ehciInstance, ehciPipePointer); in USB_HostEhciClosePipe()
4856 temp = (void *)ehciInstance->ehciRunningPipeList; in USB_HostEhciClosePipe()
4862 ehciInstance->ehciRunningPipeList = (usb_host_ehci_pipe_t *)(temp); in USB_HostEhciClosePipe()
4884 temp = (void *)ehciInstance->ehciPipeList; in USB_HostEhciClosePipe()
4886 ehciInstance->ehciPipeList = ehciPipePointer; in USB_HostEhciClosePipe()
4896 usb_host_ehci_instance_t *ehciInstance = (usb_host_ehci_instance_t *)controllerHandle; in USB_HostEhciWritePipe() local
4909 status = USB_HostEhciQhQtdListInit(ehciInstance, ehciPipePointer, in USB_HostEhciWritePipe()
4921 status = USB_HostEhciItdArrayInit(ehciInstance, ehciPipePointer, in USB_HostEhciWritePipe()
4928 status = USB_HostEhciSitdArrayInit(ehciInstance, ehciPipePointer, in USB_HostEhciWritePipe()
4952 usb_host_ehci_instance_t *ehciInstance = (usb_host_ehci_instance_t *)controllerHandle; in USB_HostEhciIoctl() local
4967 …status = USB_HostEhciCancelPipe(ehciInstance, (usb_host_ehci_pipe_t *)param->pipeHandle, param->tr… in USB_HostEhciIoctl()
4971 status = USB_HostEhciControlBus(ehciInstance, *((uint8_t *)ioctlParam)); in USB_HostEhciIoctl()
4975 … *((uint32_t *)ioctlParam) = ((ehciInstance->ehciIpBase->FRINDEX & EHCI_MAX_UFRAME_VALUE) >> 3); in USB_HostEhciIoctl()
4985 USB_HostEhciDelay(ehciInstance->ehciIpBase, 2U); in USB_HostEhciIoctl()
4992 if (0U != (ehciInstance->ehciIpBase->USBSTS & USBHS_USBSTS_AS_MASK)) in USB_HostEhciIoctl()
4994 USB_HostEhciStopAsync(ehciInstance); in USB_HostEhciIoctl()
4999 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciIoctl()
5024 usb_host_ehci_instance_t *ehciInstance; in USB_HostEhciTaskFunction() local
5032 … ehciInstance = (usb_host_ehci_instance_t *)((usb_host_instance_t *)hostHandle)->controllerHandle; in USB_HostEhciTaskFunction()
5034 if (OSA_EventWait(ehciInstance->taskEventHandle, 0xFF, 0, USB_OSA_WAIT_TIMEOUT, &bitSet) == in USB_HostEhciTaskFunction()
5039 USB_HostEhciPortChange(ehciInstance); in USB_HostEhciTaskFunction()
5044 USB_HostEhciTimer0(ehciInstance); in USB_HostEhciTaskFunction()
5050 USB_HostEhciTimer1(ehciInstance); in USB_HostEhciTaskFunction()
5054 if ((ehciInstance->deviceAttached == (uint8_t)kEHCIDeviceAttached)) in USB_HostEhciTaskFunction()
5058 USB_HostEhciTransactionDone(ehciInstance); in USB_HostEhciTaskFunction()
5063 ehciInstance->ehciIpBase->USBINTR &= in USB_HostEhciTaskFunction()
5065 ehciInstance->deviceAttached = (uint8_t)kEHCIDeviceDetached; in USB_HostEhciTaskFunction()
5066 (void)USB_HostDetachDevice(ehciInstance->hostHandle, 0, 0); in USB_HostEhciTaskFunction()
5069 else if (ehciInstance->deviceAttached != (uint8_t)kEHCIDeviceAttached) in USB_HostEhciTaskFunction()
5074 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciTaskFunction()
5075 USB_HostEhciStartPeriodic(ehciInstance); in USB_HostEhciTaskFunction()
5078 … if (USB_HostAttachDevice(ehciInstance->hostHandle, ehciInstance->firstDeviceSpeed, 0, 0, 1, in USB_HostEhciTaskFunction()
5081 ehciInstance->deviceAttached = (uint8_t)kEHCIDeviceAttached; in USB_HostEhciTaskFunction()
5094 usb_host_ehci_instance_t *ehciInstance; in USB_HostEhciIsrFunction() local
5102 … ehciInstance = (usb_host_ehci_instance_t *)((usb_host_instance_t *)hostHandle)->controllerHandle; in USB_HostEhciIsrFunction()
5107 if (0U != (ehciInstance->registerNcBase->USB_OTGn_CTRL & USBNC_USB_OTGn_CTRL_WIE_MASK)) in USB_HostEhciIsrFunction()
5109 usb_host_instance_t *hostPointer = (usb_host_instance_t *)ehciInstance->hostHandle; in USB_HostEhciIsrFunction()
5110 ehciInstance->registerNcBase->USB_OTGn_CTRL &= ~USBNC_USB_OTGn_CTRL_WIE_MASK; in USB_HostEhciIsrFunction()
5114 …while (0U == (ehciInstance->registerNcBase->USB_OTGn_PHY_CTRL_0 & USBNC_USB_OTGn_PHY_CTRL_0_UTMI_C… in USB_HostEhciIsrFunction()
5118 if (0U != (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_CCS_MASK)) in USB_HostEhciIsrFunction()
5120 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciIsrFunction()
5121 USB_HostEhciStartPeriodic(ehciInstance); in USB_HostEhciIsrFunction()
5123 ehciInstance->ehciIpBase->USBCMD |= (USBHS_USBCMD_RS_MASK); in USB_HostEhciIsrFunction()
5124 if ((kBus_EhciSuspended == ehciInstance->busSuspendStatus)) in USB_HostEhciIsrFunction()
5127 ehciInstance->busSuspendStatus = kBus_EhciStartResume; in USB_HostEhciIsrFunction()
5141 if (0U != (ehciInstance->ehciIpBase->USBGENCTRL & USBHS_USBGENCTRL_WU_IE_MASK)) in USB_HostEhciIsrFunction()
5143 usb_host_instance_t *hostPointer = (usb_host_instance_t *)ehciInstance->hostHandle; in USB_HostEhciIsrFunction()
5151 ehciInstance->ehciIpBase->USBGENCTRL |= USBHS_USBGENCTRL_WU_INT_CLR_MASK; in USB_HostEhciIsrFunction()
5152 ehciInstance->ehciIpBase->USBGENCTRL &= ~USBHS_USBGENCTRL_WU_IE_MASK; in USB_HostEhciIsrFunction()
5153 if (0U != (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_CCS_MASK)) in USB_HostEhciIsrFunction()
5155 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciIsrFunction()
5156 USB_HostEhciStartPeriodic(ehciInstance); in USB_HostEhciIsrFunction()
5158 ehciInstance->ehciIpBase->USBCMD |= (USBHS_USBCMD_RS_MASK); in USB_HostEhciIsrFunction()
5159 if ((kBus_EhciSuspended == ehciInstance->busSuspendStatus)) in USB_HostEhciIsrFunction()
5161 ehciInstance->busSuspendStatus = kBus_EhciStartResume; in USB_HostEhciIsrFunction()
5177 interruptStatus = ehciInstance->ehciIpBase->USBSTS; in USB_HostEhciIsrFunction()
5178 interruptStatus &= ehciInstance->ehciIpBase->USBINTR; in USB_HostEhciIsrFunction()
5181 ehciInstance->ehciIpBase->USBSTS = interruptStatus; /* clear interrupt */ in USB_HostEhciIsrFunction()
5194 (void)OSA_EventSet(ehciInstance->taskEventHandle, EHCI_TASK_EVENT_TRANSACTION_DONE); in USB_HostEhciIsrFunction()
5200 usb_host_instance_t *hostPointer = (usb_host_instance_t *)ehciInstance->hostHandle; in USB_HostEhciIsrFunction()
5201 if (0U != (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_FPR_MASK)) in USB_HostEhciIsrFunction()
5203 if (kBus_EhciStartSuspend == ehciInstance->busSuspendStatus) in USB_HostEhciIsrFunction()
5205 if (0U != (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_CCS_MASK)) in USB_HostEhciIsrFunction()
5207 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciIsrFunction()
5208 USB_HostEhciStartPeriodic(ehciInstance); in USB_HostEhciIsrFunction()
5213 ehciInstance->busSuspendStatus = kBus_EhciIdle; in USB_HostEhciIsrFunction()
5214 ehciInstance->ehciIpBase->USBINTR &= ~(USBHS_USBINTR_TIE1_MASK); in USB_HostEhciIsrFunction()
5222 if ((kBus_EhciSuspended == ehciInstance->busSuspendStatus)) in USB_HostEhciIsrFunction()
5224 usb_host_instance_t *hostPointer = (usb_host_instance_t *)ehciInstance->hostHandle; in USB_HostEhciIsrFunction()
5233 if (0U != (ehciInstance->ehciIpBase->PORTSC1 & USBHS_PORTSC1_CCS_MASK)) in USB_HostEhciIsrFunction()
5235 USB_HostEhciStartAsync(ehciInstance); in USB_HostEhciIsrFunction()
5236 USB_HostEhciStartPeriodic(ehciInstance); in USB_HostEhciIsrFunction()
5238 ehciInstance->ehciIpBase->USBCMD |= (USBHS_USBCMD_RS_MASK); in USB_HostEhciIsrFunction()
5239 ehciInstance->busSuspendStatus = kBus_EhciStartResume; in USB_HostEhciIsrFunction()
5243 (void)OSA_EventSet(ehciInstance->taskEventHandle, EHCI_TASK_EVENT_PORT_CHANGE); in USB_HostEhciIsrFunction()
5248 (void)OSA_EventSet(ehciInstance->taskEventHandle, EHCI_TASK_EVENT_TIMER0); in USB_HostEhciIsrFunction()
5254 (void)OSA_EventSet(ehciInstance->taskEventHandle, EHCI_TASK_EVENT_TIMER1); in USB_HostEhciIsrFunction()
5258 interruptStatus = ehciInstance->ehciIpBase->USBSTS; in USB_HostEhciIsrFunction()
5259 interruptStatus &= ehciInstance->ehciIpBase->USBINTR; in USB_HostEhciIsrFunction()