From patchwork Wed Dec 6 11:50:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: JeeHeng Sia X-Patchwork-Id: 174538 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4049586vqy; Wed, 6 Dec 2023 03:53:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IG1VIBwOnJHW610knTdzO5YCIit0cQeoPIBeH1Reauv8zrHIzw2owsAKX44r/M9cKlCAlAE X-Received: by 2002:a17:902:f54f:b0:1d0:c849:780 with SMTP id h15-20020a170902f54f00b001d0c8490780mr500841plf.70.1701863615994; Wed, 06 Dec 2023 03:53:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701863615; cv=none; d=google.com; s=arc-20160816; b=qcz7yDGGrA0sSQ4aci7kAw9whpiCVemTK1LGgwtytQETaaZCfn6f9i4hAF6sKEzHny TMKGt7O0xskW/hcI/OcG+idly/uT4xomAVxL0LQ+3eom9Ffuqgy2OvmXufhwRU1Mmqt0 W5xUVJIaG+pLLCaR1fTUu8zgxY6JFczUrO+LAvgS7SmgGwGMph3CiI4fPcuvqoxIVntj U1i/SLyHvh902jX439gkVG7u9MSpa/aq9Y9FcCkvymoSuLTXROmCe3rQ1gY2jJD5hcct TCnbzY43q+WKP4myegYOxRSPbxCrWPASDsxdS+Bn5KGTGNnWmQrNlOYSNX74Tz80Hk8J QOzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=T1VYiXIuPL1+dEJnpeOl+boXgk3DktyKt0Pzr0WSv10=; fh=nAnTSeHk7ZG6JaVuKwLyTGDSWDb/q5GiASFSvBr1exo=; b=K9R4HiSlTbTj+Q1lwv6akDJg5997xK9qXgtXs0DXzwZ3aP4xumf3rSJk1NSXkmMmIV 7KWVWs1+66Cgx42BmE/vvpaO+WyBfBpYMfZo827nxb/GxLt5qnTl3G718CItYzA0S3R8 yqKcglamXZwGdtaJYUf52TcfRvZ126+IoxK1Zh/lQ8Iq7bm+PUrn8nrPTa4mz0qaPo2q MFKXfZreCPwtRDbnWVclFThvnrJm1c25ixwP6LPGHD7FJ5CcfllMmrknjmYHO1vtpUiM rlVxWAtSv7W9Sr1AngvvUA/+hrJFBiVMIJy+LGV+pNMFBnGoHUvUaPx4fKbB2+S5UzMs lyEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id be8-20020a170902aa0800b001cfda41727esi5388610plb.509.2023.12.06.03.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 03:53:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 36EA380C257C; Wed, 6 Dec 2023 03:53:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377876AbjLFLxQ convert rfc822-to-8bit (ORCPT + 99 others); Wed, 6 Dec 2023 06:53:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377867AbjLFLxA (ORCPT ); Wed, 6 Dec 2023 06:53:00 -0500 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC83826AF; Wed, 6 Dec 2023 03:52:22 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 3F79C24E311; Wed, 6 Dec 2023 19:52:21 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 6 Dec 2023 19:52:21 +0800 Received: from jsia-virtual-machine.localdomain (175.136.135.142) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 6 Dec 2023 19:52:14 +0800 From: Sia Jee Heng To: , , , , , , , , , , , , CC: , , , , , Subject: [PATCH v1 16/16] riscv: dts: starfive: jh8100: Add clocks and resets nodes Date: Wed, 6 Dec 2023 19:50:00 +0800 Message-ID: <20231206115000.295825-17-jeeheng.sia@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231206115000.295825-1-jeeheng.sia@starfivetech.com> References: <20231206115000.295825-1-jeeheng.sia@starfivetech.com> MIME-Version: 1.0 X-Originating-IP: [175.136.135.142] X-ClientProxiedBy: EXCAS062.cuchost.com (172.16.6.22) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 06 Dec 2023 03:53:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784533342638571031 X-GMAIL-MSGID: 1784533342638571031 Add SYSCRG/SYSCRG-NE/SYSCRG-NW/SYSCRG-SW/AONCRG clock and reset nodes for JH8100 RISC-V SoC. Signed-off-by: Sia Jee Heng Reviewed-by: Ley Foon Tan --- arch/riscv/boot/dts/starfive/jh8100-clk.dtsi | 180 +++++++++++++++++++ arch/riscv/boot/dts/starfive/jh8100.dtsi | 115 ++++++++++++ 2 files changed, 295 insertions(+) create mode 100644 arch/riscv/boot/dts/starfive/jh8100-clk.dtsi diff --git a/arch/riscv/boot/dts/starfive/jh8100-clk.dtsi b/arch/riscv/boot/dts/starfive/jh8100-clk.dtsi new file mode 100644 index 000000000000..27ba249f523e --- /dev/null +++ b/arch/riscv/boot/dts/starfive/jh8100-clk.dtsi @@ -0,0 +1,180 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2023 StarFive Technology Co., Ltd. + */ + +/ { + clk_osc: clk_osc { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <24000000>; + }; + + clk_i2srx_bclk_ext: clk_i2srx_bclk_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12288000>; + }; + + clk_i2srx_lrck_ext: clk_i2srx_lrck_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <192000>; + }; + + clk_mclk_ext: clk_mclk_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <49152000>; + }; + /* sys-ne */ + clk_usb3_tap_tck_ext: clk_usb3_tap_tck_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_glb_ext_clk: clk_glb_ext_clk { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <30000000>; + }; + + clk_usb1_tap_tck_ext: clk_usb1_tap_tck_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_usb2_tap_tck_ext: clk_usb2_tap_tck_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_i2s_tscko: clk_i2s_tscko { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12800000>; + }; + + clk_typec_tap_tck_ext: clk_typec_tap_tck_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_spi_in0_ext: clk_spi_in0_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_spi_in1_ext: clk_spi_in1_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_spi_in2_ext: clk_spi_in2_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_i2stx_bclk_ext: clk_i2stx_bclk_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12288000>; + }; + + clk_i2stx_lrck_ext: clk_i2stx_lrck_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <192000>; + }; + /* sys-nw */ + clk_dvp_ext: clk_dvp_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <150000000>; + }; + + clk_isp_dphy_tap_tck_ext: clk_isp_dphy_tap_tck_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_vout_mipi_dphy_tap_tck_ext: clk_vout_mipi_dphy_tap_tck_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_vout_edp_tap_tck_ext: clk_vout_edp_tap_tck_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <100000000>; + }; + + clk_rtc: clk_rtc { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <32768>; + }; + /* aon */ + clk_gmac0_rmii_func: clk_gmac0_rmii_func { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + }; + + clk_gmac0_rgmii_func: clk_gmac0_rgmii_func { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <125000000>; + }; + + clk_aon50: clk_aon50 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + }; + + clk_aon125: clk_aon125 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <125000000>; + }; + + clk_aon2000: clk_aon2000 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <2000000000>; + }; + + clk_aon200: clk_aon200 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <200000000>; + }; + + clk_aon667: clk_isp_aon667 { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <667000000>; + }; + + clk_i3c_ext: clk_i3c_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <12500000>; + }; + + clk_espi_ext: clk_espi_ext { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <60000000>; + }; +}; diff --git a/arch/riscv/boot/dts/starfive/jh8100.dtsi b/arch/riscv/boot/dts/starfive/jh8100.dtsi index f26aff5c1ddf..9863c61324a0 100644 --- a/arch/riscv/boot/dts/starfive/jh8100.dtsi +++ b/arch/riscv/boot/dts/starfive/jh8100.dtsi @@ -4,6 +4,9 @@ */ /dts-v1/; +#include +#include +#include "jh8100-clk.dtsi" / { compatible = "starfive,jh8100"; @@ -357,6 +360,104 @@ uart4: serial@121a0000 { status = "disabled"; }; + syscrg_ne: syscrg_ne@12320000 { + compatible = "starfive,jh8100-syscrg-ne"; + reg = <0x0 0x12320000 0x0 0x10000>; + clocks = <&clk_osc>, <&syscrg SYSCRG_CLK_AXI_400>, + <&syscrg SYSCRG_CLK_VOUT_ROOT0>, + <&syscrg SYSCRG_CLK_VOUT_ROOT1>, + <&syscrg SYSCRG_CLK_USB_WRAP_480>, + <&syscrg SYSCRG_CLK_USB_WRAP_625>, + <&syscrg SYSCRG_CLK_USB_WRAP_240>, + <&syscrg SYSCRG_CLK_USB_WRAP_60>, + <&syscrg SYSCRG_CLK_USB_WRAP_156P25>, + <&syscrg SYSCRG_CLK_USB_WRAP_312P5>, + <&syscrg SYSCRG_CLK_USB_125M>, + <&syscrg_nw SYSCRG_NW_CLK_GPIO_100>, + <&syscrg SYSCRG_CLK_PERH_ROOT>, <&syscrg SYSCRG_CLK_MCLK>, + <&syscrg SYSCRG_CLK_PERH_ROOT_PREOSC>, + <&syscrg SYSCRG_CLK_AHB0>, + <&syscrg SYSCRG_CLK_APB_BUS_PER1>, + <&syscrg SYSCRG_CLK_APB_BUS_PER2>, + <&syscrg SYSCRG_CLK_APB_BUS_PER3>, + <&syscrg SYSCRG_CLK_APB_BUS_PER5>, + <&syscrg SYSCRG_CLK_VENC_ROOT>, + <&syscrg SYSCRG_CLK_SPI_CORE_100>, + <&clk_glb_ext_clk>, <&clk_usb3_tap_tck_ext>, + <&clk_usb1_tap_tck_ext>, <&clk_usb2_tap_tck_ext>, + <&clk_typec_tap_tck_ext>, <&clk_spi_in0_ext>, + <&clk_spi_in1_ext>, <&clk_i2stx_bclk_ext>, <&clk_i2stx_lrck_ext>; + clock-names = "clk_osc", "sys_clk_axi_400", + "sys_clk_vout_root0", "sys_clk_vout_root1", + "sys_clk_usb_wrap_480", "sys_clk_usb_wrap_625", + "sys_clk_usb_wrap_240", "sys_clk_usb_wrap_60", + "sys_clk_usb_wrap_156p25", "sys_clk_usb_wrap_312p5", + "sys_clk_usb_125m", "sys_nw_clk_gpio_100", + "sys_clk_perh_root", "sys_clk_mclk", + "sys_clk_perh_root_preosc", "sys_clk_ahb0", + "sys_clk_apb_bus_per1", "sys_clk_apb_bus_per2", + "sys_clk_apb_bus_per3", "sys_clk_apb_bus_per5", + "sys_clk_venc_root", "sys_clk_spi_core_100", + "clk_glb_ext_clk", "clk_usb3_tap_tck_ext", + "clk_usb1_tap_tck_ext", "clk_usb2_tap_tck_ext", + "clk_typec_tap_tck_ext", "clk_spi_in0_ext", + "clk_spi_in1_ext", "clk_i2stx_bclk_ext", + "clk_i2stx_lrck_ext"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + syscrg_nw: syscrg_nw@123c0000 { + compatible = "starfive,jh8100-syscrg-nw"; + reg = <0x0 0x123c0000 0x0 0x10000>; + clocks = <&clk_osc>, <&syscrg SYSCRG_CLK_APB_BUS>, + <&syscrg SYSCRG_CLK_ISP_2X>, <&syscrg SYSCRG_CLK_ISP_AXI>, + <&syscrg SYSCRG_CLK_VOUT_ROOT0>, <&syscrg SYSCRG_CLK_VOUT_ROOT1>, + <&syscrg SYSCRG_CLK_VOUT_SCAN_ATS>, + <&syscrg SYSCRG_CLK_VOUT_DC_CORE>, <&syscrg SYSCRG_CLK_VOUT_AXI>, + <&syscrg SYSCRG_CLK_AXI_400>, <&syscrg SYSCRG_CLK_AXI_200>, + <&syscrg SYSCRG_CLK_PERH_ROOT_PREOSC>, + <&clk_dvp_ext>, <&clk_isp_dphy_tap_tck_ext>, + <&clk_glb_ext_clk>, <&clk_i2s_tscko>, + <&clk_vout_mipi_dphy_tap_tck_ext>, <&clk_vout_edp_tap_tck_ext>, + <&clk_spi_in2_ext>; + clock-names = "clk_osc", "sys_clk_apb_bus", + "sys_clk_isp_2x", "sys_clk_isp_axi", + "sys_clk_vout_root0", "sys_clk_vout_root1", + "sys_clk_vout_scan_ats", "sys_clk_vout_dc_core", + "sys_clk_vout_axi", "sys_clk_axi_400", + "sys_clk_axi_200", "sys_clk_perh_root_preosc", "clk_dvp_ext", + "clk_isp_dphy_tap_tck_ext", "clk_glb_ext_clk", + "clk_i2s_tscko", "clk_vout_mipi_dphy_tap_tck_ext", + "clk_vout_edp_tap_tck_ext", "clk_spi_in2_ext"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + syscrg: syscrg@126d0000 { + compatible = "starfive,jh8100-syscrg"; + reg = <0x0 0x126d0000 0x0 0x10000>; + clocks = <&clk_osc>, <&clk_i2srx_bclk_ext>, + <&clk_i2srx_lrck_ext>, <&clk_mclk_ext>; + clock-names = "clk_osc", "clk_i2srx_bclk_ext", + "clk_i2srx_lrck_ext", "clk_mclk_ext"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + + syscrg_sw: syscrg_sw@12720000 { + compatible = "starfive,jh8100-syscrg-sw"; + reg = <0x0 0x12720000 0x0 0x10000>; + clocks = <&syscrg SYSCRG_CLK_APB_BUS>, + <&syscrg SYSCRG_CLK_VDEC_ROOT>, + <&syscrg SYSCRG_CLK_FLEXNOC1>; + clock-names = "sys_clk_apb_bus", + "sys_clk_vdec_root", + "sys_clk_flexnoc1"; + #clock-cells = <1>; + #reset-cells = <1>; + }; + uart5: serial@127d0000 { compatible = "starfive,jh8100-uart", "cdns,uart-r1p8"; reg = <0x0 0x127d0000 0x0 0x10000>; @@ -374,5 +475,19 @@ uart6: serial@127e0000 { interrupts = <73>; status = "disabled"; }; + + aoncrg: aoncrg@1f310000 { + compatible = "starfive,jh8100-aoncrg"; + reg = <0x0 0x1f310000 0x0 0x10000>; + clocks = <&clk_osc>, <&clk_gmac0_rmii_func>, + <&clk_gmac0_rgmii_func>, <&clk_aon125>, + <&clk_aon2000>, <&clk_aon200>, + <&clk_aon667>, <&clk_rtc>; + clock-names = "clk_osc", "clk_gmac0_rmii_func", "clk_gmac0_rgmii_func", + "clk_aon125", "clk_aon2000", "clk_aon200", + "clk_aon667", "clk_rtc"; + #clock-cells = <1>; + #reset-cells = <1>; + }; }; };