Adding in-tree kernel modules to Torizon

Hello there, I’m working on a project where I need to add support for two devices: PCA9685 over I2C and SC16IS752 over SPI. I’m using Torizon on a Verdin Mini but am realizing that it may not be possible to modify the kernel configuration with Torizon.

I went down the route of using bitbake -c menuconfig virtual/kernel to add these modules, but when building torizon-core-docker, the kernel modules are not added. I have my device tree overlays ready to go, but I can’t seem to get the modules loaded.

Any suggestions? or should I just switch to non-Torizon?

Greetings @mckay,

We actually take requests to enable various in-tree kernel configs from customers. Assuming of course there’s no issues or conflicts with enabling these new configurations.

It would probably be simpler and in your best interest to enable these drivers for these devices as kernel modules by default in our kernel for TorizonCore.

If you just let me know what exact kernel config options we should enable for these two devices I can make the request right away.

Best Regards,
Jeremias

Here is the diff:

diff ./tmp/work/verdin_imx8mm-tdx-linux/linux-toradex/5.4.161+gitAUTOINC+d1af79b2a0_0f00118249-r0/build/original.config ./tmp/work/verdin_imx8mm-tdx-linux/linux-toradex/5.4.161+gitAUTOINC+d1af79b2a0_0f00118249-r0/build/custom.config
3105c3105,3108
< # CONFIG_SERIAL_SC16IS7XX is not set
---
> CONFIG_SERIAL_SC16IS7XX_CORE=m
> CONFIG_SERIAL_SC16IS7XX=m
> # CONFIG_SERIAL_SC16IS7XX_I2C is not set
> CONFIG_SERIAL_SC16IS7XX_SPI=y
6890c6893
< # CONFIG_PWM_PCA9685 is not set
---
> CONFIG_PWM_PCA9685=m

So it should be just 4 extra options, 3 for the SC16IS7xx support and 1 for the PCA9685 support.

Alright I’ve submitted the request internally to the team to add these config options. I’ll let you know once I hear back. Typically it should be within the next week or so.

Best Regards,
Jeremias

@mckay Sorry about the delay due to circumstances this took longer than expected for us to add.

All the configs you requested should now be enabled as loadable modules in our kernel by default. You’ll need check our latest nightly builds going forward to have access to this. But our next official release of TorizonCore should then have this change as well.

Best Regards,
Jeremias

Could the approach described here be used here? Specifically, I’m referring to what looks like adding in-tree kernel modules to the Torizon platform.
Additionally, are there plans for allowing custom kernel configurations with Torizon which could enable the addition of in-tree kernel modules?

Hi @mckay ,

Could the approach described here be used here? Specifically, I’m referring to what looks like adding in-tree kernel modules to the Torizon platform.

If you mean using TorizonCore Builder to add the drivers as external kernel modules to a custom TorizonCore image, it depends. On some more complex drivers their dependencies might not allow doing this, at least not easily. For your devices I think it’s possible, though I can’t confirm this as I haven’t tried adding them.

Additionally, are there plans for allowing custom kernel configurations with Torizon which could enable the addition of in-tree kernel modules?

TorizonCore Builder allows kernel customization with external modules and kernel arguments. Is this what you mean?

Also, can you confirm if the configs you requested are enabled? They should be starting from TorizonCore 5.7.0 LTS.

Best regards,
Lucas Akira