I have a wl1271 module connected to an OMAP 4430
When using the wl12xx driver with this module I get the following error
"chip id doesn't match after firmware boot"
a Google search seem to associate this with Power Management issues
In my case the WL_EN pin on the wl1271 module is always enabled
Has anyone been able to run the wl12xx driver (I am using version 2.6.38 on Ubuntu) when power management is not used????
(or is this error message caused by something else)
thanks
Bernard
Hi Bernard,
Are you using omappedia OMAP4 versions? These version already setup the sequence order, which is the other way around. First the WLAN driver is being loaded -> toggle the WLAN_EN -> Inject the SDIO driver.
The SDIO shouldn't be loaded before that. See "carddetection" feature in the kernel (TIWLAN_SDIO_CONFIG)
- Elad.
- Elad Raz
CTO
www.integrity-project.com
The sequence is correct except that as I said, WLAN_EN is always enabled on our system
When I do "ifconfig wlan0 up" I get the following trace (I added some printk to see what is going in more details)
[ 1008.992584] DBG> wl1271_op_start [ 1008.992584] DBG> wl1271_op_add_interface [ 1008.992614] DBG> wl1271_chip_wakeup [ 1009.017944] DBG> wl1271_sdio_set_power [ 1009.017974] DBG> wl1271_sdio_power_on (st 0) [ 1009.017974] iCORAL icoral_set_ios : clk (25000000) vdd (0x14) pwr (1) bus (0) [ 1009.074432] DBG> wl1271_sdio_power_on power restore (ret 0) [ 1009.283538] DBG> wl1271_sdio_init [ 1009.284088] DBG> wl1271_fw_wakeup [ 1009.284118] DBG> wl1271_setup [ 1009.284149] DBG> wl1271_fetch_firmware [ 1009.309661] DBG> wl1271_fetch_nvs (code 0) [ 1009.309692] DBG> wl1271_fetch_nvs (fw size 912)
[ 1010.372955] DBG > wl1271_boot_run_firmware chip id 0x10101 vs wl.chip.id 0x4030111[ 1010.372955] wl1271: ERROR chip id doesn't match after firmware bootthanks for your help
intersting. The chip ID is the first SDIO command that is read from the chip. The command is read using SDSIO CMD 52 (1 byte read).
It's look like that we area reading "01" value 3 times, hence the result.
Can you debug the SDIO and see if the sdio_sync_read() works?
it is a bit strange since this is the reading of the CHIP ID in wl1271_fetch_formware
A lot of CMD 52 & 53 have taken palce before this read with no apparent errors (the chip is recognized properly as a wl1271 , etc.)
Also a quick search of the Internet has showed other people having similar problems ... but with no clear solution to the problem
The CHIP is is reading a value from the HW. (Using CMD 52)
It can be read before FW download and after FW boot.
But, the FW boot started with "partition" command, which changes the memory layout of the chip.
I'm not sure which NLCP version you have, but can you look for all the "read-chip-id" (Just grep CHIP_ID_B) and see their values?
If the value is wrongly read after "partition", please send me the exact hw-address of CMD 52
I am using compat-wireless version 3.2
The CHIP_ID_B is read properly in wl1271_chip_wakeup & wl1271_load_firmware
but when it reaches wl1271_boot_run_firmware it gets the wrong value (or maybe partial value)
I am a bit puzzled at the address translation process ...
Here is the trace
thanks for the help
[ 409.601715] DBG> wl1271_op_start [ 409.601745] DBG> wl1271_op_add_interface [ 409.601745] DBG> wl1271_chip_wakeup [ 409.893829] DBG> wl1271_fw_wakeup [ 409.893859] DBG> wl1271_read32 [ 409.893859] addr 0x305674 translates to 0x5674 [ 409.893890] DBG> wl1271_chip_wakeup CHIP ID = 0x4030111 [ 409.893890] DBG> wl1271_setup [ 409.893890] DBG> wl1271_fetch_firmware [ 409.922302] DBG> wl1271_load_firmware [ 409.926727] DBG> wl1271_read32 [ 409.926727] addr 0x305674 translates to 0x1a634 [ 409.926757] DBG> wl1271_load_firmware CHIP ID = 0x4030111 [ 410.089477] DBG> wl1271_boot_run_firmware [ 410.089569] DBG> wl1271_read32 [ 410.089569] addr 0x305674 translates to 0x1ce34 [ 410.089599] iCORAL req opcode=53 arg:0x279c6804 read >> 0x0 0x0 0x11 0x1 -----[ 410.089630] DBG> wl1271_boot_run_firmware CHIP ID = 0x1110000 [ 410.089630] DBG> wl1271_boot_run_firmware chip id 0x1110000 vs wl.chipid 0x4030111 [ 410.089630] wl1271: ERROR chip id doesn't match after firmware boot
A partition process is dividing the chip's memory for SDIO transaction. It also affects registers address.
Why don't you move to the latest R4 in the git?
I am currently using compat-wireless-3.2-rc6.3
from http://linuxwireless.org/en/users/Download/stable#compat-wireless_3.2_stable_releases
Is R4 more recent?
One thing that I am wondering is if the fact that my card is always powered ON and always enabled has an impact on the Initialization of the state machine in the WL1271?
When I compare the calls to the wl12xx driver for a bulit-in wl1271 (working) module and my external wl1271 (non-working) card
- the sequence of wl1271 function calls is the same up-to my CHIP ID problem
- the translated addresses are the same in both cases, so it looks like I am reading the right region
The latest code can be found in the git. R4 is the latest, soon is about to be release the R5 (as far as I know).
I think that the fact that the WLAN_EN is always ON is making you these type of troubles.
Be able to toggle the WLAN_EN for reset (or recovery) is important.
I don't have your full logs, but maybe the WLAN driver try to reset the chip and changes his state machine as if the partition table was converted back to default. And this is why the chip-id have different values in it.
It's not such a big design change to just connect the WLAN_EN to a GPIO...
Elad.
Unfortunately, connecting WLAN_EN to a GPIO to be able to toggle it has not solved my problem (see trace below)
The first 2 read of CHIP_ID_B are good
and the one in wl1271_boot_run_firmware fails ...
Note that power management is disabled - could it be part of the problem? has anyone run the wl12xx with power management turned off?
[ 209.847839] DBG> wl1271_op_start[ 209.847869] DBG> wl1271_op_add_interface[ 209.847869] DBG> wl1271_chip_wakeup[ 209.877838] DBG> wl1271_sdio_power_on[ 210.143920] DBG> wl1271_fw_wakeup[ 210.143951] DBG> wl1271_read32[ 210.143951] addr 0x305674 translates to 0x5674[ 210.143981] DBG> wl1271_chip_wakeup CHIP ID = 0x4030111[ 210.143981] DBG> wl1271_setup[ 210.143981] DBG> wl1271_fetch_firmware[ 210.171905] DBG> wl1271_load_firmware[ 210.176727] DBG> wl1271_read32[ 210.176727] addr 0x305674 translates to 0x1a634[ 210.176757] DBG> wl1271_load_firmware CHIP ID = 0x4030111[ 210.337738] DBG> wl1271_boot_run_firmware[ 210.337829] DBG> wl1271_read32[ 210.337829] addr 0x305674 translates to 0x1ce34[ 210.337890] DBG> wl1271_boot_run_firmware CHIP ID = 0x1110000[ 210.337951] DBG> wl1271_boot_run_firmware chip id 0x1110000 vs wl.chipid 0x4030111[ 210.337951] wl1271: ERROR chip id doesn't match after fiwl1271_load_firmware CHIP ID = 0x4030111 rmware boot
I don't think that the power management has any effects (Enterting to ELP shouldn't change HW register reads), I still thinks that the "partition" command changes the register maps. (Maybe old driver) Can you put trace on the partition command as well?
Here is a trace with some info about calls to wl1271_set_partition:
[ 249.885498] DBG> wl1271_set_partition reg_start 00300000 reg_size 00008800 mem_size 00000000[ 249.886016] DBG> wl1271_fw_wakeup [ 249.886047] DBG> wl1271_read32 [ 249.886047] addr 0x305674 translates to 0x5674 [ 249.886077] DBG> wl1271_chip_wakeup CHIP ID = 0x4030111 [ 249.886077] DBG> wl1271_setup [ 249.886077] DBG> wl1271_fetch_firmware [ 249.924285] DBG> wl1271_load_firmware [ 249.926422] DBG> wl1271_set_partition reg_start 00310000 reg_size 00006000 mem_size 00014FC0[ 249.927032] DBG> wl1271_set_partition reg_start 00300000 reg_size 0000A000 mem_size 00014FC0[ 249.928039] DBG> wl1271_set_partition reg_start 00300000 reg_size 0000A000 mem_size 00014FC0[ 249.928741] DBG> wl1271_read32 [ 249.928771] addr 0x305674 translates to 0x1a634 [ 249.928771] DBG> wl1271_load_firmware CHIP ID = 0x4030111 [ 249.928802] DBG> wl1271_set_partition reg_start 00300000 reg_size 00008800 mem_size 000177C0<many more calls deleted from trace (all the same for reg_start, reg_size, mem_size) ...>[ 250.111755] DBG> wl1271_set_partition reg_start 00300000 reg_size 00008800 mem_size 000177C0[ 250.114196] DBG> wl1271_boot_run_firmware [ 250.114288] DBG> wl1271_read32 [ 250.114288] addr 0x305674 translates to 0x1ce34 [ 250.114349] DBG> wl1271_boot_run_firmware CHIP ID = 0x1110000 [ 250.114410] DBG> wl1271_boot_run_firmware chip id 0x1110000 vs wl.chipid 0x4030111 [ 250.114410] wl1271: ERROR chip id doesn't match after firmware boot[ 250.114440] DBG> wl1271_sdio_power_off
Just to close on my issue in case people run into the same problem
- my problem was due to a quirk in the SDIO core we are using(It was reading 8B when I was asking for 4B in an SDIO cmd 53)
once this issue was resolved I ran into another problem
I was getting "ELP wakeup timeout" error
and this was due to the fact that my GPIO pin was not set properly to get the interrupt
I could verify using /proc/interrupts that I was not getting the interrupts
thanks Elad for your suggestions