Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: AT91sam9 SDIO WiFi not working
PostPosted: Mon Jul 11, 2011 4:36 pm 
Offline

Joined: Sun Apr 17, 2011 5:44 pm
Posts: 11
Hi,

We are trying to run SDIO WiFI with a board based on AT91sam9g45EK, we are following instructs from http://www.at91.com/linux4sam/bin/view/ ... ll_88w8686

Our configuration and firmware files are apparently ok but now we have got this erro:

root@buildroot:~# modprobe libertas
root@buildroot:~# modprobe libertas_sdio.ko helper_name=sd8686_v8_helper.bin fw_
name=sd8686_v8.bin
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
libertas: failed to load helper firmware
mmc_host mmc0: WARNING: IMR=0xc0600000
mmc_host mmc0: WARNING: IMR=0xc0600000
mmc_host mmc0: WARNING: IMR=0xc0600000
mmc_host mmc0: WARNING: IMR=0xc0600000
libertas_sdio: probe of mmc0:0001:1 failed with error -84

Is there some problem with IRQ at host? What is happen to show this error?

Thanks,
Paulo.


Top
 Profile  
 
 Post subject: Re: AT91sam9 SDIO WiFi not working
PostPosted: Mon Jul 11, 2011 4:47 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
>>libertas: failed to load helper firmware

Make sure the bin files are in /lib/firmware/


Top
 Profile  
 
 Post subject: Re: AT91sam9 SDIO WiFi not working
PostPosted: Tue Jul 12, 2011 2:40 pm 
Offline

Joined: Sun Apr 17, 2011 5:44 pm
Posts: 11
[quote="CptTitanic"]>>libertas: failed to load helper firmware

Make sure the bin files are in /lib/firmware/[/quote]

Yes, they are:

root@buildroot:/lib/firmware# ls -l
total 416
-rw------- 1 root root 122916 Oct 10 06:16 sd8686.bin
-rw------- 1 root root 2464 Oct 10 06:20 sd8686_helper.bin
-rw------- 1 root root 122800 Oct 10 06:16 sd8686_v8.bin
-rw------- 1 root root 2464 Oct 10 06:16 sd8686_v8_helper.bin
-rw------- 1 root root 124188 Oct 10 06:16 sd8686_v9.bin
-rw------- 1 root root 2516 Oct 10 06:16 sd8686_v9_helper.bin
root@buildroot:/lib/firmware# modprobe libertas
root@buildroot:/lib/firmware# modprobe libertas_sdio.ko helper_name=sd8686_v8_he
lper.bin fw_name=sd8686_v8.bin
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
libertas: failed to load helper firmware
mmc_host mmc0: WARNING: IMR=0xc0600000
mmc_host mmc0: WARNING: IMR=0xc0600000
mmc_host mmc0: WARNING: IMR=0xc0600000
mmc_host mmc0: WARNING: IMR=0xc0600000
libertas_sdio: probe of mmc0:0001:1 failed with error -84
root@buildroot:/lib/firmware# mmc_host mmc0: WARNING: IMR=0xc0600000


Top
 Profile  
 
 Post subject: Re: AT91sam9 SDIO WiFi not working
PostPosted: Tue Jul 12, 2011 4:36 pm 
Offline

Joined: Sun Apr 17, 2011 5:44 pm
Posts: 11
When is specified whole path for firmware different error code is showed:

root@buildroot:~# modprobe libertas
root@buildroot:~# modprobe libertas_sdio.ko helper_name=/lib/firmware/sd8686_v8_
helper.bin fw_name=/lib/firmware/sd8686_v8.bin
libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
libertas: can't load helper firmware
libertas: failed to load helper firmware
libertas_sdio: probe of mmc0:0001:1 failed with error -2

What does mean error code -2 and -84?


Top
 Profile  
 
 Post subject: Re: AT91sam9 SDIO WiFi not working
PostPosted: Tue Jul 12, 2011 5:24 pm 
Offline

Joined: Sat Oct 30, 2010 6:04 pm
Posts: 574
The example has "" around the bin name.

There is also this
http://lkml.indiana.edu/hypermail/linux ... 00930.html


Top
 Profile  
 
 Post subject: Re: AT91sam9 SDIO WiFi not working
PostPosted: Mon Jul 18, 2011 2:46 pm 
Offline

Joined: Thu Jan 06, 2011 11:13 am
Posts: 31
Hello,

I am facing the same problem as yours and I am trying to solve it but without success for the moment.

Have you solved your problem ?

Regards,

Ludovic


Top
 Profile  
 
 Post subject: Re: AT91sam9 SDIO WiFi not working
PostPosted: Mon Jul 18, 2011 4:18 pm 
Offline

Joined: Thu Jan 06, 2011 11:13 am
Posts: 31
I think the problem may be in relation with udev because:


