Message ID | 20230809173905.1844132-3-a-nandan@ti.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2980335vqr; Wed, 9 Aug 2023 11:03:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGWZ0CBw6G64zGMw15hPYhoHmAVdv+EYLuL56MRxDZlma/gEn0JSzan7xm8YCD2QtMv9FIm X-Received: by 2002:a05:6a20:7486:b0:135:2b01:3739 with SMTP id p6-20020a056a20748600b001352b013739mr3565149pzd.56.1691604205910; Wed, 09 Aug 2023 11:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691604205; cv=none; d=google.com; s=arc-20160816; b=LIDBQT9VDRMi7Z25ID0Zuw88Yn8X1CdhvtsQQpoy5yl8tW7p9tAQKQSkhT6YJvwBFo AYC1c1Hn/gCeuV2s+TZyrSvaXtq4ei/hBhmftPLtoF3r/W7VaFMKu8SW1FVCQKj9IMAE zRp+4Z5nQd4FVmMnIu62GzFZlOXvH4lkIz6yPjC88beNHi8mkjFVDWrNPQWripAkUfAM ilsyV5ESdJ94MH5c2AzohRH4GVX6HxO/IxrZMqE7LeiJ6Y9KFAv/Onm/517fdfZfv7C/ gW+0EtueQMdVj19BVkcOadJQoeGl2LSu7R2fKEV3zZvXsJBjO5BCKbsy7cZcQdOXh9wS ZGIQ== 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:to:from :dkim-signature; bh=UIYntFequHuzIo6Glfr820/gXNIQMMks+9Ss5XA5YU0=; fh=A+sJqtc66o/ycZb+bBWr5uFmf4t500A0xvaxVrwD2BU=; b=yZ+12a6QKjyl66xZKZpe1azxfDI9TAX/j39O1xTM8qnVX4TSef+XlbInjN83QXm/Pr gGpTOs0tOmQcSb1t0iLI2I9a0vwSNPgOn7cGCXpB4OkbB0hsFZcda7jJIp5a956PMxX2 it2vp0N8OoXwC+7cjt/WKhSAbarz4EHhw1IZ8za2KbR+7wKmRD1LjwZXceaxOznRh9b/ VQnB8hQSYicShL0lX358WrQ1/UxMx2tY7H6k0n2oOICrVaU4dGZabJe4233XmnXdepud 2sTdgv+zHv4kM7F3x5MAXc1xEdkBcOU0X+p5m9vS2O2xYpAftn4rJCQHRmCwvpjGRpup NSRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ds87j5vf; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bv14-20020a056a00414e00b00678243b2774si9585323pfb.78.2023.08.09.11.02.58; Wed, 09 Aug 2023 11:03:25 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=ds87j5vf; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229636AbjHIRje (ORCPT <rfc822;craechal@gmail.com> + 99 others); Wed, 9 Aug 2023 13:39:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232505AbjHIRjc (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 9 Aug 2023 13:39:32 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5D3310D2; Wed, 9 Aug 2023 10:39:31 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 379HdKLe058037; Wed, 9 Aug 2023 12:39:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1691602760; bh=UIYntFequHuzIo6Glfr820/gXNIQMMks+9Ss5XA5YU0=; h=From:To:Subject:Date:In-Reply-To:References; b=ds87j5vfrjxggSFQ0JzvJbRiN5NljSaNC6fnIrKTe3VkfohVvsxESHDH769YrEcYU iKjOQ2apJhb5HXkCcQgBd1+U8UuZTh44lxFUdwrBVMwNBF3FiUrLT7vgG8VxeznDv5 YwoX82NrCGrdd5ASicKFZUeBEE47gUyWESHaYNT4= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 379HdKHs082190 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 9 Aug 2023 12:39:20 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 9 Aug 2023 12:39:20 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 9 Aug 2023 12:39:20 -0500 Received: from TI.dhcp.ti.com (ileaxei01-snat.itg.ti.com [10.180.69.5]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 379Hd6gc077353; Wed, 9 Aug 2023 12:39:15 -0500 From: Apurva Nandan <a-nandan@ti.com> To: Apurva Nandan <a-nandan@ti.com>, Nishanth Menon <nm@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>, Tero Kristo <kristo@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Rafael J Wysocki <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>, <linux-arm-kernel@lists.infradead.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>, Udit Kumar <u-kumar1@ti.com>, Keerthy J <j-keerthy@ti.com> Subject: [PATCH 2/3] arm64: dts: ti: k3-j7200: Add the supported frequencies for A72 Date: Wed, 9 Aug 2023 23:09:04 +0530 Message-ID: <20230809173905.1844132-3-a-nandan@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230809173905.1844132-1-a-nandan@ti.com> References: <20230809173905.1844132-1-a-nandan@ti.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773775571972794268 X-GMAIL-MSGID: 1773775571972794268 |
Series |
Add support for thermal mitigation for K3 J7200 SoC
|
|
Commit Message
Apurva Nandan
Aug. 9, 2023, 5:39 p.m. UTC
From: Keerthy <j-keerthy@ti.com> Add 750M, 1G, 1.5G & 2G as the supported frequencies for A72. This enables support for Dynamic Frequency Scaling(DFS) Signed-off-by: Keerthy <j-keerthy@ti.com> Signed-off-by: Apurva Nandan <a-nandan@ti.com> --- arch/arm64/boot/dts/ti/k3-j7200.dtsi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
Comments
On 23:09-20230809, Apurva Nandan wrote: > From: Keerthy <j-keerthy@ti.com> > > Add 750M, 1G, 1.5G & 2G as the supported frequencies for A72. > This enables support for Dynamic Frequency Scaling(DFS) > > Signed-off-by: Keerthy <j-keerthy@ti.com> > Signed-off-by: Apurva Nandan <a-nandan@ti.com> > --- > arch/arm64/boot/dts/ti/k3-j7200.dtsi | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > > diff --git a/arch/arm64/boot/dts/ti/k3-j7200.dtsi b/arch/arm64/boot/dts/ti/k3-j7200.dtsi > index ef73e6d7e858..7222c453096f 100644 > --- a/arch/arm64/boot/dts/ti/k3-j7200.dtsi > +++ b/arch/arm64/boot/dts/ti/k3-j7200.dtsi > @@ -48,6 +48,10 @@ cpu0: cpu@0 { > d-cache-line-size = <64>; > d-cache-sets = <256>; > next-level-cache = <&L2_0>; > + clocks = <&k3_clks 202 2>; > + clock-names = "cpu"; > + operating-points-v2 = <&cpu0_opp_table>; > + #cooling-cells = <2>; /* min followed by max */ > }; > > cpu1: cpu@1 { > @@ -62,6 +66,30 @@ cpu1: cpu@1 { > d-cache-line-size = <64>; > d-cache-sets = <256>; > next-level-cache = <&L2_0>; > + clocks = <&k3_clks 203 0>; > + clock-names = "cpu"; > + operating-points-v2 = <&cpu0_opp_table>; > + #cooling-cells = <2>; /* min followed by max */ > + }; > + }; > + > + cpu0_opp_table: opp-table { > + compatible = "operating-points-v2"; > + > + opp4-2000000000 { > + opp-hz = /bits/ 64 <2000000000>; > + }; > + > + opp3-1500000000 { > + opp-hz = /bits/ 64 <1500000000>; > + }; > + > + opp2-1000000000 { > + opp-hz = /bits/ 64 <1000000000>; > + }; > + > + opp1-750000000 { > + opp-hz = /bits/ 64 <750000000>; > }; > }; > > -- > 2.34.1 > Are you sure this is correct to enable all OPPs without efuse bit checks? https://www.ti.com/lit/ds/symlink/dra821u-q1.pdf 7.5 Operating Performance Points DRA821xC operates only upto 750MHz DRA821xE at 1GHz DRA821xL upto 1.5GHz and DRA821xT upto 2GHz
On 8/10/2023 12:39 AM, Nishanth Menon wrote: > On 23:09-20230809, Apurva Nandan wrote: >> From: Keerthy <j-keerthy@ti.com> >> >> Add 750M, 1G, 1.5G & 2G as the supported frequencies for A72. >> This enables support for Dynamic Frequency Scaling(DFS) >> >> Signed-off-by: Keerthy <j-keerthy@ti.com> >> Signed-off-by: Apurva Nandan <a-nandan@ti.com> >> --- >> arch/arm64/boot/dts/ti/k3-j7200.dtsi | 28 ++++++++++++++++++++++++++++ >> 1 file changed, 28 insertions(+) >> >> diff --git a/arch/arm64/boot/dts/ti/k3-j7200.dtsi b/arch/arm64/boot/dts/ti/k3-j7200.dtsi >> index ef73e6d7e858..7222c453096f 100644 >> --- a/arch/arm64/boot/dts/ti/k3-j7200.dtsi >> +++ b/arch/arm64/boot/dts/ti/k3-j7200.dtsi >> @@ -48,6 +48,10 @@ cpu0: cpu@0 { >> d-cache-line-size = <64>; >> d-cache-sets = <256>; >> next-level-cache = <&L2_0>; >> + clocks = <&k3_clks 202 2>; >> + clock-names = "cpu"; >> + operating-points-v2 = <&cpu0_opp_table>; >> + #cooling-cells = <2>; /* min followed by max */ >> }; >> >> cpu1: cpu@1 { >> @@ -62,6 +66,30 @@ cpu1: cpu@1 { >> d-cache-line-size = <64>; >> d-cache-sets = <256>; >> next-level-cache = <&L2_0>; >> + clocks = <&k3_clks 203 0>; >> + clock-names = "cpu"; >> + operating-points-v2 = <&cpu0_opp_table>; >> + #cooling-cells = <2>; /* min followed by max */ >> + }; >> + }; >> + >> + cpu0_opp_table: opp-table { >> + compatible = "operating-points-v2"; >> + >> + opp4-2000000000 { >> + opp-hz = /bits/ 64 <2000000000>; >> + }; >> + >> + opp3-1500000000 { >> + opp-hz = /bits/ 64 <1500000000>; >> + }; >> + >> + opp2-1000000000 { >> + opp-hz = /bits/ 64 <1000000000>; >> + }; >> + >> + opp1-750000000 { >> + opp-hz = /bits/ 64 <750000000>; >> }; >> }; >> >> -- >> 2.34.1 >> > Are you sure this is correct to enable all OPPs without efuse bit checks? > > https://www.ti.com/lit/ds/symlink/dra821u-q1.pdf > 7.5 Operating Performance Points > DRA821xC operates only upto 750MHz > DRA821xE at 1GHz > DRA821xL upto 1.5GHz and > DRA821xT upto 2GHz Looks, top SKUs is considered here . After detecting which SKU we are running (I hope TRM should have this information- through efuse or some other register) I think, we can follow two approaches. 1) have OPP table for each SKU and select based SKUs type or 2) Do run time fixup by u-boot based upon SKU type
On 17:23-20230810, Kumar, Udit wrote: [..] > > > + opp1-750000000 { > > > + opp-hz = /bits/ 64 <750000000>; > > > }; > > > }; > > > -- > > > 2.34.1 > > > > > Are you sure this is correct to enable all OPPs without efuse bit checks? > > > > https://www.ti.com/lit/ds/symlink/dra821u-q1.pdf > > 7.5 Operating Performance Points > > DRA821xC operates only upto 750MHz > > DRA821xE at 1GHz > > DRA821xL upto 1.5GHz and > > DRA821xT upto 2GHz > > Looks, top SKUs is considered here . > > After detecting which SKU we are running (I hope TRM should have this > information- through efuse or some other register) > > I think, we can follow two approaches. Both of these are wrong approaches. > > 1) have OPP table for each SKU and select based SKUs type or This proliferates cpu dtsi to make it hard to manage > > 2) Do run time fixup by u-boot based upon SKU type This wont work: a) in u-boot's falcon boot mode and puts unrelated responsibility to bootloader (u-boot is not the only bootloader in the party here). b) Further, the reason for doing the opp detection in the kernel is due to the severity of consequence of attempting to run a lower rated chip at higher frequency - PoH (Power on Hours) or physical damage can result. c) Finally, in a virtualized environment: TISCI will get DM (Device Manager) to arbitrate between the each of the VM's request, but if the VM's are'nt self sufficient, we will have DM making wrong choices resulting in (b) condition again. This is the reason why drivers/cpufreq/ti-cpufreq.c exists and all SoCs that have OPPs from TI is handled in the kernel itself.
On 8/10/2023 6:23 PM, Nishanth Menon wrote: > On 17:23-20230810, Kumar, Udit wrote: > [..] >>>> + opp1-750000000 { >>>> + opp-hz = /bits/ 64 <750000000>; >>>> }; >>>> }; >>>> -- >>>> 2.34.1 >>>> >>> [..] >>> This wont work: >>> >>> a) in u-boot's falcon boot mode and puts unrelated responsibility to >>> bootloader (u-boot is not the only bootloader in the party here). >>> b) Further, the reason for doing the opp detection in the kernel is >>> due to the severity of consequence of attempting to run a lower rated >>> chip at higher frequency - PoH (Power on Hours) or physical damage can >>> result. >>> c) Finally, in a virtualized environment: TISCI will get DM (Device >>> Manager) to arbitrate between the each of the VM's request, but if >>> the VM's are'nt self sufficient, we will have DM making wrong choices >>> resulting in (b) condition again. >>> >>> This is the reason why drivers/cpufreq/ti-cpufreq.c exists and all SoCs >>> that have OPPs from TI is handled in the kernel itself. Thanks to pointing to this driver.
diff --git a/arch/arm64/boot/dts/ti/k3-j7200.dtsi b/arch/arm64/boot/dts/ti/k3-j7200.dtsi index ef73e6d7e858..7222c453096f 100644 --- a/arch/arm64/boot/dts/ti/k3-j7200.dtsi +++ b/arch/arm64/boot/dts/ti/k3-j7200.dtsi @@ -48,6 +48,10 @@ cpu0: cpu@0 { d-cache-line-size = <64>; d-cache-sets = <256>; next-level-cache = <&L2_0>; + clocks = <&k3_clks 202 2>; + clock-names = "cpu"; + operating-points-v2 = <&cpu0_opp_table>; + #cooling-cells = <2>; /* min followed by max */ }; cpu1: cpu@1 { @@ -62,6 +66,30 @@ cpu1: cpu@1 { d-cache-line-size = <64>; d-cache-sets = <256>; next-level-cache = <&L2_0>; + clocks = <&k3_clks 203 0>; + clock-names = "cpu"; + operating-points-v2 = <&cpu0_opp_table>; + #cooling-cells = <2>; /* min followed by max */ + }; + }; + + cpu0_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp4-2000000000 { + opp-hz = /bits/ 64 <2000000000>; + }; + + opp3-1500000000 { + opp-hz = /bits/ 64 <1500000000>; + }; + + opp2-1000000000 { + opp-hz = /bits/ 64 <1000000000>; + }; + + opp1-750000000 { + opp-hz = /bits/ 64 <750000000>; }; };