HOW TO - compile a kernel. HOW TO - overclock - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: ROCKPRO64 (https://forum.pine64.org/forumdisplay.php?fid=98) +--- Forum: RockPro64 Projects, Ideas and Tutorials (https://forum.pine64.org/forumdisplay.php?fid=104) +--- Thread: HOW TO - compile a kernel. HOW TO - overclock (/showthread.php?tid=6799) |
HOW TO - compile a kernel. HOW TO - overclock - dukla2000 - 11-14-2018 Figure worth trying to make a single collection of the bits to compile a new kernel for your RockPro64. On your RockPro64. And what could be better motivation than to overclock your RockPro64? As always the warranty for these instructions is - if you break it you own both parts. And, as always on Linux, there are a million ways to do this. My steps below are just 1 way that works for me, I don't claim any particular benefit over any other way. To cause an argument let me assume the starting point is an Ayufan 0.7.9 image on an SDcard in your RockPro64. And that you want to get the current 4.19 kernel running with a 2.1GHz max speed for your A72 cores. First observation: the way Ayufan has set things up you will be able to toggle between the 4.4.x kernel in his 0.7.9 image and your 4.19 image as long as you can edit a text file on your SDcard on another Linux PC so you should not "brick" anything. Second observation - everything below you can search www and find other pages/advice/embellishments if you want. 1) Create a working directory: if you start a terminal session (Open a terminal using your menu system - probably under system tools) you are most likely to be the user rock64 in your home directory (which is /home/rock64/). If you type Code: mkdir bin 2) Download some Linux source code. As per the assumptions the simplest way to do this is to go to Ayufan mainline github page and click the big green "clone or download" button and select the "download zip" option at the bottom. Save the file to the bin directory you created in step 1. 3) We need to install some software - p7zip to unzip the file you just downloaded as well as some prerequisites to get the compile and build environment to work. I hope the following is complete - if you get any errors in later steps it will be most likely because of something missing here! First we are going to update/upgrade all the software you already have, then we will install the new stuff. type (or copy/paste) the following 4 lines 1 at a time - enter your password (possibly still rock64?) when asked after the first line: Code: sudo apt-get update 4) OK - assuming you still have your terminal window open type Code: cd bin Code: unzip linux-mainline-kernel-master.zip 5) Still at your terminal type Code: cd linux-mainline-kernel-master Code: make menuconfig 6) To fix things for the overclock there are a couple of device tree files we need to edit. To setup any overclock edit ~/bin/4.19/linux-mainline-kernel-master/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts about line 20 change the include to be #include "rk3399-op1-opp.dtsi" {it was "rk3399-opp.dtsi"} Code: nano ~/bin/4.19/linux-mainline-kernel-master/arch/arm64/boot/dts/rockchip/rk3399-rockpro64.dts then edit ~/bin/4.19/linux-mainline-kernel-master/arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi you will see at the top the cluster0 clock definitions for the A53 (up to 1512 - the rk3399-opp.dtsi file has max 1400) followed by the cluster1 definitions for the A72s. I just amend the 2016/last entry to be 2108, leave the voltage at 1.25V (1250000) works fine for me Code: nano ~/bin/4.19/linux-mainline-kernel-master/arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi 7) To kick off your kernel compile type Code: make -j6 bindeb-pkg 8) When your compile has finished, type Code: cd .. Not only that but the overclock should be there: Code: $ cat /sys/devices/system/cpu/cpu4/cpufreq/scaling_available_frequencies Now, if something goes wrong or you want to revert to your 4.4 kernel for whatever reason simply edit your /boot/extconfig/extconfig.conf file and set a default - my current file is below, the default line is what you have to add. The names of the labels can be freely abbreviated from what you find - just make sure whatever you put on line 1 matches a later label in the file. Otherwise the first label becomes the actual default! Code: timeout 10 Have fun. |