Hi @JosephAtNXP
Thanks for your further suggestions. I made the devicetree changes you suggested. On probing the pin being used for GPIO wake I could at that point not see any activity on the pin, although wakeup was now working on ping from an external device.
I then changed the pinmux definition from 0x116 to 0x16 (disable the pad control register Pull Resistors Enable bit). After this I could see the pin momentarily dropping low after powering up the 1ZM module, but still no activity on the GPIO line during wake events, although wakeup on ping was still working. I suspect the change to 0x16 is required because our hardware has an external pullup and the GPIO goes through a voltage level converter as well.
I then took another look at my parameters passed to hssetpara, and realised I had misunderstood the documentation where it talks about the GPIO
where GPIO is the pin number of GPIO used to wakeup the host. It could be any valid
GPIO pin# (e.g. 0-7) or 0xff (interface, e.g. SDIO will be used instead).
The default is 0xff.
I had been passing 0x56 as this parameter as I thought this was referencing host GPIO pin, in fact I realise now it is the GPIO pin # on the 1ZM, as the WLAN_WAKEUP_HOST signal only defaults to pin 27 which is also GPIO1, but can in fact be specified to be on any GPIO pin. Changing this parameter to 0x1 resulted in the pin 27 pulsing as expected on wakeup events. I presume that 0x56 is a large enough number that there is no GPIO that corresponds to it, so it is treated as SDIO wake by the card in the same way as 0xFF. I think this is why wake worked initially but without the pin pulsing when expected. For reference, the complete command that works is:
echo enabled > /sys/bus/platform/devices/30b40000.mmc/power/wakeup && \
/usr/share/nxp_wireless/mlanutl mlan0 hssetpara 2 1 0xc8 3 400 && echo freeze > /sys/power/state
I have one remaining issue however - the SDIO interface does not appear to power down when wake is configured to use the GPIO pin, the power consumption for the "freeze" state when waking via SDIO and wake via GPIO is about the same, circa 120mA on our hardware. How can I configure the devicetree to allow the SDIO interface to suspend during sleep but without preventing sleep in the first place?
I attempted to remove the keep-power-in-suspend node from the usdhc1 section of the devicetree, but this prevents sleep entirely as you then can't write to /sys/bus/platform/devices/30b40000.mmc/power/wakeup (it doesn't exist) and echo freeze > /sys/power/state errors with "Function not implemented". My understanding was the the reason for using GPIO wake is to allow SDIO power savings during sleep, but at the moment I'm not seeing any.
Thank you.