From patchwork Mon Jun 27 06:47:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 585383 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 49D75C43334 for ; Mon, 27 Jun 2022 06:49:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232502AbiF0Gto (ORCPT ); Mon, 27 Jun 2022 02:49:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232464AbiF0Gtm (ORCPT ); Mon, 27 Jun 2022 02:49:42 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 940B810AD for ; Sun, 26 Jun 2022 23:49:38 -0700 (PDT) Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220627064933epoutp01ba6c83fe26ba2d7002fefa1716b7d4ec~8Z4J5ukM61164311643epoutp01m for ; Mon, 27 Jun 2022 06:49:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220627064933epoutp01ba6c83fe26ba2d7002fefa1716b7d4ec~8Z4J5ukM61164311643epoutp01m DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1656312573; bh=5z+x19IHjXLCqg8eCmD1MyhqL/USWu8oisWwN3c0QFU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MSoed4f22FjsqZRRb4U8uboNsJf+lBXd7+tFG47/Z5JsDb9HWwEWCExiskTlAjTco uIyu0g7xclQAc2V6vKtfk4vldlxD75gxcTwLpd5HMPBHOnwiwmNBJAO2A52YN24xk+ n7ZuIY8p5ZbdlHdI4bI6WnKg8UUsoyP0uayvPs4o= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20220627064932epcas2p3dfef94079bcfe8f811f1d59bbb31397b~8Z4JcLJCS2915129151epcas2p34; Mon, 27 Jun 2022 06:49:32 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.36.98]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4LWdcr1LRYz4x9Q7; Mon, 27 Jun 2022 06:49:32 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 55.EC.09662.CF259B26; Mon, 27 Jun 2022 15:49:32 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20220627064931epcas2p2e1dc352f41895b294d7945c2239de362~8Z4IsbvYj2456724567epcas2p2Q; Mon, 27 Jun 2022 06:49:31 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220627064931epsmtrp210b758ea1309d2dbf70f564305f8f3e8~8Z4IrhnDS2166021660epsmtrp2B; Mon, 27 Jun 2022 06:49:31 +0000 (GMT) X-AuditID: b6c32a48-9f7ff700000025be-99-62b952fce882 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 1E.89.08905.BF259B26; Mon, 27 Jun 2022 15:49:31 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220627064931epsmtip25afe0f913e703d45bb6699095eceaf3c~8Z4Ie5LNL3090630906epsmtip2g; Mon, 27 Jun 2022 06:49:31 +0000 (GMT) From: Chanho Park To: Krzysztof Kozlowski , Andi Shyti , Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Alim Akhtar , devicetree@vger.kernel.org, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Chanho Park Subject: [PATCH 3/5] spi: s3c64xx: support custom value of internal clock divider Date: Mon, 27 Jun 2022 15:47:05 +0900 Message-Id: <20220627064707.138883-4-chanho61.park@samsung.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627064707.138883-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCJsWRmVeSWpSXmKPExsWy7bCmme6foJ1JBp9XsVk8mLeNzWLxj+dM FlMfPmGzuLxf22L+kXOsFn0vHjJb7H29ld1i0+NrrBYzzu9jsmj8eJPdonXvEXYHbo/rSz4x e2xa1cnmcefaHjaPzUvqPfq2rGL0+LxJLoAtKtsmIzUxJbVIITUvOT8lMy/dVsk7ON453tTM wFDX0NLCXEkhLzE31VbJxSdA1y0zB+g6JYWyxJxSoFBAYnGxkr6dTVF+aUmqQkZ+cYmtUmpB Sk6BeYFecWJucWleul5eaomVoYGBkSlQYUJ2xtPX4QV75Su2TJjI2MA4T7KLkYNDQsBEYtW6 qC5GLg4hgR2MEg9bXjBBOJ+AnLtzmSGcb4wSd1+tY+xi5ATr2L3oHCtEYi+jRN/Di1AtHxkl Nv/uZQKpYhPQldjy/BUjSEJE4CajxPSzfWBVzAI3GCX2zlgPNktYIFhi14OZ7CA2i4CqxPWJ G8G6eQXsJfZvecgMsU9eYsP8XjCbU8BBYtHTK1A1ghInZz5hAbGZgWqat84GO1ZCoJdDYsdX mGYXiZ+nXkLZwhKvjm9hh7ClJD6/28sGYRdLLJ31iQmiuYFR4vK2X1AJY4lZz9oZQeHELKAp sX6XPiTIlCWO3ILayyfRcfgvO0SYV6KjTQiiUV3iwPbpLBC2rET3nM+sELaHxJb1r6FhOplR YtfFnewTGBVmIXlnF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PMQowcGsJML7+vrWJCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8F7pOxgsJpCeWpGanphak FsFkmTg4pRqYGLum9kudKe3IeXpi/uxf8/c/2D/zZIh2+OwlMQanr/9cfkh6ZfDVEwmneSRD TnuzT915Z9rxU2xuos9nV8T/e9JgXidc/lGZofx+1ISTCyMlLn6fqGh48JqMTeQD/o7lc8yk u+quteu8fbc/SLCkinlxs/Aen+9u0YlBDEX7provyd5U/9On/aT9jSdOIbwZi3a/V79VdjqR aWnNwmZG81pPk+vxqs2H4owSo+YuKO4JbctcUbdJQq9sj4mUgs/WJ84sdnJufKejnh8reLDb NHzqkjO/zs+bu+HyrvWv2mOUrra+vzXzu3x51vwaj/dvDnDUbzGPqMziV+78yVXfnvFuoZ3h M5v5iau+h3+zUmIpzkg01GIuKk4EALVjHIHxAgAA X-CMS-MailID: 20220627064931epcas2p2e1dc352f41895b294d7945c2239de362 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220627064931epcas2p2e1dc352f41895b294d7945c2239de362 References: <20220627064707.138883-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Modern exynos SoCs such as Exynos Auto v9 has different internal clock divider, for example "4". To support this internal value, this adds clk_div of the s3c64xx_spi_port_config and use it if it is specified. Otherwise, use "2" which is the previous default value. Signed-off-by: Chanho Park --- drivers/spi/spi-s3c64xx.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index e17c74c0d7de..dd5fc8570bce 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -131,6 +131,7 @@ struct s3c64xx_spi_dma_data { * @fifo_lvl_mask: Bit-mask for {TX|RX}_FIFO_LVL bits in SPI_STATUS register. * @rx_lvl_offset: Bit offset of RX_FIFO_LVL bits in SPI_STATUS regiter. * @tx_st_done: Bit offset of TX_DONE bit in SPI_STATUS regiter. + * @clk_div: Internal clock divider, if not specified, use 2 as the default. * @quirks: Bitmask of known quirks * @high_speed: True, if the controller supports HIGH_SPEED_EN bit. * @clk_from_cmu: True, if the controller does not include a clock mux and @@ -148,6 +149,7 @@ struct s3c64xx_spi_port_config { int rx_lvl_offset; int tx_st_done; int quirks; + int clk_div; bool high_speed; bool clk_from_cmu; bool clk_ioclk; @@ -620,6 +622,7 @@ static int s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) void __iomem *regs = sdd->regs; int ret; u32 val; + u32 div = sdd->port_conf->clk_div ? sdd->port_conf->clk_div : 2; /* Disable Clock */ if (!sdd->port_conf->clk_from_cmu) { @@ -668,16 +671,15 @@ static int s3c64xx_spi_config(struct s3c64xx_spi_driver_data *sdd) writel(val, regs + S3C64XX_SPI_MODE_CFG); if (sdd->port_conf->clk_from_cmu) { - /* The src_clk clock is divided internally by 2 */ - ret = clk_set_rate(sdd->src_clk, sdd->cur_speed * 2); + ret = clk_set_rate(sdd->src_clk, sdd->cur_speed * div); if (ret) return ret; - sdd->cur_speed = clk_get_rate(sdd->src_clk) / 2; + sdd->cur_speed = clk_get_rate(sdd->src_clk) / div; } else { /* Configure Clock */ val = readl(regs + S3C64XX_SPI_CLK_CFG); val &= ~S3C64XX_SPI_PSR_MASK; - val |= ((clk_get_rate(sdd->src_clk) / sdd->cur_speed / 2 - 1) + val |= ((clk_get_rate(sdd->src_clk) / sdd->cur_speed / div - 1) & S3C64XX_SPI_PSR_MASK); writel(val, regs + S3C64XX_SPI_CLK_CFG); @@ -871,6 +873,7 @@ static int s3c64xx_spi_setup(struct spi_device *spi) struct s3c64xx_spi_csinfo *cs = spi->controller_data; struct s3c64xx_spi_driver_data *sdd; int err; + u32 div = 2; sdd = spi_master_get_devdata(spi->master); if (spi->dev.of_node) { @@ -889,22 +892,26 @@ static int s3c64xx_spi_setup(struct spi_device *spi) pm_runtime_get_sync(&sdd->pdev->dev); + /* Use clk_div value if it is specified, otherwise use 2 as default */ + if (sdd->port_conf->clk_div) + div = sdd->port_conf->clk_div; + /* Check if we can provide the requested rate */ if (!sdd->port_conf->clk_from_cmu) { u32 psr, speed; /* Max possible */ - speed = clk_get_rate(sdd->src_clk) / 2 / (0 + 1); + speed = clk_get_rate(sdd->src_clk) / div / (0 + 1); if (spi->max_speed_hz > speed) spi->max_speed_hz = speed; - psr = clk_get_rate(sdd->src_clk) / 2 / spi->max_speed_hz - 1; + psr = clk_get_rate(sdd->src_clk) / div / spi->max_speed_hz - 1; psr &= S3C64XX_SPI_PSR_MASK; if (psr == S3C64XX_SPI_PSR_MASK) psr--; - speed = clk_get_rate(sdd->src_clk) / 2 / (psr + 1); + speed = clk_get_rate(sdd->src_clk) / div / (psr + 1); if (spi->max_speed_hz < speed) { if (psr+1 < S3C64XX_SPI_PSR_MASK) { psr++; @@ -914,7 +921,7 @@ static int s3c64xx_spi_setup(struct spi_device *spi) } } - speed = clk_get_rate(sdd->src_clk) / 2 / (psr + 1); + speed = clk_get_rate(sdd->src_clk) / div / (psr + 1); if (spi->max_speed_hz >= speed) { spi->max_speed_hz = speed; } else { From patchwork Mon Jun 27 06:47:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanho Park X-Patchwork-Id: 585382 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2787CCA485 for ; Mon, 27 Jun 2022 06:49:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232509AbiF0Gtp (ORCPT ); Mon, 27 Jun 2022 02:49:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232468AbiF0Gtm (ORCPT ); Mon, 27 Jun 2022 02:49:42 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8774010A8 for ; Sun, 26 Jun 2022 23:49:38 -0700 (PDT) Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220627064933epoutp014f1a8d9099abc33bb4c0628d463b8327~8Z4Kr6w9Y1102211022epoutp01g for ; Mon, 27 Jun 2022 06:49:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220627064933epoutp014f1a8d9099abc33bb4c0628d463b8327~8Z4Kr6w9Y1102211022epoutp01g DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1656312573; bh=8zllR9hyJ8dKnQ6gq7P0sG117iOyo/OTY/EOHg1rNjI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sQE2AZtz8GZ2F9HFL9en4a1Re25RJM6/bKaOgyNIW8FW0iX6Hu7s9t1H/TmzOgDt1 JLhZr8ct4vezYioMRyY5LITLRcV1MkU1Jnmunz89DQx5C2F1aSigBUJJm0NdhNUNRT yXwgANrREcrWPC5SZztAnm73HdZUfbus+V++T0oM= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20220627064932epcas2p4c2e3bdc39c17b362b5e8a11965b76391~8Z4Js1BvZ0616106161epcas2p41; Mon, 27 Jun 2022 06:49:32 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.102]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4LWdcr368Sz4x9Pw; Mon, 27 Jun 2022 06:49:32 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 93.FF.09650.CF259B26; Mon, 27 Jun 2022 15:49:32 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20220627064931epcas2p19407c5c3da3319cfb55dcb2c6d517256~8Z4I1-5Yi1673416734epcas2p1X; Mon, 27 Jun 2022 06:49:31 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220627064931epsmtrp2c026b9dc08fe93b205048abcc9b81026~8Z4I1PsG82152221522epsmtrp2c; Mon, 27 Jun 2022 06:49:31 +0000 (GMT) X-AuditID: b6c32a46-0a3ff700000025b2-2f-62b952fceccc Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id DA.E5.08802.BF259B26; Mon, 27 Jun 2022 15:49:31 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.51]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220627064931epsmtip2affe897662142e83b378f306a93aa11e~8Z4Iphwwh3217532175epsmtip29; Mon, 27 Jun 2022 06:49:31 +0000 (GMT) From: Chanho Park To: Krzysztof Kozlowski , Andi Shyti , Mark Brown , Rob Herring , Krzysztof Kozlowski Cc: Alim Akhtar , devicetree@vger.kernel.org, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Chanho Park Subject: [PATCH 5/5] spi: s3c64xx: add spi port configuration for Exynos Auto v9 SoC Date: Mon, 27 Jun 2022 15:47:07 +0900 Message-Id: <20220627064707.138883-6-chanho61.park@samsung.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627064707.138883-1-chanho61.park@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrCJsWRmVeSWpSXmKPExsWy7bCmqe6foJ1JBrMvC1s8mLeNzWLxj+dM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Xxej/q6vmHs+yiHjJk7nsnEv/RjuV wA1Jdb+6m++fVmIpzkg01GIuKk4EACdAOxnyAgAA X-CMS-MailID: 20220627064931epcas2p19407c5c3da3319cfb55dcb2c6d517256 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220627064931epcas2p19407c5c3da3319cfb55dcb2c6d517256 References: <20220627064707.138883-1-chanho61.park@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add exynosautov9 spi port configuration. It supports up to 12 spis and has DIV_4 as the default internal clock divider. The spi also has an internal loopback mode to run a loopback test. Signed-off-by: Chanho Park --- drivers/spi/spi-s3c64xx.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index dd5fc8570bce..67b1fecf6fc6 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -1447,6 +1447,19 @@ static const struct s3c64xx_spi_port_config exynos5433_spi_port_config = { .quirks = S3C64XX_SPI_QUIRK_CS_AUTO, }; +static struct s3c64xx_spi_port_config exynosautov9_spi_port_config = { + .fifo_lvl_mask = { 0x1ff, 0x1ff, 0x7f, 0x7f, 0x7f, 0x7f, 0x1ff, 0x7f, + 0x7f, 0x7f, 0x7f, 0x7f}, + .rx_lvl_offset = 15, + .tx_st_done = 25, + .high_speed = true, + .clk_from_cmu = true, + .clk_ioclk = true, + .clk_div = 4, + .has_loopback = true, + .quirks = S3C64XX_SPI_QUIRK_CS_AUTO, +}; + static struct s3c64xx_spi_port_config fsd_spi_port_config = { .fifo_lvl_mask = { 0x7f, 0x7f, 0x7f, 0x7f, 0x7f}, .rx_lvl_offset = 15, @@ -1487,6 +1500,9 @@ static const struct of_device_id s3c64xx_spi_dt_match[] = { { .compatible = "samsung,exynos5433-spi", .data = (void *)&exynos5433_spi_port_config, }, + { .compatible = "samsung,exynosautov9-spi", + .data = (void *)&exynosautov9_spi_port_config, + }, { .compatible = "tesla,fsd-spi", .data = (void *)&fsd_spi_port_config, },