Error in usb_host_ehci.c

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error in usb_host_ehci.c

579 Views
mjbcswitzerland
Specialist V

Hi

I would suggest that this code fails when the user selects any value of
USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE
that is not 1024:

    /* set frame list size */
    if (ehciInstance->ehciIpBase->HCCPARAMS & USBHS_HCCPARAMS_PFL_MASK)
    {
#if (USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE <= 64)
        ehciInstance->ehciIpBase->USBCMD |= (USBHS_USBCMD_FS2_MASK);
#if (USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE == 64)
        ehciInstance->ehciIpBase->USBCMD |= (0x00 << USBHS_USBCMD_FS_SHIFT);
#elif(USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE == 32)
        ehciInstance->ehciIpBase->USBCMD |= (0x01 << USBHS_USBCMD_FS_SHIFT);
#elif(USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE == 16)
        ehciInstance->ehciIpBase->USBCMD |= (0x02 << USBHS_USBCMD_FS_SHIFT);
#elif(USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE == 8)
        ehciInstance->ehciIpBase->USBCMD |= (0x03 << USBHS_USBCMD_FS_SHIFT);
#endif
#else
#if (USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE == 1024)
        ehciInstance->ehciIpBase->USBCMD |= (0x00 << USBHS_USBCMD_FS_SHIFT);
#elif(USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE == 512)
        ehciInstance->ehciIpBase->USBCMD |= (0x01 << USBHS_USBCMD_FS_SHIFT);
#elif(USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE == 256)
        ehciInstance->ehciIpBase->USBCMD |= (0x02 << USBHS_USBCMD_FS_SHIFT);
#elif(USB_HOST_CONFIG_EHCI_FRAME_LIST_SIZE == 128)
        ehciInstance->ehciIpBase->USBCMD |= (0x03 << USBHS_USBCMD_FS_SHIFT);
#endif
#endif
    }

    /* start the controller */
    ehciInstance->ehciIpBase->USBCMD = USBHS_USBCMD_RS_MASK;

Line 17 is redundant

and

line 29 overwrites whatever else could have been set.

Regards

Mark

Labels (1)
0 Kudos
2 Replies

432 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Mark,

Internal team has confirmed there is an issue here. It'll be reported to the SW team. Thanks a lot for your feedback again.

Best regards,

Felipe

0 Kudos

432 Views
FelipeGarcia
NXP Employee
NXP Employee

Hi Mark,

 

Thanks for sharing your feedback with us. I have sent your comments internally.

 

Best regards,

Felipe

0 Kudos