Skip to contentSkip to conversation

firmware: mtk: add adsp ipc protocol for sof

PATCH Superseded allen-kh.cheng 3 participants 4 messages Jan 12, 2022 Arm MediaTek

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v2 cover firmware: mtk: add adsp ipc protocol for sof

From: Allen-KH Cheng <[email protected]>

This patch provides mtk adsp ipc support for sof.

ADSP IPC protocol offers (send/recv) interfaces using mediatek-mailbox APIs.

changes since v1:
- add comments for mtk_adsp_ipc_send and mtk_adsp_ipc_recv
- remove unuseful MODULE_LICENSE
- change label name to out_free

Allen-KH Cheng (1):
firmware: mediatek: add adsp ipc protocol interface

 drivers/firmware/Kconfig                      |   1 +
 drivers/firmware/Makefile                     |   1 +
 drivers/firmware/mediatek/Kconfig             |   9 +
 drivers/firmware/mediatek/Makefile            |   2 +
 drivers/firmware/mediatek/mtk-adsp-ipc.c      | 159 ++++++++++++++++++
 .../linux/firmware/mediatek/mtk-adsp-ipc.h    |  65 +++++++
 6 files changed, 237 insertions(+)
 create mode 100644 drivers/firmware/mediatek/Kconfig
 create mode 100644 drivers/firmware/mediatek/Makefile
 create mode 100644 drivers/firmware/mediatek/mtk-adsp-ipc.c
 create mode 100644 include/linux/firmware/mediatek/mtk-adsp-ipc.h
Signature · 7 lines
2.18.0


_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek
#1 lore raw

PATCH v2 1/1 firmware: mediatek: add adsp ipc protocol interface

From: Allen-KH Cheng <[email protected]>

Some of mediatek processors contain
the Tensilica HiFix DSP for audio processing.

The communication between Host CPU and DSP firmware is taking place using a shared memory area for message passing.

ADSP IPC protocol offers (send/recv) interfaces using mediatek-mailbox APIs.

We use two mbox channels to implement a request-reply protocol.

---
 drivers/firmware/Kconfig                      |   1 +
 drivers/firmware/Makefile                     |   1 +
 drivers/firmware/mediatek/Kconfig             |   9 +
 drivers/firmware/mediatek/Makefile            |   2 +
 drivers/firmware/mediatek/mtk-adsp-ipc.c      | 159 ++++++++++++++++++
 .../linux/firmware/mediatek/mtk-adsp-ipc.h    |  65 +++++++
 6 files changed, 237 insertions(+)
 create mode 100644 drivers/firmware/mediatek/Kconfig
 create mode 100644 drivers/firmware/mediatek/Makefile
 create mode 100644 drivers/firmware/mediatek/mtk-adsp-ipc.c
 create mode 100644 include/linux/firmware/mediatek/mtk-adsp-ipc.h
drivers/firmware/Kconfig +1 -0
index 75cb91055c17..f3578c60cff0 100644
@@ -299,6 +299,7 @@ source "drivers/firmware/cirrus/Kconfig"
 source "drivers/firmware/google/Kconfig"
 source "drivers/firmware/efi/Kconfig"
 source "drivers/firmware/imx/Kconfig"
+source "drivers/firmware/mediatek/Kconfig"
 source "drivers/firmware/meson/Kconfig"
 source "drivers/firmware/psci/Kconfig"
 source "drivers/firmware/smccc/Kconfig"
drivers/firmware/Makefile +1 -0
index 4e58cb474a68..88fbdc110100 100644
@@ -34,6 +34,7 @@ obj-$(CONFIG_GOOGLE_FIRMWARE)	+= google/
 obj-$(CONFIG_EFI)		+= efi/
 obj-$(CONFIG_UEFI_CPER)		+= efi/
 obj-y				+= imx/
+obj-y				+= mediatek/
 obj-y				+= psci/
 obj-y				+= smccc/
 obj-y				+= tegra/
drivers/firmware/mediatek/Kconfig new file +9 -0
new file mode 100644
index 000000000000..6d1e580b967b
@@ -0,0 +1,9 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config MTK_ADSP_IPC
+	tristate "MTK ADSP IPC Protocol driver"
+	depends on MTK_ADSP_MBOX
+	help
+	  Say yes here to add support for the MediaTek ADSP IPC
+	  between host AP (Linux) and the firmware running on ADSP.
+	  ADSP exists on some mtk processors.
+	  Client might use shared memory to exchange information with ADSP side.
drivers/firmware/mediatek/Makefile new file +2 -0
new file mode 100644
index 000000000000..4e840b65650d
@@ -0,0 +1,2 @@
+# SPDX-License-Identifier: GPL-2.0
+obj-$(CONFIG_MTK_ADSP_IPC)		+= mtk-adsp-ipc.o
drivers/firmware/mediatek/mtk-adsp-ipc.c new file +159 -0

159 lines not on this page · raw message

include/linux/firmware/mediatek/mtk-adsp-ipc.h new file +65 -0

65 lines not on this page · raw message

Signature · 1 line
2.18.0
Reviewed-by on v2 1/1
#2 lore raw

Re: [PATCH v2 1/1] firmware: mediatek: add adsp ipc protocol interface

Quoted 9 lines · allen-kh.cheng

From: Allen-KH Cheng <[email protected]>

Some of mediatek processors contain
the Tensilica HiFix DSP for audio processing.

The communication between Host CPU and DSP firmware is taking place using a shared memory area for message passing.

Quoted 7 lines

ADSP IPC protocol offers (send/recv) interfaces using mediatek-mailbox APIs.

We use two mbox channels to implement a request-reply protocol.

#3 lore raw
In reply to allen-kh.cheng
Quoted 11 lines · allen-kh.cheng

From: Allen-KH Cheng <[email protected]>

This patch provides mtk adsp ipc support for sof.

ADSP IPC protocol offers (send/recv) interfaces using mediatek-mailbox APIs.

changes since v1:
- add comments for mtk_adsp_ipc_send and mtk_adsp_ipc_recv
- remove unuseful MODULE_LICENSE
- change label name to out_free

my comment was not on changing the label name, but making sure you only free something that was allocated by using *two* labels.

Quoted 4 lines

Allen-KH Cheng (1):
firmware: mediatek: add adsp ipc protocol interface

Quoted 12 lines
 drivers/firmware/Kconfig                      |   1 +
 drivers/firmware/Makefile                     |   1 +
 drivers/firmware/mediatek/Kconfig             |   9 +
 drivers/firmware/mediatek/Makefile            |   2 +
 drivers/firmware/mediatek/mtk-adsp-ipc.c      | 159 ++++++++++++++++++
 .../linux/firmware/mediatek/mtk-adsp-ipc.h    |  65 +++++++
 6 files changed, 237 insertions(+)
 create mode 100644 drivers/firmware/mediatek/Kconfig
 create mode 100644 drivers/firmware/mediatek/Makefile
 create mode 100644 drivers/firmware/mediatek/mtk-adsp-ipc.c
 create mode 100644 include/linux/firmware/mediatek/mtk-adsp-ipc.h

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek