Wl12xx

Hi,

Interfacing wifi module (wl12xx ti chipset) with beaglebone black. Unable to bring up wlan0 interface, please guide me for proper device tree configuration.

After booting excecuted
modprobe wlcore_sdio
modprobe wl12xx

Below are my configurations.

Kernel : 4.1
Rootfs : Debian

Device Tree:

/ {
vwlan_en_reg: regulator-vwlan-en {
compatible = “regulator-fixed”;
regulator-name = “vwlan_en”;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpio = <&gpio0 27 0>;
enable-active-high;
startup-delay-us = <70000>;
pinctrl-names = “default”;
pinctrl-0 = <&wlan_enable_pins>;
};
};

&am33xx_pinmux {

wlan_pins: pinmux_wlan_pins {
pinctrl-single,pins = <
0x28 (PIN_INPUT_PULLUP | MUX_MODE7) /* gpio0_26 WL_IRQ */

;
};

wlan_enable_pins: pinmux_wlan_enable_pins {
pinctrl-single,pins = <
0x2c (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpio0_27 WL_EN */

;
};

mmc2_pins: pinmux_mmc2_pins {
pinctrl-single,pins = <
0x3C (PIN_INPUT_PULLUP | MUX_MODE3) /* mmc2_dat3 /
0x38 (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_dat2 /
0x34 (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_dat1 /
0x30 (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_dat0 /
0x8c (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_clk /
0x88 (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_cmd */

;
};
};

&i2c2 {
pinctrl-names = “default”;
pinctrl-0 = <&i2c2_pins>;

status = “okay”;
clock-frequency = <100000>;

/* ODIN-W160 EEPROM */
eeprom@5D {
compatible = “at,24c64”;
reg = <0x5D>;
pagesize = <32>;
};
};

&mmc2 {
non-removable; /* TI specific feature /
bus-width = <4>;
cap-power-off-card; /
TI specific feature */
vmmc-supply = <&vwlan_en_reg>;
pinctrl-names = “default”;
pinctrl-0 = <&mmc2_pins &wlan_pins>;
status = “okay”;

#address-cells = <1>;
#size-cells = <0>;
wlcore: wlcore@0 {
compatible = “ti,wl1273”;
reg = <2>;
interrupt-parent = <&gpio0>;
interrupts = <26 0x4>;
ref-clock-frequency = <38400000>;
};
};

dmesg log:

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.1.3+ (dileep@ubuntu) (gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ) #2 SMP PREEMPT Tue Aug 18 16:54:12 IST 2015
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine model: TI AM335x BeagleBone Black
[ 0.000000] cma: Reserved 24 MiB at 0x9e000000
[ 0.000000] Memory policy: Data cache writeback
[ 0.000000] On node 0 totalpages: 130560
[ 0.000000] free_area_init_node: node 0, pgdat c0f4c700, node_mem_map df96d000
[ 0.000000] Normal zone: 1152 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 130560 pages, LIFO batch:31
[ 0.000000] CPU: All CPU(s) started in SVC mode.
[ 0.000000] AM335X ES2.1 (sgx neon )
[ 0.000000] PERCPU: Embedded 13 pages/cpu @df925000 s22336 r8192 d22720 u53248
[ 0.000000] pcpu-alloc: s22336 r8192 d22720 u53248 alloc=13*4096
[ 0.000000] pcpu-alloc: [0] 0
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 129408
[ 0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/nfs rw nfsroot=192.168.0.101:/home/dileep/BeagleBone/rootfs_debian ip=192.168.0.105:::::eth0
[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
[ 0.000000] Memory: 475580K/522240K available (10502K kernel code, 881K rwdata, 3680K rodata, 672K init, 901K bss, 22084K reserved, 24576K cma-reserved, 0K highmem)
[ 0.000000] Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xe0800000 - 0xff000000 ( 488 MB)
lowmem : 0xc0000000 - 0xe0000000 ( 512 MB)
pkmap : 0xbfe00000 - 0xc0000000 ( 2 MB)
modules : 0xbf000000 - 0xbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc0de1d40 (14184 kB)
.init : 0xc0de2000 - 0xc0e8a000 ( 672 kB)
.data : 0xc0e8a000 - 0xc0f6666c ( 882 kB)
.bss : 0xc0f69000 - 0xc104a648 ( 902 kB)
[ 0.000000] Preemptible hierarchical RCU implementation.
[ 0.000000] RCU dyntick-idle grace-period acceleration is enabled.
[ 0.000000] RCU restricting CPUs from NR_CPUS=2 to nr_cpu_ids=1.
[ 0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
[ 0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[ 0.000016] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[ 0.000040] clocksource timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[ 0.000054] OMAP clocksource: timer1 at 24000000 Hz
[ 0.000437] Console: colour dummy device 80x30
[ 0.000465] WARNING: Your ‘console=ttyO0’ has been replaced by ‘ttyS0’
[ 0.000474] This ensures that you still see kernel messages. Please
[ 0.000482] update your kernel commandline.
[ 0.000504] Calibrating delay loop… 996.14 BogoMIPS (lpj=4980736)
[ 0.088666] pid_max: default: 32768 minimum: 301
[ 0.088826] Security Framework initialized
[ 0.088911] AppArmor: AppArmor disabled by boot time parameter
[ 0.088921] Yama: becoming mindful.
[ 0.089140] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.089154] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[ 0.090088] Initializing cgroup subsys blkio
[ 0.090116] Initializing cgroup subsys memory
[ 0.090164] Initializing cgroup subsys devices
[ 0.090185] Initializing cgroup subsys freezer
[ 0.090213] Initializing cgroup subsys net_cls
[ 0.090231] Initializing cgroup subsys perf_event
[ 0.090249] Initializing cgroup subsys net_prio
[ 0.090309] CPU: Testing write buffer coherency: ok
[ 0.090373] ftrace: allocating 34337 entries in 101 pages
[ 0.185862] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[ 0.185994] Setting up static identity map for 0x80008280 - 0x800082d8
[ 0.238749] Brought up 1 CPUs
[ 0.238776] SMP: Total of 1 processors activated (996.14 BogoMIPS).
[ 0.238786] CPU: All CPU(s) started in SVC mode.
[ 0.239723] devtmpfs: initialized
[ 0.258431] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[ 0.280001] omap_hwmod: tptc0 using broken dt data from edma
[ 0.280242] omap_hwmod: tptc1 using broken dt data from edma
[ 0.280462] omap_hwmod: tptc2 using broken dt data from edma
[ 0.286479] omap_hwmod: debugss: _wait_target_disable failed
[ 0.341305] clocksource jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.343537] xor: measuring software checksum speed
[ 0.438761] arm4regs : 1218.400 MB/sec
[ 0.538693] 8regs : 1090.800 MB/sec
[ 0.638691] 32regs : 807.600 MB/sec
[ 0.738692] neon : 1662.000 MB/sec
[ 0.738702] xor: using function: neon (1662.000 MB/sec)
[ 0.738887] pinctrl core: initialized pinctrl subsystem
[ 0.740981] NET: Registered protocol family 16
[ 0.743658] DMA: preallocated 256 KiB pool for atomic coherent allocations
[ 0.749925] OMAP GPIO hardware version 0.1
[ 0.762640] No ATAGs?
[ 0.762674] hw-breakpoint: debug architecture 0x4 unsupported.
[ 0.764679] omap4_sram_init:Unable to allocate sram needed to handle errata I688
[ 0.764700] omap4_sram_init:Unable to get sram pool needed to handle errata I688
[ 0.968887] raid6: int32x1 gen() 205 MB/s
[ 1.138747] raid6: int32x1 xor() 165 MB/s
[ 1.308851] raid6: int32x2 gen() 241 MB/s
[ 1.478767] raid6: int32x2 xor() 188 MB/s
[ 1.648854] raid6: int32x4 gen() 234 MB/s
[ 1.818742] raid6: int32x4 xor() 162 MB/s
[ 1.988999] raid6: int32x8 gen() 183 MB/s
[ 2.158816] raid6: int32x8 xor() 117 MB/s
[ 2.328691] raid6: neonx1 gen() 1452 MB/s
[ 2.498720] raid6: neonx2 gen() 1864 MB/s
[ 2.668706] raid6: neonx4 gen() 785 MB/s
[ 2.838694] raid6: neonx8 gen() 321 MB/s
[ 2.838703] raid6: using algorithm neonx2 gen() 1864 MB/s
[ 2.838712] raid6: using intx1 recovery algorithm
[ 2.848426] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
[ 2.849484] reg-fixed-voltage regulator-vwlan-en: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_wlan_enable_pins, deferring probe
[ 2.852189] vgaarb: loaded
[ 2.852959] SCSI subsystem initialized
[ 2.853364] libata version 3.00 loaded.
[ 2.853752] usbcore: registered new interface driver usbfs
[ 2.853837] usbcore: registered new interface driver hub
[ 2.853949] usbcore: registered new device driver usb
[ 2.854623] omap_i2c 44e0b000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c0_pins, deferring probe
[ 2.854684] omap_i2c 4802a000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c1_pins, deferring probe
[ 2.854724] omap_i2c 4819c000.i2c: could not find pctldev for node /ocp/l4_wkup@44c00000/scm@210000/pinmux@800/pinmux_i2c2_pins, deferring probe
[ 2.854881] pps_core: LinuxPPS API ver. 1 registered

did you place t-connectivity directory to /lib/firmware?

I don’t see a wl12 boot message when the firmware is successfully loaded

Wl12xx will not support device tree. Need to find out other procedure to enable in some board init function

why not? this package enables wl12 for TI’s am335x EVMSK and uses the device tree
http://www.ti.com/tool/PROCESSOR-SDK-AM335X

Hi,
Which wilink device are you building for?
The wl18xx family is now fully supported in 4.1 kernel. There is a device tree file for the wl1835 cape in the kernel that is best place to look.
If you are looking at wl127x or wl128x then device tree will be similar but you'll need to build the Wi-Fi drivers out of tree.
For the wl1835 cape look at the ti processor wiki for a page to describe full build and configuration on 4.1 kernel.
Iain

Hi,
As a follow up I agree with the previous statement that wl127x drivers have no device tree support. So you’ll need to merge device tree support from wl18xx drivers. As far as I can remember there are no major changes to parameters passed by device tree to WiFi driver from wl127x to wl18xx. As long as you successfully pass the wl12xx probe function without an error you should be ok. Caveat is that I’ve not done this exercise.
Iain

Hi,

When i add wl12xx module, none of the functions from wl12xx and wlcore are getting called.

logs:
root@arm:~# modprobe wlcore_sdio
[ 48.682409]
[ 48.682409] ********** wl1271_init ************
[ 48.690385]
[ 48.690385] ********** sdio_register_driver ************
[ 48.708615]
[ 48.708615] ********** sdio_register_driver : wl1271_sdio ************
root@arm:~# modprobe wl12xx
[ 57.901415]
[ 57.901415] ********** Country : COUNTRY=00 *********
[ 57.908006] cfg80211: Calling CRDA to update world regulatory domain
[ 58.061324]
[ 58.061324] ********** ieee80211_init ************
[ 58.067658]
[ 58.067658] ********** ieee80211_init 1 ************
[ 58.076820]
[ 58.076820] ********** ieee80211_init 2 ************
[ 58.086826]
[ 58.086826] ********** ieee80211_init 3 ************
root@arm:~# [ 58.207791] cfg80211: World regulatory domain updated:
[ 58.213206] cfg80211: DFS Master region: unset
[ 58.217588] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
[ 58.229554] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 58.237609] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
[ 58.246721] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
[ 58.255431] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
[ 58.265659] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
[ 58.275796] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
[ 58.284697] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
[ 58.293341] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)

root@arm:~# lsmod
Module Size Used by
wl12xx 64379 0
wlcore 213095 1 wl12xx
mac80211 631232 2 wl12xx,wlcore
cfg80211 518978 2 mac80211,wlcore
rfkill 20618 1 cfg80211
wlcore_sdio 8050 0
snd_soc_evm 7798 0
omap_rng 5144 0
rng_core 8712 1 omap_rng
tilcdc 31000 0
snd_soc_tlv320aic32x4 16689 1
snd_soc_davinci_mcasp 18424 2
snd_soc_edma 1166 1 snd_soc_davinci_mcasp
uio_pdrv_genirq 3625 0
uio 9898 1 uio_pdrv_genirq
root@arm:~#

Did you use device tree in the end or modify a board.c?
If so that looks like the mmc port is not being probed correctly as it is not defined. You should at least get some activity on mmc to try and read the type of “sd card” on this bus. This should identify as a wl12xx and then load the drivers when you insmod wlcore_sdio
Iain

Hi lain,

I have configured MMC3 for SDIO communiction. but still sdio communication is not up.

If clock is not enabled by default for MMC3 how can it be done in device tree,

dmesg log shows:
[ 4.259093] omap_hsmmc 47810000.mmc: unable to get vmmc regulator -517

Device tree configurations.

wl12xx_vmmc: fixedregulator@2 {
pinctrl-names = “default”;
pinctrl-0 = <&wl12xx_gpio>;
compatible = “regulator-fixed”;
regulator-name = “vwl1271”;
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
gpio = <&gpio0 27 0>;
startup-delay-us = <70000>;
enable-active-high;
};

mmc3_pins: pinmux_mmc3_pins {
pinctrl-single,pins = <
0x3C (PIN_INPUT_PULLUP | MUX_MODE3) /* mmc2_dat3 /
0x38 (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_dat2 /
0x34 (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_dat1 /
0x30 (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_dat0 /
0x8c (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_clk /
0x88 (PIN_INPUT_PULLUP | MUX_MODE3) /
mmc2_cmd */

;
};

&mmc3 {
/* these are on the crossbar and are outlined in the
xbar-event-map element */
dmas = <&edma 32 &edma 33>;
dma-names = “tx”, “rx”;

status = “okay”;
vmmc-supply = <&wl12xx_vmmc>;
ti,non-removable;
bus-width = <4>;
cap-power-off-card;
pinctrl-names = “default”;
pinctrl-0 = <&mmc3_pins>;

#address-cells = <1>;
#size-cells = <0>;
wlcore: wlcore@2 {
compatible = “ti,wl1271”;
reg = <2>;
interrupt-parent = <&gpio0>;
interrupts = <26 0x4>; /* gpio 31 */
ref-clock-frequency = <38400000>;
};
};

&edma {
ti,edma-xbar-event-map = /bits/ 16 <1 32 2 33>;
};

Hi

This is not good. You have tried to start mmc3 but it failed to get a regulator, so may not have continued its initialisation - i don’t know how driver behaves in this case.
omap_hsmmc 47810000.mmc: unable to get vmmc regulator -517

So suggestion would be to trace omap_hsmmc driver to understand why it fails to get a regulator.
Iain

Enable dummy regulators in the kernel

Hi Dileep,

I am also trying to bring up wl12xx based on BBB kernel. Is there any update on this ?

Do we need to use &mmc2 or & mmc3 ?

Thanks & Regard
Raghu Ramaraj

Hi Raghu,

you should use &mmc3.

Because of other work, currently we are not working on that. still we need to debug SDIO communication on hardware line.

Regards,
Dileep