Jump to content

H5 board without voltage-switching only up to 816Mhz?


guidol

Recommended Posts

One month ago I got on my OPi Zero Plus2 H5 only up to 816Mhz with armbian.
In the past I got on this device up to 1.1GHz (1080000 cpufreq) with older armbian builds.

@5kft Told me thats because frequencys greater than 816Mhz require 1.2v and the OPi Zero Plus2 H5 isnt/couldnt switch(ing) and would only run at 1.1v.

 

So it seems the cpu-table is now more conservative than before.

 

Yesterday I did see the same behaviour and my "older" non-LTS NanoPi Neo2 (H5 also).

 

Because in September I edited the cpu-table less conservative for the OPi Zero Plus2 H5 I did test this also on the non-LTS NanoPi Neo2 and it worked like on the OPi Zero Plus2 H5 :)

 

 

Link to comment
Share on other sites

4 hours ago, 5kft said:

Not all H5 parts are created equal, so the default ensures that it should be safe for all boards. 

Quote

Some H5 boards are designed to start at 1.1V CPUx voltage (e.g. Nano Pi
NEO2), which may not work properly at 1008MHz if the chip's quality is
not so good.
Lower the default CPUx frequency of H5 to 816MHz.
Signed-off-by: Icenowy Zheng <ice...@aosc.io>

So its on Allwinner to deliver better tested H5 CPUs (like Intel SX/DX or AMD Phenom II with X4 or X3 = one disabled Core)

 

But also someone say its "hard":
 

Quote

So you have one single model that fails, and you change the default
frequency of all the boards using that SoC?

It seems a bit overkill.

I guess we have two solutions:
  1) Change the frequency in that board config
  2) Change the voltage in that board config

There's no need to enforce a SoC-wide change.

Maxime

 

Link to comment
Share on other sites

This would all be a bit more deterministic (and easier) if there were clear guidelines, and consistency in HW design :)  Unfortunately there doesn't seem to be much to go on.  I guess the "best" consideration at this point is the Xunlong SDK note (?):

 

Quote

The default CPU voltage is 1.1V after power-on [...].  According to the table above, this default voltage should be safe for using with the CPU clock frequencies up to 816MHz.

 

One simple answer (workaround) is to simply provide optional overlays that enable the higher speeds; then this lets the user try this on their boards, and if it works, great!  This is one reason I created the 1.3GHz/1.3v overlay; it seems to work fine for people who use it, but if it doesn't, then the board will still always boot and function by default.

 

Perhaps we should include a 1.0GHz/1.1v overlay as well?  This would be easy enough to do.

 

Link to comment
Share on other sites

55 minutes ago, 5kft said:

Perhaps we should include a 1.0GHz/1.1v overlay as well?  This would be easy enough to do.

That sounds - for me  like a good & "easy" user-useable fix :)

1.08GHz/1.1v or 1.1GHz/1.1v because of the cpu-freq 1080000

Link to comment
Share on other sites

1 minute ago, guidol said:

That sounds - for me  like a good & "easy" user-useable fix :)

1.08GHz/1.1v or 1.1GHz/1.1v because of the cpu-freq 1080000

 

Indeed!  However I think it is 1008 (divisible by 16, and also according to the Xunlong reference and in the existing tables).  How it would be nice to have real documentation on this! :)

Link to comment
Share on other sites

2 minutes ago, 5kft said:

 

Indeed!  However I think it is 1008 (divisible by 16, and also according to the Xunlong reference and in the existing tables).  How it would be nice to have real documentation on this! :)

you are right, because normally is shows 1,01GHz for the 1008000 in cpufreq-info ;)

Link to comment
Share on other sites

20 hours ago, guidol said:

Yesterday I did see the same behaviour and my "older" non-LTS NanoPi Neo2 (H5 also).

 

Remind me - which version of that board (the NanoPi Neo 2)

 

My NanoPi Neo 2 is v1.1, so it does have the voltage regulator... but I had to 

 

