From patchwork Thu Nov 29 03:37:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "houlong.wei" X-Patchwork-Id: 10703881 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 75AED13AD for ; Thu, 29 Nov 2018 03:38:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 67CCE2E6AF for ; Thu, 29 Nov 2018 03:38:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BCDB2E703; Thu, 29 Nov 2018 03:38:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3D6372E6AF for ; Thu, 29 Nov 2018 03:38:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject: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=ZXVow357E5lNhc1IX7Ogflk0VF+Y1n7/eKE0eZU6O00=; b=LT6lwbRM2++xXB PXNvK1zwyoZrTCzU+lNMwc8cdspIrjtwgcHx0O80u8FXdr0HBOTIq3MEBinWr6Knjhclqj2r74OBC vXhAjq9SR+IGcGW5g5WtxG3ipzQ9GoaPKUwYue+0edPbH7/WwdofCVoDfZep04s48McUsDEatNhJZ k0+KjWbZ7EB73zsvoXLXluW0J+Lyph+2YldIgKnWQXl+OMNWqhtfLMRgLbLUCxTUoP0u0EoBHGHVb YgYHfkJSRsBiscmNLqIiyceu7do8eEj+VVMuxWpLz0pBvqvOI5pvZ0+I9TC1x7VUO8GZY/vxdFzFE QDRhtb3618LiwNgbgtuQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSD9F-0006ln-Fs; Thu, 29 Nov 2018 03:37:53 +0000 Received: from [210.61.82.184] (helo=mailgw02.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gSD9B-0006l0-JX; Thu, 29 Nov 2018 03:37:51 +0000 X-UUID: dc90f1dffdc94b1ba7552a14c28daff8-20181129 X-UUID: dc90f1dffdc94b1ba7552a14c28daff8-20181129 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 578699797; Thu, 29 Nov 2018 11:37:27 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 29 Nov 2018 11:37:19 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 29 Nov 2018 11:37:18 +0800 From: Houlong Wei To: Matthias Brugger Subject: [PATCH v27 0/2] MediaTek MT8173 CMDQ support Date: Thu, 29 Nov 2018 11:37:07 +0800 Message-ID: <1543462629-32746-1-git-send-email-houlong.wei@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181128_193749_770801_A3F9C893 X-CRM114-Status: GOOD ( 10.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Kurtz , Monica Wang , enzhu.wang@mediatek.com, Jiaguang Zhang , Nicolas Boichat , Jassi Brar , HS Liao , Bibby Hsieh , YT Shen , devicetree@vger.kernel.org, kendrick.hsu@mediatek.com, Sascha Hauer , Daoyuan Huang , Sascha Hauer , Houlong Wei , CK HU , Rob Herring , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, srv_heupstream@mediatek.com, linux-kernel@vger.kernel.org, Dennis-YC Hsieh , ginny.chen@mediatek.com, Philipp Zabel Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hi, This is Mediatek MT8173 Command Queue(CMDQ) driver. The CMDQ is used to help write registers with critical time limitation, such as updating display configuration during the vblank. It controls Global Command Engine (GCE) hardware to achieve this requirement. Changes since v26: -rebase on v4.20-rc1 -add comment to explain why cmdq_buf_size is increased in case of appending command failure Changes since v25: -Replace WARN_ON() with WARN_ONCE() and add debug information. Changes since v24: -move WARN_ON() into cmdq_pkt_append_command() from outside Changes since v23: -rebase on v4.19-rc1 -revise return value of cmdq_mbox_create() -revise cmdq_pkt_create() -add MODULE_LICENSE() for mtk-cmdq-helper.c -adjust functions order in mtk-cmdq.h Changes since v22: -remove properties 'timeout' and 'thread-num' from device tree -move timer from CMDQ driver to CMDQ helper -move dma unmap from CMDQ driver to CMDQ helper -config thread number in CMDQ match table -remove reallocate mechanism and let client specify the cmdq buffer size -let client specify the timeout time Changes since v21: -rebase on v4.18-rc1 -remove subsys code and event id definition from mtk-cmdq-helper.c -add mt8173-gce.h to define the subsys code and envent id Changes since v20: -rebase on v4.15-rc1 -move dma_map_single outside of spinlock Changes since v19: -rebase to v4.10-rc2 Houlong Wei (2): arm64: dts: mt8173: Add GCE node soc: mediatek: Add Mediatek CMDQ helper arch/arm64/boot/dts/mediatek/mt8173.dtsi | 10 + drivers/soc/mediatek/Kconfig | 12 + drivers/soc/mediatek/Makefile | 1 + drivers/soc/mediatek/mtk-cmdq-helper.c | 300 +++++++++++++++++++++++ include/linux/soc/mediatek/mtk-cmdq.h | 133 ++++++++++ 5 files changed, 456 insertions(+) create mode 100644 drivers/soc/mediatek/mtk-cmdq-helper.c create mode 100644 include/linux/soc/mediatek/mtk-cmdq.h