Wake on LAN WL_HOST_WAKE IMX8 Android9.0.0 2.3.4

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Utsav
Level 2
Level 2
25 sign-ins 10 replies posted 10 sign-ins

Hello,

We are using CYW43438 with our imx8mn android 9.0.0 2.3.4 project. We have the driver as dhd-android-1.363.125.17.The wifi module is working fine

In our dts file we have the declaration

&usdhc1 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_wlan>;
pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_wlan>;
pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_wlan>;
bus-width = <4>;
pm-ignore-notify;
keep-power-in-suspend;
non-removable;
cap-power-off-card;
/delete-property/ vmmc-supply;
mmc-pwrseq = <&usdhc1_pwrseq>;
status = "okay";

brcmf: bcrmf@1 {
reg = <1>;
compatible = "brcm,bcm4329-fmac";
interrupt-parent = <&gpio2>;
interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "host-wake";
};
};

I have checked that the pin is connected in board properly. For testing purpose we are connecting the wifi to a mobile hotspot. After a while the when the device goes to sleep(CPU shutdown) we turn off the mobile hotspot but we dont see any interrupt coming from the wifi module in logs. Can you help us to figure out the problem

 

 

0 Likes
1 Solution
Vivek_gunapati
Moderator
Moderator
Moderator
250 replies posted 10 likes given 50 solutions authored

Hi @Utsav, If your solution does not use the DTS file, you can hardcode the OOB GPIO number. for example, you could define the following to enable OOB

DHDCFLAGS += -DOOB_INTR_ONLY -DHW_OOB and define the OOB pin in dhd_custom_gpio.c dhd_oob_gpio_num , or  Provide "dhd_oob_gpio_num=X" paramter as part of insmod during driver initialization

View solution in original post

0 Likes
12 Replies
Vivek_gunapati
Moderator
Moderator
Moderator
250 replies posted 10 likes given 50 solutions authored

Hi @Utsav ,
1) Could you please let me know the value of muxenab parameter in the NVRAM file? could you please set it to 0x11 and check if the issue persist?

2) could you please share us know the firmware bin file used?

3) could you please share the result of the following test 
-> Connect 4343w to an Hostspot
-> Host goes to sleep /suspend
-> Ping 4343w 
-> Does this wakeup the host?

4) After Suspend  and before suspend could you please probe the wl_host_wake pin and check if you are getting any interrupt toggle during ping.

Regards
Vivek

0 Likes
lock attach
Attachments are accessible only for community members.

Hello @Vivek_gunapati 

I tried the above steps by changing the value of muxenab from 0x1 to 0x11 in nvram file. After that below steps are performed

  • Connected to host
  • Put the device into sleep
  • Ping the ip

Result :The host did not wake up

I will try to check the interrupt pin also and let you know

I have attached the nvram txt and firmware bin file

Regards,

Utsav

 

0 Likes
Utsav
Level 2
Level 2
25 sign-ins 10 replies posted 10 sign-ins

Hello @Vivek_gunapati 

While looking into the kernel-imx code i see that the this particular below dts(bcm4329-fmac) will work for drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c which is different. We use dhd-android-1.363.125.17 which has no declaration for bcm4329-fmac. Is my understand correct. If it is then what do we need to change to make it work?

&usdhc1 {
#address-cells = <1>;
#size-cells = <0>;
pinctrl-names = "default", "state_100mhz", "state_200mhz";
pinctrl-0 = <&pinctrl_usdhc1>, <&pinctrl_wlan>;
pinctrl-1 = <&pinctrl_usdhc1_100mhz>, <&pinctrl_wlan>;
pinctrl-2 = <&pinctrl_usdhc1_200mhz>, <&pinctrl_wlan>;
bus-width = <4>;
pm-ignore-notify;
keep-power-in-suspend;
non-removable;
cap-power-off-card;
/delete-property/ vmmc-supply;
mmc-pwrseq = <&usdhc1_pwrseq>;
status = "okay";

brcmf: bcrmf@1 {
reg = <1>;
compatible = "brcm,bcm4329-fmac";
interrupt-parent = <&gpio2>;
interrupts = <9 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "host-wake";
};
};

0 Likes
Vivek_gunapati
Moderator
Moderator
Moderator
250 replies posted 10 likes given 50 solutions authored

Hi @Utsav ,  your understanding is true the compatible strings  "brcm" "brcm4329" are only used for fmac,  in DHD the IRQ pins are hardcoded and depend on config_dts and platform data, let me check what are the changes required to enable irq in DHD.
Meanwhile could you please let us know the status of the project i.e is and upgrade to existing project? or it a new project for testing or evaluation?  is wowl a requirement or is it used for evaluation?
Regards
Vivek.

0 Likes

Hello @Vivek_gunapati 

It is a requirement to our project whirlpool. We need to support this as a wake up mechanism to provided to our customers through app. But first we need to validate this behavior to forward to the application team. The config_dts and platform data where exactly can we get this information?

Regards,

Utsav Lath

0 Likes
Vivek_gunapati
Moderator
Moderator
Moderator
250 replies posted 10 likes given 50 solutions authored

Hi Utsav lath, 

Please find the procedure to enable OOB .  The procedure for DHD is different when compared to FMAC

-> while building .KO file "CONFIG_DTS" should be enabled.
-> In the dts file gpios should be defined  for example gpios= <&gpio6 9 0>;  defined under bcmdhd_wlan_0: bcmdhd_wlan@0

+ bcmdhd_wlan_0: bcmdhd_wlan@0 {
+ compatible = "android,bcmdhd_wlan";
+ /* WL_HOST_WAKE: SD2_DAT1 (gpio6 9) */
+ gpios = <&gpio6 9 0>; /* OOB pin */
+ wlreg_on-supply = <&wlreg_on>;

-> The makefile should enable -DOOB_INTR_ONLY &  -DHW_OOB flags

DHD will start the probe procedure by calling "wifi_plat_dev_drv_probe" and check for the interrupt flag "OOB_INTR_ONLY" if defined it will look for gpios string using the function of_get_gpio() and assign the OOB GPIO

Hope this helps

0 Likes

Hello @Vivek_gunapati 

Thanks for the above solution.

We currently don't use the dts based properties for wifi driver. If i enable it do i need to provide any other properties also ?

Regards,

Utsav Lath

0 Likes
Vivek_gunapati
Moderator
Moderator
Moderator
250 replies posted 10 likes given 50 solutions authored

Hi @Utsav, If your solution does not use the DTS file, you can hardcode the OOB GPIO number. for example, you could define the following to enable OOB

DHDCFLAGS += -DOOB_INTR_ONLY -DHW_OOB and define the OOB pin in dhd_custom_gpio.c dhd_oob_gpio_num , or  Provide "dhd_oob_gpio_num=X" paramter as part of insmod during driver initialization

0 Likes
lock attach
Attachments are accessible only for community members.

Hello Vivek

 I tried the above solution by enabling the flags -DOOB_INTR_ONLY -DHW_OOB and defining the dhd_oob_gpio_num pin in dhd_custom_gpio.c

But i saw that it didnt work. The bcmsdh_probe() function which has OOB_INTR_ONLY uses wifi_platform_get_irq_number which always return null. The dhd_oob_gpio_num is only used in dhd_customer_oob_irq_map() so i replaced wifi_platform_get_irq_number with dhd_customer_oob_irq_map.

We were using -DCUSTOMER_HW2 which was again using wifi_platform_get_irq_number and i changed it to -DCUSTOMER_HW3 which also gave us the benefit to return directly IRQ number in dhd_customer_oob_irq_map().

I was able to compile the code properly and in the /sys/kernel/debug/gpio was able to see the gpio pin as IRQ pin.

But bluetooth stopped working and was not able to start. The wifi is working properly. The pin i used in IMX8MN is SD1_DATA7 which is GPIO2 IO9 for Wake up WLAN.

The solution didnt seem to work as when the device goes to sleep and i disconnect the wifi I am able to see the logs from wifi driver regarding disconnection but i dont see anything regarding wakeup.

Can you please guide me what could i expect should happen and are the steps correct ?

I have attached the  patch also

Regards,

Utsav Lath

 

 

 

0 Likes
Vivek_gunapati
Moderator
Moderator
Moderator
250 replies posted 10 likes given 50 solutions authored

Hi Utsav,

Sorry for the delay in response, Could you pleaes verify if the the GPIO pin used is not multiplexed or used by any other interface such as UART or SPI etc.. and is dedicated to be GPIO

Also could you please check if the GPIO IRQ is enabled to run in suspend mode.

Regards
Vivek

0 Likes

Hi @Utsav , 
Any update on the issue?

0 Likes

Closing the case due to inactivity 

0 Likes