From patchwork Mon Jul 8 11:04:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Chen X-Patchwork-Id: 11034901 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 CBA1E13B1 for ; Mon, 8 Jul 2019 11:06:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8DA427F3E for ; Mon, 8 Jul 2019 11:06:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACA292851A; Mon, 8 Jul 2019 11:06:09 +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=unavailable 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 5E00727F3E for ; Mon, 8 Jul 2019 11:06:09 +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:References:In-Reply-To: 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: List-Owner; bh=0p8OTia8DkR7kTf7Nu3phqgfLP7iCGmIt0YyTBtrwcg=; b=g0s5pLaP4nFeR6 xWw+zEv2bmZDWbNgxD5Mck7azRy3Jz/D7SRV7nYluKO3owfuM5XGmBrxffx4ZdCgt5QSt3GqWQNMQ ApphVYDE2mt0TB0DFcV40zZd2shJyTEUfqpvdzDjbB0pWDKinrLtpbjvX3K/TAWAN3DeH6BbYLN6k xMCpd+HRJBQLpOOfN9lVsZSVxJYX6fIlIllLPvdsrzxN9umCr9Ju6wSSfePYOM46ExY2Y3pK3Qyrc rKMKP+eujBdRkVZ689dzGPVdDh2qwIIdhfMkntlmIvhBWZuoTnW3mM5IWv9uX4EpsZOya2OLAMv5L /59rtwyo9JwXWrYltPKw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hkRTA-0003GU-8e; Mon, 08 Jul 2019 11:06:04 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hkRSW-0002ls-9B; Mon, 08 Jul 2019 11:05:26 +0000 X-UUID: 44e5d8776a044a048ed945fd1b525bed-20190708 X-UUID: 44e5d8776a044a048ed945fd1b525bed-20190708 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1732951587; Mon, 08 Jul 2019 03:05:22 -0800 Received: from MTKMBS01N1.mediatek.inc (172.21.101.68) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Jul 2019 04:05:20 -0700 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; Mon, 8 Jul 2019 19:05:06 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 8 Jul 2019 19:05:06 +0800 From: To: , , , , Subject: [RFC PATCH V2 1/6] dt-bindings: mt8183: Added DIP dt-bindings Date: Mon, 8 Jul 2019 19:04:55 +0800 Message-ID: <20190708110500.7242-2-frederic.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190708110500.7242-1-frederic.chen@mediatek.com> References: <20190708110500.7242-1-frederic.chen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190708_040524_542707_20DDCDAA X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shik@chromium.org, devicetree@vger.kernel.org, Sean.Cheng@mediatek.com, Rynn.Wu@mediatek.com, Allan.Yang@mediatek.com, srv_heupstream@mediatek.com, holmes.chiou@mediatek.com, suleiman@chromium.org, Jerry-ch.Chen@mediatek.com, jungo.lin@mediatek.com, sj.huang@mediatek.com, yuzhao@chromium.org, linux-mediatek@lists.infradead.org, zwisler@chromium.org, christie.yu@mediatek.com, frederic.chen@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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 From: Frederic Chen This patch adds DT binding documentation for the Digital Image Processing (DIP) unit of camera ISP system on Mediatek's SoCs. It depends on the SCP and MDP 3 patch as following: 1. dt-bindings: Add a binding for Mediatek SCP https://patchwork.kernel.org/patch/11027247/ 2. dt-binding: mt8183: Add Mediatek MDP3 dt-bindings https://patchwork.kernel.org/patch/10945603/ Signed-off-by: Frederic Chen Reviewed-by: Rob Herring --- .../bindings/media/mediatek,mt8183-dip.txt | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek,mt8183-dip.txt diff --git a/Documentation/devicetree/bindings/media/mediatek,mt8183-dip.txt b/Documentation/devicetree/bindings/media/mediatek,mt8183-dip.txt new file mode 100644 index 000000000000..3a0435513089 --- /dev/null +++ b/Documentation/devicetree/bindings/media/mediatek,mt8183-dip.txt @@ -0,0 +1,40 @@ +* Mediatek Digital Image Processor (DIP) + +Digital Image Processor (DIP) unit in Mediatek ISP system is responsible for +image content adjustment according to the tuning parameters. DIP can process +the image form memory buffer and output the processed image to multiple output +buffers. Furthermore, it can support demosaicing and noise reduction on the +images. + +Required properties: +- compatible: "mediatek,mt8183-dip" +- reg: Physical base address and length of the function block register space +- interrupts: interrupt number to the cpu +- iommus: should point to the respective IOMMU block with master port as + argument, see Documentation/devicetree/bindings/iommu/mediatek,iommu.txt + for details. +- mediatek,mdp3: should point to the respective mdp block. DIP hardware + connects to MDP and we can get the processed image with both effect of the + two blocks. +- mediatek,larb: must contain the local arbiters in the current SoCs, see + Documentation/devicetree/bindings/memory-controllers/mediatek,smi-larb.txt + for details. +- mediatek,scp: should point to the scp node since the we use SCP + coprocessor to control DIP hardware +- clocks: must contain the local arbiters 5 (LARB5) and DIP clock +- clock-names: must contain "larb5" and "dip" + +Example: + dip: dip@15022000 { + compatible = "mediatek,mt8183-dip"; + mediatek,larb = <&larb5>; + mediatek,mdp3 = <&mdp_rdma0>; + mediatek,scp = <&scp>; + iommus = <&iommu M4U_PORT_CAM_IMGI>; + reg = <0 0x15022000 0 0x6000>; + interrupts = ; + clocks = <&imgsys CLK_IMG_LARB5>, + <&imgsys CLK_IMG_DIP>; + clock-names = "larb5", + "dip"; + }; From patchwork Mon Jul 8 11:04:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Chen X-Patchwork-Id: 11034879 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 74890912 for ; Mon, 8 Jul 2019 11:05:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F57A28173 for ; Mon, 8 Jul 2019 11:05:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51D41285A3; Mon, 8 Jul 2019 11:05: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=-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 CA56F2856E for ; Mon, 8 Jul 2019 11:05: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:References:In-Reply-To: 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: List-Owner; bh=dLABQtQi+TzHyPwn2rfL4WDGLf+aQGLbTP6JDy09e7g=; b=MA5Tq2n/6+kcYK 0FYWK+I7FPymTvIcE5WGtvygk3gGILjnMBz/q7d3oE8uDxluDWJFxKQ/5LjMRg21sP6SpbTMhlmPK iwCdU20O2f10DvGGzc3P+TwviHm7bFM/fK4aI2cv1jA/9fuU0aEwJx4kOiF78mi2b4N/opGk6vbEW E0/29PWWMW3grXTwhcFnIiHymhfWa4zDlJr0Z4maazoR3zDbbAwLrKN+InKS7OrlagzGx7bZC/iZp PW+QZyjJ6Uz/8VUZhsJhtzYkGJcOte+JrfTBvviOWBJoAnc/GovGDfpYwLOYQMBkVVaMkFJQXAclt r1Q8MyIaSogpIsVU2ozg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hkRSS-0002i8-VO; Mon, 08 Jul 2019 11:05:21 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hkRSO-0002hG-Um; Mon, 08 Jul 2019 11:05:18 +0000 X-UUID: ac2181e1d81b4a35a83b760fb9e4cb31-20190708 X-UUID: ac2181e1d81b4a35a83b760fb9e4cb31-20190708 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1651558110; Mon, 08 Jul 2019 03:05:11 -0800 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Jul 2019 04:05:10 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Jul 2019 19:05:08 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 8 Jul 2019 19:05:08 +0800 From: To: , , , , Subject: [RFC PATCH V2 2/6] dts: arm64: mt8183: Add DIP nodes Date: Mon, 8 Jul 2019 19:04:56 +0800 Message-ID: <20190708110500.7242-3-frederic.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190708110500.7242-1-frederic.chen@mediatek.com> References: <20190708110500.7242-1-frederic.chen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190708_040517_000848_E7439584 X-CRM114-Status: UNSURE ( 7.20 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shik@chromium.org, devicetree@vger.kernel.org, Sean.Cheng@mediatek.com, Rynn.Wu@mediatek.com, Allan.Yang@mediatek.com, srv_heupstream@mediatek.com, holmes.chiou@mediatek.com, suleiman@chromium.org, Jerry-ch.Chen@mediatek.com, jungo.lin@mediatek.com, sj.huang@mediatek.com, yuzhao@chromium.org, linux-mediatek@lists.infradead.org, zwisler@chromium.org, christie.yu@mediatek.com, frederic.chen@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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 From: Frederic Chen This patch adds nodes for Digital Image Processing (DIP). DIP is embedded in Mediatek SoCs and works with the co-processor to adjust image content according to tuning input data. It also provides image format conversion, resizing, and rotation features. Signed-off-by: Frederic Chen --- arch/arm64/boot/dts/mediatek/mt8183.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8183.dtsi b/arch/arm64/boot/dts/mediatek/mt8183.dtsi index 0f2646c9eb65..d7b0fb8230f0 100644 --- a/arch/arm64/boot/dts/mediatek/mt8183.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8183.dtsi @@ -513,6 +513,22 @@ #clock-cells = <1>; }; + dip: dip@15022000 { + compatible = "mediatek,mt8183-dip"; + mediatek,larb = <&larb5>; + mediatek,mdp3 = <&mdp_rdma0>; + mediatek,scp = <&scp>; + iommus = <&iommu M4U_PORT_CAM_IMGI>; + reg = <0 0x15022000 0 0x6000>; + interrupts = ; + clocks = + <&imgsys CLK_IMG_LARB5>, + <&imgsys CLK_IMG_DIP>; + clock-names = + "larb5", + "dip"; + }; + vdecsys: syscon@16000000 { compatible = "mediatek,mt8183-vdecsys", "syscon"; reg = <0 0x16000000 0 0x1000>; From patchwork Mon Jul 8 11:04:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Chen X-Patchwork-Id: 11034911 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 7697213B1 for ; Mon, 8 Jul 2019 11:07:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6420627F3E for ; Mon, 8 Jul 2019 11:07:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 580112851A; Mon, 8 Jul 2019 11:07:01 +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 0508B27F3E for ; Mon, 8 Jul 2019 11:07: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:References:In-Reply-To: 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: List-Owner; bh=ESzq+D4UaCVG0yHYS1lEhpwMC9UyMpAwTTWaTcLzMOg=; b=CYwh8YbNJGGmHW aE+QOBoOpX4hqSYA5TxecurTXTmotmlreDQORXWiyxOhwBHK4ta6Ytybreq/wS6iV7145rag3e0EI 5g1gyyme2s25QxHyKt/JCyxU8aV4Q1GwA5ko6f/O5zBQVhznQdt7WA4MLXMzQcbcPiYy4S9yscx+6 0WNmM5dtWMXIDYyi+GpN4UAh4cb5NpPfPjqZMCJF029ioNZL9IsDZ/vZQPXuPS7qVqDJOlrcF+5v0 TehD9ejxSdUvgJEXJ2hejzAdPVf4K+plZWCPnn5yLOru97gSWry9OprHyEJZM/C9dG/iPr3X1n3p8 tHQ2ukGW4kJDrEKn7RXg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hkRU0-0003w0-SC; Mon, 08 Jul 2019 11:06:57 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hkRT5-0003Cx-Fe; Mon, 08 Jul 2019 11:06:01 +0000 X-UUID: 0a8a70655d87492ba2b5c69ffb347864-20190708 X-UUID: 0a8a70655d87492ba2b5c69ffb347864-20190708 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 347287009; Mon, 08 Jul 2019 03:05:29 -0800 Received: from MTKMBS01N2.mediatek.inc (172.21.101.79) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Jul 2019 04:05:28 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Jul 2019 19:05:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 8 Jul 2019 19:05:11 +0800 From: To: , , , , Subject: [RFC PATCH V2 3/6] media: platform: Add Mediatek DIP driver KConfig Date: Mon, 8 Jul 2019 19:04:57 +0800 Message-ID: <20190708110500.7242-4-frederic.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190708110500.7242-1-frederic.chen@mediatek.com> References: <20190708110500.7242-1-frederic.chen@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: E2B9BCA9C78A31471D6E66FDD38C8EA85FA55EE481B47A72F6E097A06996EFEF2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190708_040559_588180_C4A66D75 X-CRM114-Status: UNSURE ( 8.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shik@chromium.org, devicetree@vger.kernel.org, Sean.Cheng@mediatek.com, Rynn.Wu@mediatek.com, Allan.Yang@mediatek.com, srv_heupstream@mediatek.com, holmes.chiou@mediatek.com, suleiman@chromium.org, Jerry-ch.Chen@mediatek.com, jungo.lin@mediatek.com, sj.huang@mediatek.com, yuzhao@chromium.org, linux-mediatek@lists.infradead.org, zwisler@chromium.org, christie.yu@mediatek.com, frederic.chen@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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 From: Frederic Chen This patch adds KConfig for Mediatek Digital Image Processing driver(DIP). DIP is embedded in Mediatek SoCs. It provides image format conversion, resizing, and rotation function. Signed-off-by: Frederic Chen --- drivers/media/platform/Kconfig | 2 ++ drivers/media/platform/mtk-isp/Kconfig | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 drivers/media/platform/mtk-isp/Kconfig diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig index 0c725d4dcf80..b8501e1b134f 100644 --- a/drivers/media/platform/Kconfig +++ b/drivers/media/platform/Kconfig @@ -32,6 +32,8 @@ source "drivers/media/platform/davinci/Kconfig" source "drivers/media/platform/omap/Kconfig" +source "drivers/media/platform/mtk-isp/Kconfig" + config VIDEO_ASPEED tristate "Aspeed AST2400 and AST2500 Video Engine driver" depends on VIDEO_V4L2 diff --git a/drivers/media/platform/mtk-isp/Kconfig b/drivers/media/platform/mtk-isp/Kconfig new file mode 100644 index 000000000000..24a592022dd5 --- /dev/null +++ b/drivers/media/platform/mtk-isp/Kconfig @@ -0,0 +1,21 @@ +config VIDEO_MEDIATEK_ISP_DIP + bool "Mediatek Digital Image Processing function" + select DMA_SHARED_BUFFER + select VIDEO_V4L2_SUBDEV_API + select VIDEOBUF2_DMA_CONTIG + select VIDEOBUF2_CORE + select VIDEOBUF2_V4L2 + select VIDEOBUF2_MEMOPS + select VIDEOBUF2_VMALLOC + select MEDIA_CONTROLLER + + default n + help + Support the basic Digital Image Processing (DIP) driver. + + DIP driver provides image format conversion, resizing, + and rotation function through the low power hardware. + DIP also supports multiple output feature. It can + generate two or more output image with different effect + based on a single input image at the same time. + From patchwork Mon Jul 8 11:04:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Chen X-Patchwork-Id: 11034905 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 0176713B1 for ; Mon, 8 Jul 2019 11:06:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DFC1527F3E for ; Mon, 8 Jul 2019 11:06:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF0312851A; Mon, 8 Jul 2019 11:06:37 +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=unavailable 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 6654427F3E for ; Mon, 8 Jul 2019 11:06:37 +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:References:In-Reply-To: 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: List-Owner; bh=Tvihem+Bowgj6Q65nyZcEBIkuffDcJuKOUPXb82c/pQ=; b=Qs8aMPbq2hq3tB ShKBNjNrYMz8fcJDx1BwQy+vkHC+GFBvbiqUfw/FhWrGbfSKYQhj6vx3l5ZKGi3KbhQ2AOM+dEbUi 4tNcGd+fMV+g4xbAFo879B8RFg7dXsQLZpU7g/ZtL2iNO0J2+4Ph9A/JBSbrjUqI3wGQCQMbtfnTf 8jbwkLSINteVQO2CO12qU33xEBD53LcjRvaLt/k5isAD64skBRg61Tvj7djrE7fJofohDc1IVsuyW aTUmycsN9QrRaGgFkVDjC4QZANCaicJSBUwc6HAvS1Itaj4FuPmpalItndJDicPMArE3j2BZ2Tn/m ql4ENQXezOMihmEq6l0g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hkRTd-0003bm-Bb; Mon, 08 Jul 2019 11:06:33 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hkRSZ-0002nq-T5; Mon, 08 Jul 2019 11:05:31 +0000 X-UUID: 2d61691631e64233a59a5341c41ef879-20190708 X-UUID: 2d61691631e64233a59a5341c41ef879-20190708 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 1928795390; Mon, 08 Jul 2019 03:05:18 -0800 Received: from mtkmbs07n1.mediatek.inc (172.21.101.16) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Jul 2019 04:05:17 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Jul 2019 19:05:16 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 8 Jul 2019 19:05:15 +0800 From: To: , , , , Subject: [RFC PATCH V2 5/6] remoteproc/mediatek: add SCP's shared dma pool support for mt8183 Date: Mon, 8 Jul 2019 19:04:59 +0800 Message-ID: <20190708110500.7242-6-frederic.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190708110500.7242-1-frederic.chen@mediatek.com> References: <20190708110500.7242-1-frederic.chen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190708_040528_043407_C4B4CEF0 X-CRM114-Status: GOOD ( 13.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shik@chromium.org, devicetree@vger.kernel.org, Sean.Cheng@mediatek.com, Rynn.Wu@mediatek.com, Allan.Yang@mediatek.com, srv_heupstream@mediatek.com, holmes.chiou@mediatek.com, suleiman@chromium.org, Jerry-ch.Chen@mediatek.com, jungo.lin@mediatek.com, sj.huang@mediatek.com, yuzhao@chromium.org, linux-mediatek@lists.infradead.org, zwisler@chromium.org, christie.yu@mediatek.com, frederic.chen@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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 From: Frederic Chen This patch uses of_reserved_mem_device_init_by_idx() to hook the scp device to DMA mapping API to provide a shared dma pool of SCP DMA buffers for SCP's client such as DIP and ISP Pass 1 drivers. Signed-off-by: Frederic Chen --- drivers/remoteproc/mtk_scp.c | 54 ++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 21 deletions(-) diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c index 4c093dec52b9..0cffe4b63dba 100644 --- a/drivers/remoteproc/mtk_scp.c +++ b/drivers/remoteproc/mtk_scp.c @@ -4,12 +4,14 @@ #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -487,29 +489,29 @@ EXPORT_SYMBOL_GPL(scp_get_reserve_mem_size); static int scp_map_memory_region(struct mtk_scp *scp) { - struct device_node *node; - struct resource r; - int ret; + int ret, id; - node = of_parse_phandle(scp->dev->of_node, "memory-region", 0); - if (!node) { - dev_err(scp->dev, "no memory-region specified\n"); - return -EINVAL; + ret = of_reserved_mem_device_init_by_idx(scp->dev, scp->dev->of_node, + 0); + if (ret) { + dev_err(scp->dev, + "%s:of_reserved_mem_device_init_by_idx(0) failed:(%d)", + __func__, ret); + return -ENOMEM; } - ret = of_address_to_resource(node, 0, &r); - if (ret) - return ret; + /* Pre-allocate the working buffers */ + scp->dram_size = MAX_CODE_SIZE; + for (id = 0; id < SCP_NUMS_MEM_ID; id++) + scp->dram_size += scp_reserve_mblock[id].size; - scp->phys_addr = r.start; - scp->dram_size = resource_size(&r); - scp->cpu_addr = - devm_ioremap_wc(scp->dev, scp->phys_addr, scp->dram_size); + scp->cpu_addr = dma_alloc_coherent(scp->dev, scp->dram_size, + &scp->phys_addr, GFP_KERNEL); if (!scp->cpu_addr) { - dev_err(scp->dev, "unable to map memory region: %pa+%zx\n", - &r.start, scp->dram_size); - return -EBUSY; + dev_err(scp->dev, "unable to pre-allocate memory for SCP: %zx\n", + scp->dram_size); + return -ENOMEM; } #if SCP_RESERVED_MEM @@ -519,6 +521,13 @@ static int scp_map_memory_region(struct mtk_scp *scp) return 0; } +static void scp_unmap_memory_region(struct mtk_scp *scp) +{ + dma_free_coherent(scp->dev, scp->dram_size, scp->cpu_addr, + scp->phys_addr); + of_reserved_mem_device_release(scp->dev); +} + static struct mtk_rpmsg_info mtk_scp_rpmsg_info = { .send_ipi = scp_ipi_send, .register_ipi = scp_ipi_register, @@ -594,20 +603,20 @@ static int scp_probe(struct platform_device *pdev) if (IS_ERR(scp->clk)) { dev_err(dev, "Failed to get clock\n"); ret = PTR_ERR(scp->clk); - goto free_rproc; + goto release_dev_mem; } ret = clk_prepare_enable(scp->clk); if (ret) { dev_err(dev, "failed to enable clocks\n"); - goto free_rproc; + goto release_dev_mem; } ret = scp_ipi_init(scp); clk_disable_unprepare(scp->clk); if (ret) { dev_err(dev, "Failed to init ipi\n"); - goto free_rproc; + goto release_dev_mem; } /* register SCP initialization IPI */ @@ -617,7 +626,7 @@ static int scp_probe(struct platform_device *pdev) scp); if (ret) { dev_err(dev, "Failed to register IPI_SCP_INIT\n"); - goto free_rproc; + goto release_dev_mem; } mutex_init(&scp->lock); @@ -645,6 +654,8 @@ static int scp_probe(struct platform_device *pdev) remove_subdev: scp_remove_rpmsg_subdev(scp); mutex_destroy(&scp->lock); +release_dev_mem: + scp_unmap_memory_region(scp); free_rproc: rproc_free(rproc); @@ -658,6 +669,7 @@ static int scp_remove(struct platform_device *pdev) scp_remove_rpmsg_subdev(scp); rproc_del(scp->rproc); rproc_free(scp->rproc); + scp_unmap_memory_region(scp); return 0; } From patchwork Mon Jul 8 11:05:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frederic Chen X-Patchwork-Id: 11034889 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 37A4A13B1 for ; Mon, 8 Jul 2019 11:05:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 251642836F for ; Mon, 8 Jul 2019 11:05:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 132FC284D2; Mon, 8 Jul 2019 11:05:49 +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 AFED02836F for ; Mon, 8 Jul 2019 11:05:48 +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:References:In-Reply-To: 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: List-Owner; bh=ksI7GKf/Eoru/u7AuHWZwKkO3stycWASG/az7hENf5E=; b=IPCIXPRU/cDRU7 e7VYR0d1/dRudfAKiQvM13H27cDWQKHzqTGZfPXepRpiDaAyEuShAkWTU/AFA/WrOz+wkd4yP+bTV G/UmdQk85PLqa/O7yaNbVpDbJ1GV1vPefJcZPBa8pbj4dgGWT9IVJ8U6tTm0cbD+brzoJDSv2YliC bdQRDSJz4WI1Mkwy9yCV2EKdRnWUNtgPunnIEWkphTtMDAfZG4v36k2VHt8LTQLc6GTJvhl4IcgQT CQIH8sQXCgwMk/xH0Ao43jGrdHtQX2CDtoo+rYcGwpWUrbaTN4MvV1Jcik6AxZ6TWtyyFFL6mnOix l0y+2gLhKXwV4QByjaiA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hkRSn-0002xH-KX; Mon, 08 Jul 2019 11:05:41 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hkRST-0002jR-Ks; Mon, 08 Jul 2019 11:05:23 +0000 X-UUID: 505852f5c65a443196f68bbed4ef5e84-20190708 X-UUID: 505852f5c65a443196f68bbed4ef5e84-20190708 Received: from mtkcas68.mediatek.inc [(172.29.94.19)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 332433345; Mon, 08 Jul 2019 03:05:20 -0800 Received: from MTKMBS07N2.mediatek.inc (172.21.101.141) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Jul 2019 04:05:18 -0700 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 8 Jul 2019 19:05:16 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 8 Jul 2019 19:05:17 +0800 From: To: , , , , Subject: [RFC PATCH V2 6/6] media: platform: mtk-mdp3: Add struct tuning_addr to identify user tuning data Date: Mon, 8 Jul 2019 19:05:00 +0800 Message-ID: <20190708110500.7242-7-frederic.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190708110500.7242-1-frederic.chen@mediatek.com> References: <20190708110500.7242-1-frederic.chen@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190708_040521_827908_765F8669 X-CRM114-Status: UNSURE ( 9.06 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shik@chromium.org, devicetree@vger.kernel.org, Sean.Cheng@mediatek.com, Rynn.Wu@mediatek.com, Allan.Yang@mediatek.com, srv_heupstream@mediatek.com, holmes.chiou@mediatek.com, suleiman@chromium.org, Jerry-ch.Chen@mediatek.com, jungo.lin@mediatek.com, sj.huang@mediatek.com, yuzhao@chromium.org, linux-mediatek@lists.infradead.org, zwisler@chromium.org, christie.yu@mediatek.com, frederic.chen@mediatek.com, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org 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 From: Frederic Chen We added a struct tuning_addr which contains a field "present" so that the driver can tell the firmware if we have user tuning dataor not. Signed-off-by: Frederic Chen --- drivers/media/platform/mtk-mdp3/mtk-img-ipi.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/mtk-mdp3/mtk-img-ipi.h b/drivers/media/platform/mtk-mdp3/mtk-img-ipi.h index 9fabe7e8b71d..0944fe911d97 100644 --- a/drivers/media/platform/mtk-mdp3/mtk-img-ipi.h +++ b/drivers/media/platform/mtk-mdp3/mtk-img-ipi.h @@ -38,6 +38,12 @@ struct img_addr { u32 iova; /* Used by IOMMU HW access */ } __attribute__ ((__packed__)); +struct tuning_addr { + u32 present; + u32 pa; /* Used by CM4 access */ + u32 iova; /* Used by IOMMU HW access */ +} __attribute__ ((__packed__)); + struct img_sw_addr { u64 va; /* Used by APMCU access */ u32 pa; /* Used by CM4 access */ @@ -105,7 +111,7 @@ struct img_ipi_frameparam { u64 drv_data; struct img_input inputs[IMG_MAX_HW_INPUTS]; struct img_output outputs[IMG_MAX_HW_OUTPUTS]; - struct img_addr tuning_data; + struct tuning_addr tuning_data; struct img_addr subfrm_data; struct img_sw_addr config_data; struct img_sw_addr self_data;