Jump to content

H616 mainlining effort


mcerveny

Recommended Posts

Hello.

I see some progress in H616 (OPIZ2) support in mainline linux (now 6.2RC5 comes with USB) - https://linux-sunxi.org/Linux_mainlining_effort .
I tried to setup/enable some other components and I am successful with upstream linux kernel 6.2RC5:
- displayengine (drm, fb, mixer, tcon, hdmi) (seems to have some I2C/EDID problems)
- videoengine (cedrus) (in testing now)
- gpu (3d mali, panfrost)
- dma, efuse, thermal ...
but I am unsuccessful with
- crypto (total different behavior in contrast to H616 manual)
and untested
- audio codecs and hdmi audio
- opp power management (frequency + voltage) for CPU and GPU
- SDIO wifi 

I was also successful with uBoot (some patches from upstream uBoot) to boot sdcard-less from SPI flash and then from network PXE+NFS.

Does anyone do some work in this direction ?
 

image.png

Edited by mcerveny
add url
Link to comment
Share on other sites

Nice, looks like you standing up on Orangepi there?

 

9 hours ago, mcerveny said:

Does anyone do some work in this direction ?

 

Interesting, I've been working low down your list, testing cpu-frequency-scaling for a while, which I think now will submit PR to 5.19 for others to try. The patch addresses all variants, but is not optimized, limited to 1512 Mhz, still WIP is the frequency calc's and micro-volt testing.

 

All that you list has been in progress for a while, but has not seen the light here for lack of someone knowledgeable having time or perhaps interest, and that it seems there are still issues to be worked out in some parts.

 

@going is doing an incredible job at maintaining sunxi here for us to develop off.

Edited by ALIGMSTEN
Forgot to say!!
Link to comment
Share on other sites

27.01.2023 в 23:03, mcerveny сказал:

crypto (total different behavior in contrast to H616 manual)

Unfortunately, this is not the only discrepancy.

 

27.01.2023 в 23:03, mcerveny сказал:

Does anyone do some work in this direction ?

I'm doing a little work, but it's about supporting a series of patches.

Which are applied using the function lib/functions/compilation/patch/patching.sh.

The day after the origin/linux-6.1.y branch appeared in linux-stable.git I extract from this repository

branch origin/orange-pi-6.1 all the commits that were applied from above. And it becomes a series of megous patches.

A series of armbian patches are those patches that one of the users once suggested for use.

I am not able to check all of them and the correctness of their work after applying them.

All I do is monitor their correct application when moving the kernel code upstream.

And I fix compilation errors if they occur.
@Igor also makes a huge contribution to this process.

We hope for your contribution to the development.

 

Link to comment
Share on other sites

If you addressing me and above patch @mcerveny I'm happy to play here, its not serious.

 

I cant speak for mainline process.

 

In similar vein could quite happily carry on and not 'contribute' getting the 'stuffs' I need working and abuse. However I am completely against that type of behavior, and why I choose to donate and contribute.

Link to comment
Share on other sites

On 1/29/2023 at 4:08 PM, ALIGMSTEN said:

Hi nope, fun in spare time approach here, arm64-dts-allwinner-h616-Add-efuse_xlate-cpufreq.patch.

I tested with kernel 6.2RC4 (some driver code change needed), notes:

  • do not increase GPU voltage
                 reg_dcdcc: dcdcc {
                     regulator-always-on;
                     regulator-min-microvolt = <810000>;
    -                regulator-max-microvolt = <1080000>;
    +                regulator-max-microvolt = <1100000>;
                     regulator-name = "vdd-gpu-sys";
                 };
    absolute maximum (from H616_Datasheet_V1.0_cleaned.pdf):
    image.thumb.png.dce411d5e702a2f13d0b2b91c9a6adfd.png
    recommended (from H616_Datasheet_V1.0_cleaned.pdf):
    image.thumb.png.0beb29e4d7092146ddc3b5cfa73d9c60.png
    my sun50i-h616-orangepi-zero2.dts:
    reg_dcdcc: dcdcc {
    regulator-always-on;
    regulator-min-microvolt = <810000>;
    regulator-max-microvolt = <990000>;
    regulator-name = "vdd-gpu-sys";
    };

     

  • I also reworked temperature - cooling
    my sun50i-h616.dtsi:
    		cpu_thermal: cpu-thermal {
    			polling-delay-passive = <500>;
    			polling-delay = <1000>;
    			thermal-sensors = <&ths 2>;
    
    			trips {
    				cpu_target: cpu-target {
    					temperature = <75000>;
    					hysteresis = <2000>;
    					type = "passive";
    				};
    
    				critical {
    					temperature = <105000>;
    					hysteresis = <2000>;
    					type = "critical";
    				};
    			};
    
    			cooling-maps {
    				map0 {
    					trip = <&cpu_target>;
    					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
    						<&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
    						<&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
    						<&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
    				};
    			};
    		};

    my sun50i-h616-orangepi-zero2.dts:
     

    &cpu_thermal {
    	/delete-node/ trips; 
    	// beaware, all points must have different names otherwise dts compiller does not hold position and driver stuck in differnt trip point
    	trips {
    		cpu_warm: cpu_warm {
    			temperature = <75000>;
    			hysteresis = <2000>;
    			type = "passive";
    		};
    
    		cpu_hot_pre: cpu_hot_pre {
    			temperature = <80000>;
    			hysteresis = <2000>;
    			type = "passive";
    		};
    
    		cpu_hot: cpu_hot {
    			temperature = <85000>;
    			hysteresis = <2000>;
    			type = "passive";
    		};
    
    		cpu_very_hot: cpu_very_hot {
    			temperature = <90000>;
    			hysteresis = <2000>;
    			type = "passive";
    		};
    
    		cpu_critical {
    			temperature = <105000>;
    			hysteresis = <2000>;
    			type = "critical";
    		};
    	};
    
    	/delete-node/ cooling-maps;
    	cooling-maps {
    		cpu_warm_limit_cpu {
    			trip = <&cpu_warm>;
    			cooling-device = <&cpu0 THERMAL_NO_LIMIT 2>;
    		};
    
    		cpu_hot_pre_limit_cpu {
    			trip = <&cpu_hot_pre>;
    			cooling-device = <&cpu0 3 3>;
    		};
    
    		cpu_hot_limit_cpu {
    			trip = <&cpu_hot>;
    			cooling-device = <&cpu0 4 4>;
    		};
    
    		cpu_very_hot_limit_cpu {
    			trip = <&cpu_very_hot>;
    			cooling-device = <&cpu0 5 THERMAL_NO_LIMIT>;
    		};
    	};
    };

     

  • my testing
    • 0 - idle
    • 10 - run "stress --cpu 4"
    • 36 - additional external heating
    • 134 - remove heating
    • 304 - stop "stress --cpu 4"
      image.thumb.png.b927aa84f0e7c858d8827c093db93cb3.png
Link to comment
Share on other sites

23 часа назад, mcerveny сказал:

So the question, the armbian patches are well aligned with the new kernel, why are they not pushed to mainline ?

That's not so. Some patches are outdated and do not work in the 6.1 kernel.

sunxi-6.1/series.conf the bad ones are off

Some patches are applied and work, but these changes in the 6.1 kernel are useless.
I only discovered this today.

 

Most of the armbian patches were taken from those that were proposed for kernel.org .

Those patches that were accepted are gone from this list.

Link to comment
Share on other sites

On 1/29/2023 at 4:08 PM, ALIGMSTEN said:

Hi nope, fun in spare time approach here, arm64-dts-allwinner-h616-Add-efuse_xlate-cpufreq.patch.

This code does not seem to be right:
 

#define SUN50I_H616_NVMEM_MASK 0x22
#define SUN50I_H616_NVMEM_SHIFT 5
...
u32 efuse_value = (*(u32 *)efuse >> SUN50I_H616_NVMEM_SHIFT) & SUN50I_H616_NVMEM_MASK;
...
if (efuse_value >=1 && efuse_value <= 3)

Are you sure about MASK ?
Or it is bitmask that should be translated like A100 ->  https://www.lkml.org/lkml/2020/12/8/70

Link to comment
Share on other sites

On 1/27/2023 at 9:03 PM, mcerveny said:

- displayengine (drm, fb, mixer, tcon, hdmi) (seems to have some I2C/EDID problems)
- videoengine (cedrus) (in testing now)

I successfully tested videoengine (tested 2k,4k,hevc,h264 and 4k hdr hevc (with non hdr output)). I found the problem in VI (video) layer in DRM (displayengine) output. I must change at least once after poweron DRM property "COLOR_RANGE" to DRM_COLOR_YCBCR_FULL_RANGE to get correctly setup CSC (color space conversion) in hw 🤨, lost 3 days in kernel debug.

Edited by mcerveny
Link to comment
Share on other sites

On 2/2/2023 at 11:42 PM, mcerveny said:

n hw 🤨, lost 3 days in kernel debug

 

Very interesting, thanks for your work.

 

Personally still making changes during my testing atm, better understanding uboot registers, static const struct sunxi_cpufreq_soc_data sun50i_h616_data.. . etc...

 

I see 10 Members have downloaded , Add-h616-efuse_xlate-cpu-freq-scaling - any other feedback?

 

Here as is sbc-bench output ( no extended thermal and gpu-sys set as manual recommends)

 

Spoiler

alistair@orangepizero2:~$ sudo /bin/bash ./sbc-bench.sh -c
[sudo] password for alistair: 

Average load and/or CPU utilization too high (too much background activity). Waiting...

Too busy for benchmarking: 12:02:09 up 19 min,  0 users,  load average: 0.13, 0.16, 0.17,  cpu: 7%
Too busy for benchmarking: 12:02:14 up 19 min,  0 users,  load average: 0.12, 0.16, 0.17,  cpu: 0%
Too busy for benchmarking: 12:02:19 up 19 min,  0 users,  load average: 0.11, 0.15, 0.17,  cpu: 0%
Too busy for benchmarking: 12:02:24 up 20 min,  0 users,  load average: 0.10, 0.15, 0.17,  cpu: 0%
Too busy for benchmarking: 12:02:29 up 20 min,  0 users,  load average: 0.09, 0.15, 0.17,  cpu: 0%

Status of performance related governors/policies found below /sys:
cpufreq-policy0: performance / 1512 MHz (conservative ondemand userspace powersave performance schedutil)

sbc-bench v0.9.13

