Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm64-sun50i-h616 Add-cpu-frequency #4165

Closed
wants to merge 0 commits into from
Closed

Conversation

AGM1968
Copy link
Collaborator

@AGM1968 AGM1968 commented Sep 8, 2022

Description

Add cpu-frequency to orangepizero2, allwinner h616.

From sunxi 5.16 the drivers and dtsi, dts files have the necessary support.

Add: sun50i-h616-cpu-opp.dtsi

Additions: sun50i-h616-orangepi-zero2.dts

+#include "sun50i-h616-cpu-opp.dtsi"

+&cpu0 {
+ cpu-supply = <&reg_dcdca>;
+};

How Has This Been Tested?

Test A: BUILD
compiled and booted

Test B: BOARD
@orangepizero2:~$ uname -a Linux orangepizero2 5.19.6-sunxi64 #trunk SMP Mon Sep 5 23:16:49 UTC 2022 aarch64 GNU/Linux
@orangepizero2:~$ find /sys -name cpufreq /sys/devices/system/cpu/cpu3/cpufreq /sys/devices/system/cpu/cpu1/cpufreq /sys/devices/system/cpu/cpufreq /sys/devices/system/cpu/cpu2/cpufreq /sys/devices/system/cpu/cpu0/cpufreq /sys/module/cpufreq

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

@The-going
Copy link
Contributor

@AGM1968
If you've tested it, I won't have any objections.
Please commit your changes by first telling the git who you are, i.e. specify your credentials on the github.
Please leave a description of what you did in the body of the commit message.
Please extract the patch as the git format-patch command.
This will make it easier for the maintainer to support the patch with future changes in the kernel.
Please put the patch in the armbian-build/patch/kernel/archive/sunxi-5.19/ folder.

Patches in the folders patches.megous, patshes.armbian are applied as a series and must have
the appropriate format, i.e. they must be applied as the git am command.
In the future, I will add your patch to the series myself.

With respect to your work and understanding.

Copy link
Member

@EvilOlaf EvilOlaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rename the patch properly. It must not have white-spaces and add .patch file extension.
Also please take not of The going's thoughts.

Thanks

@AGM1968
Copy link
Collaborator Author

AGM1968 commented Sep 8, 2022

Thank you for assisting.

Testing has been successful.

1: I've created the patch with the initial build from my fork AGM1968/build.

This was TestA refered to above, which compiled and booted without issue and once completed the login formalities showed cpu-frequency in htop etc.

@orangepizero2:~$ cpufreq-info -c 0
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: cpufreq-dt
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 244 us.
  hardware limits: 480 MHz - 1.20 GHz
  available frequency steps: 480 MHz, 600 MHz, 792 MHz, 1.01 GHz, 1.20 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 480 MHz and 1.20 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 480 MHz.
  cpufreq stats: 480 MHz:95.35%, 600 MHz:0.48%, 792 MHz:0.53%, 1.01 GHz:2.21%, 1.20 GHz:1.43%  (6819)

2: Committed the changes to AGM1968/build
(https://github.com/AGM1968/build)/[patch](https://github.com/AGM1968/build/tree/master/patch)/[kernel](https://github.com/AGM1968/build/tree/master/patch/kernel)/[archive](https://github.com/AGM1968/build/tree/master/patch/kernel/archive)/[sunxi-5.19](https://github.com/AGM1968/build/tree/master/patch/kernel/archive/sunxi-5.19)/patches.armbian/

Updated with git pull origin master to reflect the changes and did another test build.
Test B, as referenced above was then transferred to A1 sd card and had the same success as Test A.

@AGM1968
Copy link
Collaborator Author

AGM1968 commented Sep 8, 2022

Thanks @The-going and @EvilOlaf . All noted

@AGM1968
Copy link
Collaborator Author

AGM1968 commented Sep 8, 2022

@The-going and @EvilOlaf please suggest appropriate naming convention?

arm64-dts-Add-sun50i-h616-orangepi-zero2-cpu-frequency.patch

@The-going
Copy link
Contributor

arm64-dts-Add-sun50i-h616-orangepi-zero2-cpu-frequency.patch

To get this name, the first line in the commit message should be like this:

arm64 dts: Add sun50i-h616-orangepi-zero2 cpu frequency  scaling
                                                                                                              # the next line is empty.
Then any long description text with a line length of 80 characters.

@The-going
Copy link
Contributor

Patches in the folders patches.megous, patshes.armbian are applied as a series

In order for the patch to be applied, it must be registered in the series.conf file. This file defines the order in which patches are applied. Your patch is in the patches.armbian folder but is not registered in the series.conf file, which means it is not applied.

@AGM1968
Copy link
Collaborator Author

AGM1968 commented Sep 8, 2022

Oh! -mistakenly assumed that the series.conf was automatically generated

@igorpecovnik
Copy link
Member

Is this still interesting?

@AGM1968
Copy link
Collaborator Author

AGM1968 commented Sep 20, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants