Plans for updating NXP/Freescale BSP/kernel versions

The Torizon OS images for the Verdin IMX8MP currently use a 5.15 kernel based on the 5.15_2.2.0 BSP from NXP, released 2022-12. Are there plans for bumping to a new BSP and kernel version in the near future?

The reason I ask is I am working with a CSI camera and ran into some issues in the IMX8 media and ISI driver that need (fairly trivial) kernel patches. Trying to submit these kernel patches to GitHub - Freescale/linux-fslc: Linux kernel source tree, I noticed the 6.6.3-1.0.0 BSP version released last week (which is being merged into the meta-freescale layer) currently).

I noticed that that version contains two versions of the ISI driver - apparently a driver was merged into mainline since version 6.4 (in this commit). From a first look, this driver is a cleaned up version of the staging driver from the NXP BSP and does not have the issues I was trying to fix (improper handling of missing link_setup and s_power calls - those calls are removed entirely in favor of generic code, and support for RAW capturing which seems to be supported now). So it would be super useful for our project to switch over to this new kernel version and the mainline driver, if this could happen somewhere in the coming months.

Realistically, I suspect that Toradex might want to wait for a few BSP updates before switching, might need quite a bit of time to do the upgrade or might not even upgrade to this version at all (not sure how NXP BSP LTS versioning works, the 6.6 kernel does seem to be an LTS version). If that is the case, we might need to get our fixes into the toradex 5.15 kernel instead, which lives on Index of /linux-toradex.git. Are patches accepted? If so, what is the recommended way to submit them? Or should this go through linux-fslc maybe (if they even accept patches to 5.15 still)?

1 Like

Or is the plan to maybe switch to mainline kernels instead of NXP BSP kernels as a next step (like the "mainline first approach now used for the 32-bit IMX platforms already)? I saw there is already a meta-toradex-bsp-common layer that builds mainline 6.1 with some patches - with the ISI/CSI drivers now (since 6.4) in mainline, that might make the 6.6 version even more usable without the NXP BSP patches (not sure what else the NXP BSP kernel adds that is not yet in mainline, though).

1 Like

Greetings @matthijs,

It is very unlikely we will move kernel versions in our current 6.X OS releases. What I can tell you is that for the 7.X series the plan for the Verdin i.MX8MP is to use the 6.6 downstream kernel based on the NXP release of the same version. Take this with some caution however as our 7.X release is still quite a ways off (later half of this year) and plans could change.

With this information what are your thoughts/plans?

Best Regards,
Jeremias

1 Like

Thanks for your quick and clear reply!

Ok, so we hope to be shipping our product by then, so we’ll have to make do with the 6.x release then.

I’ve done a bit more testing and experimenting, and have managed to copy the ISI driver from the Toradex 5.15 driver, make my modifications to it and then compile it as an out-of-tree driver using torizon-core-builder. That required a bit of fiddling (renaming exported symbols, changing driver names and changing compatible strings in the driver and devicetree files) to make this driver coexist with and be used instead of the builtin driver in the kernel, but actually works pretty neatly now. This allows full control of this bit of kernel code, while still using image tarballs built by Toradex (so without having to do our own Yocto build, which would be a lot more work to manage). So for now, I think we are good to move forward.

In case Toradex is interested in picking up the fixes to the ISI driver, I’ve pushed them here: Commits · matthijskooijman/linux · GitHub That branch also has some other changes, it would be the “staging: media: *” commits that are bugfixes to be considered for merging. Two commits, “staging: media: imx8-media-dev: Do not fail on missing link_setup” and “staging: media: imx8-isi-cap: Do not fail on missing s_power” are the most important ones, these allow working with more sensor drivers such as the IMX219 (already in the kernel) or IMX708 (ported over from rasbperry pi by me). The other ones are small issues I ran into while debugging. The commit “staging: media: imx-isi-cap: Hack to enable SRRGB10/RG10 format” is also needed to really get proper data from the IMX219 and IMX708 (which only output RAW), but the commit is more a hack than a proper implementation, so not really ready to merge anywhere (but it makes RGGB10 work, which is enough for us for now to continue development in other areas, we might revisit this patch later).

In addition, I also tried backporting the new and improved ISI driver from the 6.6 kernel and compile that as an out-of-tree driver, but that ran into quite some issues because it relies on v4l2 features and APIs that are not present in 5.15 yet. I think it would be feasible to backport it given sufficient time, but I’ve stopped pursuing this route for now.

Well glad to hear you were able to progress in some way with your work. Keep an eye out for future news regarding our next 7.X major release.

Best Regards,
Jeremias