Installing needed tools: apt -f -qq -y install dmidecode lshw mbw, tinymembench., ramlat, mhz, cpuminer. Done.
Checking cpufreq OPP. Done (results will be available in 20-30 minutes).
Executing tinymembench. Done.
Executing RAM latency tester. Done.
Executing OpenSSL benchmark. Done.
Executing 7-zip benchmark..../sbc-bench.sh: line 3003: 11120 Killed                  "${SevenZip}" b ${DictSize} -mmt=${CPUCores} >> ${TempLog}
 Done.
Executing cpuminer. 5 more minutes to wait. Done.
Checking cpufreq OPP again. Done (29 minutes elapsed).

ATTENTION: Throttling might have occured. Check the log for details.

Memory performance
memcpy: 1664.7 MB/s
memset: 5294.1 MB/s

Cpuminer total scores (5 minutes execution): 3.94,3.72,3.71,3.70,3.69,3.68 kH/s

7-zip total scores (3 consecutive runs): 2715,2723, single-threaded: 1085

OpenSSL results:
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
aes-128-cbc      98069.94k   312232.98k   667921.24k   974638.42k  1124769.79k  1136678.23k
aes-128-cbc      98187.41k   312142.08k   667988.74k   974738.43k  1124734.29k  1137016.83k
aes-192-cbc      94054.75k   283486.10k   557781.33k   759236.61k   848199.68k   855009.96k
aes-192-cbc      94047.96k   283296.06k   557753.43k   759076.86k   848158.72k   854944.43k
aes-256-cbc      91867.29k   264464.04k   489722.20k   638698.84k   700489.73k   704856.06k
aes-256-cbc      91867.89k   264689.41k   489831.25k   638774.95k   700609.88k   705232.90k

Full results uploaded to http://ix.io/4nxo. Please check the log for anomalies (e.g. swapping
or throttling happenend).

sbc-bench v0.9.13 OrangePi Zero2 (Thu, 09 Feb 2023 12:08:08 +0200)

Distributor ID:    Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:    11
Codename:    bullseye
Armbian info:   Orange Pi Zero2, sun50iw9, sunxi64, 23.02.0-trunk, https://github.com/AGM1968/build

/usr/bin/gcc (Debian 10.2.1-6) 10.2.1 20210110

Uptime: 12:08:09 up 25 min,  0 users,  load average: 1.19, 0.91, 0.52,  50.3°C,  330893796

Linux 5.19.17-sunxi64 (orangepizero2)     02/09/23     _aarch64_    (4 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           9.25    0.01    2.31    0.70    0.00   87.72

Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
mmcblk0           9.99       276.05       276.53         0.00     427622     428364          0
mtdblock0         0.02         0.07         0.00         0.00        112          0          0
zram0             0.54         1.55         0.61         0.00       2396        948          0
zram1             0.28         0.32         3.28         0.00        488       5084          0

               total        used        free      shared  buff/cache   available
Mem:           984Mi       276Mi       586Mi        12Mi       121Mi       627Mi
Swap:          492Mi       1.0Mi       490Mi

Filename                Type        Size    Used    Priority
/dev/zram0                                 partition    503972    1280    5

##########################################################################

Checking cpufreq OPP (Cortex-A53):

Cpufreq OPP: 1512    Measured: 1510 (1510.763/1510.694/1510.556)
Cpufreq OPP: 1200    Measured: 1198 (1198.722/1198.559/1198.504)
Cpufreq OPP: 1008    Measured: 1006 (1006.661/1006.637/1006.590)
Cpufreq OPP:  792    Measured:  790    (790.694/790.583/790.546)
Cpufreq OPP:  600    Measured:  598    (598.660/598.660/598.634)
Cpufreq OPP:  480    Measured:  478    (478.697/478.581/478.570)

##########################################################################

Hardware sensors:

cpu_thermal-virtual-0
temp1:        +51.3 C  

gpu_thermal-virtual-0
temp1:        +50.7 C  

ddr_thermal-virtual-0
temp1:        +52.4 C  

ve_thermal-virtual-0
temp1:        +51.5 C  

##########################################################################

Executing benchmark on cpu0 (Cortex-A53):

tinymembench v0.4.9 (simple benchmark for memory throughput and latency)

==========================================================================
== Memory bandwidth tests                                               ==
==                                                                      ==
== Note 1: 1MB = 1000000 bytes                                          ==
== Note 2: Results for 'copy' tests show how many bytes can be          ==
==         copied per second (adding together read and writen           ==
==         bytes would have provided twice higher numbers)              ==
== Note 3: 2-pass copy means that we are using a small temporary buffer ==
==         to first fetch data into it, and only then write it to the   ==
==         destination (source -> L1 cache, L1 cache -> destination)    ==
== Note 4: If sample standard deviation exceeds 0.1%, it is shown in    ==
==         brackets                                                     ==
==========================================================================

 C copy backwards                                     :   1652.7 MB/s (8.5%)
 C copy backwards (32 byte blocks)                    :   1655.1 MB/s (3.7%)
 C copy backwards (64 byte blocks)                    :   1672.5 MB/s (4.3%)
 C copy                                               :   1555.9 MB/s (1.2%)
 C copy prefetched (32 bytes step)                    :   1159.5 MB/s (3.5%)
 C copy prefetched (64 bytes step)                    :   1159.2 MB/s (1.0%)
 C 2-pass copy                                        :   1342.8 MB/s (6.3%)
 C 2-pass copy prefetched (32 bytes step)             :    967.3 MB/s (4.6%)
 C 2-pass copy prefetched (64 bytes step)             :    830.9 MB/s (0.8%)
 C fill                                               :   5431.6 MB/s (1.1%)
 C fill (shuffle within 16 byte blocks)               :   5413.6 MB/s (1.5%)
 C fill (shuffle within 32 byte blocks)               :   5434.6 MB/s (1.3%)
 C fill (shuffle within 64 byte blocks)               :   5425.0 MB/s (1.0%)
 ---
 standard memcpy                                      :   1664.7 MB/s (1.7%)
 standard memset                                      :   5294.1 MB/s
 ---
 NEON LDP/STP copy                                    :   1543.6 MB/s
 NEON LDP/STP copy pldl2strm (32 bytes step)          :    977.1 MB/s (1.0%)
 NEON LDP/STP copy pldl2strm (64 bytes step)          :   1254.0 MB/s (0.9%)
 NEON LDP/STP copy pldl1keep (32 bytes step)          :   1634.6 MB/s (0.1%)
 NEON LDP/STP copy pldl1keep (64 bytes step)          :   1648.5 MB/s
 NEON LD1/ST1 copy                                    :   1527.8 MB/s (0.5%)
 NEON STP fill                                        :   5298.8 MB/s
 NEON STNP fill                                       :   4328.3 MB/s (0.5%)
 ARM LDP/STP copy                                     :   1538.4 MB/s (1.2%)
 ARM STP fill                                         :   5304.1 MB/s
 ARM STNP fill                                        :   4314.1 MB/s (0.7%)

==========================================================================
== Memory latency test                                                  ==
==                                                                      ==
== Average time is measured for random memory accesses in the buffers   ==
== of different sizes. The larger is the buffer, the more significant   ==
== are relative contributions of TLB, L1/L2 cache misses and SDRAM      ==
== accesses. For extremely large buffer sizes we are expecting to see   ==
== page table walk with several requests to SDRAM for almost every      ==
== memory access (though 64MiB is not nearly large enough to experience ==
== this effect to its fullest).                                         ==
==                                                                      ==
== Note 1: All the numbers are representing extra time, which needs to  ==
==         be added to L1 cache latency. The cycle timings for L1 cache ==
==         latency can be usually found in the processor documentation. ==
== Note 2: Dual random read means that we are simultaneously performing ==
==         two independent memory accesses at a time. In the case if    ==
==         the memory subsystem can't handle multiple outstanding       ==
==         requests, dual random read has the same timings as two       ==
==         single reads performed one after another.                    ==
==========================================================================

block size : single random read / dual random read, [MADV_NOHUGEPAGE]
      1024 :    0.0 ns          /     0.0 ns 
      2048 :    0.0 ns          /     0.0 ns 
      4096 :    0.0 ns          /     0.0 ns 
      8192 :    0.0 ns          /     0.0 ns 
     16384 :    0.0 ns          /     0.0 ns 
     32768 :    0.0 ns          /     0.0 ns 
     65536 :    4.3 ns          /     7.2 ns 
    131072 :    6.6 ns          /    10.4 ns 
    262144 :    8.1 ns          /    12.3 ns 
    524288 :   79.0 ns          /   123.2 ns 
   1048576 :  121.2 ns          /   162.5 ns 
   2097152 :  143.1 ns          /   175.5 ns 
   4194304 :  159.3 ns          /   186.1 ns 
   8388608 :  168.2 ns          /   192.2 ns 
  16777216 :  173.5 ns          /   197.2 ns 
  33554432 :  177.7 ns          /   201.2 ns 
  67108864 :  190.5 ns          /   225.2 ns 

block size : single random read / dual random read, [MADV_HUGEPAGE]
      1024 :    0.0 ns          /     0.0 ns 
      2048 :    0.0 ns          /     0.0 ns 
      4096 :    0.0 ns          /     0.0 ns 
      8192 :    0.0 ns          /     0.0 ns 
     16384 :    0.0 ns          /     0.0 ns 
     32768 :    0.0 ns          /     0.0 ns 
     65536 :    4.3 ns          /     7.4 ns 
    131072 :    6.6 ns          /    10.4 ns 
    262144 :    8.1 ns          /    12.3 ns 
    524288 :   78.9 ns          /   123.2 ns 
   1048576 :  121.1 ns          /   162.4 ns 
   2097152 :  142.3 ns          /   174.7 ns 
   4194304 :  153.4 ns          /   178.9 ns 
   8388608 :  158.9 ns          /   180.5 ns 
  16777216 :  161.5 ns          /   181.2 ns 
  33554432 :  162.8 ns          /   181.4 ns 
  67108864 :  163.5 ns          /   181.6 ns 

##########################################################################

Executing ramlat on cpu0 (Cortex-A53), results in ns:

       size:  1x32  2x32  1x64  2x64 1xPTR 2xPTR 4xPTR 8xPTR
         4k: 2.654 2.650 1.986 1.986 1.987 1.986 2.734 5.545 
         8k: 2.648 2.650 1.986 1.989 1.986 1.986 2.734 5.559 
        16k: 2.651 2.651 1.997 1.997 1.993 1.990 2.733 5.549 
        32k: 5.720 7.517 5.350 7.101 5.347 7.240 10.72 19.30 
        64k: 15.69 17.49 15.14 17.02 15.13 17.07 22.86 43.76 
       128k: 19.49 20.30 19.14 19.90 19.98 20.01 25.73 50.78 
       256k: 44.95 56.59 42.81 55.29 43.24 55.33 87.50 164.0 
       512k: 150.2 162.1 149.0 152.0 149.9 152.3 222.7 444.4 
      1024k: 168.9 168.7 168.1 166.0 166.1 166.0 229.9 458.5 
      2048k: 169.3 169.3 169.1 167.3 167.5 167.0 230.0 460.2 
      4096k: 175.3 176.1 175.4 178.5 175.6 176.0 239.1 483.3 
      8192k: 177.3 180.4 177.1 182.1 177.3 179.7 245.3 493.8 
     16384k: 179.6 182.5 178.6 184.0 178.6 182.0 247.2 497.3 

##########################################################################

Executing benchmark twice on cluster 0 (Cortex-A53)

OpenSSL 1.1.1n, built on 15 Mar 2022
type             16 bytes     64 bytes    256 bytes   1024 bytes   8192 bytes  16384 bytes
aes-128-cbc      98069.94k   312232.98k   667921.24k   974638.42k  1124769.79k  1136678.23k
aes-128-cbc      98187.41k   312142.08k   667988.74k   974738.43k  1124734.29k  1137016.83k
aes-192-cbc      94054.75k   283486.10k   557781.33k   759236.61k   848199.68k   855009.96k
aes-192-cbc      94047.96k   283296.06k   557753.43k   759076.86k   848158.72k   854944.43k
aes-256-cbc      91867.29k   264464.04k   489722.20k   638698.84k   700489.73k   704856.06k
aes-256-cbc      91867.89k   264689.41k   489831.25k   638774.95k   700609.88k   705232.90k

##########################################################################

Executing benchmark single-threaded on cpu0 (Cortex-A53)

7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=C,Utf16=off,HugeFiles=on,64 bits,4 CPUs LE)

