From patchwork Wed Nov 24 17:55:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Bornyakov X-Patchwork-Id: 12693564 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 8E0E8C433EF for ; Wed, 24 Nov 2021 18:12:00 +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:References:In-Reply-To: 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: List-Owner; bh=uI75zDh09grN/zF8T3AbGiTbCzjK96kt+cKiKT7L8zE=; b=s70hk9YdusgYYA +Gv/NgkjuLBIwBQ6fihCQuxrff0aKkcDdDxm3bjejfw8q+hnHl9wHcWuHzmtoZrmoujEINHF7adKa fMk1UYgRPicPR9KP4+ZCwja9K9n4uKx8k9ujt0B9RmLOfSeP1dbYemqfvYFz3oDi5iQ1L/5lVwJee 8K4IVkgpmOPtqiqoJJeHDscn7UkPrQuNze74HULtM6wT3niP0Jirzenv4zbexF8DSU6Uq7ZsbWQOP iBe9IbttYZB87cfB5nr3G0A/cJ2W+i8oyk5qKfo0ktifYrDEEM16hkPQ/h24O6R2YANhb3WtT6Wha dbFm/vnqLPzgbTCqNXAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpwjF-005TqW-Cz; Wed, 24 Nov 2021 18:10:45 +0000 Received: from mail.pr-group.ru ([178.18.215.3]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpwiy-005Tkw-7z for linux-arm-kernel@lists.infradead.org; Wed, 24 Nov 2021 18:10:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=metrotek.ru; s=mail; h=from:subject:date:message-id:to:cc:mime-version:content-transfer-encoding: in-reply-to:references; bh=To9e4hBk+9KWTAv+yOOa9YU2qidFr8D9clDVYMRnqn8=; b=DOevVwMSVvd9FTZE+Jo0u8a6CqSwzCp9wVIZ45wU3dFoyiHSE0rY9w74PMGyeE3c+9GyUVU2wik25 PWSlZ6DDOXnqBl6Z/ZwbpgthPok518iKtxXmbwRbKZb3CTC9k0g02MIdj2T3U7zkaB+B8dBuMDyoJ2 dhMUchOyBqlZptsf6D8YXaBbEnmljr/moIjCECp6M6KD7BuB1WCIoE1YRXAbBERDKzE1zBjZd6QdXD Qn5hl4sffWHoXDzFzn9nHmuGvRZzUJOt31gd8r7EaSxusJJimdHwlCI1/h/hGyxqX6fwXmw0DueOcG Use/NfGXn8XmuptCIbNwHpMekp3rwlw== X-Footer: bWV0cm90ZWsucnU= Received: from localhost.localdomain ([178.66.213.198]) (authenticated user i.bornyakov@metrotek.ru) by mail.pr-group.ru with ESMTPSA (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)); Wed, 24 Nov 2021 21:10:24 +0300 From: Ivan Bornyakov To: Cc: Ivan Bornyakov , system@metrotek.ru, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 1/2] bus: imx-weim: optionally enable continuous burst clock Date: Wed, 24 Nov 2021 20:55:41 +0300 Message-Id: <20211124175542.2772-2-i.bornyakov@metrotek.ru> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211124175542.2772-1-i.bornyakov@metrotek.ru> References: <20211124175542.2772-1-i.bornyakov@metrotek.ru> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211124_101028_646498_76F38B04 X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To enable continuous burst clock, add "fsl,continuous-burst-clk" along with "fsl,burst-clk-enable" property to the weim bus's devicetree node. Example: weim: weim@21b8000 { compatible = "fsl,imx6ul-weim", "fsl,imx6q-weim"; reg = <0x021b8000 0x4000>; clocks = <&clks 143>; #address-cells = <2>; #size-cells = <1>; ranges = <0 0 0x50000000 0x08000000>; fsl,weim-cs-gpr = <&gpr>; fsl,burst-clk-enable; fsl,continuous-burst-clk; client-device@0 { ... }; }; Signed-off-by: Ivan Bornyakov Reviewed-by: Fabio Estevam --- drivers/bus/imx-weim.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index 28bb65a5613f..bccb275b65ba 100644 --- a/drivers/bus/imx-weim.c +++ b/drivers/bus/imx-weim.c @@ -21,6 +21,7 @@ struct imx_weim_devtype { unsigned int cs_stride; unsigned int wcr_offset; unsigned int wcr_bcm; + unsigned int wcr_cont_bclk; }; static const struct imx_weim_devtype imx1_weim_devtype = { @@ -41,6 +42,7 @@ static const struct imx_weim_devtype imx50_weim_devtype = { .cs_stride = 0x18, .wcr_offset = 0x90, .wcr_bcm = BIT(0), + .wcr_cont_bclk = BIT(3), }; static const struct imx_weim_devtype imx51_weim_devtype = { @@ -206,8 +208,20 @@ static int weim_parse_dt(struct platform_device *pdev, void __iomem *base) if (of_property_read_bool(pdev->dev.of_node, "fsl,burst-clk-enable")) { if (devtype->wcr_bcm) { reg = readl(base + devtype->wcr_offset); - writel(reg | devtype->wcr_bcm, - base + devtype->wcr_offset); + reg |= devtype->wcr_bcm; + + if (of_property_read_bool(pdev->dev.of_node, + "fsl,continuous-burst-clk")) { + if (devtype->wcr_cont_bclk) { + reg |= devtype->wcr_cont_bclk; + } else { + dev_err(&pdev->dev, + "continuous burst clk not supported.\n"); + return -EINVAL; + } + } + + writel(reg, base + devtype->wcr_offset); } else { dev_err(&pdev->dev, "burst clk mode not supported.\n"); return -EINVAL; From patchwork Wed Nov 24 17:55:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Bornyakov X-Patchwork-Id: 12693565 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 4ABD7C433F5 for ; Wed, 24 Nov 2021 18:12:11 +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:References:In-Reply-To: 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: List-Owner; bh=NS6ehrpdjEqmT2MEZomCBLxVzwR/mPVlIEglcOh8F/I=; b=Uw1er1AiWvdjGA B8P4ib1biwjnHuxYJv56/pPpgq2Mt/neW8k61Pvxqga7Z3sNMWHybFFg50lg5XHDDFpeCrfd6eDPE GOOs+bvqkCC2kyya6rsUAOIJflxKvFQBpZrKmDrOPw4lmoe0vQn/4qiJ5wKcNiVCoaFMgibEz1Q+C 9XJLbf0WXrhFxrPz3PbcjRCYlE+21R0VcR2qUBUYCan3O1mq+x3qlROLcuVqky20RimnvBwAJqZbi 9UZIp0TwSE6byRvKbuK5dOwOy42wB+5a2VSgvAigtBFGkF9D/xdbgAH1qEcMj1H2oYvVs4KJf9yEC 5mf8xR7ysrlwvRwXP/AQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpwjR-005Tuy-PZ; Wed, 24 Nov 2021 18:10:57 +0000 Received: from mail.pr-group.ru ([178.18.215.3]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mpwj2-005TmO-9k for linux-arm-kernel@lists.infradead.org; Wed, 24 Nov 2021 18:10:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=metrotek.ru; s=mail; h=from:subject:date:message-id:to:cc:mime-version:content-transfer-encoding: in-reply-to:references; bh=eRPC+jPltyinnrCnMd2235MZc7JZTbnA8XD3gJo7/5g=; b=hrEOstFkItKn3yTvsyL9B4hUI2Wear7cd9MSAcRr+VpfUxK0MG1WpSjEVlX7IdihljL22ybukDY28 iVHw0wqxSr508AaeRhO8n2TMskmxxBPc2nm8UXxXS4cwQbFzp1tE8vBg/fHSFEqXuvyX6KQzpHa9B8 3rOHLOWJ4g8E6oKVRYNv80UXOco+QPnvOVbcp5FYIZjXKg5L382rQdgXKtLiFMvAMbLc2wA9MgrEYb xgC6r9qGkpHhICqSpl2P7LIdM3p3MXRN4hBDBrD7Tdyj2PtMx4us15fjc+a3cu3sZCHmnVD/Cut/lF FYrMgtV57MygC11D9L/fUHJakaySuCQ== X-Footer: bWV0cm90ZWsucnU= Received: from localhost.localdomain ([178.66.213.198]) (authenticated user i.bornyakov@metrotek.ru) by mail.pr-group.ru with ESMTPSA (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)); Wed, 24 Nov 2021 21:10:27 +0300 From: Ivan Bornyakov To: Cc: Ivan Bornyakov , system@metrotek.ru, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org Subject: [PATCH v2 2/2] dt-bindings: bus: imx-weim: add words about continuous bclk Date: Wed, 24 Nov 2021 20:55:42 +0300 Message-Id: <20211124175542.2772-3-i.bornyakov@metrotek.ru> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211124175542.2772-1-i.bornyakov@metrotek.ru> References: <20211124175542.2772-1-i.bornyakov@metrotek.ru> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211124_101032_552425_0A80B874 X-CRM114-Status: UNSURE ( 7.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Document continuous Burst Clock option. With this option Burst Clock, if enabled, will output continuous clock, otherwise Burst Clock will output clock only when necessary. --- Documentation/devicetree/bindings/bus/imx-weim.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/bus/imx-weim.txt b/Documentation/devicetree/bindings/bus/imx-weim.txt index 1b1d1c5c21ea..e7f502070d77 100644 --- a/Documentation/devicetree/bindings/bus/imx-weim.txt +++ b/Documentation/devicetree/bindings/bus/imx-weim.txt @@ -48,6 +48,11 @@ Optional properties: devices, the presence of this property indicates that the weim bus should operate in Burst Clock Mode. + - fsl,continuous-burst-clk Make Burst Clock to output continuous clock. + Without this option Burst Clock will output clock + only when necessary. This takes effect only if + "fsl,burst-clk-enable" is set. + Timing property for child nodes. It is mandatory, not optional. - fsl,weim-cs-timing: The timing array, contains timing values for the