Libertas with if_cs.c on ARM processor
Cyril HAENEL
chaenel at free.fr
Fri Jan 23 08:33:07 EST 2009
Ryan Mallon a écrit :
> Cyril HAENEL wrote:
>
>> Hi all,
>>
>> I am not sure I am on the right place, but I don't know where to ask my
>> question.
>>
>> I built a custom board based on the AT91SAM9260 ARM processor. My wifi
>> card is based on the marvell 8385 chip, and is connected to the
>> processor with compact flash bus.
>> The card is detected but the board freeze when I try to load the helper
>> in the card. The problem comes from the /WAIT signal, after some
>> read/write on the bus the 8385 put this signal low for ever, and the
>> processor wait for ever....
>>
>> I looked in detail on the scope, and I seen that the 8385 put the /wait
>> signal low when its chip selects CE1 and CE2 are not active !!
>> So I seen it puts the /wait signal low when /IORD and /IOWR are low.
>> Because /IORD and /IOWR are multiplexed with other signal on the
>> AT91SAM9260, it is possible these signals goes low simultaneously. It's
>> seems the 8385 is affected by this situation, even if it is not
>> chip-selected.
>>
>> Is someone have a 8385 cf module working on a AT91SAM926x board ? If
>> yes, how have you connected these signals ?
>>
>
> Hi,
>
> First off, I'm a software engineer, so forgive me if my explanation is a
> little off :-). We have the Marvell 8385 compact flash (Winstron Wifi
> module) working on an AT91SAM9260 based board. Our memory bus is 1.8v so
> there are buffers for the conversion from 3v3 on the compact flash
> signals and also pullups on the pc_wait_n, pc_rst, pc_reg and pc_rdy
> signals to 3v3.
>
> Also, check that your kernel is putting all of the pins in their correct
> alternative function mode for compact flash.
>
> ~Ryan
>
>
I added 2 logic gates between the processor and the 8385 to always have
/IORD and /IOWR high when the 8385 is not chip-selected. It works well now.
But I think I found a bug in the libertas driver :
In if_cs_probe, we have :
[...]
/* Load the firmware early, before calling into libertas.ko */
ret = if_cs_prog_helper(card);
if (ret == 0)
ret = if_cs_prog_real(card);
if (ret)
goto out2;
[...]
At the end of the if_cs_prog_real function we have :
[...]
ret = if_cs_poll_while_fw_download(card, IF_CS_SCRATCH, 0x5a);
if (ret < 0)
lbs_pr_err("firmware download failed\n");
err_release:
release_firmware(fw);
done:
lbs_deb_leave_args(LBS_DEB_CS, "ret %d", ret);
return ret;
In my case ret value is 28 because if_cs_poll_while_fw_download() takes
28 read loop to have IF_CS_SCRATCH register value equal to 0x5A.
But in if_cs_probe() function, 28 is considered as an error, and give me
on my console :
libertas_cs: probe of 0.0 failed with error 28
Regards
--
Cyril Haenel
Registered Linux User #332632
More information about the libertas-dev
mailing list