AnsweredAssumed Answered

Is there a demo source code for peripheral sharing between Linux and FreeRTOS ?

Question asked by harish Ganesan on Feb 7, 2018
Latest reply on Feb 15, 2018 by Jas Math

I want to share a I2C device between the 2 cores( A7 and M4 ) in imx7. I am aware of the RDC permissions , which must be given to peripherals before using that peripheral . The current permissions are set with the below code in the FreeRTOS side.  

RDC_SetPdapAccess(RDC, BOARD_I2C_RDC_PDAP, ( 3 << (BOARD_DOMAIN_ID * 2) | 3 ) , true , false);

Since i have chosen to enforce the use of RDC_SEMAPHORE for peripheral sharing , Everytime i access I2C in either of the cores, i should obtain the semaphore of the particular peripheral , like this in FreeRTOS , inorder to maintain exclusive access to that particular peripheral.


These things were mentioned beautifully in an example program in the FreeRTOS BSP.


Similarly ,to use these kinds of exclusive access, is there any demo driver available to perform the same kind of operation in Linux side ? I see that there is absolutely no APIs for RDC access in linux side. I know that these are all the things that i should be taking care of in the A7 side. But is there any potential pitfalls that i should be taking care of in linux side drivers ?


If i choose to use semaphores for sharing resources, will it affect the boot of linux in anyway ? ( Will it hang the linux boot ? ).