AnsweredAssumed Answered

i.MX28 Errata ENGR119653 ARM to USB Write Issue Windows CE

Question asked by markwilliams on Feb 17, 2015
Latest reply on Jun 10, 2015 by markwilliams

Hi all,


Since starting work with the i.MX28 processor we have encountered various issues with the USB support under the Windows CE 6.0 BSP. Just recently I have managed to port a few Microsoft updates into the cloned USB driver in the BSP which has helped, however we have recently found out that a chip errata (ENGR119653) is not implemented in the Freescale CE 6.0 BSP and there are no patches available.


This issue affects the USB under certain circumstances when writing to the USB registers ( The fix is to use the ARM SWP instruction to write to the register rather than directly access it.


We have found that under Linux they have released a patch which changes a main register write inline function for the EHCI driver: LKML: Kamal Mostafa: [PATCH 3.8 059/124] usb: ehci: add freescale imx28 special write register method


I have been looking into the Windows CE driver and how it accesses the registers. In the chw.h file (C:\WINCE600\PLATFORM\COMMON\SRC\SOC\COMMON_FSL_V2_PDK1_9\MS\USBH\EHCI\chw.h) there are a number of inline functions declared that are used to read/write the USB host controller registers, namely:


inline void Write_USBCMD( IN const USBCMD data )

inline void Write_USBSTS( IN const USBSTS data )

inline void Write_USBINTR( IN const USBINTR data )

inline void Write_FRINDEX( IN const FRINDEX data )

inline void Write_EHCIRegister(IN ULONG const Index, IN ULONG const data)

inline void Write_PORTSC( IN const UINT port, IN const PORTSC data )

inline void Write_TXFILLTUNING(IN const TXFILLTUNING data)


These all make use of WRITE_REGISTER_ULONG() Windows CE built-in function that compiles as basic register copies in assembly.


To perform the errata I would need to use the SWP instruction as per the Linux fix so I may just be able to redefine WRITE_REGISTER_ULONG() in this module, or edit each of the implementations. However, I believe Windows CE does not support inline assembly in C code. To achieve this fix I would need a seperate assembly file to call into from the C file.


I am therefore wondering if anyone has implemented this fix or could help with an assembly file that would perform a register write as per the Linux patch linked above. I am also slightly concerned that there may be other accesses of the hardware outside of the chw.c file not covered by the above functions but my 'find in files' has not revealed any as of yet.


Thank you in advance, Mark