Skip to content

CPU frequency #4

Open
Open

Description

@CityAceE

I have been experimenting with "Orange Pi PC" and "TV box v88 mini" with AllWinner H3 and noticed that on the RX and LT builds there are no CPU frequency utilization statistics in the CPU properties, which is available in the Armbian builds for similar devices:

/sys/devices/system/cpu/cpu0/.

In addition, in the log via UART I saw the following lines:

Starting kernel ...

[    0.001938] /cpus/cpu@0 missing clock-frequency property
[    0.001974] /cpus/cpu@1 missing clock-frequency property
[    0.002004] /cpus/cpu@2 missing clock-frequency property
[    0.002034] /cpus/cpu@3 missing clock-frequency property
[    0.108006] sun4i-usb-phy 1c19400.phy: Couldn't request ID GPIO
Starting syslogd: OK

I'm not sure, but it seems to me that the BASIC Engine is running at the minimum frequency.

I analyzed the original Device Tree of v88 mini. As a result, I tweaked sun8i-h3.dtsi by adding lines to each core:
clock-frequency = <1008000000>; (1,008 GHz)

That is:

	cpus {
		#address-cells = <1>;
		#size-cells = <0>;

		cpu0: cpu@0 {
			compatible = “arm,cortex-a7”;
			device_type = “cpu”;
			reg = <0>;
			clocks = <&ccu CLK_CPUX>;
			clock-names = “cpu”;
			operating-points-v2 = <&cpu0_opp_table>;
			clock-frequency = <1008000000>;
			#cooling-cells = <2>;
		};

After that, at least the error missing clock-frequency property disappeared. But still no statistics on CPU frequency utilization appeared.

Activity

  1. uli commented on May 27, 2024

    @uli
    Owner

    Looking at the H3 config, it would seem that CONFIG_CPU_FREQ isn't enabled. I don't precisely remember the reason for that, but generally speaking, I am very conservative with this stuff:

    1. More performance is rarely required. We're running a BASIC interpreter that was developed for a 72 MHz MCU on >1 GHz machines...
    2. There were issues with Allwinner CPU frequency scaling that introduced unacceptable latencies when switching frequencies. That manifested itself in stutters when scrolling, for instance, so switching frequencies automatically was out.
    3. Higher frequencies mean more heat; the default config runs the Orange Pis with the GPIO-controlled voltage regulator (forgot which ones those are) at 1.3 volts, making them super-hot and eventually triggering a shutdown if you don't have a large(!) heatsink installed. I therefore added a patch ("[PATCH] HACK: enable 1.08 GHz on 1.1 volts") that allows running H3s at 1.08 GHz at 1.1 volts to fix that.

    I am not categorically against enabling CPU frequency scaling, but I would still set it to default to a conservative frequency with manual frequency governor.

  2. CityAceE commented on Jun 11, 2024

    @CityAceE
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions