Skip to content

Commit cdd4cbc

Browse files
andyrosskartben
authored andcommitted
soc/mtk_adsp: Remove "msg" API
This is a feature of the 8195 DSP only, which is used only vestigially by SOF to store data that nothing reads. The Linux kernel on the other side uses a shared driver for all 81xx devices, which does not expose the feature. It seems to work, but it's not worth maintaining a driver in tree for legacy hardware that will never use it. Signed-off-by: Andy Ross <[email protected]>
1 parent 48a8491 commit cdd4cbc

File tree

3 files changed

+1
-34
lines changed

3 files changed

+1
-34
lines changed

soc/mediatek/mtk_adsp/mbox.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,25 +65,6 @@ void mtk_adsp_mbox_set_handler(const struct device *mbox, uint32_t chan,
6565
}
6666
}
6767

68-
void mtk_adsp_mbox_set_msg(const struct device *mbox, uint32_t idx, uint32_t val)
69-
{
70-
const struct mbox_cfg *cfg = ((struct device *)mbox)->config;
71-
72-
if (idx < MTK_ADSP_MBOX_MSG_WORDS) {
73-
cfg->mbox->out_msg[idx] = val;
74-
}
75-
}
76-
77-
uint32_t mtk_adsp_mbox_get_msg(const struct device *mbox, uint32_t idx)
78-
{
79-
const struct mbox_cfg *cfg = ((struct device *)mbox)->config;
80-
81-
if (idx < MTK_ADSP_MBOX_MSG_WORDS) {
82-
return cfg->mbox->in_msg[idx];
83-
}
84-
return 0;
85-
}
86-
8768
void mtk_adsp_mbox_signal(const struct device *mbox, uint32_t chan)
8869
{
8970
const struct mbox_cfg *cfg = ((struct device *)mbox)->config;

soc/mediatek/mtk_adsp/soc.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,6 @@ typedef void (*mtk_adsp_mbox_handler_t)(const struct device *mbox, void *arg);
2323
void mtk_adsp_mbox_set_handler(const struct device *mbox, uint32_t chan,
2424
mtk_adsp_mbox_handler_t handler, void *arg);
2525

26-
/* Mailbox hardware has an array of unstructured "message" data in
27-
* each direction. Any value can be placed in the registers.
28-
*/
29-
#define MTK_ADSP_MBOX_MSG_WORDS 5
30-
void mtk_adsp_mbox_set_msg(const struct device *mbox, uint32_t idx, uint32_t val);
31-
uint32_t mtk_adsp_mbox_get_msg(const struct device *mbox, uint32_t idx);
32-
3326
/* Signal an interrupt on the specified channel for the other side */
3427
void mtk_adsp_mbox_signal(const struct device *mbox, uint32_t chan);
3528

tests/boards/mtk_adsp/src/main.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ static void mbox_fn(const struct device *mbox, void *arg)
6969
/* Test in/out interrupts from the host. This relies on a SOF driver
7070
* on the host, which has the behavior of "replying" with an interrupt
7171
* on mbox1 after receiving a "command" on mbox0 (you can also see it
72-
* whine about the invalid IPC message in the kernel logs). SOF
73-
* ignores the message bytes (it uses a DRAM area instead), so we just
74-
* write them blindly. It's only a partial test of the hardware, but
75-
* easy to run and exercises the core functionality.
72+
* whine about the invalid IPC message in the kernel logs).
7673
*
7774
* Note that there's a catch: SOF's "reply" comes after a timeout
7875
* (it's an invalid command, afterall) which is 165 seconds! But the
@@ -82,10 +79,6 @@ ZTEST(mtk_adsp, mbox)
8279
{
8380
mtk_adsp_mbox_set_handler(MBOX1, 1, mbox_fn, NULL);
8481

85-
for (int i = 0; i < MTK_ADSP_MBOX_MSG_WORDS; i++) {
86-
mtk_adsp_mbox_set_msg(MBOX0, i, 0x01010100 | i);
87-
}
88-
8982
/* First signal the host with a reply on the second channel,
9083
* that effects a reply to anything it thinks it might have
9184
* sent us

0 commit comments

Comments
 (0)