tests/boards/mtk_adsp: Handle protocol skew
Recent kernel drivers for some devices have swapped the mailbox device used for replies. It used to be that all commands in either direction were sent on mbox0 and all replies on mbox1. Now mbox0 handles commands and replies for "DSP to Host" communication, and mbox1 is for "Host to DSP". Listen to both devices for our simple test. Signed-off-by: Andy Ross <andyross@google.com>
This commit is contained in:
parent
1ec2b1c68f
commit
da35377256
1 changed files with 2 additions and 2 deletions
|
@ -63,13 +63,11 @@ static bool mbox1_fired;
|
|||
|
||||
static void mbox_fn(const struct device *mbox, void *arg)
|
||||
{
|
||||
zassert_equal(mbox, MBOX1);
|
||||
zassert_equal(arg, NULL);
|
||||
mbox1_fired = true;
|
||||
k_sem_give(&mbox_sem);
|
||||
}
|
||||
|
||||
|
||||
/* Test in/out interrupts from the host. This relies on a SOF driver
|
||||
* on the host, which has the behavior of "replying" with an interrupt
|
||||
* on mbox1 after receiving a "command" on mbox0 (you can also see it
|
||||
|
@ -81,6 +79,8 @@ static void mbox_fn(const struct device *mbox, void *arg)
|
|||
*/
|
||||
ZTEST(mtk_adsp, mbox)
|
||||
{
|
||||
/* Different SOCs transmit the replies on different devices! Just listen to both */
|
||||
mtk_adsp_mbox_set_handler(MBOX0, 1, mbox_fn, NULL);
|
||||
mtk_adsp_mbox_set_handler(MBOX1, 1, mbox_fn, NULL);
|
||||
|
||||
/* First signal the host with a reply on the second channel,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue