• Peng Fan's avatar
    mailbox: imx: add SCU MU support · 0a67003b
    Peng Fan authored
    i.MX8/8X SCU MU is dedicated for communication between SCU and Cortex-A
    cores from hardware design, and could not be reused for other purpose.
    
    Per i.MX8/8X Reference mannual, Chapter "12.9.2.3.2 Messaging Examples",
     Passing short messages: Transmit register(s) can be used to pass
     short messages from one to four words in length. For example, when
     a four-word message is desired, only one of the registers needs to
     have its corresponding interrupt enable bit set at the receiver side;
     the message’s first three words are written to the registers whose
     interrupt is masked, and the fourth word is written to the other
     register (which triggers an interrupt at the receiver side).
    
    i.MX8/8X SCU firmware IPC is an implementation of passing short
    messages. But current imx-mailbox driver only support one word
    message, i.MX8/8X linux side firmware has to request four TX
    and four RX to support IPC to SCU firmware. This is low efficent
    and more interrupts triggered compared with one TX and
    one RX.
    
    To make SCU MU work,
      - parse the size of msg.
      - Only enable TR0/RR0 interrupt for transmit/receive message.
      - For TX/RX, only support one TX channel and one RX channel
      - For RX, support receive msg larger than 4 u32 words.
      - Support 6 channels, TX0/RX0/RXDB[0-3], not support TXDB.
    Reviewed-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
    Signed-off-by: default avatarPeng Fan <peng.fan@nxp.com>
    Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
    0a67003b
imx-mailbox.c 13.3 KB