Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5908032rdb; Thu, 14 Dec 2023 03:15:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IFBvpPcFUfW5/J0CjtrhbfTkFor94oPRIMoUPtMccuWqaaYBC++Giv5tlJkkVJotNk5wj+j X-Received: by 2002:a17:902:e5c5:b0:1d0:700b:3f77 with SMTP id u5-20020a170902e5c500b001d0700b3f77mr13181331plf.49.1702552503982; Thu, 14 Dec 2023 03:15:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702552503; cv=none; d=google.com; s=arc-20160816; b=GMx9GCawXGtnn1BuVKpYiqsitmubTk49/9QGmtMqUiFYjHD0yPcgJEBhCkMJTYY8Dd I8uPnTaHqc7SnaxRaGLcWkv4jo7opSAFVEluK/ho9RgQwjTN8Z7rq2MnrPklk+9dlmFT jErPxIk/IEO+pET/+AIgv9CvsjwC6uEgj0k7io35iucrZEJXCpiBbH/Mu5PuUsIfxT1f pOa9he4gY8owbsrENQ+Jp6oUyDr/zl9bstBDDrtnmDWw1gt/m1RN4OTmwFWX+c4tISrC UysgNgnbXbKqLutWAcnhbhP5am1f7hL4Rh2920RNyoElPMYLepUMw4qFXewptUvrGGkg GJyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=FVPTp88lkoUNclLNyMQ28Q4aUPFrbO4VyJ2R1jHccBw=; fh=CcoIwwT9tmYlT4FCwWq35qp4sIWwMFMbkWyp8PZ8pdg=; b=x1VfoqGmBKnmi6KVBbWMKuJn2xKMNTNURbljMH+YORIKwX/Q7dQIo9eQMHrO1pDBtH WayN2ijaxyOJ5xwgP238UafQaeXSqGqqGIHoeZQ6MSUtA+8VgplDSHAPaUwdKVvjQilg Cc7oWroEmQa5kCQ3FdObKD5LwMeRLubWeNLGH7N8Y1LkoDPwrmWFHl+dy95MWKgaO/Q/ P8uZpT3ArWfwwbR1U1PeOocNGDQzyW4S9jXPJpSYHb++sVzCDTPMYPKIt7X7QVjicYHY T3XyHA2IRl6ey2OhRC13W3yS7mJEYPRseH4/ymS6drEYE0fOBKNgUf+Gaot1Au+8BGCb G9tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DIDX77vu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id v67-20020a632f46000000b005c66e020cbdsi10924087pgv.709.2023.12.14.03.15.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:15:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DIDX77vu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id D0CC8833CE25; Thu, 14 Dec 2023 03:15:00 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443970AbjLNLOo (ORCPT + 99 others); Thu, 14 Dec 2023 06:14:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443857AbjLNLOn (ORCPT ); Thu, 14 Dec 2023 06:14:43 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84E75CF for ; Thu, 14 Dec 2023 03:14:49 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d04c097e34so3944905ad.0 for ; Thu, 14 Dec 2023 03:14:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702552489; x=1703157289; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=FVPTp88lkoUNclLNyMQ28Q4aUPFrbO4VyJ2R1jHccBw=; b=DIDX77vu7Ylo0Yxtx6Ept/UrSz8TcmxYZQX6RDkBQjN25+TeGY+EaG0OQdyCGcXiOb qyAq2s+Hw96ZkUjGunUetmCOg2grzAEQ/f2Qc48Yr4fSJTiKb7dDzzyaPublX0wXvdk/ IpLSYTvwRKptTCKLIPAu3LPCR8MrX4MfuMqWwZo0PGjombsrm0jw+kU1pLrRvkZel3uA ZYBwB0sL8giSRJcWAqa6J49LIEkTB5N9g4xxRdGHYv50QW9qloCQtOQtEP4VhXOq9U4/ kClVDPWJwwOoMO0537NHamdcCFpy44px8UHYfyMaTG2Z1drKfJLrfiejIGJwpZKk4Z+x aIGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702552489; x=1703157289; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FVPTp88lkoUNclLNyMQ28Q4aUPFrbO4VyJ2R1jHccBw=; b=Dj1dqpo7FvEskiNwl6z/iqjZfQnb7Ls00b8GUjhTmBaKUEYScCxoNXC4iJFRTyH80L 8HujnAci9klQ8c8eePDrcdBYQsjaQtP7ag7HbofqZBL7l9K4HDwVzhb+S9lcw9C0pSE/ Y1YNV+0/SniBKvZRmodlVpvcYMDb89zDUQ1CwhjL+aCy83kNsJyxaRIOI+TNplDsulPd qTSVD+n0zlNxYTvlNnOpaXOiohX0QFX9E90bvNSeLnfRgXcgATlWopib/FLq6c3gqP0y AGUcHPkOH+6PN4iq2exr54YcAGlXwR+Ql5TdMATqn9KW4WsxayQ6pIVh+YTi6kz0CU54 d06A== X-Gm-Message-State: AOJu0YwqwlsMOVsYT/HqhtOhY5/OsS1HmwSWty1wxtT0rj3qlem20Acn fvQMLqXEWWoeihKmj0TnG1UVOA== X-Received: by 2002:a17:902:ce86:b0:1d3:7368:663 with SMTP id f6-20020a170902ce8600b001d373680663mr343871plg.7.1702552488925; Thu, 14 Dec 2023 03:14:48 -0800 (PST) Received: from localhost ([122.172.82.6]) by smtp.gmail.com with ESMTPSA id j4-20020a170902da8400b001d072591d77sm12200392plx.247.2023.12.14.03.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Dec 2023 03:14:48 -0800 (PST) Date: Thu, 14 Dec 2023 16:44:46 +0530 From: Viresh Kumar To: Brandon Cheo Fusi Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Yangtao Li , devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH 1/5] riscv: dts: allwinner: Update opp table to allow CPU frequency scaling Message-ID: <20231214111446.camz2krqanaieybh@vireshk-i7> References: <20231214103342.30775-1-fusibrandon13@gmail.com> <20231214103342.30775-2-fusibrandon13@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231214103342.30775-2-fusibrandon13@gmail.com> X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Thu, 14 Dec 2023 03:15:01 -0800 (PST) On 14-12-23, 11:33, Brandon Cheo Fusi wrote: > Two OPPs are currently defined for the D1/D1s; one at 408MHz and > another at 1.08GHz. Switching between these can be done with the > "sun50i-cpufreq-nvmem" driver. This patch populates the opp table > appropriately, with inspiration from > https://github.com/Tina-Linux/linux-5.4/blob/master/arch/riscv/boot/dts/sunxi/sun20iw1p1.dtsi > > The supply voltages are PWM-controlled, but support for that IP > is still in the works. So stick to a fixed 0.9V vdd-cpu supply, > which seems to be the default on most D1 boards. > > Signed-off-by: Brandon Cheo Fusi > --- > arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi | 18 +++++++++++++++--- > 1 file changed, 15 insertions(+), 3 deletions(-) > > diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi b/arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi > index 64c3c2e6c..e211fe4c7 100644 > --- a/arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi > +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi > @@ -39,16 +39,22 @@ cpu0_intc: interrupt-controller { > }; > > opp_table_cpu: opp-table-cpu { > - compatible = "operating-points-v2"; > + compatible = "allwinner,sun20i-d1-operating-points", I don't think you should add a new compatible for every SoC that needs to be supported by a DT bindings and cpufreq driver. Maybe you should just reuse "allwinner,sun50i-h6-operating-points" and it will work fine for you ? Rob ? > + "allwinner,sun50i-h6-operating-points"; > + nvmem-cells = <&cpu_speed_grade>; > + nvmem-cell-names = "speed"; > + opp-shared; > > opp-408000000 { > + clock-latency-ns = <244144>; /* 8 32k periods */ > opp-hz = /bits/ 64 <408000000>; > - opp-microvolt = <900000 900000 1100000>; > + opp-microvolt-speed0 = <900000>; The separate property name thing was required when you could have different values for different SoC instances, which can be read from efuses, like in your case. But all I see is speed0 here, why don't you always set opp-microvolt then ? Also why degrade from min/max/target type to just target ? > }; > > opp-1080000000 { > + clock-latency-ns = <244144>; /* 8 32k periods */ > opp-hz = /bits/ 64 <1008000000>; > - opp-microvolt = <900000 900000 1100000>; > + opp-microvolt-speed0 = <900000>; > }; > }; > > @@ -115,3 +121,8 @@ pmu { > <0x00000000 0x0000000f 0xffffffff 0xffffffff 0x00020000>; > }; > }; > + > +&sid { > + cpu_speed_grade: cpu-speed-grade@0 { > + reg = <0x00 0x2>; > + }; > +}; > -- > 2.30.2 -- viresh