sfx@nano2:~$ cpufreq-info -c1
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 1:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 5.44 ms.
  hardware limits: 120 MHz - 1.30 GHz
  available frequency steps: 120 MHz, 240 MHz, 480 MHz, 648 MHz, 816 MHz, 960 MHz, 1.01 GHz, 1.06 GHz, 1.10 GHz, 1.15 GHz, 1.20 GHz, 1.22 GHz, 1.25 GHz, 1.30 GHz
  available cpufreq governors: conservative, userspace, powersave, ondemand, performance, schedutil
  current policy: frequency should be within 120 MHz and 1.30 GHz.
                  The governor "schedutil" may decide which speed to use
                  within this range.
  current CPU frequency is 816 MHz (asserted by call to hardware).
  cpufreq stats: 120 MHz:97.01%, 240 MHz:0.19%, 480 MHz:0.06%, 648 MHz:0.02%, 816 MHz:0.07%, 960 MHz:0.06%, 1.01 GHz:0.00%, 1.06 GHz:0.00%, 1.10 GHz:0.00%, 1.15 GHz:0.00%, 1.20 GHz:0.00%, 1.22 GHz:0.00%, 1.25 GHz:0.00%, 1.30 GHz:2.57%  (1571539)

If I recall - boards that run at 1.1 only, there was a decision to limit to 816 to cover all H5's...

 

looking at /etc/default/cpufrequtils...

 

# WARNING: this file will be replaced on board support package (linux-root-...) upgrade
ENABLE=true
MIN_SPEED=120000
#MIN_SPEED=120000
#MAX_SPEED=1296000
MAX_SPEED=1296000
GOVERNOR=schedutil

But @guidol - you know this already, as I made that tweak based on your posts ;)

 

 

Link to comment
Share on other sites

13 hours ago, 5kft said:

Perhaps we should include a 1.0GHz/1.1v overlay as well?  This would be easy enough to do.

Hmm - seems not to easy for me :(

I decompiled your 1.3Ghz overlay and did try to edit it for the Neo2 with 1.01.Ghz/1.1V, but now the Neo2 wouldnt boot anymore :(

Can you please take a look what I did wrong?

Maybe something with

 

target = < 0xffffffff >;

or

    __fixups__ {
        opp_table0 = "/fragment@0:target:0";
    };

 

Also a 2nd version doenst work, but Neo2 is booting but says:
 

cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.
analyzing CPU 1:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.
analyzing CPU 2:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.
analyzing CPU 3:
  no or unknown cpufreq driver is active on this CPU
  maximum transition latency: 4294.55 ms.

 

neo2_1_01ghz_1_1v.dts

2nd_version_neo2_1_01ghz_1_1v.dts

Link to comment
Share on other sites

6 hours ago, guidol said:

I decompiled your 1.3Ghz overlay and did try to edit it for the Neo2 with 1.01.Ghz/1.1V, but now the Neo2 wouldnt boot anymore :(

Can you please take a look what I did wrong?

 

Ah...unfortunately I won't be able to actually look at this until later, and right now I don't have access to source except through git browsing on the web...  However, I can try to give you some pointers from memory/github that may help! :)

 

Here's my patch that creates the 1.3GHz/1.3v overlay (development build):  https://github.com/armbian/build/blob/master/patch/kernel/sunxi-dev/sunxi-h5-add-gpio-regulator-overclock.patch.  You can start from this. 

 

All that should need to be done to create your 1.0GHz/1.1v overlay is to update the voltages for the entries that you want to change (i.e., 960MHz and 1008MHz).  Take a look at https://github.com/megous/linux/blob/orange-pi-5.3/arch/arm/boot/dts/sunxi-h3-h5.dtsi, and find the entries for 960MHz and 1008MHz:

		opp-960000000 {
			opp-hz = /bits/ 64 <960000000>;
			opp-microvolt = <1200000 1200000 1300000>;
			clock-latency-ns = <244144>; /* 8 32k periods */
		};

		opp-1008000000 {
			opp-hz = /bits/ 64 <1008000000>;
			opp-microvolt = <1200000 1200000 1300000>;
			clock-latency-ns = <244144>; /* 8 32k periods */
		};

You could copy my 1.3GHz overlay, and remove the "opp-" modifications (starting with "opp-1056000000" through "opp-1296000000"), and then insert your own new entries, changing the "1200000" values in "opp-microvolt" for these frequencies to "1100000".

 

Also, I'm not sure at what speed the H5 parts might become unstable at 1.1v, but for fun you could also try modifying the 1.1GHz entry as well, and give it a try perhaps? :rolleyes:

 

I hope that this helps!

 

Link to comment
Share on other sites

2 hours ago, 5kft said:

Here's my patch that creates the 1.3GHz/1.3v overlay (development build):  https://github.com/armbian/build/blob/master/patch/kernel/sunxi-dev/sunxi-h5-add-gpio-regulator-overclock.patch.  You can start from this. 

 

You could copy my 1.3GHz overlay, and remove the "opp-" modifications (starting with "opp-1056000000" through "opp-1296000000"), and then insert your own new entries, changing the "1200000" values in "opp-microvolt" for these frequencies to "1100000".

I hope that this helps!

 

In my opinion a overlay is a overlay of/for a .dtb, because of the .dtb(o)verlay

Your patch is a change while compiling the kernel/image!?

 

I did try to copy your 1.3GHz overlay (as I decompiled it and changed "something")  - but as I wrote I didnt work for in in 2 trys.

 

So the easys way for me was to decompile the normal Neo2 .dtb and to change the line this way- so that 960 & 1008 Mhz is also 1.1v:
 

		opp-816000000 {
			opp-hz = < 0x00 0x30a32c00 >;
			opp-microvolt = < 0x10c8e0 0x10c8e0 0x13d620 >;
			clock-latency-ns = < 0x3b9b0 >;
		};

		opp-960000000 {
			opp-hz = < 0x00 0x39387000 >;
			opp-microvolt = < 0x10c8e0 0x10c8e0 0x13d620 >;
			clock-latency-ns = < 0x3b9b0 >;
		};

		opp-1008000000 {
			opp-hz = < 0x00 0x3c14dc00 >;
			opp-microvolt = < 0x10c8e0 0x10c8e0 0x13d620 >;
			clock-latency-ns = < 0x3b9b0 >;
		};

But a .dtbo overlay would be a nice addon to learn ;)

Link to comment
Share on other sites

56 minutes ago, guidol said:

Your patch is a change while compiling the kernel/image!?

 

Yes, part of my patch simply creates the 1.3GHz-1.3v overlay included in the dtb package that can be loaded at boot time (it ultimately ends up included in /boot/dtb/allwinner/overlay/ along with all of the other AW overlays).  Using overlays like this is really nice because they are optional, and give the user complete control in terms of overclocking.  In any case, I can try to look at this later for you when I have an opportunity.

 

Link to comment
Share on other sites

Hi @guidol, I made a quick build patch and created two test 1.1v overclock overlays for you for testing.  I have attached them to this message in a tarfile.  These are built against the 5.3.7 Armbian sunxi-dev kernel; they will not work with -next 4.19 as the opp table definitions are different between these kernels.

 

You can extract this tarfile from the root of your board ("/"), and two overlay files will be extracted into "boot/dtb-5.3.7-sunxi64/allwinner/overlay/":

-rw-r--r-- root/root       478 2019-10-30 03:19 boot/dtb-5.3.7-sunxi64/allwinner/overlay/sun50i-h5-cpu-clock-1.0GHz-1.1v.dtbo
-rw-r--r-- root/root       562 2019-10-30 03:19 boot/dtb-5.3.7-sunxi64/allwinner/overlay/sun50i-h5-cpu-clock-1.1GHz-1.1v.dtbo

 

Specify the desired one just like for my 1.3GHz overclock overlay; e.g., add these lines to your "/boot/armbianEnv.txt" (this is an example):

overlay_prefix=sun50i-h5
overlays=usbhost1 usbhost2 cpu-clock-1.0GHz-1.1v

 

I have included both a 1.0GHz overclock overlay as well as a 1.1GHz overclock overlay.  Speeds above 816MHz are set at 1.1v.  NOTE:  I'm not sure if 1.1GHz at 1.1v is pushing it too much, but I figured you could give it a try if you are feeling adventurous :)

 

I did a quick test of both of these and they loaded fine, set the clock maximums fine, cpufreq-info works, the board works, etc.

 

Give these a try and let me know how it goes...  If these work I could add these to the Armbian build as additional overclock options.

 

H5-overclock-test-dtbs-1.1v.tar.gz

Link to comment
Share on other sites

5 hours ago, 5kft said:

Hi @guidol, I made a quick build patch and created two test 1.1v overclock overlays for you for testing. 

Specify the desired one just like for my 1.3GHz overclock overlay; e.g., add these lines to your "/boot/armbianEnv.txt" (this is an example):

 

I have included both a 1.0GHz overclock overlay as well as a 1.1GHz overclock overlay.  Speeds above 816MHz are set at 1.1v.  NOTE:  I'm not sure if 1.1GHz at 1.1v is pushing it too much, but I figured you could give it a try if you are feeling adventurous :)

 

Give these a try and let me know how it goes...  If these work I could add these to the Armbian build as additional overclock options.

@5kft Many thanks for your "quick build patch" :)

I did untar it on my Neo2 and selected the 1.01GHz version in armbian-config ==> system ==> hardware (was quicker for me :) ) and rebooted.

 

System do work like my changed .dtb

 

I dont think we should push 1.1v to 1.1GHz, because in the past we had also "only" 1.01GHz (1008000) available on the H5 system I got - and mine never crashed with that.

 

The only system I have - which would reboot on early startup (maybe a undervoltage for max-cpu) is my NanoPi A64 with A64-CPU

And the A64 is also mentioned in the thread you did show to me as a problematic candidate.
But the NanoPi A64 is for me only a experiment, because its completly unsupported by armbian - so armbian problem :)

If I lower the max-cpu a bit on the NanoPi A64 then it do work also stable for me.

 

I think you/we could try to push the overlay "sun50i-h5-cpu-clock-1.0GHz-1.1v.dtbo" to the build system if no-one has a problem with it ;)

 

PS. I also would try now - like you - the governor schedutil - which seems to be a new one (since kernel 4.7)

Link to comment
Share on other sites

2 hours ago, Igor said:

Will be enabled when development branch "arm64" gets merged to the master:
https://github.com/armbian/build/commit/09341a28e5d962836cbfd79d383cbdccd16a0ae7

 

@Igor - is this a safe change to make for the OPi Zero Plus2 H5?  The default H5 CPU frequency opp table now goes to ~1.4GHz, and by adding this regulator overlay you're telling the system that the board has a 1.3v regulator, which by default it likely will not:

 

Perhaps the Armbian default MAX_SPEED= cpufrequtils value will gate this so it will be fine, but I'm not sure if this will happen early enough?  I wouldn't be able to check on my unmodified OPi Plus2 physical board until tonight.  My thinking in making this an optional overlay was so that people had to really know what they are doing in order to overclock...but perhaps I am being too conservative ^_^

 

Just want to make sure...thanks!

 

Link to comment
Share on other sites

4 hours ago, guidol said:

I think you/we could try to push the overlay "sun50i-h5-cpu-clock-1.0GHz-1.1v.dtbo" to the build system if no-one has a problem with it ;)

 

Makes sense; I'll merge this new overlay patch in with the existing 1.3GHz patch and should be able to push it tonight.  Thanks for testing it!

Link to comment
Share on other sites

59 minutes ago, 5kft said:

is this a safe change to make for the OPi Zero Plus2 H5?  The default H5 CPU frequency opp table now goes to ~1.4GHz, and by adding this regulator overlay you're telling the system that the board has a 1.3v regulator, which by default it likely will not:


Hmm, my (only) v1.0 board goes to 1Ghz with this overlay, 812 without. If you find this wrong, please do revert my commit.

Link to comment
Share on other sites

10 hours ago, Igor said:

Hmm, my (only) v1.0 board goes to 1Ghz with this overlay, 812 without. If you find this wrong, please do revert my commit.

 

Thanks @Igor!  I looked into this and it works because the default CPU opp table requires 1.32v starting at clock frequency 1104MHz; this voltage is higher than the 1.30v provided by the regulator overlay, so the higher clock rates will not be enabled.  I also confirmed that this works fine on my unmodified board as well :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines