1 Reply Latest reply on Aug 15, 2017 9:26 PM by mifo

    dts settings for 1dx with 6sl, device discovery failure

    jayakumar

      Hi,

       

      I'm working with an i.mx6sololite (6sl) board with a LBEE5KL1DX (1dx / bcm4343w) wifi module. I am developing with Linux 4.1.15 BSP from NXP.

       

      My driver build config is:

      CONFIG_BCMDHD=m

      CONFIG_BCMDHD_SDIO=m

      # CONFIG_BCM4339 is not set

      # CONFIG_BCM4354 is not set

      CONFIG_BCMDHD_FW_PATH="/lib/firmware/bcm/1DX_BCM4343W/fw_bcmdhd.bin"

      CONFIG_BCMDHD_NVRAM_PATH="/lib/firmware/bcm/1DX_BCM4343W/bcmdhd.1DX.SDIO.cal"

       

      My device tree setup is:

      &usdhc3 {

              pinctrl-names = "default";

              pinctrl-0 = <&pinctrl_usdhc3>;

              no-1-8-v;

              non-removable;

              pm-ignore-notify;

              bus-width = <4>;

              vmmc-supply = <&wlreg_on>;

              keep-power-in-suspend;

              enable-sdio-wakeup;

              status = "okay";

              needs-special-hs-handling;

              wifi-host;

       

              bcmdhd_wlan_0: bcmdhd_wlan@0 {

                      compatible = "android,bcmdhd_wlan";

                      gpios = <&gpio5 7 0>; /* WIFI_HOST_WAKE */

                      wlreg_on-supply = <&wlreg_on>;

                      interrupt-parent = <&gpio5>;

                      interrupts = <7 0>;

              };

      };

       

      So far I've been able to detect the device on mmc. I can see:

      mmc2: SDHCI controller on 2198000.usdhc [2198000.usdhc] using DMA

      mmc2: queuing unknown CIS tuple 0x80 (2 bytes)

      mmc2: queuing unknown CIS tuple 0x80 (3 bytes)

      mmc2: queuing unknown CIS tuple 0x80 (3 bytes)

      mmc2: queuing unknown CIS tuple 0x80 (7 bytes)

      mmc2: queuing unknown CIS tuple 0x80 (3 bytes)

      mmc2: queuing unknown CIS tuple 0x80 (6 bytes)

      mmc2: new high speed SDIO card at address 0001

       

      So that tells me that the sdio comms with the 1dx is working fine.

       

      However, when I load the bcmdhd driver, I only see:

      insmod ./bcmdhd.ko dyndbg=+p

      dhd_module_init in

       

      No wlan0 interface or any other interface gets created.

       

      I started inserting debug into the driver to see at what point it fails. I found that in:

      drivers/net/wireless/bcmdhd/dhd_linux_platdev.c in static int wifi_ctrlfunc_register_drv(void)

              dev1 = bus_find_device(&platform_bus_type, NULL, WIFI_PLAT_NAME, wifi_platdev_match);

              dev2 = bus_find_device(&platform_bus_type, NULL, WIFI_PLAT_NAME2, wifi_platdev_match);

              DHD_ERROR(("%s:%d,dev1=%p,name=%s\n", __func__, __LINE__, dev1,WIFI_PLAT_NAME));

              DHD_ERROR(("%s:%d,dev2=%p,name=%s\n", __func__, __LINE__, dev2,WIFI_PLAT_NAME2));

       

      which when I added debug, I see:

      wifi_ctrlfunc_register_drv:462,dev1=  (null),name=bcmdhd_wlan

      wifi_ctrlfunc_register_drv:463,dev2=  (null),name=bcm4329_wlan

       

      That searches for bcmdhd_wlan in the device list but doesn't match because it sees:

      wifi_platdev_match:445,name=bcmdhd_wlan,pdev=2190000.usdhc

      wifi_platdev_match:445,name=bcmdhd_wlan,pdev=2194000.usdhc

      wifi_platdev_match:445,name=bcmdhd_wlan,pdev=2198000.usdhc

      wifi_platdev_match:445,name=bcmdhd_wlan,pdev=21a0000.i2c

      wifi_platdev_match:445,name=bcmdhd_wlan,pdev=21a4000.i2c

       

      2198000.usdhc is the correct bus device because:

      ls -l /sys/devices/soc0/soc/2100000.aips-bus/2198000.usdhc/of_node/                                                                 

      drwxr-xr-x    2 root     root             0 Aug  2 10:58 bcmdhd_wlan@0

       

      In the code lower in that same wifi_ctrlfunc_register_drv function:

      #ifdef CONFIG_DTS

              wifi_plat_dev_probe_ret = platform_driver_register(&wifi_platform_dev_driver);

              DHD_ERROR(("%s:%d,err=%d\n", __func__, __LINE__, wifi_plat_dev_probe_ret));

      #endif /* CONFIG_DTS */

       

      That is called but gets:

      wifi_ctrlfunc_register_drv:524,err=0

       

      But it never gets to dhd_wifi_platform_load().

       

      I'm wondering whether I've missed something obvious about the devicetree setup which is causing it to fail to get the right of_node.

       

      Thanks!