root@at91sam9g20ek:~# insmod libertas.ko libertas_debug=0x5063a7
[ 28.950000] libertas enter: lbs_init_module()
[ 28.950000] libertas leave: lbs_init_module()
root@at91sam9g20ek:~# insmod libertas_sdio.ko
[ 37.590000] libertas enter: if_sdio_init_module()
[ 37.600000] libertas_sdio: Libertas SDIO driver
[ 37.600000] libertas_sdio: Copyright Pierre Ossman
[ 37.600000] libertas leave: if_sdio_init_module(), ret 0
root@at91sam9g20ek:~# [ 45.780000] mmc1: new SDIO card at address 0001
[ 45.790000] libertas enter: if_sdio_probe()
[ 45.790000] libertas sdio: class = 0x7, vendor = 0x2DF, device = 0x9103, model = 0xB, ioport = 0x10000
[ 45.800000] libertas enter: if_sdio_prog_firmware()
[ 45.820000] libertas sdio: firmware status = 0x0
[ 45.820000] libertas sdio: scratch ret = 0
[ 45.860000] libertas_sdio mmc1:0001:1: try helper: libertas/sd8686_v9_helper.bin
[ 45.910000] libertas_sdio mmc1:0001:1: try helper: libertas/sd8686_v8_helper.bin
[ 45.960000] libertas_sdio mmc1:0001:1: try helper: sd8686_helper.bin
[ 45.970000] libertas_sdio: failed to find firmware (-2)
[ 45.970000] libertas leave: if_sdio_prog_firmware(), ret -2
[ 46.030000] libertas leave: if_sdio_probe(), ret -2
[ 46.030000] libertas_sdio: probe of mmc1:0001:1 failed with error -2


When the driver calls the request_firmware interface an uevent is sent to udev which has to copy the firmware into the sysfs. The /lib/udev/firmware.sh script should be executed



root@at91sam9g20ek:~# cat /lib/udev/firmware.sh
#!/bin/sh -e

FIRMWARE_DIRS="/lib/firmware /usr/local/lib/firmware"

err() {
echo "$@" >&2
logger -t "${0##*/}[$$]" "$@" 2>/dev/null || true
}

if [ ! -e /sys$DEVPATH/loading ]; then
err "udev firmware loader misses sysfs directory"
exit 1
fi

for DIR in $FIRMWARE_DIRS; do
[ -e "$DIR/$FIRMWARE" ] || continue
echo 1 > /sys$DEVPATH/loading
cat "$DIR/$FIRMWARE" > /sys$DEVPATH/data
echo 0 > /sys$DEVPATH/loading
exit 0
done

echo -1 > /sys$DEVPATH/loading
err "Cannot find firmware file '$FIRMWARE'"
exit 1


So if my file is into /lib/firmware it will be ok:


root@at91sam9g20ek:~# ls -l /lib/firmware/sd8686_helper.bin


It's the case but it doesn't work. I think a rule is missing. I am not a udev guru, I have tried to add this but the behavior is still the same.


root@at91sam9g20ek:~# cat /etc/udev/rules.d/50-firmware.rules
SUBSYSTEM=="firmware", ACTION=="add", RUN+="/lib/udev/firmware.sh"


Regards,

Ludovic


Top
 Profile  
 
 Post subject: Re: AT91sam9 SDIO WiFi not working
PostPosted: Mon Jul 18, 2011 4:39 pm 
Offline

Joined: Thu Jan 06, 2011 11:13 am
Posts: 31
In progress !

Don't take care of 50-firmware.rules which is already into 50-udev-default-rules.

The problem is not about the firmware but about sysfs:



[1381] run_program: '/lib/udev/firmware.sh' (stdout) 'DEVPATH:'
[1381] run_program: '/lib/udev/firmware.sh' (stdout) '/devices/platform/atmel_mci/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/firmware/mmc1:0001:1'
[1381] run_program: '/lib/udev/firmware.sh' (stderr) 'udev firmware loader misses sysfs directory'

I have added the two first lines into firmware.sh


Top
 Profile  
 
 Post subject: Re: AT91sam9 SDIO WiFi not working
PostPosted: Tue Jul 19, 2011 2:19 pm 
Offline

Joined: Thu Jan 06, 2011 11:13 am
Posts: 31
Hello,

The problem probably comes from libertas driver. Without giving the firmware names as parameters to libertas_sdio, you may encounter the problem I have with sysfs.

I don't really know what happens but there is probably a bug because the driver is looking for several firmware names. For the first one is looking for the firmware sysfs entry is ok but after it disappeas so even if the firmware is found, it can be copied.

With helper_name and fw_name parameters it seems to be better. It works one time for me but after I have cleaned all the hacks I have added to debug this problem and it is no more working but it seems better than your situation:


root@at91sam9g20ek:~# [ 427.170000] mmc1: new SDIO card at address 0001
[ 427.180000] libertas enter: if_sdio_probe()
[ 427.180000] libertas sdio: class = 0x7, vendor = 0x2DF, device = 0x9103, model = 0xB, ioport = 0x10000
[ 427.190000] libertas enter: if_sdio_prog_firmware()
[ 427.210000] libertas sdio: firmware status = 0x0
[ 427.210000] libertas sdio: scratch ret = 0
[ 427.210000] libertas_sdio mmc1:0001:1: load user helper firmware: helper_sd.bin
[ 427.260000] libertas_sdio mmc1:0001:1: load user main firmware: sd8686.bin
[ 427.320000] libertas enter: if_sdio_prog_helper()
[ 427.510000] libertas sdio: waiting for helper to boot...
[ 427.510000] libertas leave: if_sdio_prog_helper(), ret 0
[ 427.520000] libertas sdio: Helper firmware loaded
[ 427.520000] libertas enter: if_sdio_prog_real()
[ 427.530000] libertas sdio: firmware size: 2516
[ 427.530000] libertas sdio: firmware wants 16 bytes
[ 427.530000] libertas sdio: sending 16 bytes (32 bytes) chunk
[ 427.550000] libertas sdio: firmware wants 17 bytes
[ 427.550000] libertas sdio: firmware helper signalled error
[ 427.560000] libertas_sdio: failed to load firmware
[ 427.560000] libertas leave: if_sdio_prog_real(), ret -5
[ 427.570000] libertas leave: if_sdio_prog_firmware(), ret -5
[ 427.570000] libertas leave: if_sdio_probe(), ret -5
[ 427.580000] libertas_sdio: probe of mmc1:0001:1 failed with error -5

It will be interesting that you give your logs with insmod libertas.ko libertas_debug=0x5063a7

After that, do the same test but restart udevd with -d --debug --trace-debug options.


Regards,

Ludovic


Top
 Profile  
 
 Post subject: Re: AT91sam9 SDIO WiFi not working
PostPosted: Tue Jul 19, 2011 4:36 pm 
Offline

Joined: Thu Jan 06, 2011 11:13 am
Posts: 31
Hello,

As attachment you will find a patch. I don't which version of the libertas driver you are using but the patch is based on linux-3.0-rc7 and it seems to be ok:

root@at91sam9g20ek:~# insmod libertas.ko
root@at91sam9g20ek:~# insmod libertas_sdio.ko helper_name="helper_sd.bin" fw_nam
e="sd8686.bin"
[ 28.130000] libertas_sdio: Libertas SDIO driver
[ 28.130000] libertas_sdio: Copyright Pierre Ossman
root@at91sam9g20ek:~# [ 31.950000] mmc1: new SDIO card at address 0001
[ 31.960000] libertas_sdio mmc1:0001:1: load user helper firmware: helper_sd.bin
[ 32.220000] libertas_sdio mmc1:0001:1: load user main firmware: sd8686.bin
[ 33.470000] libertas_sdio mmc1:0001:1: (unregistered net_device): 00:1a:6b:93:33:27, fw 9.70.3p24, cap 0x00000303
[ 33.490000] libertas_sdio mmc1:0001:1: wlan0: Marvell WLAN 802.11 adapter


I can't explain why I need this patch, it just comes from a feeling. I am trying to get more information about the subject.


Regards,

Ludovic



edit: attachment is rejected so the path is:

commit 53ad5481c1d659da920e950f47ae25cbfc288239
Author: Ludovic Desroches <ludovic.desroches@atmel.com>
Date: Tue Jul 19 15:52:26 2011 +0200

libertas: separate helper and main firmware request

Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>

diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c
index 224e985..01e530c 100644
--- a/drivers/net/wireless/libertas/if_sdio.c
+++ b/drivers/net/wireless/libertas/if_sdio.c
@@ -723,7 +723,7 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)
}

ret = lbs_get_firmware(&card->func->dev, lbs_helper_name, lbs_fw_name,
- card->model, &fw_table[0], &helper, &mainfw);
+ card->model, &fw_table[0], &helper, NULL);
if (ret) {
pr_err("failed to find firmware (%d)\n", ret);
goto out;
@@ -735,6 +735,10 @@ static int if_sdio_prog_firmware(struct if_sdio_card *card)

lbs_deb_sdio("Helper firmware loaded\n");

+ ret = lbs_get_firmware(&card->func->dev, lbs_helper_name, lbs_fw_name,
+ card->model, &fw_table[0], NULL, &mainfw);
+
+
ret = if_sdio_prog_real(card, mainfw);
if (ret)
goto out;
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 8c40949..b35ca07 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1075,11 +1075,9 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
const struct lbs_fw_table *iter;
int ret;

- BUG_ON(helper == NULL);
- BUG_ON(mainfw == NULL);
-
/* Try user-specified firmware first */
- if (user_helper) {
+ if (user_helper && helper) {
+ dev_info(dev, "load user helper firmware: %s\n", user_helper);
ret = request_firmware(helper, user_helper, dev);
if (ret) {
dev_err(dev, "couldn't find helper firmware %s\n",
@@ -1087,7 +1085,8 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
goto fail;
}
}
- if (user_mainfw) {
+ if (user_mainfw && mainfw) {
+ dev_info(dev, "load user main firmware: %s\n", user_mainfw);
ret = request_firmware(mainfw, user_mainfw, dev);
if (ret) {
dev_err(dev, "couldn't find main firmware %s\n",
@@ -1096,8 +1095,7 @@ int lbs_get_firmware(struct device *dev, const char *user_helper,
}
}

- if (*helper && *mainfw)
- return 0;
+ return 0;

/* Otherwise search for firmware to use. If neither the helper or
* the main firmware were specified by the user, then we need to


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: