-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
H3 ddr dynamic freq (experimental) #5127
base: main
Are you sure you want to change the base?
Conversation
Yes, this way we can merge this at once. Ideally adding an overlay for easier manipulation. |
@Azq2 Do you know how long it takes to switch the frequency? |
Congrats for the study and very hard development work! 👍 Perhaps WFE instructions (Wait for Event) could be used during the idle period to avoid active looping? |
Sorry for the long delay! @The-going This is a good question. My measurements:
It doesn't look very good for Does anyone have A64/h3/a33/a83t and the ability to measure the Like that:
But anyway even without
Finally, I have two variants:
Two:
@paolosabatino Thanks, good point. |
In different versions of the documentation for allwinner processors, it is written a little differently about the frequency switching process. Maybe it's just an incorrect translation. And if part of the frequency grid does not correspond to some dividers and switching occurs at this frequency, then the frequency is first switched to the default minimum, and then switching occurs at the selected frequency. This rule applies if you need to switch to a frequency less than the default one. After its application, switching occurs faster. |
I have A64 and A83T on my test stand. |
🧹 PR Cleanup Quest 🧹 This PR looks quite sophisticated, but looks like it needs some rebasing to the current state, some testing and maybe some updating. @Azq2 is there any update on this? |
Description
This is experimental support for DDR dynamic frequency changing for Allwinner H3.
It based on:
Due to H3 hardware bugs (see listing) it implemented by software "emulation" of MDFS:
while(true)
on PSCI handler (in SRAM). This is needed, because after DDR RAM enters self-refresh mode any RAM access leads to a complete freeze. We must suspend all execution on any secondary cores to prevent this.Not great, but works.
Similar way implemented in the original legacy sunxi kernels: https://github.com/Tina-Linux/tina-v83x-linux-4.9/blob/master/drivers/devfreq/dramfreq/sunxi-ddrfreq.c#L1373
But instead of PSCI in u-boot it uses a dirty hack by writing code from kernel to the SRAM.
P.S.II'm not sure if this module should be enabled by default.
Most of users want performance instead of power saving. Maybe better and safer to disable this in DT (by status = "disabled").
And who needs it can enable using DT overlay.
How Has This Been Tested?
Tested:
Not tested:
Checklist: