initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

s_graf
I just realized that the cpu speed on these boards defaults on start-up, the
pc2 to 816Mhz and the one to 1008 Mhz. Both of these machines should be able
to run at 1300Mhz.
The pc2 speed can be changed with hw.setperf, but not the one.
Can the sxiccmu module be changed to read a value from the dtb to use as the
initial cpu speed?

Reply | Threaded
Open this post in threaded view
|

Re: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

Krystian Lewandowski
Wiadomość napisana przez [hidden email] w dniu 02.02.2019, o godz. 18:26:
>
> I just realized that the cpu speed on these boards defaults on start-up, the
> pc2 to 816Mhz and the one to 1008 Mhz. Both of these machines should be able
> to run at 1300Mhz.
> The pc2 speed can be changed with hw.setperf, but not the one.
> Can the sxiccmu module be changed to read a value from the dtb to use as the
> initial cpu speed?
>

Does the DT for OrangePi One have the "operating-points-v2" property?

It seems H3 is already supported by OpenBSD:
https://github.com/openbsd/src/blob/master/sys/dev/fdt/sxiccmu.c#L110

--
Krystian

Reply | Threaded
Open this post in threaded view
|

FW: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

s_graf
In reply to this post by s_graf


-----Original Message-----
From: [hidden email] <[hidden email]>
Sent: February 2, 2019 11:29 AM
To: 'Krystian Lewandowski' <[hidden email]>
Subject: RE: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

Thank you for your reply.
The stock dtbs do not have the "operating-points-v2" and it follows that there is no frequency set by the dtb.
Can you point me to a dtb block that has the property with an example of setting the frequency.

One dtb:
                clock@1c20000 {
                        reg = < 0x1c20000 0x400 >;
                        clocks = < 0x0e 0x0f >;
                        clock-names = "hosc\0losc";
                        #clock-cells = < 0x01 >;
                        #reset-cells = < 0x01 >;
                        compatible = "allwinner,sun8i-h3-ccu";
                        phandle = < 0x03 >;
                };

Pc2 dtb:

                clock@1c20000 {
                        reg = < 0x1c20000 0x400 >;
                        clocks = < 0x0e 0x0f >;
                        clock-names = "hosc\0losc";
                        #clock-cells = < 0x01 >;
                        #reset-cells = < 0x01 >;
                        compatible = "allwinner,sun50i-h5-ccu";
                        phandle = < 0x03 >;
                };

Stephen Graf

-----Original Message-----
From: Krystian Lewandowski <[hidden email]>
Sent: February 2, 2019 10:53 AM
To: [hidden email]
Cc: [hidden email]
Subject: Re: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

Wiadomość napisana przez [hidden email] w dniu 02.02.2019, o godz. 18:26:
>
> I just realized that the cpu speed on these boards defaults on start-up, the
> pc2 to 816Mhz and the one to 1008 Mhz. Both of these machines should be able
> to run at 1300Mhz.
> The pc2 speed can be changed with hw.setperf, but not the one.
> Can the sxiccmu module be changed to read a value from the dtb to use as the
> initial cpu speed?
>

Does the DT for OrangePi One have the "operating-points-v2" property?

It seems H3 is already supported by OpenBSD:
https://github.com/openbsd/src/blob/master/sys/dev/fdt/sxiccmu.c#L110

--
Krystian

Reply | Threaded
Open this post in threaded view
|

Re: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

Krystian Lewandowski
Wiadomość napisana przez [hidden email] w dniu 02.02.2019, o godz. 21:30:

>
>
>
> -----Original Message-----
> From: [hidden email] <[hidden email]>
> Sent: February 2, 2019 11:29 AM
> To: 'Krystian Lewandowski' <[hidden email]>
> Subject: RE: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards
>
> Thank you for your reply.
> The stock dtbs do not have the "operating-points-v2" and it follows that there is no frequency set by the dtb.
> Can you point me to a dtb block that has the property with an example of setting the frequency.
>

Maybe this one?
https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun8i-h3.dtsi#L46 <https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun8i-h3.dtsi#L46>

--
Krystian

