This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM5729: NONOS (baremetal) implementation of some xhci functions that use TIRTOS OSAL

Part Number: AM5729

Hi,

I appreciate your time reading this and I've tried to be as accurate as I can since this is a problem I've been dealing with for weeks now. your help is highly appreciated.

I noticed TI has an XHCI implementation in the processor SDK USB driver section (drv/usb/src). I'm trying to write a bare-metal simple USB application that runs on am5729 (which supports XHCI on its USB subsystem). I noticed, however, that TI uses some functions from the OSAL, which is meant for RTOS if I'm not mistaken. I know that OSAL has a NONOS implementation but as far as I could understand, it does not implement every function that the XHCI code uses from OSAL. for example, in XHCI code, shown down below, in the USBHostWrite and USBHostRead functions, there is a call to usb_osalCacheWb and usb_osalCacheWbInv. I found their implementation inside osal/src/tirtos/ but not in the osal/src/nonos/ folder (which i assume is for bare metal). I want to take advantage of this amazing piece of code(XHCI) that TI has made available for us but I do not want to use any RTOS functionalities. please help me understand how I can change the XHCI code for my application by rewriting or finding the aforementioned cache-related functions.

More info on my Application, I want to use my AM5729 in host mode and write some data through bulk out endpoint to another device. to start with, I don't want to write anything complicated and don't need any driver for HID or MS or Audio, etc. I just want to detect and configure a device attached to my USB port and write to it a few hundred hardcoded bytes using bulk transfer. 

you have made this great XHCI code available, please help me use it. 

  • can I please get a response to this? to rephrase my question, I want to know the source code (either c or assembly) of the usb_osalCacheWbInv and usb_osalCacheWb which I guess is similar to Linux clear_cache. Where can I find the source code for these three?

  • Hi Amir,

    Apologies for delay in response.

    I want to know the source code (either c or assembly) of the usb_osalCacheWbInv and usb_osalCacheWb which I guess is similar to Linux clear_cache. Where can I find the source code for these three?

     
    usb_osalCacheWb, usb_osalCacheWbInv, usb_osalCacheInvalidate are defined in usb_osal.h which maps these functions to CacheP_Inv, CacheP_wb, CacheP_wbInv which in turn are defined in osal/arch/core/<CORE>/CacheP_nonos.c which finally maps them to APIs in csl/arch/<CORE>/<V#>/csl_<CORE>Asm.asm

    So for A15 core, these source can be found in csl/arch/a15/V0/csl_a15Asm.asm as CSL_a15WbDataCache, CSL_a15WbInvDataCache and CSL_a15InvDataCache.

    Regards,
    Parth