Skip to content

Hardware Fixes IW612 Power Management Fix

Alex J Lennon edited this page Oct 7, 2025 · 1 revision

IW612 Power Management Fix for imx8mm-jaguar-sentai

Problem Description

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.

Root Cause Analysis

Based on research and analysis of the codebase:

  1. SDIO Wake Interrupt Issues: The IW612 module requires proper SDIO wake interrupt configuration to handle power state transitions correctly.

  2. Missing Device Tree Configuration: The imx8mm-jaguar-sentai device tree was missing proper USDHC2 (SDIO) configuration for the IW612 module.

  3. Power Management Configuration: The kernel configuration lacked specific power management settings for the IW612 SDIO interface.

  4. GPIO Wake Configuration: The WiFi wake GPIO (WL_WAKE_DEV) was not properly configured as a wakeup source.

Solution Implementation

1. Device Tree Updates

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.

2. Kernel Configuration

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

3. Power Management Service

Files:

  • meta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management/imx8mm-jaguar-sentai-wifi-pm.sh
  • meta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management/imx8mm-jaguar-sentai-wifi-pm.service

Created a dedicated power management service that:

  1. Configures SDIO Runtime PM: Enables runtime power management for SDIO devices
  2. Sets Autosuspend Delays: Configures appropriate delays for power state transitions
  3. Enables WiFi Power Save: Configures the WiFi interface for power saving
  4. Sets up Wake-on-LAN: Enables magic packet wake functionality
  5. Configures GPIO Wake: Sets up the WiFi wake GPIO as a wakeup source
  6. Fixes SDIO Interrupts: Ensures SDIO cards maintain wakeup capability

4. Build System Integration

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.

Key Features of the Fix

SDIO Power Management

  • 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

GPIO Wake Configuration

  • 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

WiFi Power Save

  • 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

Testing and Validation

To test the fix:

  1. Build and Flash: Build the updated image and flash to the board
  2. Monitor Logs: Check /var/log/wifi-power-management.log for service status
  3. Test Power States: Verify WiFi functionality and power state transitions
  4. Check for Errors: Monitor dmesg for the absence of the original error

Expected Behavior

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

Related Files Modified

  1. meta-dynamicdevices-bsp/recipes-bsp/device-tree/lmp-device-tree/imx8mm-jaguar-sentai.dts
  2. meta-dynamicdevices-bsp/recipes-kernel/linux/linux-lmp-fslc-imx/imx8mm-jaguar-sentai/wifi-power-management.cfg
  3. meta-dynamicdevices-bsp/recipes-kernel/linux/linux-lmp-fslc-imx_%.bbappend
  4. meta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management_1.0.bb
  5. meta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management/imx8mm-jaguar-sentai-wifi-pm.sh
  6. meta-dynamicdevices-bsp/recipes-support/wifi-power-management/wifi-power-management/imx8mm-jaguar-sentai-wifi-pm.service

References

Status

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.

Clone this wiki locally