CPU frequency regulation for Colib T30 with 6.1 version mainline kernel

Hello,
I have updated our Yocto build for the Colibri T30 to use kernel version 6.1… it took quite a bit of work to do that based on your BSP v 2.8.8 (mostly because some of classes didn’t want to compile the newer kernel versions) but we wanted long term support of existing T30 devices.

Upon loading the OS, we get a few errors from the cpufreq driver

[ 3.045827] tegra20-cpufreq tegra20-cpufreq: operating points not found
[ 3.052705] tegra20-cpufreq tegra20-cpufreq: please update your device tree

do you know what exactly the operating points in this case would be? Do we get dynamic scaling of the

[ 18.409506] tegra30-tsensor 70014000.tsensor: calibration: 12323 10245 90 24 ATE ver: 40 SoC rev: 3
[ 18.567999] tegra30-tsensor 70014000.tsensor: ch0: PMC emergency shutdown trip set to 90C

I am kind of confused on what the situation with cpufreq is in the new kernel. Can I just update the device tree with the OPPs and get dynamic frequency scaling? Or do I need to apply these patches
https://lore.kernel.org/lkml/20210302121003.15058-1-digetx@gmail.com/
@marcel.tx can you help us out here? What do I need to do to get the dynamic frequency scaling goodness?

Thanks,

Brad

Colibri T30 1GB IT
V 1.1B
Yocto BSP 2.8.8
custom carrier board

Do you know what the values for our CPU are? I am looking through the documentation in device tree and need these two values.

  1. CPU process ID mask
  2. CPU speedo ID mask

Thanks,
Brad

Hello @bertin,

Your account manager will contact you soon about this topic.

We would like to remind you that since the T30 is going EOL, support for these modules will be stopped.

Here you can have a look at our migration guide:

Best regards,
Josep

Hello @bertin

Sorry to bother you, but we’re kind of facing the same situation.

We’re also planning to use a newer kernel (Likely 6.1, because LTS) for our system if possible.
Hardware’s the Colibri T30 Module on a custom carrierboard, using the most recent BSP 2.8.8.

Because you mentioned that it was “quite a bit of work” to get the new Kernel working: Where did you find the documentation / ressources for achieving this?
Could you provide some pointers what components / files in the BSP are affected and need to be changed to use a newer kernel?

Thanks and best regards,

Simon

(I’m aware that the Colibri T30 is not officially supported by Toradex anymore, but we need to provide a solution for our customers regardless.)

Hi Simon,

Ok. there are several issues you will face.

  1. how to get the graphics hardware supported. Instead of the propietary drivers from Nvidia, you will need to figure out the correct open source config. Check xf86-video-opentegra as well as look on the nvidia forums to see how some of the other members were able to use mainline kernels instead of the ancient one that nvidia forked.
  2. Look at the mainline recipes from Toradex directly. They did work to bring the apalis using the mainline kernel. Use the mainline recipes and work in the meta-toradex-tegra layer to add in colibri support
  3. You will actually need to modify the kernel.bbclass, module-base.bbclass, and module.bbclass . Below is a line that will need to be added to kernel.bbclass
    [ -e scripts/module.lds ] && install -Dm 0644 scripts/module.lds ${STAGING_KERNEL_BUILDDIR}/scripts/module.lds
  4. you will need to add some recipes to handle the scripts used to make modules in the newer kernels (it also depends on if you need out of tree modules )

There are also other things like changes to how the kernel mounts partitons in the fstab file. The newer kernels use UUIDs to ID partitions. And the existing 2.8.8 will sometimes fail to boot because the naming of partitions has changed. (even though you can sometimes boot and when you do boot, you can manually change the fstab file to fix this)

It is not for the faint of heart, but can be done.

Brad

Hi @bertin

Thanks very much for the quick response!

  1. Fortunately, we don’t need a lot of features (e.g. no video/display, therefore no graphics support at all), I guess that makes things easier.

  2. You mean the recipes from here, right? linux « recipes-kernel - meta-toradex-tegra.git - Toradex BSP layer, recipes for NVIDIA Tegra based modules
    Are the patches from linux-toradex-mainline-4.14 still needed for 6.1? Because these are a lot of them.
    When checking kernel 6.6, there seems to be full (?) support for the colibri t30, there’s a device tree available: https://github.com/torvalds/linux/tree/v6.6/arch/arm/boot/dts/nvidia (tegra30-colibri-eval-v3.dts)

  3. Perfect, thanks!

  4. AFAIK we don’t need any out-of-tree modules and no kernel module support at all.

Further question: As the kernel source, do you still use the git from Toradex (git.toradex.com) with another branch than tegra, or upstream (git.kernel.org)? Did you start with a new kernel config (make tegra_defconfig or similar) or used the existing as base?

Sorry, don’t have that much exp in kernel development :smiley:

Thanks again,

Simon

Hi again @bertin

I managed to integrate & boot on Kernel 6.1.y. (Will post instructions here later, in case others need to do that aswell). However, now I’m facing the same issue with the tegra20-cpufreq as you originally described here.
Did you manage to fix this? If so, what did you need to change to make cpufreq work on the module?

Thanks and Regards,

Simon

Hi @SimonG you don’'t need to patch the kernel/device tree with a new kernel. You need to set the correct kernel confiruation options for the kernel to get the dynamic freqeuency.

You need to search through the kernel config and the easiest way I found to do that was by using the kernel config GUI. Then the .config will have correct options that you need to integrate into your Yocto build kernel recipe. I can post the options we selected on monday.

Brad