Add Kernel drivers in Torizon image

Hello,

We need to add some kernel drivers in Torizon image, that will be required by our new product.
The following configuration parameters should be include:

  • CONFIG_BATTERY_DS2782
  • CONFIG_POWER_RESET_LTC2952
  • CONFIG_COMMON_CLK_SI5351
  • CONFIG_CHARGER_MAX77976

Do you think they could be enabled on a nightly release?
Thanks in advance.

Best regards,
Alejandro

Verdin iMX8MM V1.1A
Verdin Development Board V1.1A
TorizonCore with PREEMPT_RT 5.7.0+build.17 (dunfell)

Greetings @apanelli,

Just to confirm do you want these configurations on TorizonCore 5.7.0?

Also I checked all these configurations and they should be available in the kernel used by TorizonCore 5.7.0. Except for CONFIG_CHARGER_MAX77976. According to the database it seems this configuration/driver was only added to the Linux Kernel in version 5.17: Linux Kernel Driver DataBase: CONFIG_CHARGER_MAX77976: Maxim MAX77976 battery charger driver

TorizonCore 5.7.0 uses a kernel based on version 5.4. So it doesn’t exist in this version.

Best Regards,
Jeremias

Hi @jeremias.tx,

TorizonCore 5.7.0 is the last version I’ve tried, but I don’t need to use that version specifically.
So these configurations could or should be added in the last version (I think it is 6.1, right?).
Then I will try this last version with those drivers included.

What I don’t know is if CONFIG_CHARGER_MAX77976 will be available in TorizonCore 6.x, neither which Linux Kernel version it is TorizonCore 6.x based on.

Best regards,
Alejandro

What I don’t know is if CONFIG_CHARGER_MAX77976 will be available in TorizonCore 6.x, neither which Linux Kernel version it is TorizonCore 6.x based on.

Currently for the Verdin i.MX8MM on TorizonCore 6.X the kernel version is based on version 5.15. I checked and CONFIG_CHARGER_MAX77976 is still not available in this version. As said earlier it seems it was only introduced starting with version 5.17.

Best Regards,
Jeremias

Ok, we will wait to the next kernel update to add CONFIG_CHARGER_MAX77976, meanwhile we will manage as a custom module/driver.

Do you think that the other 3 configurations could be added now?
Thank you very much.

Best regards,
Alejandro

Ok then, so just to confirm the request. You want to add just these 3 kernel configurations:

  • CONFIG_BATTERY_DS2782
  • CONFIG_POWER_RESET_LTC2952
  • CONFIG_COMMON_CLK_SI5351

To TorizonCore 6.X, correct?

Best Regards,
Jeremias

Yes, that’s right.
Thanks.

Best regards,
Alejandro

I’ve went ahead and made the request to our team. Once there’s any updates on this I’ll notify you here.

Best Regards,
Jeremias

Hi @apanelli,

Your requested configs have been added to the default kernel configuration of TorizonCore:

Keep in mind these are only available in our latest nightly builds. But they will be apart of our future releases going forward. Also these were only added to our 6.X.Y version images.

Best Regards,
Jeremias

Hi @jeremias.tx ,

Sorry my delay on this topic, I was out for holidays, and now I’m resuming this…

I have seen that requested configs were included in TorizonCore 6.2.0-devel-202302 (Release date: 2023-02-07), so I loaded the following image using TEZI:
TorizonCore with evaluation containers (PREEMPT_RT)
6.2.0-devel-202302+build.5.container

Prior to try requested drivers, I tried to add my customized overlay to use my LVDS display, that works properly on last image I was using (5.7), but when I try to update devicetree in the host computer, using:

$ torizoncore-builder dt checkout

I get the following response:
image

And it creates a ‘device-trees’ directory inside my working directory, but it seems to be an old version (toradex_5.4-2.1.x-imx).
I also tried to execute:

But it didn’t work either.
What could I be doing wrong?

Best regards,
Alejandro

Unfortunately the dt checkout command does not work for TorizonCore 6.X.Y at the moment. There is not even a branch of the device-trees repo for this kernel version. If you want to work with device trees/overlays on TorizonCore 6.X.Y you’ll need to clone the overlay and device tree sources manually. More details on this here: Device Tree Overlays on Torizon | Toradex Developer Center

Best Regards,
Jeremias

Hi @jeremias.tx ,

I have cloned overlay and device tree sources in my working directory.
After that, linux and device-trees directories have been created.

From a clean v6.2 image installed on Verdin module, I removed dsi to hdmi overlay using command:
$ torizoncore-builder dto remove verdin-imx8mm_dsi-to-hdmi_overlay.dtbo

But when I try to add dsi to lvds overlay, it fails:

After that, I have to do tcb image unpack again because any tcb command throws:

With image unpack done again, I tried to select wifi-dev device tree, but it also fails:

Is there a simple way to make work in the new v6.2 the already tested overlays on v5.7?
Thanks in advance.

Best regards,
Alejandro

I forgot to mention previously that there are some other compatibility issues between TorizonCore 6.X.Y and TorizonCore Builder beyond the device tree overlays workflow. However, most of these issues have been resolved and are available in the early-access version of TorizonCore Builder.

To use this version please see the README here: GitHub - toradex/tcb-env-setup: TorizonCore Builder Environment Setup Script

This should get you past the issue in your first screenshot. The issue in your second screenshot was caused by the failure in your first, so the early-access should also resolve this.

As for the issue in your last screenshot, as the error message shows, this device tree relies on the pwm.h header file. Since you had to clone the source repos manually, TorizonCore Builder does not know where to find this header file anymore. Therefore you need to provide it’s location.

Doing something like this should work:

torizoncore-builder dt apply <path to dts file> --include-dir ./linux/include

The ./linux/include directory should have most of the include/header files required for device tree compilation.

Best Regards,
Jeremias