From owner-freebsd-arm@freebsd.org Sun Mar 11 01:58:10 2018 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 701D2F4AC9C for ; Sun, 11 Mar 2018 01:58:10 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E8CB37142E for ; Sun, 11 Mar 2018 01:58:09 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 8a570b18; Sun, 11 Mar 2018 02:58:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=At7mhm0xAYv2i/PjGNFWZR7dZK8=; b=XOYGOe3VNqB3SuD+fhiyHafvWef0 OVfi2jIBJG6HsXpFrFau0fqKJq5znzjDovMB6E5vcMTOhj83rhRpT9RQ24R8kZpp ulg1jm00Px+5F/+QRwqIQIWQ2ZfjeBKzF67RJfypekDvdTecftgOVFM4hoY49rVn 9unuRa/w6dYaCOA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=UfiyeQN3FANuDtGUK4/R3x+oA32AEobmAuioT0kt+Odt2MlZLm/niWWc ZemquNmuVbxxLA6TDdKLUPdTtbYOdwOs3g2phncsL61ue8NJeW9HXcFWcMwZiib7 4XlOl+Hx6/OttlpLCNYE3ajOKhpCHXEm0NRRO7U6zys+Phoi5WA= Received: from arcadia (ai126174027189.26.access-internet.ne.jp [126.174.27.189]) by mail.blih.net (OpenSMTPD) with ESMTPSA id b27dc05c TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Sun, 11 Mar 2018 02:58:01 +0100 (CET) Date: Sun, 11 Mar 2018 02:57:56 +0100 From: Emmanuel Vadot To: Luc Hondareyte Cc: Luc Hondareyte via freebsd-arm Subject: Re: cpufreq support on Allwinner H3 Message-Id: <20180311025756.bbddd0616bc61d78f66093a5@bidouilliste.com> In-Reply-To: <542a7663-b4e0-2093-4dfc-9b8e9c3b513b@laposte.net> References: <5332936b-f38b-ca7a-03d9-dfc7c92e2727@laposte.net> <20180308061806.d9c9c7282d1a956d86b6bb22@bidouilliste.com> <542a7663-b4e0-2093-4dfc-9b8e9c3b513b@laposte.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.31; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Mar 2018 01:58:10 -0000 On Thu, 8 Mar 2018 12:33:44 +0100 Luc Hondareyte wrote: > Le 08/03/2018 =E0 06:18, Emmanuel Vadot a =E9crit=A0: > > On Tue, 6 Mar 2018 20:59:37 +0100 > > Luc Hondareyte via freebsd-arm wrote: > > > >> Hi, > >> > >> I've just build 12-current for Allwinner H3=A0 (armv7) and it seems th= at > >> cpufreq support is missing (orangepi or nanopi): > > There is no opp table (freq<->voltage table) in the DTS that's why > > it's not working. > This thread?=20 > http://lists.infradead.org/pipermail/linux-arm-kernel/2018-February/55794= 0.html=20 Yep exactly. > > I think I've seen patches on the linux-arm kernel mailing list to add > > them but even with thoses we will need support for the v2 opp. > v2 opp? Does it mean that, as a workaround, with the appropriate DTS=20 > patch and a switch back to armv6, this should work? Switch back to armv6 will change nothing but a patched dtb will do the job. That what we had before and that's why on ganbold@ images cpufreq works. Since I don't want patched DTB in the tree our only option is to implement v2 opp table in sys/dev/cpufreq/cpufreq_dt.c and wait that the dts is updated upstream. > I say that because,=20 > on nanopi neo, with the "old" 12-current image build by Ganbold=20 > Tsagaankhuu (that was available on FriendlyArm Wiki), cpu_freq support=20 > is OK and it?s run at full speed: >=20 > root@allwinner-h3:~ # uname -a > FreeBSD allwinner-h3 12.0-CURRENT FreeBSD 12.0-CURRENT #7 r308116M: Mon=20 > Oct 31 10:56:20 ULAT 2016=20 > tsgan@beastie.mstride.com:/usr/obj/arm.armv6/usr/src/sys/GENERIC arm > root@allwinner-h3:~ # sysctl dev.cpu.0.freq > cpufreq: get returning known freq 1008 > cpufreq: get returning known freq 1008 > dev.cpu.0.freq: 1008 >=20 > And this image does not seem to use Linux DTS. > >> root@allwinner-h3:~ # service powerd onestart > >> Starting powerd. > >> powerd: no cpufreq(4) support -- aborting: No such file or directory > >> /etc/rc.d/powerd: WARNING: failed to start powerd > >> > >> So, on nanopi neo, it's slowdown (not on orange-pi that seems to run at > >> full speed). I am using a custom kernel conf that just contains: > >> > >> include GENERIC > >> nooptions=A0=A0=A0=A0=A0=A0 INVARIANTS > >> nooptions=A0=A0=A0=A0=A0=A0 INVARIANT_SUPPORT > >> nooptions=A0=A0=A0=A0=A0=A0 WITNESS > >> nooptions=A0=A0=A0=A0=A0=A0 WITNESS_SKIPSPIN > >> nooptions=A0=A0=A0=A0=A0=A0 BUF_TRACKING > >> nooptions=A0=A0=A0=A0=A0=A0 DEADLKRES > >> nooptions=A0=A0=A0=A0=A0=A0 FULL_BUF_TRACKING > >> > > You can use the GENERIC-NODEBUG for that > > > Oh, I missed that. Thanks. --=20 Emmanuel Vadot