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.

Linux/AM5728: Mailbox usage example

Part Number: AM5728


Tool/software: Linux

I am working on a Linux driver that will read from a shared memory address (a CMEM block of memory shared with the DSPs) upon reception of a mailbox event. This is an alternative to using IPC MessageQ due to performance issues (see https://e2e.ti.com/support/arm/sitara_arm/f/791/t/604259#pi316653=2

I'm looking for any examples or pointers to the best way to do this. I'm looking at the linux/drivers/remoteproc/omap_remoteproc.c example in how it interacts with a mailbox. I'm looking for the most surgical way to have a generic custom shared memory read/write driver utilize as much existing code as possible to accomplish my need. Essentially I just need interrupt-like behavior from the mailbox - it will indicate to the driver that data is available from the DSP in this shared memory buffer.

Thanks

  • Hi Gerard,

    Did you search for mailbox client example in the Linuc kernel documentation at:
    www.kernel.org/.../mailbox.txt

    BR
    Tsvetolin Shulev
  • Cvetolin Shulev-XID said:

    Did you search for mailbox client example in the Linuc kernel documentation at:
    www.kernel.org/.../mailbox.txt

    I looked that over and see the mailbox usage in the remote processor driver code. What I was hoping to get some guidance on was how to write a custom driver that worked in concert with the remote processor driver. Specifically, the remote processor driver knows which mailbox to use depending on whether you're using DSP 1 or DSP 2 (pulled from the device tree). My custom driver needs this information as well so it can use the right mailbox for sending an interrupt to the right remote processor (DSP).

    Essentially the use cases for the custom driver are:

    • ARM writes data to shared (CMEM) buffer for DSP 1 or DSP 2 (predetermined memory address)
      1. Data is written to shared buffer
      2. Mailbox message is sent using the appropriate mailbox to DSP 1 or DSP 2
    • ARM reads data from shared (CMEM) buffer from DSP 1 or DSP 2
      1. Mailbox message is received from either DSP 1 or DSP 2
      2. Data is read from the shared buffer

    Thanks