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

I wanted to ask the same question because we’re relying also heavily on torizoncore-builder and TorizonOS.
Now, 3 months later, are there any news or plans to switch to the 6.6 kernel for the BSP 7 for Verdin i.MX8MP?

Thanks in advance,
Lukas

Hi @lzaugg_parametric,

Now, 3 months later, are there any news or plans to switch to the 6.6 kernel for the BSP 7 for Verdin i.MX8MP?

For our BSP 7 our current plan is still to provide a 6.6 kernel based on the NXP release for the Verdin i.MX8M Plus. In fact you can even see the kernel to-be here: linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

Do note that our BSP 7 is still not officially released as of yet, so this kernel is still a work in progress at this time.

Best Regards,
Jeremias

@jeremias.tx Thanks for the update. When do you plan to have any TorizonOS nightly build ready with this kernel?

Just checked https://artifacts.toradex.com/artifactory/torizoncore-oe-prerelease-frankfurt/scarthgap-7.x.y/nightly/11/verdin-imx8mp/torizon/torizon-docker/oedeploy/.kernel_scmbranch and it’s still pointing to toradex_5.15-2.2.x-imx.

Oh, and are there plans regarding switching kernel version from NXP downstream to mainline (upstream)?

When do you plan to have any TorizonOS nightly build ready with this kernel?

For the kernel Torizon OS just inherits from our BSP layers. Basically when this recipe gets updated is when Torizon OS will get the new kernel: linux « recipes-kernel - meta-toradex-nxp.git - Toradex BSP layer, recipes for NXP based modules

When this happens is hard to say exactly. It depends on various things like stabilizing the new kernel version and passing various testing. Whenever our BSP team decides the new kernel version is ready, which again is hard to put an exact date on at the moment.

Oh, and are there plans regarding switching kernel version from NXP downstream to mainline (upstream)?

We do not at the moment. Torizon OS plans to stick with the downstream NXP based kernel for Verdin i.MX8M Plus. We may have build options for the mainline kernel, but as of right now the plan is that our default build will use the downstream for this module at least.

Do you have interest in the mainline kernel for Verdin i.MX8M Plus? And if yes, may I ask for what reasons?

Best Regards,
Jeremias

Thanks for letting me know. I will keep an eye on it.

We use a switch chip, which is still subject to major software changes (features and fixes). Plus we added support for our specific device in use that got added in kernel 6.9 and if we can use that version or newer we wouldn’t need to make the extra step of patching the kernel/module.

Nevertheless, looking forward to use TorizonOS with kernel version 6.6, which will get a lot of patching obsolete on our side!

Best Regards,
Lukas

I see well just keep an eye out like I said. The official release of our BSP 7.X is still some time out. If you have any other questions about this upcoming release feel free to ask on our community here.

Best Regards,
Jeremias