-
Notifications
You must be signed in to change notification settings - Fork 0
Hardware Fixes IW612 Power Management Fix
The imx8mm-jaguar-sentai board was experiencing the following error with the IW612 WiFi/Bluetooth module:
[ 40.291710] CMD_RESP: 0x107 block in pre_asleep!
[ 40.296624] CMD_RESP: 0x107 block in pre_asleep!
[ 40.301496] CMD_RESP: 0x107 block in pre_asleep!
This error indicates that the IW612 module is having issues entering sleep mode, typically related to SDIO power management and wake interrupt handling.
Based on research and analysis of the codebase:
-
SDIO Wake Interrupt Issues: The IW612 module requires proper SDIO wake interrupt configuration to handle power state transitions correctly.
-
Missing Device Tree Configuration: The imx8mm-jaguar-sentai device tree was missing proper USDHC2 (SDIO) configuration for the IW612 module.
-
Power Management Configuration: The kernel configuration lacked specific power management settings for the IW612 SDIO interface.
-
GPIO Wake Configuration: The WiFi wake GPIO (WL_WAKE_DEV) was not properly configured as a wakeup source.
File: meta-dynamicdevices-bsp/recipes-bsp/device-tree/lmp-device-tree/imx8mm-jaguar-sentai.dts
Added proper USDHC2 configuration for the IW612 SDIO interface:
// WiFi SDIO Interface - IW612 module with power management
&usdhc2 {
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc2>;
pinctrl-1 = <&pinctrl_usdhc2_100mhz>;
pinctrl-2 = <&pinctrl_usdhc2_200mhz>;
bus-width = <4>;
keep-power-in-suspend;
non-removable;
wakeup-source;
max-frequency = <100000000>;
fsl,sdio-async-interrupt-enabled;
pm-ignore-notify;
cap-power-off-card;
status = "okay";
wifi_wake_host {
compatible = "nxp,wifi-wake-host";
interrupt-parent = <&gpio2>;
interrupts = <6 IRQ_TYPE_LEVEL_LOW>; /* WL_WAKE_DEV GPIO */
interrupt-names = "host-wake";
wakeup-source;
};
};
Added corresponding pinctrl configurations for different frequency states.
File: meta-dynamicdevices-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/imx8mm-jaguar-sentai/wifi-power-management.cfg
Added comprehensive power management configuration:
- SDIO power management support
- Runtime power management for SDIO
- Wake interrupt handling
- Power management debugging support
Files:
meta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management/imx8mm-jaguar-sentai-wifi-pm.shmeta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management/imx8mm-jaguar-sentai-wifi-pm.service
Created a dedicated power management service that:
- Configures SDIO Runtime PM: Enables runtime power management for SDIO devices
- Sets Autosuspend Delays: Configures appropriate delays for power state transitions
- Enables WiFi Power Save: Configures the WiFi interface for power saving
- Sets up Wake-on-LAN: Enables magic packet wake functionality
- Configures GPIO Wake: Sets up the WiFi wake GPIO as a wakeup source
- Fixes SDIO Interrupts: Ensures SDIO cards maintain wakeup capability
Updated the kernel bbappend to include the new power management configuration and updated the WiFi power management recipe to install the imx8mm-jaguar-sentai specific files.
- Runtime PM: Automatic power management for SDIO devices
- Async Interrupts: Proper handling of out-of-band SDIO interrupts
- Wake Sources: SDIO card configured as wakeup source
- Power Sequencing: Proper power-on/off sequencing for the IW612
- WL_WAKE_DEV GPIO: GPIO2_6 configured for wake interrupts
- Edge Detection: Both rising and falling edge detection
- Wakeup Source: GPIO configured as system wakeup source
- Interface Power Save: WiFi interface configured for power saving
- Wake-on-LAN: Magic packet wake functionality
- PHY-level Configuration: Proper WoWLAN setup at the PHY level
To test the fix:
- Build and Flash: Build the updated image and flash to the board
-
Monitor Logs: Check
/var/log/wifi-power-management.logfor service status - Test Power States: Verify WiFi functionality and power state transitions
- Check for Errors: Monitor dmesg for the absence of the original error
After applying the fix:
- The "CMD_RESP: 0x107 block in pre_asleep!" error should no longer appear
- WiFi should maintain connectivity while using appropriate power saving
- The system should be able to wake from suspend via WiFi magic packets
- SDIO power state transitions should work smoothly
meta-dynamicdevices-bsp/recipes-bsp/device-tree/lmp-device-tree/imx8mm-jaguar-sentai.dtsmeta-dynamicdevices-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/imx8mm-jaguar-sentai/wifi-power-management.cfgmeta-dynamicdevices-bsp/recipes-kernel/linux/linux-lmp-fslc-imx_%.bbappendmeta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management_1.0.bbmeta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management/imx8mm-jaguar-sentai-wifi-pm.shmeta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management/imx8mm-jaguar-sentai-wifi-pm.service
- Linux SDIO Power Management Documentation
- NXP IW612 Power Management Guidelines
- i.MX8MM Reference Manual - USDHC Power Management
✅ IMPLEMENTED - All changes have been made to address the IW612 power management issue on imx8mm-jaguar-sentai board.
The fix addresses the root cause of the CMD_RESP: 0x107 error by implementing proper SDIO power management, wake interrupt handling, and GPIO wake configuration specifically for the IW612 module on the imx8mm-jaguar-sentai board.