> One dtb:
>                clock@1c20000 {
>                        reg = < 0x1c20000 0x400 >;
>                        clocks = < 0x0e 0x0f >;
>                        clock-names = "hosc\0losc";
>                        #clock-cells = < 0x01 >;
>                        #reset-cells = < 0x01 >;
>                        compatible = "allwinner,sun8i-h3-ccu";
>                        phandle = < 0x03 >;
>                };
>
> Pc2 dtb:
>
>                clock@1c20000 {
>                        reg = < 0x1c20000 0x400 >;
>                        clocks = < 0x0e 0x0f >;
>                        clock-names = "hosc\0losc";
>                        #clock-cells = < 0x01 >;
>                        #reset-cells = < 0x01 >;
>                        compatible = "allwinner,sun50i-h5-ccu";
>                        phandle = < 0x03 >;
>                };
>
> Stephen Graf
>
> -----Original Message-----
> From: Krystian Lewandowski <[hidden email]>
> Sent: February 2, 2019 10:53 AM
> To: [hidden email]
> Cc: [hidden email]
> Subject: Re: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards
>
> Wiadomość napisana przez [hidden email] w dniu 02.02.2019, o godz. 18:26:
>>
>> I just realized that the cpu speed on these boards defaults on start-up, the
>> pc2 to 816Mhz and the one to 1008 Mhz. Both of these machines should be able
>> to run at 1300Mhz.
>> The pc2 speed can be changed with hw.setperf, but not the one.
>> Can the sxiccmu module be changed to read a value from the dtb to use as the
>> initial cpu speed?
>>
>
> Does the DT for OrangePi One have the "operating-points-v2" property?
>
> It seems H3 is already supported by OpenBSD:
> https://github.com/openbsd/src/blob/master/sys/dev/fdt/sxiccmu.c#L110
>
> --
> Krystian
>

Reply | Threaded
Open this post in threaded view
|

Re: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

s_graf
In reply to this post by s_graf
On my pc2 I am using a dtb from Armbian that has operating points, but I am not sure if sxiccmu uses it.

 

Maybe Mark could comment.

 

It is interesting to note that Armbian sets the voltage to 1.3v at 816Mhz,

whereas Openbsd starts up at 816Mhz and 1.2v.

 

