I’ve successfully woken my Verdin IMX8MM based device from Bluetooth events by using the BT_WKUP_HOST pin on the Verdin. We connected this pin back to CTRL_WAKE1_MICO#, and this works properly. To do this, I had to add the below Device Tree snippet to let the btmrvl_sdio driver know about the pin, and the driver then correctly transfers this info with the firmware to the AW-CM276NF.
/* Provide SDIO info to btmrvl_sdio driver, which needs it to enable BT_WKUP_HOST in AW-CM276NF firmware */
&usdhc3 {
status = "okay";
#address-cells = <1>;
#size-cells = <0>;
btmrvl: bluetooth@2 {
compatible = "marvell,sd8997-bt";
reg = <2>;
/* CTRL_WAKE1_MICO# here, which doesn't work as an IRQ but the driver expects something. Fill in the GPIO you're receiving BT_WKUP_HOST with. */
interrupt-parent = <&gpio4>;
interrupts = <28 IRQ_TYPE_LEVEL_LOW>;
/* To use BT_WKUP_HOST, wakeup-pin should be 0x0d (13). 0xff uses SDIO instead of a pin on the AW-CM276NF.*/
marvell,wakeup-pin = /bits/ 16 <0x0d>;
marvell,wakeup-gap-ms = /bits/ 16 <0x64>;
};
};
With this configuration, BT_WKUP_HOST is always low until a BT event occurs during suspend, at which time a pulse is generated. The falling edge of this pulse correctly wakes the device.
We assumed the signal would be normally high and connected it to an AND gate together with an interrupt line from our touchscreen. This way the touchscreen can also wake up the device (the touch controller does not send an I2C package during sleep). This system doesn’t work now because BT_WKUP_HOST will always ‘rule’ the output of the AND gate so it is normally low.
Using marvell,wakeup-pin = /bits/ 16 <0xff>; should instead use SDIO to signal a wake-up. I added wakeup-source; to usdhc3, but I cannot seem to wake up from a BT event now.
If I can get SDIO wake working, we don’t need to patch the hardware. This user had a working SDIO BT wake with a Colibri IMX6ULL, which also uses the AW-CM276NF.
Or is there a way to configure the firmware of the 88W8997 such that the out-of-band wakeup is normally high?
Thanks for posting on the community. Can you please share with us the full name of your module and its version?
Just for us to understand your desired goal. Do you want to set up your carrier board design in a way that you can wake your device up either with a BT_WKUP_HOST or with a Touch Event? Is this right?
Would you be able to share the schematics that you used with just the BT_WKUP_HOST as you said it was working before?
Also, did you have the opportunity to measure the signals on an oscilloscope or any kind of logic analyzer to test the signal assumptions?
That’s right. Right now, both work individually but not together due to our wrong assumption of the BT_WKUP_HOST behaviour.
The schematic included in my first post shows everything for BT_WKUP_HOST to work. In the schematic, TOUCH_INTn is always high, so does not affect the AND gate and it’s as if BT_WKUP_HOST (BT_WAKE_HOST_1V8 in our schematic, pin 172 of the SODIMM) is connected straight to CTRL_WAKE1_MICO# (pin 252).
Yes, I’ve measured this behaviour on BT_WKUP_HOST (with the 10k pullup shown on the schematic). Below, I’ve included a screenshot of the oscilloscope capturing a 100 ms pulse (generated by connecting to the device while it’s sleeping), configured with (pin 13, BT_WKUP_HOST, 100 ms gap):
I’d like to suggest you then check for other possibilities on the logic circuit of your board. As you measure, the port stays low for most of the time, therefore, using an Inverter gate would be enough to have it high almost all the time. Would this fit your goal?
We usually don’t work changing the BT Firmware but I can check internally if anyone has ever done such work so that we can gather better suggestions.
I would just really prefer to wake via BT over SDIO, since this seems to be possible, and would save us from having to patch 50 boards. Is this possible?
Thanks for waiting. I discussed this with our Hardware team. The SDIO interface on the Verdin Modules with Wifi/Bluetooth is not connected to the SODIMM Connector but it’s from the SoC to the Wifi/Bluetooth Chipset. Therefore, it may be not so straightforward to implement a wake-up via BT over SDIO on this specific module.
We understand that patching 50 boards is problematic and may take time but our team thinks that this may be the easiest solution nevertheless.
Please tell us how are you going to proceed and if we can help with anything else.
Thanks for looking so deeply into this. The other poster with an IMX6ULL seems to use the on-module SDIO, which doesn’t connect to the SODIMM either, to wake without using the wakeup pin, but we have already started patching the boards as we agree it is the easiest solution.
Out of curiosity, I still wonder what the difference in software might be that they can wake from the SDIO and I seemingly cannot, but it’s no longer important for our product.
Thanks for the update. Please tell us if the patch goes well and if so I’d like to invite you to tag the post as solved
Sadly, I’m not able to comment on how they’ve been able to achieve it. I’ll try to get more knowledge about this soon and if I find a solution I’ll surely update you here.