Received: by 2002:a05:7412:8d06:b0:f9:332d:97f1 with SMTP id bj6csp42055rdb; Mon, 18 Dec 2023 08:24:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHt8x3FdO3XhoSMD6pLvUPm8xOBxIVQDJzVsrtREkQEiDVtnNNJUs+z0x36oA/KYgAdDOAS X-Received: by 2002:a17:902:ca0b:b0:1d3:8b14:6098 with SMTP id w11-20020a170902ca0b00b001d38b146098mr1845796pld.49.1702916690417; Mon, 18 Dec 2023 08:24:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702916690; cv=none; d=google.com; s=arc-20160816; b=HYWU0Ro0vQmuKOaJpCtHMlP9sxzCdbn7P/wkITUSisLX+WC9a+lbo4347g6Y4oUsZf SmjLcLJJ+zJVORLGdmeMvCufIwyb0vgH610Rd+5fY7QR4HCNTpCIaEjU7lFsYnykY8El jS8Uou+7U90GXwVIc/O36ZmXosmLQF4ToxH8f1BasgTc72ZJKmLIWCB3T/56daiP89Y2 pKQm/3pNGNs8H7sXBBVjIOnw6XAFbRV2u9VOgnG6iJIlX8EiltvmVeOEev8QDtpizjD0 tLwxAoluvGEt1/3y10z6D9A9MLCgL04y5Ck9pQTkMmo3iP6kCaXual1f2X5mocCMy2zT P7DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:feedback-id :dkim-signature:dkim-signature; bh=6hSi0QYlB46i5legZj1Q7xKc4G5X4LGmhxKU180ngxA=; fh=z0KwdO/7TfAIFX2QV+z1sO0WM9fNzocusZsVLbIzrjk=; b=oWLnpi92a9q7PA/4T3oMDX2xW44VefVDg+d0VrlUdjqH3wTnSPZxtNmC4rjX75rpXP LCafQpU5TgCBmBPD7QCtHENuR8UT+Rn/CVXEtdLTOqrBcPeRZCMM+fkKS6NsjyKcfZVJ 7UN8JcbJku01qHL4Froz6tihDGpqtkiG+iw5syuROGFwRwFipdtfnQY6RwxLZ6jIsIXn rltsEUyF5F/r1l/ZHrUexDs202Pauu5QEM9q+gPgPMn5RWIi9sdvBqg+YWG9C6rzFaEY 8B2j0gjJbwueJXb1akdU5NVF34YvIyJZHGS7BXGlkd+1DKvKJlo5eUwDHsB94PRVa7hm 7NFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=h5YRu0xm; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="2c/NbeoX"; spf=pass (google.com: domain of linux-kernel+bounces-4047-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4047-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id lp4-20020a17090b4a8400b0028ba5af7bcesi617540pjb.109.2023.12.18.08.24.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 08:24:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4047-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@sholland.org header.s=fm3 header.b=h5YRu0xm; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b="2c/NbeoX"; spf=pass (google.com: domain of linux-kernel+bounces-4047-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4047-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sholland.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EF38DB210EF for ; Mon, 18 Dec 2023 16:15:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 05AD042375; Mon, 18 Dec 2023 16:14:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sholland.org header.i=@sholland.org header.b="h5YRu0xm"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="2c/NbeoX" X-Original-To: linux-kernel@vger.kernel.org Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) (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 81BDF49891; Mon, 18 Dec 2023 16:14:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sholland.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sholland.org Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 83B0B580974; Mon, 18 Dec 2023 11:14:44 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 18 Dec 2023 11:14:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1702916084; x=1702923284; bh=6hSi0QYlB46i5legZj1Q7xKc4G5X4LGmhxKU180ngxA=; b= h5YRu0xmF3N6ngePNTIApGIvibyXXlEaYL2Zsyftd4C/eDKPQHQs9P2T5T6dP5d7 Zw0q+wS53eIHOSOlXqC8BMNo0+nBjTH6QWpL9S3BflMvnV4s10eD5xqBL9Fup0iV SyDVTrgbeeVstoj6Eu70FJ5MBy0GgIBeO9STD+R0lRnAFfkcOe+ZezdPCEAFclq1 X97Cka4f228PmnderwxwTB72Uzn71nYuFcTtmPOjBcdL//ihEn7Ok2KoJnVQQIZY 8EtNHMziu4PGlmkEiJXsfN8o58R65/m0XyRIVXf05trW1tVQVm7jpjqALeBtL0Ji XhwhqTSU4He6BvYUEJGtgA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1702916084; x= 1702923284; bh=6hSi0QYlB46i5legZj1Q7xKc4G5X4LGmhxKU180ngxA=; b=2 c/NbeoXu6NgaSRQcaeYIHeUC7KDddwPp8Kt45aCedtbFloC2CDbi/3cggRpOx4Q3 IAceYKGnB00W7p0thxnkEy6hmwH/VTNm3MEwCL5b82xJtsmruAnlm+kD9henj3jm wds8nkSEBH9GmRUtCvJlDY5NQw4sx4M/W2osvdqUVdx75FDaW0IVIWPSWjn4QUCH EQiK5PmoneOn7Tp7WAHG+GjTwgxa/Qa6V+tWCNkbf25+VLiLzDhDakHAMP0uJEsE UEHoZtAxl1s8xrHbdcsBWtU+04VxDznAyPJZT3vKtLDOYPtoeKi842dw6Nl1VZvg 9iqjIFc7wf+WuJqYKLqaQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvddtkedgkeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpefurghm uhgvlhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenuc ggtffrrghtthgvrhhnpeduffekkeejtdfhjeeivddukeehhfegteeihfefleelheeuudej veefgeeggeehleenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgrmhhuvghlsehshhholhhl rghnugdrohhrgh X-ME-Proxy: Feedback-ID: i0ad843c9:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 18 Dec 2023 11:14:42 -0500 (EST) Message-ID: Date: Mon, 18 Dec 2023 10:14:42 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/5] riscv: dts: allwinner: Update opp table to allow CPU frequency scaling Content-Language: en-US To: Brandon Cheo Fusi , Yangtao Li , Viresh Kumar , Nishanth Menon , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Maxime Ripard Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org References: <20231218110543.64044-1-fusibrandon13@gmail.com> <20231218110543.64044-2-fusibrandon13@gmail.com> From: Samuel Holland In-Reply-To: <20231218110543.64044-2-fusibrandon13@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/18/23 05:05, 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, inspired by > 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 target vdd-cpu supply of 0.9V, > 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..2f1771c19 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", > + "allwinner,sun50i-h6-operating-points"; This is not correct. The compatible string specifies the algorithm for looking up the speed grade from the NVMEM cell, and D1 uses a totally different algorithm compared to H6: https://github.com/Tina-Linux/linux-5.4/blob/master/drivers/cpufreq/sun50i-cpufreq-nvmem.c#L293-L338 So you cannot use a fallback compatible string here, and you need to add driver support for the D1's speed bin encoding. Regards, Samuel > + 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 900000 1100000>; > }; > > opp-1080000000 { > + clock-latency-ns = <244144>; /* 8 32k periods */ > opp-hz = /bits/ 64 <1008000000>; > - opp-microvolt = <900000 900000 1100000>; > + opp-microvolt-speed0 = <900000 900000 1100000>; > }; > }; > > @@ -115,3 +121,9 @@ pmu { > <0x00000000 0x0000000f 0xffffffff 0xffffffff 0x00020000>; > }; > }; > + > +&sid { > + cpu_speed_grade: cpu-speed-grade@0 { > + reg = <0x00 0x2>; > + }; > +};