From nobody Thu Jul 08 20:43:40 2021 X-Original-To: freebsd-arm@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 360A311F7D2B for ; Thu, 8 Jul 2021 20:43:52 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:13b:39f::9f:25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GLStv268xz4qYt for ; Thu, 8 Jul 2021 20:43:51 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id A2C348D4A157; Thu, 8 Jul 2021 20:43:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 0414DE707E0; Thu, 8 Jul 2021 20:43:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 1kmXMX3AZM_4; Thu, 8 Jul 2021 20:43:41 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 55C14E707DF; Thu, 8 Jul 2021 20:43:41 +0000 (UTC) Date: Thu, 8 Jul 2021 20:43:40 +0000 (UTC) From: "Bjoern A. Zeeb" To: Emmanuel Vadot cc: freebsd-arm@FreeBSD.org Subject: Re: rk3399 "power off" gpu? In-Reply-To: <20210707151819.74377cb776da1acde9d9b5d6@bidouilliste.com> Message-ID: References: <20210707151819.74377cb776da1acde9d9b5d6@bidouilliste.com> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Rspamd-Queue-Id: 4GLStv268xz4qYt X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of bzeeb-lists@lists.zabbadoz.net designates 2a01:4f8:13b:39f::9f:25 as permitted sender) smtp.mailfrom=bzeeb-lists@lists.zabbadoz.net X-Spamd-Result: default: False [-1.08 / 15.00]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f8:13b:39f::9f:25]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[zabbadoz.net]; RBL_DBL_DONT_QUERY_IPS(0.00)[2a01:4f8:13b:39f::9f:25:from]; SH_EMAIL_DBL_DONT_QUERY_IPS(0.00)[0.0.0.41:email]; NEURAL_SPAM_SHORT(0.22)[0.223]; SPAMHAUS_ZRD(0.00)[2a01:4f8:13b:39f::9f:25:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DBL_PROHIBIT(0.00)[0.0.0.41:email]; RCPT_COUNT_TWO(0.00)[2]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/32, country:DE]; SUBJECT_ENDS_QUESTION(1.00)[]; MAILMAN_DEST(0.00)[freebsd-arm] X-ThisMailContainsUnwantedMimeParts: N On Wed, 7 Jul 2021, Emmanuel Vadot wrote: > On Wed, 7 Jul 2021 13:06:14 +0000 (UTC) > "Bjoern A. Zeeb" wrote: > >> Hi, >> >> I was wondering if there is a way to completely "shutdown" (power off) >> the GPU or put it into "low power" (suspend) mode? >> >> Just setting the gpu state to disabled is probably the wrong as it won't >> give the SYR828 PMIC anymore and u-boot likely enables it all. >> >> If it's possible would anyone have a dtso to do that? > > The mali part in RK3399 is powered via an external regulator. > If the regulator is unused it's automatically shutdown in FreeBSD > unless you set hw.regulator.disable_unused=0. > That being said on rockpro64 the always-on property is set for this > regulator so you will need some overlay that removes this property. Overlays don't remove anything which is not in the overlay file to my knowledge so I used: fdt rm /i2c@ff3c0000/regulator@41/regulator-always-on fdt rm /i2c@ff3c0000/regulator@41/regulator-boot-on from loder for testing. While this will result in the hoped-for regulator: shutting down vdd_gpu... ok you described, I also discovered a side-effect that I can reliably reproduce if I run the two fdt rm from above and the regulator is shut down but I cannot reproduce --it seems-- when I don't do it: on reboot the system will hang at the end of DRAM initialisation if the regulator was disabled the previous boot and needs a "hard reset". Given I cannot currently force an external reset or power off/on on this rk3399 (nanopc-t4) I'll probably have to live with the regulator staying on. I also did not notice any significant difference when it was off but I also don't have high precision measurement devices on-site currently either. I wonder if they are clever enough to internally power it down as much as possible if it's not used. /bz -- Bjoern A. Zeeb r15:7