Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5190987rwl; Tue, 11 Apr 2023 01:34:42 -0700 (PDT) X-Google-Smtp-Source: AKy350ZfRP254pWzU7yPVQ+XJRRk/vS2eUFMNaqB6ewgPnVj+/BxRzXu71M2ghMOJsTjRo9uF2NE X-Received: by 2002:a05:6a20:ce1f:b0:de:247e:d1fe with SMTP id ic31-20020a056a20ce1f00b000de247ed1femr13027158pzb.1.1681202081935; Tue, 11 Apr 2023 01:34:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681202081; cv=none; d=google.com; s=arc-20160816; b=vMDPXfaCZntiBol3tny3prd2yeap0DKximM6ru30GK2a5sng9ZGGHJLwX0/2C4XK3V I0i57I40ksIhOGmt5YMY5jhB6sguyIuOgXtawACg0avolmkv7TzTZw7Mdt9882KNqtrv XIUOxis0PPqttuLYm+HvnXhxdhGS8TkzT1iXiNdM3RNkpAkBCnKPSgZuVHqbpSmOfbaC Zj2xPX1d3MnoBS2J0CFvJXQHUPJa/E7zZqLeB99JE9T+FMPxKDVpyNBu2geyGjyb6wnm A5fM41E0LV1R4cXwd3up4sAnFzmd57SEc/VmuJMSyefMBGoyZ5AVZHwgXW/TSHhNFNqY D61w== 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=GyzjbdP7nRn54LV/8eTlE1v76l99nvHa3OJtk++6Xb0=; b=aJvwAZUAOopE1wwOi/EIDJ/11wMSsYwFYHdm7PcOVWOWIfQ8ACK7tStVTMKtDSIipm IQgwkuEo3AFlz4H63QztAzifIO+aCkUt29nUvgGjTTw2iGRsg/9SXM+0YL+UyYHaROfZ pjMuAPyyf0HqQdUrZxrub0nF/0nd68nzhY0dypAUzw/vXIcDRH267KqcURlHvKgqs92O i66vluTbVxUpfw912L4fW0AJQ6owB8cJY0ZCvdYuQa2VFyuMHeBj/eku6EhMB486f1y4 DN9Y0p4CN6s8rLAmXkVMuS6wSUWXAoddyY2VsWy/TBJFdlWuAcVKM5GbtYrN7ZoQh0Ah Tetw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j13-20020a63cf0d000000b0051827ed9c1asi8139942pgg.483.2023.04.11.01.34.29; Tue, 11 Apr 2023 01:34:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230483AbjDKIdI convert rfc822-to-8bit (ORCPT + 99 others); Tue, 11 Apr 2023 04:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230459AbjDKIdD (ORCPT ); Tue, 11 Apr 2023 04:33:03 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F491E62; Tue, 11 Apr 2023 01:33:02 -0700 (PDT) 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 1910C24E29A; Tue, 11 Apr 2023 16:33:01 +0800 (CST) Received: from EXMBX067.cuchost.com (172.16.6.67) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 11 Apr 2023 16:33:01 +0800 Received: from localhost.localdomain (113.72.145.176) by EXMBX067.cuchost.com (172.16.6.67) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 11 Apr 2023 16:33:00 +0800 From: Mason Huo To: "Rafael J. Wysocki" , Viresh Kumar , Emil Renner Berthing , "Rob Herring" , Krzysztof Kozlowski , Conor Dooley , "Paul Walmsley" , Palmer Dabbelt , Albert Ou CC: Shengyu Qu , , , , , Mason Huo Subject: [PATCH v1 3/3] riscv: dts: starfive: Add cpu scaling for JH7110 SoC Date: Tue, 11 Apr 2023 16:32:57 +0800 Message-ID: <20230411083257.16155-4-mason.huo@starfivetech.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230411083257.16155-1-mason.huo@starfivetech.com> References: <20230411083257.16155-1-mason.huo@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.145.176] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX067.cuchost.com (172.16.6.67) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.0 required=5.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the operating-points-v2 to support cpu scaling on StarFive JH7110 SoC. It supports up to 4 cpu frequency loads. Signed-off-by: Mason Huo --- .../jh7110-starfive-visionfive-2.dtsi | 25 +++++++++++++++++++ arch/riscv/boot/dts/starfive/jh7110.dtsi | 25 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi index df582bddae4b..ae446b268e78 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi @@ -228,3 +228,28 @@ &uart0 { pinctrl-0 = <&uart0_pins>; status = "okay"; }; + +&U74_1 { + clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>; + clock-names = "cpu"; + cpu-supply = <®_dcdc2>; +}; + +&U74_2 { + clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>; + clock-names = "cpu"; + cpu-supply = <®_dcdc2>; +}; + +&U74_3 { + clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>; + clock-names = "cpu"; + cpu-supply = <®_dcdc2>; +}; + +&U74_4 { + clocks = <&syscrg JH7110_SYSCLK_CPU_CORE>; + clock-names = "cpu"; + cpu-supply = <®_dcdc2>; +}; + diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi index 4c5fdb905da8..c867f968d054 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -53,6 +53,7 @@ U74_1: cpu@1 { next-level-cache = <&ccache>; riscv,isa = "rv64imafdc_zba_zbb"; tlb-split; + operating-points-v2 = <&cpu_opp>; cpu1_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -79,6 +80,7 @@ U74_2: cpu@2 { next-level-cache = <&ccache>; riscv,isa = "rv64imafdc_zba_zbb"; tlb-split; + operating-points-v2 = <&cpu_opp>; cpu2_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -105,6 +107,7 @@ U74_3: cpu@3 { next-level-cache = <&ccache>; riscv,isa = "rv64imafdc_zba_zbb"; tlb-split; + operating-points-v2 = <&cpu_opp>; cpu3_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -131,6 +134,7 @@ U74_4: cpu@4 { next-level-cache = <&ccache>; riscv,isa = "rv64imafdc_zba_zbb"; tlb-split; + operating-points-v2 = <&cpu_opp>; cpu4_intc: interrupt-controller { compatible = "riscv,cpu-intc"; @@ -164,6 +168,27 @@ core4 { }; }; + cpu_opp: opp-table-0 { + compatible = "operating-points-v2"; + opp-shared; + opp-375000000 { + opp-hz = /bits/ 64 <375000000>; + opp-microvolt = <800000>; + }; + opp-500000000 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <800000>; + }; + opp-750000000 { + opp-hz = /bits/ 64 <750000000>; + opp-microvolt = <800000>; + }; + opp-1500000000 { + opp-hz = /bits/ 64 <1500000000>; + opp-microvolt = <1040000>; + }; + }; + gmac0_rgmii_rxin: gmac0-rgmii-rxin-clock { compatible = "fixed-clock"; clock-output-names = "gmac0_rgmii_rxin"; -- 2.39.2