Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp901793ybl; Fri, 13 Dec 2019 06:24:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyWWRRnkPBejYkPxHR1o8uhJUKjp2jPp26AjuCJ91PLyek83WVdeSHQ1QZMQSvHeMqfGE/r X-Received: by 2002:a9d:5550:: with SMTP id h16mr13990001oti.235.1576247084304; Fri, 13 Dec 2019 06:24:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576247084; cv=none; d=google.com; s=arc-20160816; b=NlCyWj0Zw1CCkJNMdRscoOPM+HzJRcmnAAK0IV+pb1+IyHpa/6usqtSaAw7/cbRxT4 5te1q+/BXM2f7wFxekV6b8QPB9KPTkf5vfzXlGz8QbXIy9a3W5AiX+H+D4R00beHhm8B G5pvF8NmyFcoRCKfN+t26WXbrgWFRvkBZsuBJXSxHEP0xbyWKsEBGl4i6gx/tiY7lSYu uT3ootb+XCi7Cebvi8kVDUM1rlpH86ut034dHmjFrahjItvfVYqA2WRAYSkIOfwR8sCH HRqEsxFRElDaIMaEf7rV0SdD7MqARVA8xAU+9Qm4jF9k31FXSmz+6+l0c8ohYZUnUmOl klwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=oY4foPWzvMWBhrOb3ctOq9TVV5hU0NFwbmMTS0Zd/UU=; b=SxO38RK8aJWCUlB+aSouot9dslOtVEGeTC0p3/4JRlmgbfLmd//Ow+hWEoZvmDvpcR o146OZanlfIrIDW6QQ3Njhn90fjgm94H994fjkCXav+f2WcOSln2rJJRxlfzUia/k8/G iMjn77ESYoL3hKTVY+TbR8Al35rXd+LYnJqEp1Fi9lKJOkhzxNpTsJAUA8avhjTUyoMS Jv0M65OprY4AqxpxW02PUEYSoQ6xg7OV0X8mJZwkD/nG6dNtI/Yj9hkQlTMcFfDOAR66 LRA1rrdGTBESLsWtxIHljQOdyVq6MAlBEi3MrfrRtYtZ9czZGrPX5W+4rERmziZLfHTN DZ9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="WA/Nl5/q"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c13si5432744otr.297.2019.12.13.06.24.32; Fri, 13 Dec 2019 06:24:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="WA/Nl5/q"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727709AbfLMOXj (ORCPT + 99 others); Fri, 13 Dec 2019 09:23:39 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:34717 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727563AbfLMOXi (ORCPT ); Fri, 13 Dec 2019 09:23:38 -0500 Received: by mail-io1-f67.google.com with SMTP id z193so2576805iof.1; Fri, 13 Dec 2019 06:23:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=oY4foPWzvMWBhrOb3ctOq9TVV5hU0NFwbmMTS0Zd/UU=; b=WA/Nl5/qzxziow27rNFDBN6AR0i/0NcNiRvRVp80t0u9W0JQMaMjKJ1FXpSIJvFRsA 9XNtyo7R3tvMIJvxC8oiNyOk4J2wtKS7B3Ts81LXhTeznVpJDzP2bBwTq3eNp8TT5jGC JeJnDQdKIfDwUHRy+/BauHNwzMIsrHZwY1yL13K6S1JG3p8bmPr43mrdPMlvRX974Db3 sejJ6jhmsn/JNHCDsnNqd+DX6Vt5JKtCkrXbQGX1nBV17cl/Lwbv1gGNky1WX5xz6cB9 qNaJLQ5sYArh6IQ72EsTE5mzorok1Y/tT0dn2XFjhtREMCr3CwECOoTe5T6M5fG+Ice6 rw+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=oY4foPWzvMWBhrOb3ctOq9TVV5hU0NFwbmMTS0Zd/UU=; b=KlXoeMAgnY9wxfhJhRH5/Tqns2hvtXu50qURkzSQCsWAfHwN0Lp7jM8QPfYCvKdSCS ouost0PLswyuEPgYs9knFipMHyTc/bEUVRyb6LB+PuGWIMyV9mCP/TVSPglRtODJ/5yg 9QC7DOkjlO/eWQtqhf/OGcVdQnARX2NojWeEa6xIvqXSYrGCunasI1nLmiDX/Qq2ONvH KeO0phIXInWfgNZXhj5YRBCUHMe6XoZQ360eOizBoYAjRRTdrpLCUylU4eEg0r+huWGX XlP4k+n54KnQxEFvH++71BXuO6eXhSFXFJ5jyMOIr3JAfdj6EbiEHamVbn/TKsAxZ4rz e65g== X-Gm-Message-State: APjAAAXuo/Id0J6TNevSr1WQ7WNAGjQ+1vbsksBAT0Ph0WKELu8sUr65 eCQa3eehPSU8E5Guv+Dq26CY07nfg1npE9iuvQ8= X-Received: by 2002:a02:844e:: with SMTP id l14mr2634809jah.30.1576247017731; Fri, 13 Dec 2019 06:23:37 -0800 (PST) MIME-Version: 1.0 References: <20191101143126.2549-1-linux.amoon@gmail.com> <7hfthtrvvv.fsf@baylibre.com> <7hfthsqcap.fsf@baylibre.com> <7hpngvontu.fsf@baylibre.com> <4e1339b4-c751-3edc-3a2e-36931ad1c503@baylibre.com> <83791a71-a45c-383d-0406-b0f4e0a0c215@baylibre.com> In-Reply-To: <83791a71-a45c-383d-0406-b0f4e0a0c215@baylibre.com> From: Anand Moon Date: Fri, 13 Dec 2019 19:53:26 +0530 Message-ID: Subject: Re: [RFC-next 0/1] Odroid C2: Enable DVFS for cpu To: Neil Armstrong Cc: Martin Blumenstingl , Kevin Hilman , Rob Herring , Jerome Brunet , devicetree , linux-arm-kernel , linux-amlogic@lists.infradead.org, Linux Kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Neil On Fri, 13 Dec 2019 at 18:54, Neil Armstrong wrote: > > On 13/12/2019 12:28, Anand Moon wrote: > > Hi Martin > > > > On Fri, 13 Dec 2019 at 01:40, Martin Blumenstingl > > wrote: > >> > >> Hi Neil, > >> > >> On Wed, Dec 11, 2019 at 9:49 AM Neil Armstrong wrote: > >>> > >>> On 10/12/2019 22:47, Kevin Hilman wrote: > >>>> Martin Blumenstingl writes: > >>>> > >>>>> On Tue, Dec 10, 2019 at 7:13 PM Kevin Hilman wrote: > >>>>>> > >>>>>> Anand Moon writes: > >>>>>> > >>>>>>> Hi Neil / Kevin, > >>>>>>> > >>>>>>> On Tue, 10 Dec 2019 at 14:13, Neil Armstrong wrote: > >>>>>>>> > >>>>>>>> On 09/12/2019 23:12, Kevin Hilman wrote: > >>>>>>>>> Anand Moon writes: > >>>>>>>>> > >>>>>>>>>> Some how this patch got lost, so resend this again. > >>>>>>>>>> > >>>>>>>>>> [0] https://patchwork.kernel.org/patch/11136545/ > >>>>>>>>>> > >>>>>>>>>> This patch enable DVFS on GXBB Odroid C2. > >>>>>>>>>> > >>>>>>>>>> DVFS has been tested by running the arm64 cpuburn > >>>>>>>>>> [1] https://github.com/ssvb/cpuburn-arm/blob/master/cpuburn-a53.S > >>>>>>>>>> PM-QA testing > >>>>>>>>>> [2] https://git.linaro.org/power/pm-qa.git [cpufreq testcase] > >>>>>>>>>> > >>>>>>>>>> Tested on latest U-Boot 2019.07-1 (Aug 01 2019 - 23:58:01 +0000) Arch Linux ARM > >>>>>>>>> > >>>>>>>>> Have you tested with the Harkernel u-boot? > >>>>>>>>> > >>>>>>>>> Last I remember, enabling CPUfreq will cause system hangs with the > >>>>>>>>> Hardkernel u-boot because of improperly enabled frequencies, so I'm not > >>>>>>>>> terribly inclined to merge this patch. > >>>>>>> > >>>>>>> HK u-boot have many issue with loading the kernel, with load address > >>>>>>> *it's really hard to build the kernel for HK u-boot*, > >>>>>>> to get the configuration correctly. > >>>>>>> > >>>>>>> Well I have tested with mainline u-boot with latest ATF . > >>>>>>> I would prefer mainline u-boot for all the Amlogic SBC, since > >>>>>>> they sync with latest driver changes. > >>>>>> > >>>>>> Yes, we would all prefer mainline u-boot, but the mainline kernel needs > >>>>>> to support the vendor u-boot that is shipping with the boards. So > >>>>>> until Hardkernel (and other vendors) switch to mainline u-boot we do not > >>>>>> want to have upstream kernel defaults that will not boot with the vendor > >>>>>> u-boot. > >>>>>> > >>>>>> We can always support these features, but they just cannot be enabled > >>>>>> by default. > >>>>> (I don't have an Odroid-C2 but I'm curious) > >>>>> should Anand submit a patch to mainline u-boot instead? > >>>> > >>>> It would be in addition to $SUBJECT patch, not instead, I think. > >>>> > >>>>> the &scpi_clocks node could be enabled at runtime by mainline u-boot > >>>> > >>>> That would work, but I don't know about u-boot maintainers opinions on > >>>> this kind of thing, so let's see what Neil thinks. > >>> > >>> U-Boot doesn't anything to do with SCPI, SCPI discusses directly with the SCP > >>> processor, and the CPU clock is set to 1,56GHz by the BL2 boot stage before > >>> U-boot starts. > >>> > >>> The only viable solution I see now is to find if we could add a DT OPP table > >>> only for Odroid-C2 dts to bypass the SCPI OPP table. > >> my understanding is that mainline u-boot (with whatever SCP firmware > >> it uses) provides the *correct* OPP table > > > > Right now I am not sure how this OPP table is populated. > > But I saw the same freq table used in 3.16.x kernel after enable the clk. > > > >> in this case it would be "safe" to have SCPI enabled with mainline u-boot > >> @Anand: please correct me if I misunderstood you > >> > > > > As per my understanding DVFS OPP frequency table for SCPI firmware set > > for 1.536 GHz > > somewhere in BL2 as pointed by Neil. > > > > Arm Trusted firmware added new secure SCPI communication with > > Cortex-M3 co processor. > > [0] https://github.com/ARM-software/arm-trusted-firmware/blob/master/docs/plat/meson-gxbb.rst > > [1] https://github.com/ARM-software/arm-trusted-firmware/blob/master/plat/amlogic/common/aml_scpi.c > > > > ATF generated the *bl1.bin* which is replace the Amlogic's bl1.bin > > while preparing > > the new u-boot *u-boot.gxbb* image. > > > >> my idea to "enable SCPI with mainline u-boot" is to have u-boot update > >> the "status" property of the scpi_clocks node. > >> u-boot does something similar with the mac-address property of the > >> Ethernet controller for example. > >> as result of this users of mainline u-boot would have working CPU > >> DVFS, while users of the old vendor u-boot would run at fixed 1.54GHz. > >> > >> > >> Martin > > > > Right now as per my understanding 1.536 GHz max is bit under clocked. > > > > Some time ago on Odroid Forum tried to over clock the cpu to 2GHz. > > This is the point, the Odroid-C2 is *not* stable at 2GHz, > a large amount of board doesn't support 2GHz, this is why Amlogic > dropped the freq > 1.536 GHz for the GXBB family. > > But HardKernel still delivers the SCPI table with > 1.536 GHz which breaks > on most of the boards, but doesn't on 3.14 since they have a hack disabling > higher freqs with a cmdline set in boot.ini. > > > [3] https://forum.odroid.com/viewtopic.php?f=139&t=18738 > > So more investigation need to done in this line. > > > > I also tried the same with HardKernel Image, with modifying the boot.ini > > I could increase the max DVFS cpu frequency to 1.90 GHz, > > This is just proof of concept. > > > > odroid:~# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies > > 100000 250000 500000 1000000 1296000 1536000 1656000 1680000 1752000 1896000 > > > > I have some minimal stress testing attached are the results for HK > > 3.16.x kernel. > > > > For now we should not enable this clock. > > Until we can possible to check for higher clock frequency to work stable > > on all Amlogic S905X SBC. > > > > I like the Neil's approach to use it's own dts OPP table for SCPI protocol. > > The various tests gave very little perf enhancement by going > 1,536 GHz, seriously > it's not worth the pain. > > Neil > Ok Thanks for your expert knowledge. I agree with you completely on this to set max freq to 1,536 GHz for all S905 SoC. -Anand