From patchwork Mon Oct 8 03:43:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "houlong.wei" X-Patchwork-Id: 10629951 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 1FB4C933 for ; Mon, 8 Oct 2018 03:44:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E701F28AD6 for ; Mon, 8 Oct 2018 03:44:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D8B1328AD9; Mon, 8 Oct 2018 03:44:22 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,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 BBA6528AD6 for ; Mon, 8 Oct 2018 03:44:21 +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=qy2UuuCxTWSiKc6s4WmjoajCxFS0hEESJfPv5aZvJzc=; b=dL9ETioyqwJVEm qnxIfK4FM+l1uYclu7k3pMf0k1IvjY+WaKajqiZkA+2xKeEY8xciSXVC2nqG85HCZlWzx8lBlpqWc bxvnrQFpFs0O3peIwGJxr76e9PpcebOqiOUQKvjmnRxmj6n1S3/9UIPVmOW2Bsslxxjl/kei7YIEo pJCXA28veObQslLKpfztBcQ7lqFwUlY/eck8sakFpiA29H1cFSOY8M0b776VQI0gO0KfED5on537d rEy0iBcQjEc4pQvdWunCwBiuB6DfV7eZ+Ox8eyJnJMKC2tr9KmY+DF73DjXkr5s4rln6/QC1gc65M TbuS3iTqX9o0QB2P3ZHw==; 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 1g9MSo-00032k-Tj; Mon, 08 Oct 2018 03:44:10 +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 1g9MSh-00031Q-3V; Mon, 08 Oct 2018 03:44:07 +0000 X-UUID: de15c2f054324dad9ba2a00c32bd0822-20181008 X-UUID: de15c2f054324dad9ba2a00c32bd0822-20181008 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 91106229; Mon, 08 Oct 2018 11:43:43 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs03n1.mediatek.inc (172.21.101.181) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Oct 2018 11:43:42 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 8 Oct 2018 11:43:40 +0800 From: Houlong Wei To: Matthias Brugger Subject: [PATCH v26 0/2] MediaTek MT8173 CMDQ support Date: Mon, 8 Oct 2018 11:43:22 +0800 Message-ID: <1538970204-7517-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-20181007_204403_275246_05419CCB X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. 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 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 | 292 ++++++++++++++++++++++++++++++ include/linux/soc/mediatek/mtk-cmdq.h | 133 ++++++++++++++ 5 files changed, 448 insertions(+) create mode 100644 drivers/soc/mediatek/mtk-cmdq-helper.c create mode 100644 include/linux/soc/mediatek/mtk-cmdq.h