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.

DRA750: nonsecure callback/RPC from PPA secure FIQ handler

Part Number: DRA750


Hi,

I'm running a FIQ handler in PPA - secure mode.

On the same core, we have non-secure Linux running, and there is a handler entry which needs to be called from secure FIQ handler.

I failed to find any examples how to do that.

In general, it must be possible since ROM code supports RPC handlers in Non-Secure privileged mode (which matches our Kernel code).

Regards,

Jürgen

  • HI

    can you clarify on the intended usage for FIQ, what peripheral is hooked up as FIQ and how do you intend to use this

    Dont think we have an usage example for what you have outlined above, will check again once if you can share more details on the intended usage with PPA and how you want the notification to be dispatched and handled from Linux

  • Hi Sriram,

    FIQ interrupts are generated by PMU, intended use is as poor man's NMI to detect hard lockup condition in kernel.

    I have a Linux kernel patch (by Linaro, can provide details if requested) which sets up watchdig events by PMU, and uses FIQ as NMI replacement to detect lockup condition, and provide backtrace of the locked core.

    Thus we have an interrupt (FIQ) handler in kernel which ais supposed to acknowledge the interrupt on PMU, and do kernel bookkeeping.

    I get as far as registering the interrupt in PPA, and registering a FIQ handler (inside PPA). This handler is being called.

    However, up to now I failed to call the kernel handler code from PPA FIQ callback.

    Hope this explanation helps.

    Regards,

    Jürgen

  • Hi Jürgen,

    So you are now trying to signal the non-secure side from the secure side? Would it be easier for you print the backtrace from the secure side?

    I'm not immediately familiar with the "ROM code RPC handlers" but you you should be able to setup the non-secure handler context and exception-return to it, although I do not have a specific example matching your use-case on hand.

    Andrew

  • Hi Andrew,

    thank you for your response.

    I attempted to "manually" switch to non-secure mode and then call my handler code. Return to secure mode will happen via SMC instruction.

    Unfortunately, I had to learn that it's not so easy to switch from secure mode to non-secure mode, sunce the code (in PPA) is running in secure memory, and after setting the "NS" bit, fetching the next instruction fails and the machine locks up :(

    I also experimented with the more-or-less documented calls to register a RPC ("API_HAL_TASK_MGR_RPCINIT") and to call a RPC ("API_USR_PA_TASK_MGR_RPCCALLSTART").

    Registering appears to work, but whenever I try to call an RPC, I end up at very strange places in code - but yes, somehow the MPU switches to non-secure mode. In the end, MPU typically stops with "invalid instruction" and PC=0x00000000 :(

    Any advice is highly appreciated.

    Regards,

    Jürgen

  • Hi

    we have not exercised this path - i am trying to check if we can have additional suggestions from our side

  • Jürgen

    I  checked, and we have not tried this path before and dont think i have any additional pointers to make progress.

    Is this still blocking your work or have you been able to get around it

  • Hi Sriram,

    thank you for you response, even if it's not the kind I was hoping for. BTW: I got almost identical reply from your colleague Daniel Allred.

    And yes, I'm still stuck with my attempts to get the hard lockup detection working. 

    I achieved to set up the timer, and receive the FIQ in the secure world (i.e. PPA), but I completely failed to have related the Linux code to handle the FIQ executed (in non-secure world).

    Regards,

    Jürgen

  • HI

    I have tried checking further on this.

    Much of the references that i could get seem to point to early work done by linaro to enable FIQ handling support for  armv7a - but havent seen updates towards this in the recent past.

    We havent been able to verify or enable this feature on TI platforms - at this stage i am afraid dont have any additional inputs to help your cause

  • Hi

    Dont have additional inputs nor immediate plans to enable FIQ handling support - though we will follow-up closely with any updates in the mainline kernel for such support.

    Will mark this as closed for now