Re: rk3399 "power off" gpu?

From: Bjoern A. Zeeb <bzeeb-lists_at_lists.zabbadoz.net>
Date: Thu, 08 Jul 2021 20:43:40 UTC
On Wed, 7 Jul 2021, Emmanuel Vadot wrote:

> On Wed, 7 Jul 2021 13:06:14 +0000 (UTC)
> "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net> 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