Add Cortex-M7 remoteproc support for iot-gate-imx8plus#614
Draft
shaunmulligan wants to merge 3 commits intomasterfrom
Draft
Add Cortex-M7 remoteproc support for iot-gate-imx8plus#614shaunmulligan wants to merge 3 commits intomasterfrom
shaunmulligan wants to merge 3 commits intomasterfrom
Conversation
Enable the Cortex-M7 co-processor via remoteproc/RPMsg on the iot-gate-imx8plus (NXP i.MX8M Plus). Changes: - Add M7 device tree variant (iot-gate-imx8plus-m7.dts) with reserved memory regions, MU mailboxes, and RPMsg vring buffers. Based on CompuLab reference compulab-imx8m-plus-rpmsg.dtsi. - Add DTS patch to both linux-compulab and linux-balena-bootloader kernel builds. - Add clk_ignore_unused to u-boot mmcargs to prevent Linux from gating M7 clocks while the co-processor is running. - Add imx-rpmsg-tty-autoload recipe to auto-load the imx_rpmsg_tty kernel module at boot via modules-load.d (module cannot be built-in due to NXP Kconfig constraint). - Add M7 DTB to KERNEL_DEVICETREE in layer.conf. Tested on iot-gate-imx8plus with FreeRTOS RPMsg echo firmware loaded via ARM remoteproc-runtime OCI runtime. M7 boots, RPMsg channel established, bidirectional communication confirmed via /dev/ttyRPMSG30. Signed-off-by: Shaun Mulligan <shaun@balena.io>
0e00798 to
51b77fe
Compare
Release GPIO4 DIO pads (IN2/IO31, IN3/IO29, OUT0/IO30, OUT3/IO12) for M7
use by overriding pinctrl_ie_di4o4 with only the GPIO5/GPIO1 pads that
Linux should retain.
Uses &pinctrl_ie_di4o4 { } label reference instead of re-declaring the
label inside &iomuxc { } to avoid a duplicate-label DTC compile error.
NOT YET PUSHED - pending Yocto build and on-device verification.
Add gpio-reserved-ranges = <12 1>, <29 3> to the GPIO4 controller node in the M7 device tree. This marks GPIO4 pins 12 (DO3), 29 (DI3), 30 (DO0), and 31 (DI2) as invalid in Linux gpiolib valid_mask, preventing any Linux driver or userspace from requesting them. This is a second layer of protection beyond the pinctrl override: - pinctrl override: prevents Linux from muxing M7 pads - gpio-reserved-ranges: prevents gpiolib register-level access Linux-owned GPIO4 pins (IO20/USB2, IO24/PHY reset, IO28/LED) are unaffected. Tested on device: /sys/kernel/debug/gpio shows only gpio-116, 120, 124 for gpiochip3 (GPIO4). M7 GPIO DIO and RPMsg demo fully functional. Signed-off-by: Shaun Mulligan <shaun@balena.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable the Cortex-M7 co-processor on the iot-gate-imx8plus (NXP i.MX8M Plus) via the Linux remoteproc framework and RPMsg messaging.
iot-gate-imx8plus-m7.dtsvariant with reserved memory, MU mailboxes, and RPMsg vring buffers (based on CompuLab referencecompulab-imx8m-plus-rpmsg.dtsi)clk_ignore_unusedtommcargsso Linux doesn't gate M7 clocks while the co-processor is runningimx_rpmsg_ttymodule at boot viamodules-load.d(NXP Kconfig forces module-only build)KERNEL_DEVICETREEand include the autoload recipe inIMAGE_INSTALLContext
This is part of a PoC proving that balena can natively manage co-processor firmware as OCI container images using ARM remoteproc-runtime. The full pipeline:
balena push→ cloud build → supervisor deploys FreeRTOS firmware with remoteproc runtime → M7 boots → RPMsg channel created → bidirectional communication via/dev/ttyRPMSG30.Testing
Tested on iot-gate-imx8plus with balenaOS 6.11.11+rev1:
imx-rprocappears asremoteproc0/dev/ttyRPMSG30created, bidirectional RPMsg communication confirmedimx_rpmsg_ttymodule auto-loads at bootclk_ignore_unusedprevents M7 clock gating