From patchwork Fri Nov 26 07:14:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Allen-KH Cheng X-Patchwork-Id: 12640161 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 90ED7C433EF for ; Fri, 26 Nov 2021 07:21:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=p0QnEflXNhOG4L+AMxKOnfB/Mk3AwxWvvphGyX/Gi9M=; b=vK31vxliYUjJtA bCz/j1xp5VHxe3EdDMUrmlkV+vHlikj6A0j2FHnT+mvMhwJV+jztzMOPD1ES0CtE0rKW0fxR7zP1m ICB5rXoaCsadM76BSE2G8vqpoHZhoENVIJiRTtJJjtzRifI0WVM084AZDXfdZwvmVp4npQavpa3In rdIkA8nF/Qd66/ki6hMpT1r3Y+l5noy4vt5EQdis/TX7ANbh5rtPSojrLijbcDXfxYvcm0ri6D9Pw OMVf1i1f0jQHxkp43K0HDvweaytHgEApzDEnSQNYoQo4YAOcMJvoa+1jz257fT01EADSYMH5fOCQd BtIelQl6PDKKp1haSuEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqVYI-009QMI-PK; Fri, 26 Nov 2021 07:21:46 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mqVY5-009QKB-O0; Fri, 26 Nov 2021 07:21:34 +0000 X-UUID: cf068f9754af41dba1df8f4c2196472c-20211126 X-UUID: cf068f9754af41dba1df8f4c2196472c-20211126 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 179675663; Fri, 26 Nov 2021 00:21:29 -0700 Received: from mtkexhb01.mediatek.inc (172.21.101.102) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 25 Nov 2021 23:14:43 -0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkexhb01.mediatek.inc (172.21.101.102) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 26 Nov 2021 15:14:35 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 26 Nov 2021 15:14:34 +0800 From: allen-kh.cheng To: Mark Brown , Rob Herring , Matthias Brugger , Jassi Brar CC: Linux-ALSA , , , Pierre-Louis Bossart , Liam Girdwood , Ranjani Sridharan , Kai Vehmanen , Daniel Baluta , Jaroslav Kysela , Takashi Iwai , , , , , , , allen-kh.cheng Subject: [PATCH v5 0/3] This patches provide ADSP IPC support for MT8195 Date: Fri, 26 Nov 2021 15:14:29 +0800 Message-ID: <20211126071432.21990-1-allen-kh.cheng@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211125_232133_798664_22EE018E X-CRM114-Status: GOOD ( 11.28 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Mediatek ADSP IPC is used to send notification or short message between processors with dsp.ยท It will place the message to the share buffer and will access the ADSP mailbox registers to kick dsp. Two mailboxes used to send notification or short message between processors with dsp changes since v4: - use switch ... case in adsp_ipc_recv - add error handling path for chan_name pointer - refine some code to be concise changes since v3: - reorder MTK_ADSP_IPC_MBOX config - remove some redundant code - remove lock in mtk-adsp-mailbox changes since v2: - separate adsp_mailbox into two instances changes since v1: - fix dt_binding_check error Allen-KH Cheng (3): dt-bindings: mediatek: add adsp-mbox document firmware: mediatek: add adsp ipc protocol interface mailbox: mediatek: add support for adsp mailbox controller .../bindings/mailbox/mtk,adsp-mbox.yaml | 52 +++++ 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 | 138 ++++++++++++++ drivers/mailbox/Kconfig | 7 + drivers/mailbox/Makefile | 2 + drivers/mailbox/mtk-adsp-mailbox.c | 178 ++++++++++++++++++ .../linux/firmware/mediatek/mtk-adsp-ipc.h | 70 +++++++ 10 files changed, 460 insertions(+) create mode 100644 Documentation/devicetree/bindings/mailbox/mtk,adsp-mbox.yaml 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 drivers/mailbox/mtk-adsp-mailbox.c create mode 100644 include/linux/firmware/mediatek/mtk-adsp-ipc.h