From patchwork Wed May 14 10:02:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghav Sharma X-Patchwork-Id: 890536 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9F2C227B515 for ; Wed, 14 May 2025 13:52:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747230763; cv=none; b=YDi9JVi8BOv/IAE8YobFNVglkKeMwutcTQemuLccYXWKQIlWYuoh26fvNxhBBJEnTmUPHrdqc/a2o2aVEBhE7gwlIubudfyhyyqPZcxXR6AT9CPwjyX3Jsl0heJmcNtw0ZKWUCLpmqUBxFfW6+92KWOj7ihS86GQ+IWg5pa1YdE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747230763; c=relaxed/simple; bh=vGRXf0maFs9Ro2S//GRb+Lum6CnZm0r1JvoS56f1RHw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=cYNjvR43uttmzrYJgvDN/hAd8MmDoStABVuK0Ri+t4ZUw2kJomXd/Wykj4+n/BQhEG/jKpYIXFg40IRytGJiIm021EScOI0woQ+UrjvFs7oYtsTsjpzJwH7fK52TNH7RL0KNzigTSdQWlKvgKQcuonMz//UkoEgReQCx/iaYINs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=HZAGCzBS; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="HZAGCzBS" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20250514135239epoutp03f1974fd7e1b083c70cee1017b8072c4d~-aR5gmm0U2537225372epoutp03j for ; Wed, 14 May 2025 13:52:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20250514135239epoutp03f1974fd7e1b083c70cee1017b8072c4d~-aR5gmm0U2537225372epoutp03j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1747230759; bh=8WKsU5t0kQKXkzewEHojQ9MYlM5Y7vAzte+OeClSGAw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HZAGCzBSTJX8ipRcPHVIjoiiezhdTXPE6NKDqRYBPQf/9pBXMJ0YqKvN/BewKUYNC U4asBXfwEnOOBT/9swjI7hqW/NtER3O2pmakPQiROLPjMjmYqdU2IvVIlOHlvPNGQK bVD6n7UX3nvcWngBJRctFkBT6eseGigh9Hk57GFM= Received: from epsnrtp01.localdomain (unknown [182.195.42.153]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPS id 20250514135238epcas5p480177a4de5ac9c047399544bb3285ca4~-aR4vXONY3115031150epcas5p4M; Wed, 14 May 2025 13:52:38 +0000 (GMT) Received: from epcas5p2.samsung.com (unknown [182.195.38.178]) by epsnrtp01.localdomain (Postfix) with ESMTP id 4ZyFCS5dyyz6B9m6; Wed, 14 May 2025 13:52:36 +0000 (GMT) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p4.samsung.com (KnoxPortal) with ESMTPA id 20250514095239epcas5p4a08eea7daa18a0fbda8873f64122a774~-XAWq1QPV1932519325epcas5p4E; Wed, 14 May 2025 09:52:39 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20250514095239epsmtrp165f4ee08a6c2e9506ed795018f8114e5~-XAWp0ABe1927519275epsmtrp1Q; Wed, 14 May 2025 09:52:39 +0000 (GMT) X-AuditID: b6c32a29-55afd7000000223e-67-682467e773de Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 7E.8B.08766.7E764286; Wed, 14 May 2025 18:52:39 +0900 (KST) Received: from bose.samsungds.net (unknown [107.108.83.9]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20250514095236epsmtip2db692ab276e71302b8d52d182d5c59f7~-XAT3BQRN1817318173epsmtip2L; Wed, 14 May 2025 09:52:36 +0000 (GMT) From: Raghav Sharma To: krzk@kernel.org, s.nawrocki@samsung.com, cw00.choi@samsung.com, alim.akhtar@samsung.com, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, conor+dt@kernel.org, richardcochran@gmail.com, sunyeal.hong@samsung.com, shin.son@samsung.com Cc: linux-samsung-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, dev.tailor@samsung.com, chandan.vn@samsung.com, karthik.sun@samsung.com, Raghav Sharma Subject: [PATCH v2 2/3] clk: samsung: exynosautov920: add block hsi2 clock support Date: Wed, 14 May 2025 15:32:13 +0530 Message-Id: <20250514100214.2479552-3-raghav.s@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250514100214.2479552-1-raghav.s@samsung.com> Precedence: bulk X-Mailing-List: linux-samsung-soc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeLIzCtJLcpLzFFi42LZdlhJXvd5ukqGwbNPOhYP5m1js5jwJcJi zd5zTBbXvzxntbi3Yxm7xfwj51gtGme8YbI4f34Du8Wmx9dYLT723GO1uLxrDpvFjPP7mCwu nnK1OLZAzOL7yjuMFkfOvGC2+L9nB7vF4TftrBb/rm1ksZh8fC2rRdOy9UwOoh7vb7Sye+yc dZfdY9OqTjaPzUvqPfq2rGL0+LxJLoAtissmJTUnsyy1SN8ugSvj+qLzbAXzlSsmfm1haWA8 ItvFyMkhIWAi8XnBRxYQW0hgN6PEnXfZEHEJiX3/fzNC2MISK/89Z+9i5AKqecsosbH5HBtI gk1AS+LK9ndsIAkRgS4miXP/XoFNYhbYySSxcr0EiC0sECSxYsFpsAYWAVWJLbums4LYvALW EjvmfWSG2CAvsf/gWTCbU8BG4uuLy8wQF1lLtLyawwRRLyhxcuYTqPnyEs1bZzNPYBSYhSQ1 C0lqASPTKkbJ1ILi3PTcYsMCw7zUcr3ixNzi0rx0veT83E2M4CjT0tzBuH3VB71DjEwcjIcY JTiYlUR4r2cpZwjxpiRWVqUW5ccXleakFh9ilOZgURLnFX/RmyIkkJ5YkpqdmlqQWgSTZeLg lGpgChf03SDzNWxb7CXBTcc/aDWd7Rd5pZc3JyLgdURikKCUd6f5xWvNSbGXvu6xzfq1fENr XOb9r1mS1cczn3lPuHih0vj0oflLMiYr8te8O5/Aqc77/MYm500mU+7sTFsl+5Upd9uDOy8f Wara37s348KkPZ/7rshYKQXxKvo1PzhhLvja++BUIU5lf42nc+f47crpDfFX7suQnSO0f9rC b5+uzhLapbK3eO7tlrmf/zA3S7LprpL/UW577GShwd+TBZdj57SnfW/49P9w2MROPzWRg1ZH r7w+7XPz3dWLh89Iyxf2GB9K3T9N9KVxH3vp78aX1jtP+Nx+y2U8k/HJdK5w+bIEJWeDx5/Y Hz74/kOJpTgj0VCLuag4EQDcJh+1IQMAAA== X-CMS-MailID: 20250514095239epcas5p4a08eea7daa18a0fbda8873f64122a774 X-Msg-Generator: CA X-Sendblock-Type: REQ_APPROVE CMS-TYPE: 105P cpgsPolicy: CPGSC10-543,Y X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250514095239epcas5p4a08eea7daa18a0fbda8873f64122a774 References: <20250514100214.2479552-1-raghav.s@samsung.com> Register compatible and cmu_info data to support clocks. CMU_HSI2, this provides clocks for HSI2 block Signed-off-by: Raghav Sharma --- drivers/clk/samsung/clk-exynosautov920.c | 72 ++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/drivers/clk/samsung/clk-exynosautov920.c b/drivers/clk/samsung/clk-exynosautov920.c index da4afe8ac2ab..572b6ace14ac 100644 --- a/drivers/clk/samsung/clk-exynosautov920.c +++ b/drivers/clk/samsung/clk-exynosautov920.c @@ -26,6 +26,7 @@ #define CLKS_NR_MISC (CLK_DOUT_MISC_OSC_DIV2 + 1) #define CLKS_NR_HSI0 (CLK_DOUT_HSI0_PCIE_APB + 1) #define CLKS_NR_HSI1 (CLK_MOUT_HSI1_USBDRD + 1) +#define CLKS_NR_HSI2 (CLK_DOUT_HSI2_ETHERNET_PTP + 1) /* ---- CMU_TOP ------------------------------------------------------------ */ @@ -1752,6 +1753,74 @@ static const struct samsung_cmu_info hsi1_cmu_info __initconst = { .clk_name = "noc", }; +/* ---- CMU_HSI2 --------------------------------------------------------- */ + +/* Register Offset definitions for CMU_HSI2 (0x16b00000) */ +#define PLL_LOCKTIME_PLL_ETH 0x0 +#define PLL_CON3_PLL_ETH 0x10c +#define PLL_CON0_MUX_CLKCMU_HSI2_ETHERNET_USER 0x600 +#define PLL_CON0_MUX_CLKCMU_HSI2_NOC_UFS_USER 0x610 +#define PLL_CON0_MUX_CLKCMU_HSI2_UFS_EMBD_USER 0x630 +#define CLK_CON_MUX_MUX_CLK_HSI2_ETHERNET 0x1000 +#define CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET 0x1800 +#define CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET_PTP 0x1804 + +static const unsigned long hsi2_clk_regs[] __initconst = { + PLL_LOCKTIME_PLL_ETH, + PLL_CON3_PLL_ETH, + PLL_CON0_MUX_CLKCMU_HSI2_ETHERNET_USER, + PLL_CON0_MUX_CLKCMU_HSI2_NOC_UFS_USER, + PLL_CON0_MUX_CLKCMU_HSI2_UFS_EMBD_USER, + CLK_CON_MUX_MUX_CLK_HSI2_ETHERNET, + CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET, + CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET_PTP, +}; + +static const struct samsung_pll_clock hsi2_pll_clks[] __initconst = { + /* CMU_HSI2_PLL */ + PLL(pll_531x, FOUT_PLL_ETH, "fout_pll_eth", "oscclk", + PLL_LOCKTIME_PLL_ETH, PLL_CON3_PLL_ETH, NULL), +}; + +/* List of parent clocks for Muxes in CMU_HSI2 */ +PNAME(mout_clkcmu_hsi2_noc_ufs_user_p) = { "oscclk", "dout_clkcmu_hsi2_noc_ufs" }; +PNAME(mout_clkcmu_hsi2_ufs_embd_user_p) = { "oscclk", "dout_clkcmu_hsi2_ufs_embd" }; +PNAME(mout_hsi2_ethernet_p) = { "fout_pll_eth", "mout_clkcmu_hsi2_ethernet_user" }; +PNAME(mout_clkcmu_hsi2_ethernet_user_p) = { "oscclk", "dout_clkcmu_hsi2_ethernet" }; + +static const struct samsung_mux_clock hsi2_mux_clks[] __initconst = { + MUX(CLK_MOUT_HSI2_NOC_UFS_USER, "mout_clkcmu_hsi2_noc_ufs_user", + mout_clkcmu_hsi2_noc_ufs_user_p, PLL_CON0_MUX_CLKCMU_HSI2_NOC_UFS_USER, 4, 1), + MUX(CLK_MOUT_HSI2_UFS_EMBD_USER, "mout_clkcmu_hsi2_ufs_embd_user", + mout_clkcmu_hsi2_ufs_embd_user_p, PLL_CON0_MUX_CLKCMU_HSI2_UFS_EMBD_USER, 4, 1), + MUX(CLK_MOUT_HSI2_ETHERNET, "mout_hsi2_ethernet", + mout_hsi2_ethernet_p, CLK_CON_MUX_MUX_CLK_HSI2_ETHERNET, 0, 1), + MUX(CLK_MOUT_HSI2_ETHERNET_USER, "mout_clkcmu_hsi2_ethernet_user", + mout_clkcmu_hsi2_ethernet_user_p, PLL_CON0_MUX_CLKCMU_HSI2_ETHERNET_USER, 4, 1), +}; + +static const struct samsung_div_clock hsi2_div_clks[] __initconst = { + DIV(CLK_DOUT_HSI2_ETHERNET, "dout_hsi2_ethernet", + "mout_hsi2_ethernet", CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET, + 0, 4), + DIV(CLK_DOUT_HSI2_ETHERNET_PTP, "dout_hsi2_ethernet_ptp", + "mout_hsi2_ethernet", CLK_CON_DIV_DIV_CLK_HSI2_ETHERNET_PTP, + 0, 4), +}; + +static const struct samsung_cmu_info hsi2_cmu_info __initconst = { + .pll_clks = hsi2_pll_clks, + .nr_pll_clks = ARRAY_SIZE(hsi2_pll_clks), + .mux_clks = hsi2_mux_clks, + .nr_mux_clks = ARRAY_SIZE(hsi2_mux_clks), + .div_clks = hsi2_div_clks, + .nr_div_clks = ARRAY_SIZE(hsi2_div_clks), + .nr_clk_ids = CLKS_NR_HSI2, + .clk_regs = hsi2_clk_regs, + .nr_clk_regs = ARRAY_SIZE(hsi2_clk_regs), + .clk_name = "noc", +}; + static int __init exynosautov920_cmu_probe(struct platform_device *pdev) { const struct samsung_cmu_info *info; @@ -1779,6 +1848,9 @@ static const struct of_device_id exynosautov920_cmu_of_match[] = { }, { .compatible = "samsung,exynosautov920-cmu-hsi1", .data = &hsi1_cmu_info, + }, { + .compatible = "samsung,exynosautov920-cmu-hsi2", + .data = &hsi2_cmu_info, }, { } };