Skip to content

Commit da35377

Browse files
andyrosskartben
authored andcommitted
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 <[email protected]>
1 parent 1ec2b1c commit da35377

File tree

1 file changed

+2
-2
lines changed
  • tests/boards/mtk_adsp/src

1 file changed

+2
-2
lines changed

tests/boards/mtk_adsp/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,11 @@ static bool mbox1_fired;
6363

6464
static void mbox_fn(const struct device *mbox, void *arg)
6565
{
66-
zassert_equal(mbox, MBOX1);
6766
zassert_equal(arg, NULL);
6867
mbox1_fired = true;
6968
k_sem_give(&mbox_sem);
7069
}
7170

72-
7371
/* Test in/out interrupts from the host. This relies on a SOF driver
7472
* on the host, which has the behavior of "replying" with an interrupt
7573
* 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)
8179
*/
8280
ZTEST(mtk_adsp, mbox)
8381
{
82+
/* Different SOCs transmit the replies on different devices! Just listen to both */
83+
mtk_adsp_mbox_set_handler(MBOX0, 1, mbox_fn, NULL);
8484
mtk_adsp_mbox_set_handler(MBOX1, 1, mbox_fn, NULL);
8585

8686
/* First signal the host with a reply on the second channel,

0 commit comments

Comments
 (0)