I told codex to include Cortex-M4 support and also backport some features from Letux 7.3 to Pyra's current 5.6.19 kernel:
Kernel base: Original PyraOS kernel sources, "5.6.19-pyradef-10"
New kernel release: "5.6.19-pyradef-m4test"
Target hardware: DragonBox Pyra, OMAP5432, ARMv7-A, Pyra V5.3
1. Cortex-M4 / Remoteproc Support
The main addition is experimental support for the OMAP5432's integrated dual-core Cortex-M4 IPU subsystem.
- Backported the Device Tree-aware OMAP Remoteproc driver from Linux 5.7 to Linux 5.6.19.
- Added an OMAP5 IPU Device Tree node at physical address "0x55020000".
- Integrated the existing IPU IOMMU, mailbox, clock and reset controllers.
- Adapted the Remoteproc timer API, address translation callback and boot-address formatting for Linux 5.6.19.
- Enabled "CONFIG_REMOTEPROC", "CONFIG_OMAP_REMOTEPROC" and "CONFIG_OMAP2PLUS_MBOX".
- Added a separate "omap5-letux-cortex15-v5.3+pyra-v5.3-m4test.dtb" with the IPU enabled.
- Disabled automatic Remoteproc firmware startup as a precaution.
The original Pyra V5.3 Device Tree remains unchanged in its behavior, allowing initial kernel testing without activating the IPU.
Status: Kernel integration implemented. Actual Cortex-M4 firmware execution has not yet been validated on the Pyra.
2. Kernel Stability and Bug Fixes
Battery Charger – BQ2429x
File: "drivers/power/supply/bq2429x_charger.c"
Fixed two incorrect semicolons following conditional statements.
Previously, the driver could program precharge and charge termination currents even when the corresponding Device Tree properties had not been read successfully.
The correction ensures these optional values are applied only after successful retrieval.
Benefits: More reliable charger initialization and prevention of unintended register programming.
No battery charging limits have been changed.
SD/eMMC – OMAP HSMMC
File: "drivers/mmc/host/omap_hsmmc.c"
Fixed a possible 32-bit arithmetic overflow when converting MMC command busy-timeout values from milliseconds to nanoseconds.
The calculation now explicitly uses 64-bit arithmetic.
Benefits: More reliable timeout handling during long-running SD/eMMC operations, including potentially lengthy erase commands.
OMAP DMM/TILER
File: "drivers/gpu/drm/omapdrm/omap_dmm_tiler.c"
Corrected the error return value when allocation of the DMM refill buffer fails.
The driver now explicitly returns "-ENOMEM" instead of potentially reporting success after an unsuccessful allocation.
Benefits: Improved error handling and more predictable behavior under memory pressure.
The TILER rendering logic and DMA behavior remain unchanged.
3. USB OTG and VBUS Improvements
File: "drivers/usb/dwc3/dwc3-omap.c"
Several targeted fixes have been backported from the newer Letux kernel.
Explicit USB Initial State
The USB controller now receives explicit VBUS and USB-host identification states during initialization, including when no USB cable or host connection is detected.
Expected benefit: More consistent USB OTG initialization and device-role detection.
Safer VBUS Regulator Handling
The driver now checks whether the VBUS regulator is enabled before attempting to disable it.
This avoids unnecessary or unbalanced regulator-disable operations.
Optional VBUS Regulator Support
Replaced the previous Device Tree property check with "devm_regulator_get_optional()".
A genuinely absent optional regulator is accepted, while other errors, including probe deferral, are preserved.
Improved USB Error Cleanup
If IRQ registration fails after DWC3 child devices have been created, those devices are now explicitly removed before the remaining cleanup steps.
Expected benefits: More robust USB initialization, improved error recovery and cleaner resource management.
4. Kernel Build Compatibility
Several adjustments improve compatibility between the older Linux 5.6.19 kernel sources and modern Debian 12 development tools.
ARM/GCC compatibility
Moved the kernel's "-msoft-float" option earlier in the ARM build configuration so architecture detection works correctly with newer GCC toolchains.
This prevents incorrect fallback architecture selection and related ARM assembler errors.
SELinux host-tool compatibility
Adjusted the address-family check to accommodate newer host-system headers when building SELinux utilities, while retaining the original check for kernel code.
5. Build and Deployment Improvements
- Uses the original PyraOS kernel sources and the official Debian package revision "-10".
- Builds the kernel image, kernel modules and both standard and M4-enabled Device Trees.
- Uses a separate staging directory rather than installing files directly into the running system.
- Includes a read-only IPU diagnostic script for checking Remoteproc registration without starting firmware.
The experimental kernel uses a distinct release name so its modules can coexist with those of the original kernel.
6. Components Deliberately Left Unchanged
To minimize the risk of regressions, the following areas have not been modified by these improvements:
- PowerVR SGX544MP2 graphics driver sources, including version "1.14.3699939".
- AESS/ABE audio subsystem.
- Battery charging limits and battery-related Device Tree parameters.
- Keyboard backlight brightness tables.
- WWAN wakeup configuration.
- Existing Pyra V5.3 board configuration and default IPU-disabled behavior.
My Pyra is compiling right now at home and I can test and hopefully provide this kernel tomorrow.