LE
CPU Freq: 64000000 - - - - - - - -

RAM size:     984 MB,  # CPU hardware threads:   4
RAM usage:    435 MB,  # Benchmark threads:      1

                       Compressing  |                  Decompressing
Dict     Speed Usage    R/U Rating  |      Speed Usage    R/U Rating
         KiB/s     %   MIPS   MIPS  |      KiB/s     %   MIPS   MIPS

22:        829   100    808    807  |      16347   100   1396   1396
23:        774   100    790    789  |      16000   100   1385   1385
24:        727   100    782    782  |      15644   100   1374   1373
25:        689   100    787    787  |      15237   100   1357   1356
----------------------------------  | ------------------------------
Avr:             100    792    791  |              100   1378   1378
Tot:             100   1085   1085

##########################################################################

Executing benchmark 3 times multi-threaded on CPUs 0-3

7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=C,Utf16=off,HugeFiles=on,64 bits,4 CPUs LE)

LE
CPU Freq: 64000000 64000000 64000000 - - - 512000000 - -

RAM size:     984 MB,  # CPU hardware threads:   4
RAM usage:    882 MB,  # Benchmark threads:      4

                       Compressing  |                  Decompressing
Dict     Speed Usage    R/U Rating  |      Speed Usage    R/U Rating
         KiB/s     %   MIPS   MIPS  |      KiB/s     %   MIPS   MIPS

22:       1823   320    555   1774  |      44853   397    963   3827
23:       1850   333    566   1885  |      42321   398    919   3662
24:       1792   344    561   1927  |      42512   398    938   3732
25:       1081   289    427   1234  |      41328   398    925   3678
----------------------------------  | ------------------------------
Avr:             321    527   1705  |              398    936   3725
Tot:             360    732   2715

