From nobody Mon Feb 9 20:59:10 2026 Received: from sender4-pp-o92.zoho.com (sender4-pp-o92.zoho.com [136.143.188.92]) (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 133C326A0D5; Fri, 16 Jan 2026 13:28:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.92 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768570129; cv=pass; b=nAZBus86aYC/Z/Uznf7LIaG1y9Uj7g1iFjMGPR/bh2nPZipsVZCUJxaeZ1sqX8obEalm5rgDZjT5Qx0OIqk4A1cjrE57jSrcRgvqnjr4Mo/eY2EGClcMOb1lpLTpDJnoEKMnp7VOKpRmelCwT5pWLMr7Ago9h3zcWl5djSpSgiI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768570129; c=relaxed/simple; bh=0HKtlqHtld7EIAXot7qbi/hWBScjQ+iXc3sAYrngXHA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=eebFQQwa7FXBcItNmIYofVyxkW+DZB9RveZIa010tojBpNRzjGz4gaERpc4zRaFCCH8LltlB3Lo3t34jOxfCf4VDbwpJUKKdwv2BwEZ5+OAkAqMC2b9FKC5sqA3+w/4MFVCqQmCjmfFIQYhJpj8Lo5oM4Rz6qhcvZEtp30W57lA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.com; spf=pass smtp.mailfrom=zohomail.com; dkim=pass (1024-bit key) header.d=zohomail.com header.i=kingxukai@zohomail.com header.b=epKbVe1A; arc=pass smtp.client-ip=136.143.188.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zohomail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zohomail.com header.i=kingxukai@zohomail.com header.b="epKbVe1A" ARC-Seal: i=1; a=rsa-sha256; t=1768570070; cv=none; d=zohomail.com; s=zohoarc; b=WYrPqxsxmAojAqGgfA0mMOho9rCcvY0BHA7nKoEZOAu6W98JWDwRS/fI8R0TB5sCRaFZ64O+ikCaIBlQvnXDOwPonUE9E+r+b0pgEHZYlRS1+9vLdUr6FaJf3QiSeIyE5glbHGydnMYu37oLwEgjs/1tZStNU0lLXmviJKKVVSI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768570070; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=LTTxQ7LMKN7VTBR1jKjba6PWB38rJkXbGYL2G1nNBGI=; b=CAp3NF//xsXNwddJtNumrQReHNv2R6tzgMdP3/oyKigdQOvz7Ea9m4yRurgqXQ+HMxeEwPXDjwtky5N795qiMmKYWPxNElUpyxk9DNrM6DnHB/Tg77xOXsORAykaRajvEujR3W4nFkvmW2KvoMdUVu/pB/sQxOi4zLodCkE7mlE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zohomail.com; spf=pass smtp.mailfrom=kingxukai@zohomail.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1768570070; s=zm2022; d=zohomail.com; i=kingxukai@zohomail.com; h=From:From:Date:Date:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Message-Id:References:In-Reply-To:To:To:Cc:Cc:Feedback-ID:Reply-To; bh=LTTxQ7LMKN7VTBR1jKjba6PWB38rJkXbGYL2G1nNBGI=; b=epKbVe1A0ipQXbEon0n7sKtjNV6Pcan/cemzdfBHiXXqRejZran6miaCeunk36z0 dehAAKMM3Q8gNGejvsUWjZzXMqwrkHlfKYKNFDcBRjzXfpKHOgs0XsUPDFJ/PvYHhsH 3zK6wajVpxAhk1GlSrrEvTPSGI99fANPbFYRAwKA= Received: by mx.zohomail.com with SMTPS id 1768570067872847.172166779672; Fri, 16 Jan 2026 05:27:47 -0800 (PST) From: Xukai Wang Date: Fri, 16 Jan 2026 21:26:21 +0800 Subject: [PATCH v10 3/3] riscv: dts: canaan: Add clock definition for K230 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260116-b4-k230-clk-v10-3-de59033c5d30@zohomail.com> References: <20260116-b4-k230-clk-v10-0-de59033c5d30@zohomail.com> In-Reply-To: <20260116-b4-k230-clk-v10-0-de59033c5d30@zohomail.com> To: Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Xukai Wang , Paul Walmsley , Palmer Dabbelt , Albert Ou , Conor Dooley Cc: linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Samuel Holland , Troy Mitchell X-Mailer: b4 0.14.2 Feedback-ID: rr0801122755652d035447127a596c264700000ab2ecb4b181f084d451726eb1a5d3f6acc22c6f9eb32ceb06:zu080112272cc08f9d066e9252dfa6120c0000e08f7b20689d60c95de801b628d0a99bbdcab0910dfc776504:rf0801122c11a027cdae0de6ede47745270000c608f3fbbe86d7b63b72fdf8135d95eacd9fb94bb0e28994e0448a94a4cb:ZohoMail X-ZohoMailClient: External This patch describes the clock controller integrated in K230 SoC and replace dummy clocks with the real ones for UARTs. For k230-canmv and k230-evb, they provide an additional external pulse input through a pin to serve as clock source. Co-developed-by: Troy Mitchell Signed-off-by: Troy Mitchell Signed-off-by: Xukai Wang --- arch/riscv/boot/dts/canaan/k230-canmv.dts | 11 +++++++++++ arch/riscv/boot/dts/canaan/k230-evb.dts | 11 +++++++++++ arch/riscv/boot/dts/canaan/k230.dtsi | 26 ++++++++++++++++++-------- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/arch/riscv/boot/dts/canaan/k230-canmv.dts b/arch/riscv/boot/dt= s/canaan/k230-canmv.dts index 9565915cead6ad2381ea8249b616e79575feb896..0a862a29aa877b8418968dd0c02= b113b747a1de9 100644 --- a/arch/riscv/boot/dts/canaan/k230-canmv.dts +++ b/arch/riscv/boot/dts/canaan/k230-canmv.dts @@ -17,8 +17,19 @@ ddr: memory@0 { device_type =3D "memory"; reg =3D <0x0 0x0 0x0 0x20000000>; }; + + timerx_pulse_in: clock-50000000 { + compatible =3D "fixed-clock"; + #clock-cells =3D <0>; + clock-frequency =3D <50000000>; + }; }; =20 &uart0 { status =3D "okay"; }; + +&sysclk { + clocks =3D <&osc24m>, <&timerx_pulse_in>; + clock-names =3D "osc24m", "timer-pulse-in"; +}; diff --git a/arch/riscv/boot/dts/canaan/k230-evb.dts b/arch/riscv/boot/dts/= canaan/k230-evb.dts index f898b8e62368c3740d6795fd1e3cb0b261a460ac..c834e3cca751eb6b719d79bb225= dd51866d3caf7 100644 --- a/arch/riscv/boot/dts/canaan/k230-evb.dts +++ b/arch/riscv/boot/dts/canaan/k230-evb.dts @@ -17,8 +17,19 @@ ddr: memory@0 { device_type =3D "memory"; reg =3D <0x0 0x0 0x0 0x20000000>; }; + + timerx_pulse_in: clock-50000000 { + compatible =3D "fixed-clock"; + #clock-cells =3D <0>; + clock-frequency =3D <50000000>; + }; }; =20 &uart0 { status =3D "okay"; }; + +&sysclk { + clocks =3D <&osc24m>, <&timerx_pulse_in>; + clock-names =3D "osc24m", "timer-pulse-in"; +}; diff --git a/arch/riscv/boot/dts/canaan/k230.dtsi b/arch/riscv/boot/dts/can= aan/k230.dtsi index 95c1a3d8fb1192e30113d96d3e96329545bc6ae7..d4bd27b2c1317dd8b5fc6e097ef= 559fef850dd41 100644 --- a/arch/riscv/boot/dts/canaan/k230.dtsi +++ b/arch/riscv/boot/dts/canaan/k230.dtsi @@ -3,6 +3,7 @@ * Copyright (C) 2024 Yangyu Chen */ =20 +#include #include =20 /dts-v1/; @@ -58,11 +59,11 @@ l2_cache: l2-cache { }; }; =20 - apb_clk: apb-clk-clock { + osc24m: clock-24000000 { compatible =3D "fixed-clock"; - clock-frequency =3D <50000000>; - clock-output-names =3D "apb_clk"; #clock-cells =3D <0>; + clock-frequency =3D <24000000>; + clock-output-names =3D "osc24m"; }; =20 soc { @@ -89,10 +90,19 @@ clint: timer@f04000000 { interrupts-extended =3D <&cpu0_intc 3>, <&cpu0_intc 7>; }; =20 + sysclk: clock-controller@91102000 { + compatible =3D "canaan,k230-clk"; + reg =3D <0x0 0x91102000 0x0 0x40>, + <0x0 0x91100000 0x0 0x108>; + clocks =3D <&osc24m>; + clock-names =3D "osc24m"; + #clock-cells =3D <1>; + }; + uart0: serial@91400000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0x0 0x91400000 0x0 0x1000>; - clocks =3D <&apb_clk>; + clocks =3D <&sysclk K230_LS_UART0_RATE>; interrupts =3D <16 IRQ_TYPE_LEVEL_HIGH>; reg-io-width =3D <4>; reg-shift =3D <2>; @@ -102,7 +112,7 @@ uart0: serial@91400000 { uart1: serial@91401000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0x0 0x91401000 0x0 0x1000>; - clocks =3D <&apb_clk>; + clocks =3D <&sysclk K230_LS_UART1_RATE>; interrupts =3D <17 IRQ_TYPE_LEVEL_HIGH>; reg-io-width =3D <4>; reg-shift =3D <2>; @@ -112,7 +122,7 @@ uart1: serial@91401000 { uart2: serial@91402000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0x0 0x91402000 0x0 0x1000>; - clocks =3D <&apb_clk>; + clocks =3D <&sysclk K230_LS_UART2_RATE>; interrupts =3D <18 IRQ_TYPE_LEVEL_HIGH>; reg-io-width =3D <4>; reg-shift =3D <2>; @@ -122,7 +132,7 @@ uart2: serial@91402000 { uart3: serial@91403000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0x0 0x91403000 0x0 0x1000>; - clocks =3D <&apb_clk>; + clocks =3D <&sysclk K230_LS_UART3_RATE>; interrupts =3D <19 IRQ_TYPE_LEVEL_HIGH>; reg-io-width =3D <4>; reg-shift =3D <2>; @@ -132,7 +142,7 @@ uart3: serial@91403000 { uart4: serial@91404000 { compatible =3D "snps,dw-apb-uart"; reg =3D <0x0 0x91404000 0x0 0x1000>; - clocks =3D <&apb_clk>; + clocks =3D <&sysclk K230_LS_UART4_RATE>; interrupts =3D <20 IRQ_TYPE_LEVEL_HIGH>; reg-io-width =3D <4>; reg-shift =3D <2>; --=20 2.34.1