from Armbian dtb:

 

        opp_table0 {

                compatible = "operating-points-v2";

                opp-shared;

                phandle = < 0x30 >;

 

                opp@120000000 {

                        opp-hz = < 0x00 0x7270e00 >;

                        opp-microvolt = < 0xfde80 0xfde80 0x13d620 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@240000000 {

                        opp-hz = < 0x00 0xe4e1c00 >;

                        opp-microvolt = < 0xfde80 0xfde80 0x13d620 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@480000000 {

                        opp-hz = < 0x00 0x1c9c3800 >;

                        opp-microvolt = < 0xfde80 0xfde80 0x13d620 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@648000000 {

                        opp-hz = < 0x00 0x269fb200 >;

                        opp-microvolt = < 0xfde80 0xfde80 0x13d620 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@816000000 {

                        opp-hz = < 0x00 0x30a32c00 >;

                        opp-microvolt = < 0x10c8e0 0x10c8e0 0x13d620 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@960000000 {

                        opp-hz = < 0x00 0x39387000 >;

                        opp-microvolt = < 0x124f80 0x124f80 0x13d620 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1008000000 {

                        opp-hz = < 0x00 0x3c14dc00 >;

                        opp-microvolt = < 0x124f80 0x124f80 0x13d620 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1056000000 {

                        opp-hz = < 0x00 0x3ef14800 >;

                        opp-microvolt = < 0x142440 0x142440 0x142440 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1104000000 {

                        opp-hz = < 0x00 0x41cdb400 >;

                        opp-microvolt = < 0x142440 0x142440 0x142440 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1152000000 {

                        opp-hz = < 0x00 0x44aa2000 >;

                        opp-microvolt = < 0x142440 0x142440 0x142440 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1200000000 {

                        opp-hz = < 0x00 0x47868c00 >;

                        opp-microvolt = < 0x142440 0x142440 0x142440 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1224000000 {

                        opp-hz = < 0x00 0x48f4c200 >;

                        opp-microvolt = < 0x147260 0x147260 0x147260 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1248000000 {

                        opp-hz = < 0x00 0x4a62f800 >;

                        opp-microvolt = < 0x147260 0x147260 0x147260 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1296000000 {

                        opp-hz = < 0x00 0x4d3f6400 >;

                        opp-microvolt = < 0x147260 0x147260 0x147260 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1344000000 {

                        opp-hz = < 0x00 0x501bd000 >;

                        opp-microvolt = < 0x155cc0 0x155cc0 0x155cc0 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

 

                opp@1368000000 {

                        opp-hz = < 0x00 0x518a0600 >;

                        opp-microvolt = < 0x155cc0 0x155cc0 0x155cc0 >;

                        clock-latency-ns = < 0x3b9b0 >;

                };

        };

 

 

                cpu@0 {

                        compatible = "arm,cortex-a53\0arm,armv8";

                        device_type = "cpu";

                        reg = < 0x00 >;

                        enable-method = "psci";

                        clocks = < 0x03 0x0e >;

                        clock-names = "cpu";

                        operating-points-v2 = < 0x30 >;

                        #cooling-cells = < 0x02 >;

                        cooling-min-level = < 0x00 >;

                        cooling-max-level = < 0x0f >;

                        cpu-supply = < 0x31 >;

                        phandle = < 0x2b >;

                };

 

 

From: Krystian Lewandowski <[hidden email]>
Sent: February 2, 2019 12:44 PM
To: [hidden email]
Cc: [hidden email]
Subject: Re: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

 

Wiadomość napisana przez [hidden email] <mailto:[hidden email]>  w dniu 02.02.2019, o godz. 21:30:

 



-----Original Message-----
From: [hidden email] <mailto:[hidden email]>  <[hidden email] <mailto:[hidden email]> >
Sent: February 2, 2019 11:29 AM
To: 'Krystian Lewandowski' <[hidden email] <mailto:[hidden email]> >
Subject: RE: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

Thank you for your reply.
The stock dtbs do not have the "operating-points-v2" and it follows that there is no frequency set by the dtb.
Can you point me to a dtb block that has the property with an example of setting the frequency.

 

Maybe this one?

https://github.com/torvalds/linux/blob/master/arch/arm/boot/dts/sun8i-h3.dtsi#L46

 

--

Krystian





One dtb:
               clock@1c20000 {
                       reg = < 0x1c20000 0x400 >;
                       clocks = < 0x0e 0x0f >;
                       clock-names = "hosc\0losc";
                       #clock-cells = < 0x01 >;
                       #reset-cells = < 0x01 >;
                       compatible = "allwinner,sun8i-h3-ccu";
                       phandle = < 0x03 >;
               };

Pc2 dtb:

               clock@1c20000 {
                       reg = < 0x1c20000 0x400 >;
                       clocks = < 0x0e 0x0f >;
                       clock-names = "hosc\0losc";
                       #clock-cells = < 0x01 >;
                       #reset-cells = < 0x01 >;
                       compatible = "allwinner,sun50i-h5-ccu";
                       phandle = < 0x03 >;
               };

Stephen Graf

-----Original Message-----
From: Krystian Lewandowski <[hidden email] <mailto:[hidden email]> >
Sent: February 2, 2019 10:53 AM
To: [hidden email] <mailto:[hidden email]>
Cc: [hidden email] <mailto:[hidden email]>
Subject: Re: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

Wiadomość napisana przez [hidden email] <mailto:[hidden email]>  w dniu 02.02.2019, o godz. 18:26:




I just realized that the cpu speed on these boards defaults on start-up, the
pc2 to 816Mhz and the one to 1008 Mhz. Both of these machines should be able
to run at 1300Mhz.
The pc2 speed can be changed with hw.setperf, but not the one.
Can the sxiccmu module be changed to read a value from the dtb to use as the
initial cpu speed?


Does the DT for OrangePi One have the "operating-points-v2" property?

It seems H3 is already supported by OpenBSD:
https://github.com/openbsd/src/blob/master/sys/dev/fdt/sxiccmu.c#L110

--
Krystian

 

Reply | Threaded
Open this post in threaded view
|

Re: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

Mark Kettenis
Any OS will boot with the CPU clock frequency and voltage that was set
up by the firmware/bootloader.  Those are supposed to be "safe"
settings in the sense that the OS can run without overheating the SoC.

If the DT provides a set of operating points, and there is clock and
regulator support, OpenBSD will allow changing the clock frequency.
For each frequency it will select the associated voltage in the
operating points table.  When there is support for changing the clock
frequency, OpenBSD will switch to the operating point that has an
associated clock frequency that not higher than the clock frequency
the system booted with.

Reply | Threaded
Open this post in threaded view
|

Re: initial cpu speed on orangepi one and orangepi pc2 - probably other H5 and H3 boards

s_graf
In reply to this post by s_graf
Thank you for the information. I can now see where the various frequencies
come from when I change setperf.
Is it possible to see the cpu voltage anywhere, to go along with the
hw.cpuspeed?

I want to do further testing with the stress program as I do not think the
H5 stability problems are to do with speed/voltage.
I suspect something to do with network.  I started out with the dwxe0 lan
plugged into a 1000Mhz switch and failures were quite often. I then
downgraded to a 100Mhz port and the system seemed to hang in there longer.
I then tested with an old usb wifi adapter(run0) which was very slow and the
system behaved even better, although it did fail in the same fashion.

Has anyone tried to trace back the crash reports?  It always seems to be a
consistent crash no matter the program that was running.

Stephen Graf

-----Original Message-----
From: [hidden email] <[hidden email]> On Behalf Of Mark
Kettenis
Sent: February 3, 2019 11:54 AM
To: [hidden email]
Cc: [hidden email]; [hidden email]
Subject: Re: initial cpu speed on orangepi one and orangepi pc2 - probably
other H5 and H3 boards

Any OS will boot with the CPU clock frequency and voltage that was set
up by the firmware/bootloader.  Those are supposed to be "safe"
settings in the sense that the OS can run without overheating the SoC.

If the DT provides a set of operating points, and there is clock and
regulator support, OpenBSD will allow changing the clock frequency.
For each frequency it will select the associated voltage in the
operating points table.  When there is support for changing the clock
frequency, OpenBSD will switch to the operating point that has an
associated clock frequency that not higher than the clock frequency
the system booted with.