From patchwork Fri Dec 10 10:41:50 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: 12669217 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 708FCC433F5 for ; Fri, 10 Dec 2021 10:42:28 +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=LIbJqyjZC5fRzEwZWZBvhFyjWtMg5kO7lLlKvqrdaBE=; b=sAJ6PMaro/no5j Dq7hcdM7xYwpljpoIv4s/7yd8jChad7Wy0yrVBBzZ/qCtd+OMmZt+zwvzFV8Vovpwob1V2YmS4wz+ THgYiudaJ6JMIFVC2LOhkA4U4wfHIWOcZLfltEPHV1Np5tEq3Wa8BtU6GJl4KgFKVE70xKrQE3nMb 1tEi1hlUs69saHreoV9FcPkK6Mz5WButDPenrvOwmKlvK5pbA6oSK7NAh4NzwxSz+7G2brsNBCf73 M1vsAWgZ937BMrbQO/a9JuTkZP9D3PDOEf4e4S5UdhSy+CJ/pd6Yr+hzpoO8AqQWcF0QoE85q1ePZ 2jwrxeE9plg/W5x243OA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mvdM1-001WSD-HF; Fri, 10 Dec 2021 10:42:17 +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 1mvdLo-001WOQ-GR; Fri, 10 Dec 2021 10:42:06 +0000 X-UUID: bf930f1b3a3f4dc3893e10436a8c9723-20211210 X-UUID: bf930f1b3a3f4dc3893e10436a8c9723-20211210 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 990907084; Fri, 10 Dec 2021 03:41:58 -0700 Received: from mtkmbs10n2.mediatek.inc (172.21.101.183) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 10 Dec 2021 02:41:56 -0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.3; Fri, 10 Dec 2021 18:41:55 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 10 Dec 2021 18:41:55 +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: [RESEND PATCH v10 0/3] This patches provide ADSP IPC support for MT8195 Date: Fri, 10 Dec 2021 18:41:50 +0800 Message-ID: <20211210104153.24181-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-20211210_024204_582488_AC7D1FFB X-CRM114-Status: GOOD ( 11.12 ) 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 From: Allen-KH Cheng 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 v9: - rename adsp_mbox_chan_ops to mtk_adsp_mbox_chan_ops changes since v8: - remove struct adsp_mbox_ch_info - add get_mtk_adsp_mbox_priv - use mtk_adsp_mbox_priv va_mboxreg address in adsp mbox driver - add struct mtk_adsp_mbox_cfg for DSP mbox register offset - remove adsp mbox register offset hard code define - remove mtk-adsp-ipc.h reference in adsp mbox driver changes since v7: - add mtk prefix for adsp ipc functions - rename adsp_mbox_ch_info to mtk_adsp_mbox_ch_info - remove incorrect reviewers in commit message changes since v6: - dt-bindings: change example dtsi node. - rename config MTK_ADSP_IPC_MBOX to MTK_ADSP_MBOX - remove unused variable - add reviewers changes since v5: - remove some redundant code 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 | 135 ++++++++++++++ drivers/mailbox/Kconfig | 7 + drivers/mailbox/Makefile | 2 + drivers/mailbox/mtk-adsp-mailbox.c | 176 ++++++++++++++++++ .../linux/firmware/mediatek/mtk-adsp-ipc.h | 65 +++++++ 10 files changed, 450 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