This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

WL1273L Linux 3.12 Wifi not working using DMA for SDIO

Other Parts Discussed in Thread: WL1271

Hi All,

We have a 3.12 Linux Kernel running on a DM368 board with a WL1273L wifi module connected through the SDIO. We've been successfull at using the wifi when the SDIO is setup as PIO. However, when we enable DMA support in the kernel, the wifi stops working.

All the wifi modules are loaded correctly, however the wlcore.ko module halts when we perform an "ifconfig wlan0 up" on wlcore_boot_static_data function from wlcore module. 

Any ideas?

Thanks in advance

 

  • Hi,

    Can you share the complete kernel logs?

    Regards,
    Gigi Joseph.

  • Booting without DMA support, Wifi modules are loaded after boot with a user script.

    ***************************************************************************************************************************

    ## Booting kernel from Legacy Image at 82000000 ...
    Image Name: Linux-3.12.0-rc5-wl_
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 2158144 Bytes = 2.1 MB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
    OK

    Starting kernel ...

    [ 0.818652] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
    [ 0.822767] serial8250 serial8250.0: Runtime PM disabled, clock forced on.
    [ 0.822823] serial8250 serial8250.0: Runtime PM disabled, clock forced on.
    [ 0.822872] serial8250 serial8250.0: Runtime PM disabled, clock forced on.
    [ 0.845519] serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40, base_baud = 1500000) is a 16550A
    [ 0.846865] serial8250 serial8250.1: Runtime PM disabled, clock forced on.
    [ 0.846917] serial8250 serial8250.1: Runtime PM disabled, clock forced on.
    [ 0.846966] serial8250 serial8250.1: Runtime PM disabled, clock forced on.
    [ 0.869193] serial8250.1: ttyS1 at MMIO 0x1d06000 (irq = 41, base_baud = 10625000) is a 16550A
    [ 0.937789] console [ttyS1] enabled
    [ 0.947371] brd: module loaded
    [ 0.962077] ONFI param page 0 valid
    [ 0.965596] ONFI flash detected
    [ 0.968768] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xaa (Micron MT29F2G08ABBEAH4), 256MiB, page size: 2048, OOB size: 64
    [ 1.001499] Creating 8 MTD partitions on "davinci_nand.0":
    [ 1.007029] 0x000000000000-0x000000300000 : "bootloader"
    [ 1.018253] 0x000000300000-0x000000500000 : "params"
    [ 1.028838] 0x000000500000-0x000000b00000 : "kernel"
    [ 1.040920] 0x000000b00000-0x000003300000 : "filesystem1"
    [ 1.066305] 0x000003300000-0x000003500000 : "data1"
    [ 1.076751] 0x000003500000-0x000005d00000 : "filesystem2"
    [ 1.102321] 0x000005d00000-0x00000d500000 : "data2"
    [ 1.156590] 0x00000d500000-0x000010000000 : "backup"
    [ 1.191582] davinci_nand davinci_nand.0: controller rev. 2.3
    [ 1.207395] davinci_mdio davinci_mdio.0: Runtime PM disabled, clock forced on.
    [ 1.260190] davinci_mdio davinci_mdio.0: davinci mdio revision 1.4
    [ 1.266413] davinci_mdio davinci_mdio.0: detected phy mask fffffffc
    [ 1.276515] libphy: davinci_mdio.0: probed
    [ 1.280956] davinci_mdio davinci_mdio.0: phy[0]: device davinci_mdio-0:00, driver unknown
    [ 1.289171] davinci_mdio davinci_mdio.0: phy[1]: device davinci_mdio-0:01, driver unknown
    [ 1.298317] i2c /dev entries driver
    [ 1.304125] watchdog watchdog: Runtime PM disabled, clock forced on.
    [ 1.311128] watchdog watchdog: Runtime PM disabled, clock forced on.
    [ 1.317536] watchdog watchdog: Runtime PM disabled, clock forced on.
    [ 1.324369] watchdog watchdog: heartbeat 60 sec
    [ 1.331880] davinci_mmc da830-mmc.0: Runtime PM disabled, clock forced on.
    [ 1.338790] davinci_mmc da830-mmc.0: Runtime PM disabled, clock forced on.
    [ 1.346023] davinci_mmc da830-mmc.0: Runtime PM disabled, clock forced on.
    [ 1.375459] davinci_mmc da830-mmc.0: Can't get dma_tx channel
    [ 1.420395] davinci_mmc da830-mmc.0: Using PIO, 4-bit mode
    [ 1.426356] davinci_mmc da830-mmc.1: Runtime PM disabled, clock forced on.
    [ 1.434520] davinci_mmc da830-mmc.1: Runtime PM disabled, clock forced on.
    [ 1.443706] davinci_mmc da830-mmc.1: Runtime PM disabled, clock forced on.
    [ 1.473360] davinci_mmc da830-mmc.1: Can't get dma_tx channel
    [ 1.520382] davinci_mmc da830-mmc.1: Using PIO, 4-bit mode
    [ 1.532309] nf_conntrack version 0.5.0 (691 buckets, 2764 max)
    [ 1.542305] ip_tables: (C) 2000-2006 Netfilter Core Team
    [ 1.547827] TCP: cubic registered
    [ 1.551561] NET: Registered protocol family 17
    [ 1.568788] mmc1: card claims to support voltages below the defined range. These will be ignored.
    [ 1.578932] davinci_emac davinci_emac.1: Runtime PM disabled, clock forced on.
    [ 1.586904] davinci_emac davinci_emac.1: Runtime PM disabled, clock forced on.
    [ 1.594539] davinci_emac davinci_emac.1: Runtime PM disabled, clock forced on.
    [ 1.602461] davinci_emac davinci_emac.1: using random MAC addr: d6:24:99:06:66:51
    [ 1.617538] net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=davinci_mdio-0:01, id=221556)
    [ 1.632258] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
    [ 1.638333] mmc1: new SDIO card at address 0001
    [ 3.610462] libphy: davinci_mdio-0:01 - Link is Up - 100/Full
    [ 3.640869] IP-Config: Complete:
    [ 3.644158] device=eth0, hwaddr=d6:24:99:06:66:51, ipaddr=192.168.2.107, mask=255.255.255.0, gw=192.168.2.1
    [ 3.654584] host=192.168.2.107, domain=, nis-domain=(none)
    [ 3.660801] bootserver=192.168.2.137, rootserver=192.168.2.137, rootpath=
    [ 3.725524] VFS: Mounted root (nfs filesystem) on device 0:11.
    [ 3.732521] Freeing unused kernel memory: 144K (c03e6000 - c040a000)
    mounting filesystems...done.
    running rc.d services...
    starting udev
    mounting tmpfs at /dev
    creating static nodes
    starting udevd...done
    waiting for devices...done
    syslogd starting
    klogd starting
    crond starting
    Starting telnetd...
    starting network interfaces...
    lo Link encap:Local Loopback
    eth0 Link encap:Ethernet HWaddr D6:24:99:06:66:51
    Starting udhcpd...
    starting inetd...done
    logrotate: rotating in /var/log
    logrotate: rotation for messages ...
    loading modules

    OSELAS(R)-OSELAS.Toolchain-2013.12.2-trunk / versatilepb-2012.12.0
    ptxdist-2014.06.0/2014-07-02T17:50:54+0200

    192.168.2.107 login:

    ***************************************************************************************************************************

    Kernel with DMA support.

    This one halts when loading wlcore.ko trying to program some registers and therefore the wifi does not work.

    ***************************************************************************************************************************

    ## Booting kernel from Legacy Image at 82000000 ...
    Image Name: Linux-3.12.0-rc5-wl_CRATER_2.0+
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 2166432 Bytes = 2.1 MB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
    OK

    Starting kernel ...

    [ 0.897820] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
    [ 0.901866] serial8250 serial8250.0: Runtime PM disabled, clock forced on.
    [ 0.901921] serial8250 serial8250.0: Runtime PM disabled, clock forced on.
    [ 0.901969] serial8250 serial8250.0: Runtime PM disabled, clock forced on.
    [ 0.924650] serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40, base_baud = 1500000) is a 16550A
    [ 0.925978] serial8250 serial8250.1: Runtime PM disabled, clock forced on.
    [ 0.926027] serial8250 serial8250.1: Runtime PM disabled, clock forced on.
    [ 0.926075] serial8250 serial8250.1: Runtime PM disabled, clock forced on.
    [ 0.948305] serial8250.1: ttyS1 at MMIO 0x1d06000 (irq = 41, base_baud = 10625000) is a 16550A
    [ 1.016951] console [ttyS1] enabled
    [ 1.026463] brd: module loaded
    [ 1.041188] ONFI param page 0 valid
    [ 1.044710] ONFI flash detected
    [ 1.047884] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xaa (Micron MT29F2G08ABBEAH4), 256MiB, page size: 2048, OOB size: 64
    [ 1.080788] Creating 8 MTD partitions on "davinci_nand.0":
    [ 1.086320] 0x000000000000-0x000000300000 : "bootloader"
    [ 1.097362] 0x000000300000-0x000000500000 : "params"
    [ 1.108028] 0x000000500000-0x000000b00000 : "kernel"
    [ 1.120173] 0x000000b00000-0x000003300000 : "filesystem1"
    [ 1.145568] 0x000003300000-0x000003500000 : "data1"
    [ 1.156242] 0x000003500000-0x000005d00000 : "filesystem2"
    [ 1.181956] 0x000005d00000-0x00000d500000 : "data2"
    [ 1.236195] 0x00000d500000-0x000010000000 : "backup"
    [ 1.271230] davinci_nand davinci_nand.0: controller rev. 2.3
    [ 1.287049] davinci_mdio davinci_mdio.0: Runtime PM disabled, clock forced on.
    [ 1.340175] davinci_mdio davinci_mdio.0: davinci mdio revision 1.4
    [ 1.346399] davinci_mdio davinci_mdio.0: detected phy mask fffffffc
    [ 1.356496] libphy: davinci_mdio.0: probed
    [ 1.360920] davinci_mdio davinci_mdio.0: phy[0]: device davinci_mdio-0:00, driver unknown
    [ 1.369133] davinci_mdio davinci_mdio.0: phy[1]: device davinci_mdio-0:01, driver unknown
    [ 1.378268] i2c /dev entries driver
    [ 1.384054] watchdog watchdog: Runtime PM disabled, clock forced on.
    [ 1.391085] watchdog watchdog: Runtime PM disabled, clock forced on.
    [ 1.397489] watchdog watchdog: Runtime PM disabled, clock forced on.
    [ 1.404331] watchdog watchdog: heartbeat 60 sec
    [ 1.411859] davinci_mmc da830-mmc.0: Runtime PM disabled, clock forced on.
    [ 1.418770] davinci_mmc da830-mmc.0: Runtime PM disabled, clock forced on.
    [ 1.426009] davinci_mmc da830-mmc.0: Runtime PM disabled, clock forced on.
    [ 1.452077] edma-dma-engine edma-dma-engine.0: allocated channel for 0:27
    [ 1.465696] edma-dma-engine edma-dma-engine.0: allocated channel for 0:26
    [ 1.510415] davinci_mmc da830-mmc.0: Using DMA, 4-bit mode
    [ 1.516373] davinci_mmc da830-mmc.1: Runtime PM disabled, clock forced on.
    [ 1.524543] davinci_mmc da830-mmc.1: Runtime PM disabled, clock forced on.
    [ 1.533751] davinci_mmc da830-mmc.1: Runtime PM disabled, clock forced on.
    [ 1.559808] edma-dma-engine edma-dma-engine.0: allocated channel for 0:31
    [ 1.574739] edma-dma-engine edma-dma-engine.0: allocated channel for 0:30
    [ 1.620330] davinci_mmc da830-mmc.1: Using DMA, 4-bit mode
    [ 1.628800] nf_conntrack version 0.5.0 (691 buckets, 2764 max)
    [ 1.643055] ip_tables: (C) 2000-2006 Netfilter Core Team
    [ 1.648585] TCP: cubic registered
    [ 1.652325] NET: Registered protocol family 17
    [ 1.656878] mmc1: card claims to support voltages below the defined range. These will be ignored.
    [ 1.675809] davinci_emac davinci_emac.1: Runtime PM disabled, clock forced on.
    [ 1.683502] davinci_emac davinci_emac.1: Runtime PM disabled, clock forced on.
    [ 1.691479] davinci_emac davinci_emac.1: Runtime PM disabled, clock forced on.
    [ 1.699312] davinci_emac davinci_emac.1: using random MAC addr: da:2e:0e:10:b5:f2
    [ 1.714608] net eth0: attached PHY driver [Generic PHY] (mii_bus:phy_addr=davinci_mdio-0:01, id=221556)
    [ 1.727336] mmc1: queuing unknown CIS tuple 0x91 (3 bytes)
    [ 1.733703] mmc1: new SDIO card at address 0001
    [ 3.710468] libphy: davinci_mdio-0:01 - Link is Up - 100/Full
    [ 3.740948] IP-Config: Complete:
    [ 3.744235] device=eth0, hwaddr=da:2e:0e:10:b5:f2, ipaddr=192.168.2.107, mask=255.255.255.0, gw=192.168.2.1
    [ 3.754744] host=192.168.2.107, domain=, nis-domain=(none)
    [ 3.760870] bootserver=192.168.2.137, rootserver=192.168.2.137, rootpath=
    [ 3.786885] VFS: Mounted root (nfs filesystem) on device 0:11.
    [ 3.794961] Freeing unused kernel memory: 144K (c03ea000 - c040e000)
    mounting filesystems...done.
    running rc.d services...
    starting udev
    mounting tmpfs at /dev
    creating static nodes
    starting udevd...done
    waiting for devices...done
    syslogd starting
    klogd starting
    crond starting
    Starting telnetd...
    starting network interfaces...
    lo Link encap:Local Loopback
    eth0 Link encap:Ethernet HWaddr DA:2E:0E:10:B5:F2
    Starting udhcpd...
    starting inetd...done
    logrotate: rotating in /var/log
    logrotate: rotation for messages ...
    loading modules

    OSELAS(R)-OSELAS.Toolchain-2013.12.2-trunk / versatilepb-2012.12.0
    ptxdist-2014.06.0/2014-07-02T17:50:54+0200

    192.168.2.107 login:

    Thanks a lot for your help

  • Hi,

    It would be helpful if you can provide the logs while inserting the modules (for both cases). Also, I think you can check with the DM368 forum...

    Regards,
    Gigi Joseph.

  • insmod /lib/modules/3.12.0-rc5-/cfg80211.ko
    insmod /lib/modules/3.12.0-rc5-/firmware_class.ko
    insmod /lib/modules/3.12.0-rc5-/mac80211.ko
    insmod /lib/modules/3.12.0-rc5-wlcore.ko
    insmod /lib/modules/3.12.0-rc5-wlcore_sdio.ko
    insmod /lib/modules/3.12.0-rc5-wl12xx.ko

    #ifconfig will halt because of DMA support being ENABLED

    ifconfig wlan0 up 

    Find below the module initialization logs:


    [ 3.794782] Freeing unused kernel memory: 144K (c03ea000 - c040e000)
    [ 81.905745] device class 'ieee80211': registering
    [ 81.906494] Registering platform device 'regulatory.0'. Parent at platform
    [ 81.906549] device: 'regulatory.0': device_add
    [ 81.906641] bus: 'platform': add device regulatory.0
    [ 81.906764] platform regulatory.0: pm_clk_notify() 1
    [ 81.907031] cfg80211: Calling CRDA to update world regulatory domain
    [ 81.990609] device class 'firmware': registering
    [ 82.242044] bus: 'sdio': add driver wl1271_sdio
    [ 82.242173] bus: 'sdio': driver_probe_device: matched device mmc1:0001:1 with driver wl1271_sdio
    [ 82.242219] bus: 'sdio': really_probe: probing driver wl1271_sdio with device mmc1:0001:1
    [ 82.242387] wl1271_sdio: probe of mmc1:0001:1 rejects match -19
    [ 82.242441] bus: 'sdio': driver_probe_device: matched device mmc1:0001:2 with driver wl1271_sdio
    [ 82.242474] bus: 'sdio': really_probe: probing driver wl1271_sdio with device mmc1:0001:2
    [ 82.242669] Registering platform device 'wl12xx.0.auto'. Parent at mmc1:0001:2
    [ 82.242717] device: 'wl12xx.0.auto': device_add
    [ 82.242798] bus: 'platform': add device wl12xx.0.auto
    [ 82.242921] platform wl12xx.0.auto: pm_clk_notify() 1
    [ 82.254286] driver: 'mmc1:0001:2': driver_bound: bound to device 'wl1271_sdio'
    [ 82.254392] bus: 'sdio': really_probe: bound device mmc1:0001:2 to driver wl1271_sdio
    [ 88.571391] bus: 'platform': add driver wl12xx_driver
    [ 88.571556] bus: 'platform': driver_probe_device: matched device wl12xx.0.auto with driver wl12xx_driver
    [ 88.571604] bus: 'platform': really_probe: probing driver wl12xx_driver with device wl12xx.0.auto
    [ 88.571662] wl12xx_driver wl12xx.0.auto: pm_clk_notify() 3
    [ 88.579072] driver: 'wl12xx.0.auto': driver_bound: bound to device 'wl12xx_driver'
    [ 88.774535] Firmware is loaded
    [ 89.040232] device: 'phy0': device_add
    [ 89.048051] device: 'rfkill0': device_add
    [ 89.054781] device: 'wlan0': device_add
    [ 89.059035] wlcore: loaded
    [ 111.000443] Firmware is loaded
    [ 111.013891] MY_DEBUG wl12xx_boot
    [ 111.016985] MY_DEBUG wl12xx_pre_boot
    [ 111.023323] MY_DEBUG end wl12xx_pre_boot
    [ 111.027108] MY_DEBUG wlcore_boot_upload_nvs
    [ 111.032849] MY_DEBUG wl12xx_pre_upload
    [ 111.036676] MY_DEBUG wlcore_boot_upload_firmware
    [ 111.078444] MY_DEBUG wlcore_boot_run_firmware
    [ 111.083474] MY_DEBUG wlcore_boot_run_firmware
    [ 111.087969] MY_DEBUG wl1271_boot_set_ecpu_ctrl
    [ 111.093628] MY_DEBUG wlcore_read_reg
    [ 111.097192] MY_DEBUG wait for init to complete
    [ 111.111806] MY_DEBUG wlcore_read_reg 1
    [ 111.115453] MY_DEBUG wlcore_read_reg 2
    [ 111.119078] MY_DEBUG wlcore_boot_static_data
    [ 111.124785] MY_DEBUG wlcore_boot_static_data
    [ 111.129007] MY_DEBUG wlcore_read

    Thanks

  • Joan,

        A number of us on this board have been unsuccessful getting wl12xx working with linux 3.12 - would you mind sharing how you were able to get it up and running?  Specifically which drivers you used and what your device tree config looks like?  Any pointers would be much appreciated!

    Thanks,

    Chris

  • Hi Chris,

     I'm not using a device tree. I just cloned the latest kernel following the website steps, generate a filesystem and cross compile the tools following the instructions here:

    http://wireless.kernel.org/en/users/Drivers/wl12xx

    http://wiki.beyondlogic.org/index.php?title=Cross_Compiling_iw_wpa_supplicant_hostapd_rfkill_for_ARM 

    You can see the modules I load in the error below.

    However, I still have some problems.

    The Access Point (hostapd) shows in client devices when scanning, however when I try to connect from any client. the access point disappears.

    Also, when I do a "ifconfig wlan0 down" I get the following error:

    72.030445] cfg80211: Calling CRDA to update world regulatory domain


    [ 676.372960] wlcore: ERROR command complete timeout
    [ 676.377785] ------------[ cut here ]------------
    [ 676.382427] WARNING: CPU: 0 PID: 1079 at drivers/net/wireless/ti/wlcore/main.c:783 0xbf063158()
    [ 676.392942] Modules linked in: lib80211 wl12xx wlcore_sdio wlcore mac80211 firmware_class cfg80211
    [ 676.402043] CPU: 0 PID: 1079 Comm: hostapd Not tainted 3.12.0- #155
    [ 676.411444] Backtrace:
    [ 676.414154] Function entered at [<c000bd10>] from [<c000bfac>]
    [ 676.419999] r6:bf075fe4 r5:00000009 r4:00000000 r3:00400140
    [ 676.426934] Function entered at [<c000bf94>] from [<c03044c0>]
    [ 676.432779] Function entered at [<c03044a0>] from [<c0017710>]
    [ 676.440167] Function entered at [<c00176a4>] from [<c00177d4>]

    I have used several firmwares without success.

    My current feeling is that not all the interrupts are being received properly. Because I get also a watchdog timeout when working in client mode.

    Thanks