7-Zip (a) [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21
p7zip Version 16.02 (locale=C,Utf16=off,HugeFiles=on,64 bits,4 CPUs LE)

LE
CPU Freq: 64000000 - - - - - - - -

RAM size:     984 MB,  # CPU hardware threads:   4
RAM usage:    882 MB,  # Benchmark threads:      4

                       Compressing  |                  Decompressing
Dict     Speed Usage    R/U Rating  |      Speed Usage    R/U Rating
         KiB/s     %   MIPS   MIPS  |      KiB/s     %   MIPS   MIPS

22:       1800   319    548   1751  |      44063   397    946   3759
23:       1783   330    550   1817  |      42117   397    918   3644
24:       1720   339    545   1850  |      42440   397    938   3726
25:       1352   312    495   1545  |      41444   398    926   3688
----------------------------------  | ------------------------------
Avr:             325    535   1741  |              397    932   3704
Tot:             361    733   2723

Compression: 1705,1741
Decompression: 3725,3704
Total: 2715,2723

##########################################################################

** cpuminer-multi 1.3.7 by tpruvot@github **
BTC donation address: 1FhDPLPpw18X4srecguG3MxJYe4a1JsZnd (tpruvot)

[2023-02-09 12:31:49] 4 miner threads started, using 'scrypt' algorithm.
[2023-02-09 12:31:50] CPU #2: 1.16 kH/s
[2023-02-09 12:31:50] CPU #3: 1.13 kH/s
[2023-02-09 12:31:50] CPU #0: 1.11 kH/s
[2023-02-09 12:31:50] CPU #1: 1.08 kH/s
[2023-02-09 12:31:54] Total: 3.94 kH/s
[2023-02-09 12:31:59] CPU #2: 0.93 kH/s
[2023-02-09 12:31:59] CPU #1: 0.93 kH/s
[2023-02-09 12:31:59] CPU #0: 0.93 kH/s
[2023-02-09 12:31:59] CPU #3: 0.92 kH/s
[2023-02-09 12:31:59] Total: 3.71 kH/s
[2023-02-09 12:32:05] CPU #3: 0.92 kH/s
[2023-02-09 12:32:05] Total: 3.70 kH/s
[2023-02-09 12:32:08] Total: 3.71 kH/s
[2023-02-09 12:32:09] CPU #2: 0.93 kH/s
[2023-02-09 12:32:09] CPU #1: 0.93 kH/s
[2023-02-09 12:32:09] CPU #0: 0.92 kH/s
[2023-02-09 12:32:09] Total: 3.72 kH/s
[2023-02-09 12:32:14] CPU #3: 0.93 kH/s
[2023-02-09 12:32:14] Total: 3.71 kH/s
[2023-02-09 12:32:19] CPU #2: 0.93 kH/s
[2023-02-09 12:32:19] CPU #1: 0.93 kH/s
[2023-02-09 12:32:19] CPU #0: 0.93 kH/s
[2023-02-09 12:32:19] Total: 3.72 kH/s
[2023-02-09 12:32:24] CPU #3: 0.93 kH/s
[2023-02-09 12:32:24] Total: 3.72 kH/s
[2023-02-09 12:32:29] CPU #2: 0.93 kH/s
[2023-02-09 12:32:29] CPU #1: 0.93 kH/s
[2023-02-09 12:32:29] CPU #0: 0.93 kH/s
[2023-02-09 12:32:29] Total: 3.72 kH/s
[2023-02-09 12:32:34] CPU #3: 0.93 kH/s
[2023-02-09 12:32:34] Total: 3.72 kH/s
[2023-02-09 12:32:39] CPU #2: 0.93 kH/s
[2023-02-09 12:32:39] CPU #1: 0.92 kH/s
[2023-02-09 12:32:39] CPU #0: 0.92 kH/s
[2023-02-09 12:32:40] CPU #3: 0.92 kH/s
[2023-02-09 12:32:40] Total: 3.69 kH/s
[2023-02-09 12:32:44] Total: 3.70 kH/s
[2023-02-09 12:32:48] CPU #3: 0.93 kH/s
[2023-02-09 12:32:48] Total: 3.71 kH/s
[2023-02-09 12:32:49] CPU #2: 0.93 kH/s
[2023-02-09 12:32:49] CPU #1: 0.93 kH/s
[2023-02-09 12:32:49] CPU #0: 0.93 kH/s
[2023-02-09 12:32:49] Total: 3.72 kH/s
[2023-02-09 12:32:55] CPU #3: 0.92 kH/s
[2023-02-09 12:32:55] Total: 3.70 kH/s
[2023-02-09 12:32:58] Total: 3.70 kH/s
[2023-02-09 12:32:59] CPU #2: 0.93 kH/s
[2023-02-09 12:32:59] CPU #1: 0.93 kH/s
[2023-02-09 12:32:59] CPU #0: 0.93 kH/s
[2023-02-09 12:32:59] Total: 3.72 kH/s
[2023-02-09 12:33:04] CPU #3: 0.93 kH/s
[2023-02-09 12:33:04] Total: 3.72 kH/s
[2023-02-09 12:33:09] CPU #2: 0.93 kH/s
[2023-02-09 12:33:09] CPU #1: 0.93 kH/s
[2023-02-09 12:33:09] CPU #0: 0.93 kH/s
[2023-02-09 12:33:09] Total: 3.72 kH/s
[2023-02-09 12:33:14] CPU #3: 0.93 kH/s
[2023-02-09 12:33:14] Total: 3.72 kH/s
[2023-02-09 12:33:19] CPU #2: 0.94 kH/s
[2023-02-09 12:33:19] CPU #1: 0.93 kH/s
[2023-02-09 12:33:19] CPU #0: 0.93 kH/s
[2023-02-09 12:33:19] Total: 3.72 kH/s
[2023-02-09 12:33:25] CPU #3: 0.92 kH/s
[2023-02-09 12:33:25] Total: 3.70 kH/s
[2023-02-09 12:33:28] Total: 3.70 kH/s
[2023-02-09 12:33:29] CPU #2: 0.93 kH/s
[2023-02-09 12:33:29] CPU #1: 0.93 kH/s
[2023-02-09 12:33:29] CPU #0: 0.93 kH/s
[2023-02-09 12:33:29] Total: 3.71 kH/s
[2023-02-09 12:33:34] CPU #3: 0.93 kH/s
[2023-02-09 12:33:34] Total: 3.72 kH/s
[2023-02-09 12:33:39] CPU #2: 0.93 kH/s
[2023-02-09 12:33:39] CPU #1: 0.92 kH/s
[2023-02-09 12:33:39] CPU #0: 0.93 kH/s
[2023-02-09 12:33:40] CPU #3: 0.92 kH/s
[2023-02-09 12:33:40] Total: 3.70 kH/s
[2023-02-09 12:33:44] Total: 3.71 kH/s
[2023-02-09 12:33:49] CPU #2: 0.94 kH/s
[2023-02-09 12:33:49] CPU #3: 0.93 kH/s
[2023-02-09 12:33:49] Total: 3.72 kH/s
[2023-02-09 12:33:49] CPU #1: 0.93 kH/s
[2023-02-09 12:33:49] CPU #0: 0.93 kH/s
[2023-02-09 12:33:54] Total: 3.72 kH/s
[2023-02-09 12:33:58] CPU #2: 0.94 kH/s
[2023-02-09 12:33:59] CPU #3: 0.93 kH/s
[2023-02-09 12:33:59] Total: 3.72 kH/s
[2023-02-09 12:33:59] CPU #1: 0.93 kH/s
[2023-02-09 12:33:59] CPU #0: 0.93 kH/s
[2023-02-09 12:34:04] Total: 3.72 kH/s
[2023-02-09 12:34:04] CPU #2: 0.94 kH/s
[2023-02-09 12:34:09] CPU #3: 0.92 kH/s
[2023-02-09 12:34:09] Total: 3.72 kH/s
[2023-02-09 12:34:09] CPU #1: 0.92 kH/s
[2023-02-09 12:34:09] CPU #0: 0.92 kH/s
[2023-02-09 12:34:10] CPU #2: 0.93 kH/s
[2023-02-09 12:34:14] Total: 3.70 kH/s
[2023-02-09 12:34:18] CPU #2: 0.94 kH/s
[2023-02-09 12:34:19] CPU #3: 0.93 kH/s
[2023-02-09 12:34:19] Total: 3.71 kH/s
[2023-02-09 12:34:19] CPU #1: 0.93 kH/s
[2023-02-09 12:34:19] CPU #0: 0.93 kH/s
[2023-02-09 12:34:23] Total: 3.72 kH/s
[2023-02-09 12:34:24] CPU #2: 0.94 kH/s
[2023-02-09 12:34:24] Total: 3.72 kH/s
[2023-02-09 12:34:29] CPU #1: 0.93 kH/s
[2023-02-09 12:34:29] CPU #0: 0.93 kH/s
[2023-02-09 12:34:29] CPU #3: 0.93 kH/s
[2023-02-09 12:34:29] Total: 3.72 kH/s
[2023-02-09 12:34:34] CPU #2: 0.94 kH/s
[2023-02-09 12:34:34] Total: 3.72 kH/s
[2023-02-09 12:34:39] CPU #1: 0.93 kH/s
[2023-02-09 12:34:39] CPU #0: 0.93 kH/s
[2023-02-09 12:34:39] CPU #3: 0.93 kH/s
[2023-02-09 12:34:39] Total: 3.72 kH/s
[2023-02-09 12:34:44] CPU #2: 0.94 kH/s
[2023-02-09 12:34:44] Total: 3.72 kH/s
[2023-02-09 12:34:49] CPU #1: 0.93 kH/s
[2023-02-09 12:34:49] CPU #0: 0.93 kH/s
[2023-02-09 12:34:49] CPU #3: 0.93 kH/s
[2023-02-09 12:34:49] Total: 3.72 kH/s
[2023-02-09 12:34:54] CPU #2: 0.93 kH/s
[2023-02-09 12:34:55] CPU #3: 0.92 kH/s
[2023-02-09 12:34:55] Total: 3.70 kH/s
[2023-02-09 12:34:59] Total: 3.70 kH/s
[2023-02-09 12:34:59] CPU #1: 0.92 kH/s
[2023-02-09 12:34:59] CPU #0: 0.92 kH/s
[2023-02-09 12:35:00] CPU #2: 0.93 kH/s
[2023-02-09 12:35:04] CPU #3: 0.92 kH/s
[2023-02-09 12:35:04] Total: 3.70 kH/s
[2023-02-09 12:35:08] Total: 3.71 kH/s
[2023-02-09 12:35:09] CPU #1: 0.93 kH/s
[2023-02-09 12:35:09] CPU #0: 0.93 kH/s
[2023-02-09 12:35:09] Total: 3.72 kH/s
[2023-02-09 12:35:09] CPU #2: 0.94 kH/s
[2023-02-09 12:35:14] CPU #3: 0.93 kH/s
[2023-02-09 12:35:14] Total: 3.72 kH/s
[2023-02-09 12:35:19] CPU #1: 0.93 kH/s
[2023-02-09 12:35:19] CPU #0: 0.93 kH/s
[2023-02-09 12:35:19] CPU #2: 0.94 kH/s
[2023-02-09 12:35:19] Total: 3.72 kH/s
[2023-02-09 12:35:24] CPU #3: 0.93 kH/s
[2023-02-09 12:35:24] Total: 3.72 kH/s
[2023-02-09 12:35:29] CPU #1: 0.93 kH/s
[2023-02-09 12:35:29] CPU #0: 0.93 kH/s
[2023-02-09 12:35:29] CPU #2: 0.94 kH/s
[2023-02-09 12:35:29] Total: 3.72 kH/s
[2023-02-09 12:35:34] CPU #3: 0.93 kH/s
[2023-02-09 12:35:34] Total: 3.72 kH/s
[2023-02-09 12:35:39] CPU #1: 0.92 kH/s
[2023-02-09 12:35:39] CPU #0: 0.92 kH/s
[2023-02-09 12:35:40] CPU #2: 0.93 kH/s
[2023-02-09 12:35:40] CPU #3: 0.92 kH/s
[2023-02-09 12:35:40] Total: 3.70 kH/s
[2023-02-09 12:35:44] Total: 3.70 kH/s
[2023-02-09 12:35:48] CPU #2: 0.94 kH/s
[2023-02-09 12:35:48] CPU #3: 0.93 kH/s
[2023-02-09 12:35:48] Total: 3.71 kH/s
[2023-02-09 12:35:49] CPU #1: 0.93 kH/s
[2023-02-09 12:35:49] CPU #0: 0.93 kH/s
[2023-02-09 12:35:49] Total: 3.72 kH/s
[2023-02-09 12:35:54] CPU #2: 0.94 kH/s
[2023-02-09 12:35:54] CPU #3: 0.93 kH/s
[2023-02-09 12:35:54] Total: 3.72 kH/s
[2023-02-09 12:35:59] CPU #1: 0.93 kH/s
[2023-02-09 12:35:59] CPU #0: 0.93 kH/s
[2023-02-09 12:35:59] Total: 3.72 kH/s
[2023-02-09 12:36:04] CPU #3: 0.93 kH/s
[2023-02-09 12:36:04] Total: 3.72 kH/s
[2023-02-09 12:36:04] CPU #2: 0.94 kH/s
[2023-02-09 12:36:09] CPU #1: 0.92 kH/s
[2023-02-09 12:36:09] CPU #0: 0.91 kH/s
[2023-02-09 12:36:10] CPU #3: 0.91 kH/s
[2023-02-09 12:36:10] Total: 3.68 kH/s
[2023-02-09 12:36:13] Total: 3.69 kH/s
[2023-02-09 12:36:14] CPU #2: 0.94 kH/s
[2023-02-09 12:36:14] Total: 3.71 kH/s
[2023-02-09 12:36:19] CPU #1: 0.93 kH/s
[2023-02-09 12:36:19] CPU #0: 0.93 kH/s
[2023-02-09 12:36:19] CPU #3: 0.93 kH/s
[2023-02-09 12:36:19] Total: 3.72 kH/s
[2023-02-09 12:36:24] CPU #2: 0.93 kH/s
[2023-02-09 12:36:25] CPU #3: 0.92 kH/s
[2023-02-09 12:36:25] Total: 3.70 kH/s
[2023-02-09 12:36:29] Total: 3.70 kH/s
[2023-02-09 12:36:29] CPU #1: 0.92 kH/s
[2023-02-09 12:36:29] CPU #0: 0.92 kH/s
[2023-02-09 12:36:33] CPU #3: 0.93 kH/s
[2023-02-09 12:36:33] Total: 3.70 kH/s
[2023-02-09 12:36:34] CPU #2: 0.94 kH/s
[2023-02-09 12:36:34] Total: 3.72 kH/s
[2023-02-09 12:36:39] CPU #1: 0.93 kH/s
[2023-02-09 12:36:39] CPU #0: 0.93 kH/s
[2023-02-09 12:36:39] CPU #3: 0.93 kH/s
[2023-02-09 12:36:39] Total: 3.72 kH/s
[2023-02-09 12:36:44] CPU #2: 0.94 kH/s
[2023-02-09 12:36:44] Total: 3.72 kH/s

Total Scores: 3.94,3.72,3.71,3.70,3.69,3.68

##########################################################################

Testing maximum cpufreq again, still under full load. System health now:

Time        CPU    load %cpu %sys %usr %nice %io %irq   Temp
12:36:27: 1008MHz  4.07 100%   0%  99%   0%   0%   0%  62.0°C

Checking cpufreq OPP (Cortex-A53):

Cpufreq OPP: 1512    Measured: 1510 (1510.659/1510.625/1510.590)

##########################################################################

Hardware sensors:

cpu_thermal-virtual-0
temp1:        +58.7 C  

gpu_thermal-virtual-0
temp1:        +56.9 C  

ddr_thermal-virtual-0
temp1:        +56.1 C  

ve_thermal-virtual-0
temp1:        +55.5 C  

##########################################################################

Thermal source: /sys/devices/virtual/thermal/thermal_zone0/ (cpu-thermal)
                (Armbian wants to use /sys/class/hwmon/hwmon0 instead, that
                zone is named gpu_thermal. Please check and if wrong
                file a bug here: https://github.com/armbian/build/issues/)

System health while running tinymembench:

Time        CPU    load %cpu %sys %usr %nice %io %irq   Temp
12:08:31: 1512MHz  1.14  12%   2%   9%   0%   0%   0%  57.8°C
12:09:11: 1008MHz  1.11  25%   0%  25%   0%   0%   0%  60.7°C
12:09:51: 1008MHz  1.09  25%   0%  25%   0%   0%   0%  60.9°C
12:10:31: 1008MHz  1.05  25%   0%  25%   0%   0%   0%  62.1°C
12:11:12: 1008MHz  1.02  25%   0%  25%   0%   0%   0%  62.8°C
12:11:52: 1512MHz  1.01  25%   0%  25%   0%   0%   0%  59.7°C
12:12:32: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  58.4°C
12:13:12: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  58.0°C
12:13:52: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.8°C
12:14:32: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.3°C
12:15:12: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.9°C
12:15:52: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.5°C
12:16:32: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  54.7°C
12:17:12: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.6°C
12:17:52: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  55.9°C
12:18:32: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.8°C

System health while running ramlat:

Time        CPU    load %cpu %sys %usr %nice %io %irq   Temp
12:18:57: 1512MHz  1.00  16%   1%  13%   0%   0%   0%  56.8°C
12:19:00: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.0°C
12:19:04: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  55.9°C
12:19:07: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  57.0°C
12:19:10: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.7°C
12:19:13: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  56.9°C
12:19:16: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  57.0°C
12:19:19: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  57.1°C
12:19:22: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  57.1°C
12:19:25: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.8°C

System health while running OpenSSL benchmark:

Time        CPU    load %cpu %sys %usr %nice %io %irq   Temp
12:19:27: 1512MHz  1.00  16%   1%  14%   0%   0%   0%  59.4°C
12:19:44: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.8°C
12:20:00: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.8°C
12:20:16: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  58.8°C
12:20:32: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  56.8°C
12:20:48: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  58.1°C
12:21:04: 1512MHz  1.00  25%   0%  25%   0%   0%   0%  57.9°C

System health while running 7-zip single core benchmark:

Time        CPU    load %cpu %sys %usr %nice %io %irq   Temp
12:21:16: 1512MHz  1.00  16%   1%  14%   0%   0%   0%  57.8°C
12:21:26: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  56.0°C
12:21:36: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  56.5°C
12:21:46: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  55.8°C
12:21:56: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  55.4°C
12:22:06: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  54.7°C
12:22:16: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  54.5°C
12:22:26: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  54.5°C
12:22:36: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  55.2°C
12:22:46: 1512MHz  1.00  25%   0%  24%   0%   0%   0%  54.9°C
12:22:56: 1512MHz  1.16  25%   0%  24%   0%   0%   0%  54.5°C
12:23:07: 1512MHz  1.13  25%   0%  24%   0%   0%   0%  54.8°C
12:23:17: 1512MHz  1.11  25%   0%  24%   0%   0%   0%  55.5°C
12:23:27: 1512MHz  1.10  25%   0%  24%   0%   0%   0%  54.3°C
12:23:37: 1512MHz  1.08  25%   0%  24%   0%   0%   0%  55.0°C

System health while running 7-zip multi core benchmark:

Time        CPU    load %cpu %sys %usr %nice %io %irq   Temp
12:23:40: 1512MHz  1.07  17%   1%  15%   0%   0%   0%  59.4°C
12:24:06: 1512MHz  1.95  90%   0%  89%   0%   0%   0%  66.0°C
12:24:32: 1008MHz  2.52  93%   0%  92%   0%   0%   0%  66.4°C
12:24:57: 1008MHz  2.79  88%   1%  87%   0%   0%   0%  65.5°C
12:25:19: 1008MHz  3.03  88%   0%  87%   0%   0%   0%  60.8°C
12:26:03: 1512MHz  3.74  95%  24%  70%   0%   0%   0%  63.8°C
12:26:35: 1008MHz  4.41  92%  37%  52%   0%   1%   0%  61.1°C
12:27:01: 1008MHz  4.45  92%   0%  92%   0%   0%   0%  60.8°C
12:27:23: 1008MHz  4.16  89%   1%  88%   0%   0%   0%  60.8°C
12:27:45: 1008MHz  4.17  97%   0%  96%   0%   0%   0%  59.7°C
12:28:07: 1008MHz  3.80  80%   1%  78%   0%   0%   0%  61.2°C
12:28:45: 1008MHz  3.97  97%  51%  45%   0%   0%   0%  62.7°C
12:29:07: 1512MHz  3.97  92%  17%  74%   0%   0%   0%  59.5°C
12:29:32: 1008MHz  3.99  89%   0%  89%   0%   0%   0%  61.1°C
12:29:58: 1008MHz  3.86  92%   0%  91%   0%   0%   0%  62.6°C
12:30:20: 1008MHz  3.98  88%   1%  87%   0%   0%   0%  61.6°C
12:30:41: 1008MHz  4.05  97%   0%  96%   0%   0%   0%  61.1°C
12:31:03: 1008MHz  3.58  79%   1%  77%   0%   0%   0%  60.2°C
12:31:28: 1008MHz  3.86  96%  35%  60%   0%   0%   0%  62.3°C

System health while running cpuminer:

Time        CPU    load %cpu %sys %usr %nice %io %irq   Temp
12:31:55: 1008MHz  3.97  29%   3%  25%   0%   0%   0%  62.6°C
12:32:40: 1008MHz  4.02 100%   0%  99%   0%   0%   0%  61.4°C
12:33:26: 1008MHz  4.05 100%   0%  99%   0%   0%   0%  62.0°C
12:34:11: 1008MHz  4.06 100%   0%  99%   0%   0%   0%  61.9°C
12:34:56: 1008MHz  4.07 100%   0%  99%   0%   0%   0%  62.6°C
12:35:41: 1008MHz  4.07 100%   0%  99%   0%   0%   0%  62.0°C
12:36:27: 1008MHz  4.07 100%   0%  99%   0%   0%   0%  62.0°C

##########################################################################

Throttling statistics (time spent on each cpufreq OPP):

1512 MHz:  835.30 sec
1200 MHz:       0 sec
1008 MHz:  862.78 sec
 792 MHz:       0 sec
 600 MHz:       0 sec
 480 MHz:       0 sec

##########################################################################

dmesg output while running the benchmarks:

[ 2628.376703] Xtightvnc invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=0
[ 2628.376747] CPU: 3 PID: 1396 Comm: Xtightvnc Tainted: G         C        5.19.17-sunxi64 #trunk
[ 2628.376758] Hardware name: OrangePi Zero2 (DT)
[ 2628.376765] Call trace:
[ 2628.376769]  dump_backtrace+0x12c/0x138
[ 2628.376792]  show_stack+0x18/0x48
[ 2628.376803]  dump_stack_lvl+0x68/0x84
[ 2628.376816]  dump_stack+0x18/0x34
[ 2628.376825]  dump_header+0x44/0x1d8
[ 2628.376834]  oom_kill_process+0x274/0x278
[ 2628.376846]  out_of_memory+0x180/0x548
[ 2628.376854]  __alloc_pages_slowpath.constprop.138+0x94c/0xa78
[ 2628.376866]  __alloc_pages+0x248/0x2d0
[ 2628.376875]  alloc_pages+0xac/0x168
[ 2628.376887]  __get_free_pages+0x14/0x40
[ 2628.376894]  __pollwait+0x54/0x100
[ 2628.376905]  unix_poll+0x30/0x118
[ 2628.376916]  sock_poll+0x70/0xf8
[ 2628.376929]  do_select+0x278/0x648
[ 2628.376938]  core_sys_select+0x220/0x4f8
[ 2628.376948]  __arm64_sys_pselect6+0x188/0x218
[ 2628.376958]  invoke_syscall+0x44/0x108
[ 2628.376969]  el0_svc_common.constprop.3+0x94/0xf8
[ 2628.376979]  do_el0_svc+0x2c/0xb8
[ 2628.376988]  el0_svc+0x20/0x50
[ 2628.376998]  el0t_64_sync_handler+0x98/0xc0
[ 2628.377007]  el0t_64_sync+0x170/0x174
[ 2628.377017] Mem-Info:
[ 2628.377023] active_anon:75877 inactive_anon:76110 isolated_anon:64
                active_file:467 inactive_file:306 isolated_file:45
                unevictable:16 dirty:0 writeback:0
                slab_reclaimable:3171 slab_unreclaimable:9046
                mapped:578 shmem:3 pagetables:1991 bounce:0
                kernel_misc_reclaimable:0
                free:6078 free_pcp:86 free_cma:1093
[ 2628.377044] Node 0 active_anon:303508kB inactive_anon:304440kB active_file:1868kB inactive_file:1224kB unevictable:64kB isolated(anon):256kB isolated(file):180kB mapped:2312kB dirty:0kB writeback:0kB shmem:12kB shmem_thp: 0kB shmem_pmdmapped: 0kB anon_thp: 0kB writeback_tmp:0kB kernel_stack:3792kB pagetables:7964kB all_unreclaimable? no
[ 2628.377062] Node 0 DMA free:24312kB boost:2048kB min:24576kB low:30208kB high:35840kB reserved_highatomic:0KB active_anon:304184kB inactive_anon:304200kB active_file:1492kB inactive_file:1376kB unevictable:64kB writepending:0kB present:1048576kB managed:1007952kB mlocked:64kB bounce:0kB free_pcp:344kB local_pcp:32kB free_cma:4372kB
[ 2628.377089] lowmem_reserve[]: 0 0 0 0
[ 2628.377106] Node 0 DMA: 1546*4kB (UMEC) 617*8kB (UMEC) 306*16kB (UEC) 146*32kB (UEC) 66*64kB (UE) 4*128kB (U) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 25424kB
[ 2628.377180] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[ 2628.377188] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=32768kB
[ 2628.377196] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[ 2628.377203] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=64kB
[ 2628.377210] 839 total pagecache pages
[ 2628.377214] 29 pages in swap cache
[ 2628.377218] Swap cache stats: add 510830, delete 510667, find 215/384851
[ 2628.377224] Free swap  = 0kB
[ 2628.377228] Total swap = 503972kB
[ 2628.377232] 262144 pages RAM
[ 2628.377236] 0 pages HighMem/MovableOnly
[ 2628.377240] 10156 pages reserved
[ 2628.377243] 32768 pages cma reserved
[ 2628.377248] Tasks state (memory values in pages):
[ 2628.377251] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
[ 2628.377288] [    309]     0   309     5244        1    69632      328         -1000 systemd-udevd
[ 2628.377305] [    504]     0   504     6451        2    77824      268          -250 systemd-journal
[ 2628.377319] [    508]     0   508     1953        6    57344      767             0 haveged
[ 2628.377333] [    551]   109   551     1765        0    57344       99             0 avahi-daemon
[ 2628.377345] [    557]     0   557     1674       10    49152       53             0 cron
[ 2628.377358] [    559]   103   559     2121        3    49152      249          -900 dbus-daemon
[ 2628.377370] [    563]     0   563    63755        0   135168      587             0 NetworkManager
[ 2628.377383] [    572]     0   572    55220        0    77824      286             0 rsyslogd
[ 2628.377396] [    585]     0   585     3597        0    73728      203             0 systemd-logind
[ 2628.377409] [    591]     0   591    98253        2   122880      538             0 udisksd
[ 2628.377422] [    593]     0   593     3393        6    69632      159             0 wpa_supplicant
[ 2628.377435] [    634]   109   634     1722        1    57344       76             0 avahi-daemon
[ 2628.377448] [   1014]     0  1014     7362        0    90112      431             0 cupsd
[ 2628.377460] [   1033]   104  1033     4707        1    57344      182             0 chronyd
[ 2628.377473] [   1043]     0  1043    58784        0    98304      553             0 polkitd
[ 2628.377486] [   1060]     0  1060     3410        0    61440      235         -1000 sshd
[ 2628.377499] [   1095]   104  1095     2706        0    57344      149             0 chronyd
[ 2628.377513] [   1112]     0  1112    43527        5   110592      390             0 cups-browsed
[ 2628.377526] [   1114]     0  1114     1369        0    45056       29             0 agetty
[ 2628.377539] [   1115]     0  1115     1277        0    49152       30             0 agetty
[ 2628.377552] [   1226]  1000  1226     4055        2    65536      376             0 systemd
[ 2628.377565] [   1227]  1000  1227    42172        1    94208      694             0 (sd-pam)
[ 2628.377578] [   1241]  1000  1241    22787        0    65536      250             0 pipewire
[ 2628.377590] [   1258]   107  1258    38363        0    69632       83             0 rtkit-daemon
[ 2628.377602] [   1322]  1000  1322     2033       27    53248      196             0 dbus-daemon
[ 2628.377615] [   1342]  1000  1342    21294        0    69632      303             0 pipewire-media-
[ 2628.377628] [   1396]  1000  1396    19497       57   118784     4131             0 Xtightvnc
[ 2628.377641] [   1402]  1000  1402      515        0    40960       23             0 xstartup
[ 2628.377654] [   1404]  1000  1404     1456       53    53248       73             0 autocutsel
[ 2628.377667] [   1407]  1000  1407    66813        3   151552     1275             0 xfce4-session
[ 2628.377680] [   1449]  1000  1449     1360        0    53248      116             0 ssh-agent
[ 2628.377692] [   1459]  1000  1459    76479        0    90112      197             0 at-spi-bus-laun
[ 2628.377706] [   1464]  1000  1464     1954        2    53248      137             0 dbus-daemon
[ 2628.377718] [   1468]  1000  1468    57627        2    73728      213             0 xfconfd
[ 2628.377731] [   1474]  1000  1474    40643        4    77824      208             0 at-spi2-registr
[ 2628.377744] [   1484]  1000  1484    20139       18    57344       55             0 gpg-agent
[ 2628.377757] [   1486]  1000  1486    60476        4   200704     2015             0 xfwm4
[ 2628.377769] [   1489]  1000  1489    59385        2    98304      231             0 gvfsd
[ 2628.377783] [   1495]  1000  1495    56946        3   172032     1374             0 xfsettingsd
[ 2628.377795] [   1498]  1000  1498    80307      272   212992     2397             0 xfce4-panel
[ 2628.377815] [   1502]  1000  1502   102679        4   229376     2899             0 Thunar
[ 2628.377830] [   1507]  1000  1507    90552       70   249856     4851             0 xfdesktop
[ 2628.377844] [   1510]  1000  1510    47490        3   135168      617             0 xfce4-power-man
[ 2628.377857] [   1511]  1000  1511    47110        0   139264      525             0 polkit-gnome-au
[ 2628.377870] [   1514]  1000  1514    15108        5   151552     4592             0 applet.py
[ 2628.377883] [   1525]  1000  1525   107478        0   204800     1759             0 nm-applet
[ 2628.377895] [   1532]   113  1532    60829        3   114688      888             0 colord
[ 2628.377908] [   1533]  1000  1533    65927        0   151552      587             0 xfce4-notifyd
[ 2628.377922] [   1540]  1000  1540    39083        2    73728      146             0 dconf-service
[ 2628.377935] [   1560]     0  1560    61573        0   102400      284             0 upowerd
[ 2628.377948] [   1564]  1000  1564    85188        0   167936     1280             0 panel-6-systray
[ 2628.377961] [   1565]  1000  1565   116481      227   172032     1468             0 panel-8-pulseau
[ 2628.377974] [   1566]  1000  1566    49609        0   155648     1510             0 panel-9-power-m
[ 2628.377987] [   1567]  1000  1567    59918        0   200704     1770             0 panel-10-notifi
[ 2628.378000] [   1585]  1000  1585    48886        4   151552     1360             0 panel-14-action
[ 2628.378012] [   1586]  1000  1586    87436        0   126976      481             0 gvfs-udisks2-vo
[ 2628.378026] [   1600]  1000  1600    77893        0   102400      295             0 gvfsd-trash
[ 2628.378039] [   1605]  1000  1605    39991        0    81920      150             0 gvfsd-metadata
[ 2628.378053] [   1611]  1000  1611   105893        0    98304      334             0 pulseaudio
[ 2628.378067] [   5722]  1000  5722    99687        4   237568     2294             0 xfce4-terminal
[ 2628.378080] [   5727]  1000  5727     1740        1    57344      133             0 bash
[ 2628.378093] [   5730]  1000  5730     3089        0    65536      157             0 sudo
[ 2628.378106] [   5731]     0  5731     2441        1    61440      887             0 bash
[ 2628.378122] [  11118]     0 11118     1683       44    61440      837             0 bash
[ 2628.378135] [  11120]     0 11120   307054   151119  1921024    72717             0 7zr
[ 2628.378150] [  11402]     0 11402     1683       54    61440      827             0 bash
[ 2628.378161] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/session-3.scope,task=7zr,pid=11120,uid=0
[ 2628.378271] Out of memory: Killed process 11120 (7zr) total-vm:1228216kB, anon-rss:604392kB, file-rss:84kB, shmem-rss:0kB, UID:0 pgtables:1876kB oom_score_adj:0

##########################################################################

Linux 5.19.17-sunxi64 (orangepizero2)     02/09/23     _aarch64_    (4 CPU)

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
          32.50    0.01    3.02    0.37    0.00   64.10

Device             tps    kB_read/s    kB_wrtn/s    kB_dscd/s    kB_read    kB_wrtn    kB_dscd
mmcblk0           6.39       207.14       131.10         0.00     677822     429004          0
mtdblock0         0.01         0.03         0.00         0.00        112          0          0
zram0           681.82      1239.83      1487.44         0.00    4057076    4867340          0
zram1             0.16         0.20         1.64         0.00        652       5376          0

               total        used        free      shared  buff/cache   available
Mem:           984Mi       162Mi       754Mi       0.0Ki        67Mi       755Mi
Swap:          492Mi       183Mi       308Mi

Filename                Type        Size    Used    Priority
/dev/zram0                                 partition    503972    188284    5

CPU sysfs topology (clusters, cpufreq members, clockspeeds)
                 cpufreq   min    max
 CPU    cluster  policy   speed  speed   core type
  0        0        0      480    1512   Cortex-A53 / r0p4
  1        0        0      480    1512   Cortex-A53 / r0p4
  2        0        0      480    1512   Cortex-A53 / r0p4
  3        0        0      480    1512   Cortex-A53 / r0p4

Architecture:                    aarch64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
CPU(s):                          4
On-line CPU(s) list:             0-3
Thread(s) per core:              1
Core(s) per socket:              4
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       ARM
Model:                           4
Model name:                      Cortex-A53
Stepping:                        r0p4
CPU max MHz:                     1512.0000
CPU min MHz:                     480.0000
BogoMIPS:                        48.00
NUMA node0 CPU(s):               0-3
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Not affected
Vulnerability Retbleed:          Not affected
Vulnerability Spec store bypass: Not affected
Vulnerability Spectre v1:        Mitigation; __user pointer sanitization
Vulnerability Spectre v2:        Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid

SoC guess: Allwinner H616/H313
DT compat: xunlong,orangepi-zero2
           allwinner,sun50i-h616
 Compiler: /usr/bin/gcc (Debian 10.2.1-6) 10.2.1 20210110 / aarch64-linux-gnu
 Userland: arm64
   Kernel: 5.19.17-sunxi64/aarch64
           CONFIG_HZ=250
           CONFIG_HZ_250=y
           CONFIG_PREEMPT_NONE=y
           CONFIG_PREEMPT_NONE_BUILD=y
           raid6: neonx8   gen()   728 MB/s
           raid6: neonx4   gen()   747 MB/s
           raid6: neonx2   gen()   708 MB/s
           raid6: neonx1   gen()   614 MB/s
           raid6: int64x8  gen()   506 MB/s
           raid6: int64x4  gen()   565 MB/s
           raid6: int64x2  gen()   479 MB/s
           raid6: int64x1  gen()   357 MB/s
           raid6: using algorithm neonx4 gen() 747 MB/s
           raid6: .... xor() 539 MB/s, rmw enabled
           raid6: using neon recovery algorithm
           xor: automatically using best checksumming function   32regs    

##########################################################################

Status of performance related governors/policies found below /sys:
cpufreq-policy0: performance / 1512 MHz (conservative ondemand userspace powersave performance schedutil)

##########################################################################

5.19 has reached end-of-life on 2022-10-24. 5.19.17 is unsupported since then.

##########################################################################

   opp-table-cpu:
       480 MHz    820.0 mV   880.0 mV   880.0 mV
       600 MHz    820.0 mV   880.0 mV   880.0 mV
       792 MHz    860.0 mV   940.0 mV   940.0 mV
      1008 MHz    900.0 mV  1020.0 mV  1020.0 mV
      1200 MHz    960.0 mV  1100.0 mV  1100.0 mV
      1512 MHz   1100.0 mV  1100.0 mV  1100.0 mV

| OrangePi Zero2 | 1512 MHz (throttled) | 5.19 | Armbian 23.02.0-trunk Bullseye arm64 | 2720 | 1085 | 705040 | 1660 | 5290 | 3.72 |
alistair@orangepizero2:~$ 

 

 

Link to comment
Share on other sites

Hello @mcerveny, I would like to include your thermal changes in a PR to armbian 6.1. Would this be agreeable and how can I best credit you <@users.noreply.github.com>, ofc should you be agreeable?

 

Incidentally the switch case is finding the bins in the same manner, the sign(u32) has been noted.

 

The intended patch is V1 as WIP and will evolve, so all constructive input very welcome please.

 

Here are graphs called from sbc-bench

 

sbc-bench-v0.9.13-orangepi-zero2-.YxRzeH.pdf

Link to comment
Share on other sites

Hi

 

I am afraid I cannot contribute much to this project, as I lack the technical expertise - but I have the orangepizero2 H616, and I think it is a fantastic bit of hardware for the price. I would like to do much more with it (currently I am using it as a pikvm, which works nicely and is fun... and a lot cheaper than a raspberypi based solution).

 

It is a shame it is not more fully supported and I just wanted to say thank you for your work and efforts on this. :)

 

Thank you!

Link to comment
Share on other sites

 

Armbian-next commits

 

Commits on May 3, 2023

 

h616 Cpu frequency scaling (#5123)
* Add-h616-efuse_xlate-cpu-freq-scaling

* series_additions_h616-cpu-freq-scaling

* series_armbian_changes_h616-cpu-freq-scaling

---------

Co-authored-by: AGM1968 <AGM1968@users.noreply.githib.com>

https://github.com/armbian/build/commit/250a9c2cc0206c586557f37bc3db820d3750da39

 

Commits on May 5, 2023

 

sunxi-6.2 h616: Fix thermal zones (add missing trips)
 main (#5135)
@mdziekon
@igorpecovnik
mdziekon authored and igorpecovnik committed last week 


https://github.com/armbian/build/commit/7167d5c4200de30f7b103e5f9b478dcec78642ec





sunxi-6.1 h616: Fix thermal zones (add missing trips)
 main (#5135)
@mdziekon
@igorpecovnik
mdziekon authored and igorpecovnik committed last week 


https://github.com/armbian/build/commit/613234a75cebd4de421e8b832a4efc8bc23eeac2

 

Link to comment
Share on other sites

Hello,

 

I see that the original xlate patch has been followed and adopted by other known kernel developers for 6.x.y.

 

For the 6.x.y kernels there is a hard study to utilize the patch due to a change to tokens from tables.

 

The probe fails because of these changes. I did not want to do the obvious, and have been working through some options. However for the sake of progress to 6.x.y perhaps that might be the way to go for now, I am more comfortable doing that, seeing that was a solution adopted by well known dev.

 

[    2.335847] Internal error: Oops: 0000000096000004 [#1] SMP
[    2.341864] Modules linked in:
[    2.345158] CPU: 1 PID: 50 Comm: kworker/u8:1 Not tainted 6.1.19-sunxi64 #trunk
[    2.353065] Hardware name: OrangePi Zero2 (DT)
[    2.357848] Workqueue: events_unbound deferred_probe_work_func
[    2.364173] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    2.371706] pc : sun50i_cpufreq_nvmem_probe+0xd4/0x2e8
[    2.377270] lr : sun50i_cpufreq_nvmem_probe+0xcc/0x2e8
[    2.382847] sp : ffff8000097abad0
[    2.386405] x29: ffff8000097abad0 x28: 0000000000000000 x27: 0000000000000000
[    2.394143] x26: ffff0000020b8a74 x25: 0000000000000000 x24: ffff0000022e0000
[    2.401889] x23: ffff00003fd780b8 x22: ffff0000049c3300 x21: ffff0000049c3380
[    2.409627] x20: ffff0000049c3400 x19: ffff8000090bbe18 x18: 0000000000000014
[    2.417338] x17: 00000000413cc101 x16: 0000000042260e86 x15: 000066b8303dd330
[    2.425076] x14: 0000000000000001 x13: 000000000000006e x12: 0000000000000001
[    2.432778] x11: 0000000000000001 x10: 0000000000000050 x9 : ffff8000097ab890
[    2.440480] x8 : 0000000000000050 x7 : ffff00003fd92240 x6 : ffff0000049c3480
[    2.448199] x5 : ffff0000022e1304 x4 : 0000000000000000 x3 : 0000000000000001
[    2.455910] x2 : 0000000000000001 x1 : 0000000000000002 x0 : ffff0000022e1304
[    2.463612] Call trace:
[    2.466253]  sun50i_cpufreq_nvmem_probe+0xd4/0x2e8
[    2.471442]  platform_probe+0x68/0xd8
[    2.475378]  really_probe+0xc0/0x3a0
[    2.479265]  __driver_probe_device+0x7c/0x188
[    2.483967]  driver_probe_device+0x3c/0x108
[    2.488479]  __device_attach_driver+0xbc/0x158
[    2.493268]  bus_for_each_drv+0x7c/0xd0
[    2.497414]  __device_attach+0xec/0x1a8
[    2.501560]  device_initial_probe+0x14/0x20
[    2.506071]  bus_probe_device+0x9c/0xa8
[    2.510209]  deferred_probe_work_func+0x9c/0xf0
[    2.515101]  process_one_work+0x220/0x3e8
[    2.519420]  worker_thread+0x258/0x500
[    2.523477]  kthread+0xd8/0xe8
[    2.526758]  ret_from_fork+0x10/0x20
[    2.530605] Code: aa1503e0 9402276a b140069f 54000608 (f9400321)
[    2.537200] ---[ end trace 0000000000000000 ]---

 

Link to comment
Share on other sites

Hi @ALIGMSTEN

could you please clarify what do you mean by saying that kernel 6.x.y is problematic in terms of introduction of CPU frequency tables?

 

Personally, I was able to replicate what you've done in that regard for kernel 5.19 (I'm referring to this PR: https://github.com/armbian/build/pull/5123)

in both kernel 6.1 (current) and 6.2 (edge) with no issues (as in - the OS boots, works & passes sbc-bench). You can see my results summary here: https://github.com/mdziekon/armbian-build/pull/2

 

For now I've opened a PR against my own fork, but if you think this is the right path, there's nothing preventing me from opening a PR against main armbian repo.

Edited by dziekon
Link to comment
Share on other sites

Hi @dziekon yeah I've been a bit too much on the experiential side with this, which caused some problems with the probe failing during those tests. 

 

I wasn't wanting to progress further myself until finished with v2-opp points, xlate alternative structure and PLL_CPUX experimentation.

 

Your PR proposal is exactly how the xlate patch is transferred to 6.x.y, there is nothing magic about the change, I am experimenting with alternative ways of doing that.

 

Best,

Alistair

 

Patch below as reference: (Nonetheless just to note I was about to 'finally' submit V1 in light of the comments 12 May)

 

 

From 7aee19c8c4a6c400dc45556e138d577d5453661d Mon Sep 17 00:00:00 2001
From: AGM1968 <AGM1968@users.noreply.github.com>
Date: Wed, 1 Mar 2023 14:16:30 +0200
Subject: [PATCH] Add-h616-efuse_xlate-cpu-freq-scaling-v1

Signed-off-by: AGM1968 <AGM1968@users.noreply.github.com>
---
 .../dts/allwinner/sun50i-h616-cpu-opp.dtsi    | 75 ++++++++++++++++
 .../allwinner/sun50i-h616-orangepi-zero2.dts  |  6 ++
 drivers/cpufreq/cpufreq-dt-platdev.c          |  4 +
 drivers/cpufreq/sun50i-cpufreq-nvmem.c        | 87 ++++++++++++++-----
 4 files changed, 150 insertions(+), 22 deletions(-)
 create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h616-cpu-opp.dtsi

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-cpu-opp.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616-cpu-opp.dtsi
new file mode 100644
index 000000000000..36f2950367c6
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-cpu-opp.dtsi
@@ -0,0 +1,75 @@
+//SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+//Testing Version 1  from: AGM1968 <AGM1968@users.noreply.github.com>
+//Noted: PLL_CPUX = 24 MHz*N/P (WIP)
+
+/ {
+	cpu_opp_table: opp-table-cpu {
+		compatible = "allwinner,sun50i-h616-operating-points";
+		nvmem-cells = <&cpu_speed_grade>;
+		opp-shared;
+ 
+		opp-480000000 {
+			clock-latency-ns = <244144>; /* 8 32k periods */
+			opp-hz = /bits/ 64 <480000000>;
+			opp-microvolt-speed0 = <820000 820000 1100000>; 
+			opp-microvolt-speed1 = <880000 880000 1100000>;
+			opp-microvolt-speed2 = <880000 880000 1100000>;
+		};
+	
+		opp-600000000 {
+			clock-latency-ns = <244144>; /* 8 32k periods */
+			opp-hz = /bits/ 64 <600000000>;
+			opp-microvolt-speed0 = <820000 820000 1100000>;
+			opp-microvolt-speed1 = <880000 880000 1100000>;
+			opp-microvolt-speed2 = <880000 880000 1100000>;
+		};
+
+		opp-792000000 {
+			clock-latency-ns = <244144>; /* 8 32k periods */
+			opp-hz = /bits/ 64 <792000000>;
+		        opp-microvolt-speed0 = <860000 860000 1100000>;
+			opp-microvolt-speed1 = <940000 940000 1100000>;
+			opp-microvolt-speed2 = <940000 940000 1100000>;
+		};
+
+		opp-1008000000 {
+			clock-latency-ns = <244144>; /* 8 32k periods */
+			opp-hz = /bits/ 64 <1008000000>;
+			opp-microvolt-speed0 = <900000 900000 1100000>;
+			opp-microvolt-speed1 = <1020000 1020000 1100000>;
+			opp-microvolt-speed2 = <1020000 1020000 1100000>;
+		};
+
+		opp-1200000000 {
+			clock-latency-ns = <244144>; /* 8 32k periods */
+			opp-hz = /bits/ 64 <1200000000>;
+			opp-microvolt-speed0 = <960000 960000 1100000>;
+			opp-microvolt-speed1 = <1100000 1100000 1100000>;
+			opp-microvolt-speed2 = <1100000 1100000 1100000>;
+		};
+
+		opp-1512000000 {
+			clock-latency-ns = <244144>; /* 8 32k periods */
+			opp-hz = /bits/ 64 <1512000000>;
+			opp-microvolt-speed0 = <1100000 1100000 1100000>;
+			opp-microvolt-speed1 = <1100000 1100000 1100000>;
+			opp-microvolt-speed2 = <1100000 1100000 1100000>;
+		};
+	};
+};
+
+&cpu0 {
+	operating-points-v2 = <&cpu_opp_table>;
+};
+ 
+&cpu1 {
+	operating-points-v2 = <&cpu_opp_table>;
+};
+ 
+&cpu2 {
+	operating-points-v2 = <&cpu_opp_table>;
+};
+ 
+&cpu3 {
+	operating-points-v2 = <&cpu_opp_table>;
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
index b78941d290ad..4babfac99043 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
@@ -6,6 +6,7 @@
 /dts-v1/;
 
 #include "sun50i-h616.dtsi"
+#include "sun50i-h616-cpu-opp.dtsi"
 
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -216,6 +217,11 @@ &pio {
 	vcc-pi-supply = <&reg_aldo1>;
 };
 
+&cpu0  {
+	cpu-supply = <&reg_dcdca>;
+	status = "okay";
+};
+
 &spi0  {
 	status = "okay";
 	pinctrl-names = "default";
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 69a8742c0a7a..7fadcbe0c3c6 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -2,6 +2,9 @@
 /*
  * Copyright (C) 2016 Linaro.
  * Viresh Kumar <viresh.kumar@linaro.org>
+ *
+ * ADD cpufreq nvmem for allwinner h616 SoC, known to be analagous to h6
+ * Version 1 AGM1968 <AGM1968@users.noreply.github.com>
  */
 
 #include <linux/err.h>
@@ -102,6 +105,7 @@ static const struct of_device_id allowlist[] __initconst = {
  */
 static const struct of_device_id blocklist[] __initconst = {
 	{ .compatible = "allwinner,sun50i-h6", },
+	{ .compatible = "allwinner,sun50i-h616", },
 
 	{ .compatible = "arm,vexpress", },
 
diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
index 1acec58c33c3..690ae956659b 100644
--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c
+++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
@@ -6,6 +6,9 @@
  * provide the OPP framework with required information.
  *
  * Copyright (C) 2019 Yangtao Li <tiny.windzz@gmail.com>
+ *
+ * ADD efuse_xlate to extract SoC version so that h6 and h616 can coexist.
+ * Version 1 AGM1968 <AGM1968@users.noreply.github.com>
  */
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
@@ -19,25 +22,61 @@
 
 #define MAX_NAME_LEN	7
 
-#define NVMEM_MASK	0x7
-#define NVMEM_SHIFT	5
+#define SUN50I_H616_NVMEM_MASK 0x22
+#define SUN50I_H616_NVMEM_SHIFT 5
+#define SUN50I_H6_NVMEM_MASK 0x7
+#define SUN50I_H6_NVMEM_SHIFT 5
+
+struct sunxi_cpufreq_soc_data {
+	u32 (*efuse_xlate) (void *efuse);
+};
 
 static struct platform_device *cpufreq_dt_pdev, *sun50i_cpufreq_pdev;
 
+static u32 sun50i_h616_efuse_xlate(void *efuse)
+{
+   u32 efuse_value = (*(u32 *)efuse >> SUN50I_H616_NVMEM_SHIFT) &
+             SUN50I_H616_NVMEM_MASK;
+
+   /* Tested as V1 h616 soc. Expected efuse values are 1 - 3,
+      slowest to fastest */
+   if (efuse_value >=1 && efuse_value <= 3)
+       return efuse_value - 1;
+   else
+       return 0;
+};
+
+static u32 sun50i_h6_efuse_xlate(void *efuse)
+{
+   u32 efuse_value = (*(u32 *)efuse >> SUN50I_H6_NVMEM_SHIFT) &
+             SUN50I_H6_NVMEM_MASK;
+
+   /*
+    * We treat unexpected efuse values as if the SoC was from
+    * the slowest bin. Expected efuse values are 1 - 3, slowest
+    * to fastest.
+   */
+   if (efuse_value >= 1 && efuse_value <= 3)
+       return efuse_value - 1;
+   else
+       return 0;
+};
+
 /**
  * sun50i_cpufreq_get_efuse() - Determine speed grade from efuse value
+ * @soc_data: pointer to sunxi_cpufreq_soc_data context
  * @versions: Set to the value parsed from efuse
  *
  * Returns 0 if success.
  */
-static int sun50i_cpufreq_get_efuse(u32 *versions)
+static int sun50i_cpufreq_get_efuse(const struct sunxi_cpufreq_soc_data *soc_data,
+		u32 *versions)
 {
 	struct nvmem_cell *speedbin_nvmem;
 	struct device_node *np;
 	struct device *cpu_dev;
-	u32 *speedbin, efuse_value;
+	u32 *speedbin;
 	size_t len;
-	int ret;
 
 	cpu_dev = get_cpu_device(0);
 	if (!cpu_dev)
@@ -47,9 +86,9 @@ static int sun50i_cpufreq_get_efuse(u32 *versions)
 	if (!np)
 		return -ENOENT;
 
-	ret = of_device_is_compatible(np,
-				      "allwinner,sun50i-h6-operating-points");
-	if (!ret) {
+	if (of_device_is_compatible(np, "allwinner,sun50i-h6-operating-points")) {}
+	else if (of_device_is_compatible(np, "allwinner,sun50i-h616-operating-points")) {}
+	else {
 		of_node_put(np);
 		return -ENOENT;
 	}
@@ -65,17 +104,7 @@ static int sun50i_cpufreq_get_efuse(u32 *versions)
 	if (IS_ERR(speedbin))
 		return PTR_ERR(speedbin);
 
-	efuse_value = (*speedbin >> NVMEM_SHIFT) & NVMEM_MASK;
-
-	/*
-	 * We treat unexpected efuse values as if the SoC was from
-	 * the slowest bin. Expected efuse values are 1-3, slowest
-	 * to fastest.
-	 */
-	if (efuse_value >= 1 && efuse_value <= 3)
-		*versions = efuse_value - 1;
-	else
-		*versions = 0;
+	*versions = soc_data->efuse_xlate(speedbin);
 
 	kfree(speedbin);
 	return 0;
@@ -83,18 +112,23 @@ static int sun50i_cpufreq_get_efuse(u32 *versions)
 
 static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev)
 {
+	const struct of_device_id *match;
 	int *opp_tokens;
 	char name[MAX_NAME_LEN];
 	unsigned int cpu;
 	u32 speed = 0;
 	int ret;
 
+	match = dev_get_platdata(&pdev->dev);
+	if (!match)
+		return -EINVAL;
+
 	opp_tokens = kcalloc(num_possible_cpus(), sizeof(*opp_tokens),
 			     GFP_KERNEL);
 	if (!opp_tokens)
 		return -ENOMEM;
 
-	ret = sun50i_cpufreq_get_efuse(&speed);
+	ret = sun50i_cpufreq_get_efuse(match-> data, &speed);
 	if (ret) {
 		kfree(opp_tokens);
 		return ret;
@@ -160,8 +194,17 @@ static struct platform_driver sun50i_cpufreq_driver = {
 	},
 };
 
+static const struct sunxi_cpufreq_soc_data sun50i_h616_data = {
+    .efuse_xlate = sun50i_h616_efuse_xlate,
+};
+
+static const struct sunxi_cpufreq_soc_data sun50i_h6_data = {
+    .efuse_xlate = sun50i_h6_efuse_xlate,
+};
+
 static const struct of_device_id sun50i_cpufreq_match_list[] = {
-	{ .compatible = "allwinner,sun50i-h6" },
+	{ .compatible = "allwinner,sun50i-h6", .data = &sun50i_h6_data },
+        { .compatible = "allwinner,sun50i-h616", .data = &sun50i_h616_data },
 	{}
 };
 MODULE_DEVICE_TABLE(of, sun50i_cpufreq_match_list);
@@ -197,8 +240,8 @@ static int __init sun50i_cpufreq_init(void)
 		return ret;
 
 	sun50i_cpufreq_pdev =
-		platform_device_register_simple("sun50i-cpufreq-nvmem",
-						-1, NULL, 0);
+		platform_device_register_data(NULL,
+		"sun50i-cpufreq-nvmem", -1, match, sizeof(*match));
 	ret = PTR_ERR_OR_ZERO(sun50i_cpufreq_pdev);
 	if (ret == 0)
 		return 0;
-- 
Created with Armbian build tools https://github.com/armbian/build


 

 

Link to comment
Share on other sites

@dziekon I've left current open, please go ahead and continue experimenting, and happy to collaborate. (If you can help with adding DE let us know? that is now priority)

 

Zero2 needs people here to help!

 

Armbian-next commits

 

26th May 2023

 

https://github.com/armbian/build/commit/e08645740bc75f456e51b785ad4555fbce4f40fd

Link to comment
Share on other sites

Simple led change proposal

 

As development gains traction here I would like to propose a change to the way the onboard led's trigger.

 

Please state your preference!

 

Personal preference over time spent working with edge here.

 

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
index 159ffe654..23349c6ec 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
@@ -28,16 +28,17 @@ leds {
         compatible = "gpio-leds";
 
         led-0 {
-            function = LED_FUNCTION_POWER;
+            function = LED_FUNCTION_STATUS;
             color = <LED_COLOR_ID_RED>;
             gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */
-            default-state = "on";
+            linux,default-trigger = "heartbeat";
         };
 
         led-1 {
-            function = LED_FUNCTION_STATUS;
+            function = LED_FUNCTION_POWER;
             color = <LED_COLOR_ID_GREEN>;
             gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
+            default-state = "on";
         };
     };

Link to comment
Share on other sites

The proposed change patch looks malformed, but I assume you'd like to swap the LEDs, so that green is the board's power, while red is the board's activity (currently, power)?

If that's the case, it makes sense to me, and I believe this was the original behavior as present on orangepi-xunlong 4.9 kernel.

 

As for the patch itself, maybe it would be better to send these proposals as RFCs on Github directly, gists, or even just files? Looks like the board doesn't handle large code snippets that nicely, as it doesn't support highlighting, nor collapsing for easier thread maintenance. Just some thoughts to prevent spamming this discussion thread with non-exactly-discussion things.

Edited by dziekon
Link to comment
Share on other sites

On 5/27/2023 at 2:07 AM, dziekon said:

The proposed change patch looks malformed,

 

My humble apologies, in haste copy/paste incorrectly! have amended the example.

 

On 5/27/2023 at 2:07 AM, dziekon said:

green is the board's power, while red is the board's activity (currently, power)?

 

Correct I've found that change to be visually appealing and closest to the 4.9 legacy kernels  

 

Thanks, valid points, noted the on-page posting last couple, instead of correctly formatted text in attachments or links, agreed that might be easier read.

 

Trigger Options:

usb-gadget usb-host kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock
kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlo
ck kbd-ctrlllock kbd-ctrlrlock usbport disk-activity disk-read disk-write ide-di
sk mtd nand-disk heartbeat cpu cpu0 cpu1 cpu2 cpu3 activity default-on panic mmc
0 rfkill-any rfkill-none stmmac-0:01:link stmmac-0:01:1Gbps stmmac-0:01:100Mbps
stmmac-0:01:10Mbps

 

Lets see, perhaps doing this in a 'democratic-manner' here is not the way.

 

Merged - https://github.com/armbian/build/pull/5270

 

As above your preferences can be altered when you build!

Link to comment
Share on other sites

2 hours ago, jquagga said:

orangepi has a 6.1 kernel tree out there with different dts for the Orange Pi Zero 2.


With many patches taken directly from Armbian 6.1.y, but there are few more so its worth investigating.

Link to comment
Share on other sites

hi, I'd just like to share some resources I stumbled into:

BigTree tech CB1 is running on a H616

https://www.armbian.com/bigtreetech-cb1/

 

apparently they are using a 5.16 kernel as a base

https://github.com/bigtreetech/CB1-Kernel

https://github.com/bigtreetech/CB1

 

the commits and diffs could provide some hints on fixes, and there are apparently docs which may be unique

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines