2008-12-01 08:00:12     uClinux firmware directory

Document created by Aaronwu Employee on Aug 8, 2013
Version 1Show Document
  • View in full screen mode

2008-12-01 08:00:12     uClinux firmware directory

Ammar Asi (PAKISTAN)

Message: 66077   

 

Hi,

 

I want to use wireless usb adapter tl-wn422g from tp-link on Blackfin Asterisk (IP-08). The driver for this adapter is zd1121 which is avaiable in uClinux kernel. I have enabled this driver, built a kernel image and written the image on IP-08.

 

However, the zd1121 driver provides a firmware which is to be copied in the firmware directory of the distribution. My question is what is the default firmware directory in uClinux? On desktop distributions it is usually /lib/firmware. But on uClinux, it is not reading that directory.

QuoteReplyEditDelete

 

 

2008-12-01 08:18:05     Re: uClinux firmware directory

Michael Hennerich (GERMANY)

Message: 66080   

 

It's also lib/firmware here - don't forget to enable Busybox:mdev: Support loading of firmwares

 

I would use Wifi USB Modules using the RALINK rt2x00 driver such as the DLINK DWL-G122.

 

The zd1121 driver is a pretty bad choice, since it generates unaligned exceptions.

The driver doesn't care about unaligned all over the place:

 

It does things like this:

 

int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length)

{

 

const struct rx_status *status;

 

status = (struct rx_status *)

(buffer + (length - sizeof(struct rx_status)));

 

if (status->frame_status ....

 

-

sizeof(struct rx_status) = 5

length can be anything

buffer might even be unaligned.

 

root:/> usb 1-1: new full speed USB device using sl811-hcd and address 2

usb 1-1: configuration #1 chosen from 1 choice

usb 1-1: reset full speed USB device using sl811-hcd and address 2

zd1211rw 1-1:1.0: phy0

usb 1-1: New USB device found, idVendor=1582, idProduct=6003

usb 1-1: New USB device strings: Mfr=16, Product=32, SerialNumber=0

usb 1-1: Product: USB2.0 WLAN

usb 1-1: Manufacturer: ZyDAS

 

root:/> iwconfig wlan0 essid dlink key s:12345

root:/> ifconfig wlan0 192.168.2.50 up

usb 1-1: firmware: requesting zd1211/zd1211b_ub

usb 1-1: firmware: requesting zd1211/zd1211b_uphr

zd1211rw 1-1:1.0: firmware version 4725

zd1211rw 1-1:1.0: zd1211b chip 1582:6003 v4810 full 00-11-f6 AL2230_RF pa0 ---NS

cfg80211: Calling CRDA for country: DE

root:/> Data access misaligned address violation

- Attempted misaligned data memory or data cache access.

Kernel OOPS in progress

Deferred Exception context

 

No Valid process in current context

return address: [0x000c6306]; contents of:

0x000c62e0: b130 3004 e3ff fc20 60f8 0806 1807 e14a

0x000c62f0: 0020 e10a bc20 9110 0040 e5a0 2a04 4818

0x000c6300: 1c3d e120 008c [9539] 5401 e122 0088 0810

0x000c6310: e120 0300 0202 5441 0801 0200 5982 0c06

 

SEQUENCER STATUS: Not tainted

SEQSTAT: 00060024 IPEND: 9030 SYSCFG: 0006

EXCAUSE : 0x24

physical IVG12 asserted : <0xffa00db8> { _evt_evt12 + 0x0 }

physical IVG15 asserted : <0xffa00dd0> { _evt_system_call + 0x0 }

logical irq 6 mapped : <0xffa00390> { _timer_interrupt + 0x0 }

logical irq 10 mapped : <0x000fe5b4> { _bfin_rtc_interrupt + 0x0 }

logical irq 16 mapped : <0x00100ccc> { _bfin_twi_interrupt_entry + 0x0 }

logical irq 18 mapped : <0x000ba02c> { _bfin_serial_dma_rx_int + 0x0 }

logical irq 19 mapped : <0x000b9d9c> { _bfin_serial_dma_tx_int + 0x0 }

logical irq 24 mapped : <0x000c3e88> { _bfin_mac_interrupt + 0x0 }

logical irq 42 mapped : <0x000a4de4> { _bfin_lq035q1_irq_error + 0x0 }

logical irq 54 mapped : <0x000ebb30> { _usb_hcd_irq + 0x0 }

RETE: <0x00000000> { _do_one_initcall + 0xfffff000 }

RETN: <0x00227d34> /* kernel dynamic memory */

RETX: <0x00000480> /* Maybe fixed code section */

RETS: <0x000c6226> { _zd_mac_rx + 0x8e }

PC : <0x000c6306> { _zd_mac_rx + 0x16e }

DCPLB_FAULT_ADDR: <0x031e2004> /* kernel dynamic memory */

ICPLB_FAULT_ADDR: <0x000c6306> { _zd_mac_rx + 0x16e }

 

PROCESSOR STATE:

R0 : 0000008c R1 : 000000d4 R2 : 0000000c R3 : 00000000

R4 : 037cc1a0 R5 : 000000df R6 : 00000000 R7 : 031e2000

P0 : 00000001 P1 : 00000090 P2 : 031e2000 P3 : 031e2000

P4 : 037ccd00 P5 : 031e20da FP : 031e2005 SP : 00227c58

LB0: ffa01820 LT0: ffa0181e LC0: 00000000

LB1: 00292b91 LT1: 00292b8a LC1: 00000000

B0 : 00000000 L0 : 00000000 M0 : 00000000 I0 : 03190000

B1 : 00000000 L1 : 00000000 M1 : 00000000 I1 : 00000000

B2 : 00000000 L2 : 00000000 M2 : 00000000 I2 : 00000000

B3 : 00000000 L3 : 00000000 M3 : 00000000 I3 : 00000000

A0.w: 000002c1 A0.x: 00000000 A1.w: 000002c1 A1.x: 00000000

USP : 00228000 ASTAT: 02002002

 

Hardware Trace:

0 Target : <0x000049ac> { _trap_c + 0x0 }

Source : <0xffa006fa> { _exception_to_level5 + 0x9e } CALL pcrel

1 Target : <0xffa0065c> { _exception_to_level5 + 0x0 }

Source : <0xffa004ee> { _bfin_return_from_exception + 0xe } RTX

2 Target : <0xffa004e0> { _bfin_return_from_exception + 0x0 }

Source : <0xffa005b2> { _ex_trap_c + 0x66 } JUMP.S

3 Target : <0xffa0054c> { _ex_trap_c + 0x0 }

Source : <0xffa00794> { _trap + 0x38 } JUMP (P4)

4 Target : <0xffa0077a> { _trap + 0x1e }

Source : <0xffa00776> { _trap + 0x1a } IF !CC JUMP

5 Target : <0xffa0075c> { _trap + 0x0 }

Source : <0x000c6302> { _zd_mac_rx + 0x16a } 0xe120

6 Target : <0x000c6302> { _zd_mac_rx + 0x16a }

Source : <0x000c6278> { _zd_mac_rx + 0xe0 } IF CC JUMP

7 Target : <0x000c625e> { _zd_mac_rx + 0xc6 }

Source : <0x000c623c> { _zd_mac_rx + 0xa4 } IF !CC JUMP

8 Target : <0x000c6236> { _zd_mac_rx + 0x9e }

Source : <0x000c624e> { _zd_mac_rx + 0xb6 } IF CC JUMP

9 Target : <0x000c6236> { _zd_mac_rx + 0x9e }

Source : <0x000c624e> { _zd_mac_rx + 0xb6 } IF CC JUMP

10 Target : <0x000c6236> { _zd_mac_rx + 0x9e }

Source : <0x000c624e> { _zd_mac_rx + 0xb6 } IF CC JUMP

11 Target : <0x000c6236> { _zd_mac_rx + 0x9e }

Source : <0x000c624e> { _zd_mac_rx + 0xb6 } IF CC JUMP

12 Target : <0x000c6236> { _zd_mac_rx + 0x9e }

Source : <0x000c624e> { _zd_mac_rx + 0xb6 } IF CC JUMP

13 Target : <0x000c6236> { _zd_mac_rx + 0x9e }

Source : <0x000c624e> { _zd_mac_rx + 0xb6 } IF CC JUMP

14 Target : <0x000c6236> { _zd_mac_rx + 0x9e }

Source : <0x000c624e> { _zd_mac_rx + 0xb6 } IF CC JUMP

15 Target : <0x000c6236> { _zd_mac_rx + 0x9e }

Source : <0x000c624e> { _zd_mac_rx + 0xb6 } IF CC JUMP

 

Kernel Stack

Stack info:

SP: [0x00227f58] <0x00227f58> /* kernel dynamic memory */

Memory from 0x00227f50 to 00228000

00227f50: 00000000 00000000 [00000000] 00000000 00000000 001f61b0 00228000 0020bc20

00227f70: ffa0025c 00226000 001f2e64 0020bc20 00226000 ffa00990 001f25c4 00000000

00227f90: 00000000 00000000 00000065 00000002 0000ffff 0000ffff 0000ffff ffa00990

00227fb0: 00000006 00000000 00000000 00000000 002286de 001fd92c 002424c4 001f25d0

00227fd0: 00000000 002424c4 001f2258 0000002b 002280a8 00244510 00228000 002362f2

00227ff0: 00000000 00000000 00000000 ffb00000 0090b060

Return addresses in stack:

Modules linked in: hid_tmff hid_zpff ff_memless

Kernel panic - not syncing: Kernel exception

 

QuoteReplyEditDelete

 

 

2008-12-01 11:34:40     Re: uClinux firmware directory

Mike Frysinger (UNITED STATES)

Message: 66091   

 

Linux does not read any firmware file.  that is left up to userspace.  udev is generally used on desktop systems where mdev is used on embedded systems.

 

please read the documentation:

http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:hotplug#firmware

QuoteReplyEditDelete

 

 

2008-12-02 02:49:38     Re: uClinux firmware directory

Ammar Asi (PAKISTAN)

Message: 66121   

 

I have enabled BusyBox->mdev but still it does not seem to recognize the firmware placed in /lib/firmware directory.

 

When I insert the usb adapter in the board, following lines appear on console:

 

root:~> usb 1-2: new full speed USB device using isp1362-hcd and address 2

usb 1-2: configuration #1 chosen from 1 choice

usb 1-2: Could not load firmware file zd1211/zd1211b_ub. Error number -2

zd1211rw 1-2:1.0: couldn't load firmware. Error number -2

usb 1-2: reset full speed USB device using isp1362-hcd and address 2

zd1211rw: probe of 1-2:1.0 failed with error -2

usb 1-2: device_add(1-2:1.0) --> -2

 

 

 

Also, an idea is to view the debugging log of zd1211 driver, since I also enabled debugging for this driver in menuconfig. Can you tell where these logs are saved.

QuoteReplyEditDelete

 

 

2008-12-02 02:54:45     Re: uClinux firmware directory

Mike Frysinger (UNITED STATES)

Message: 66123   

 

all kernel debugging is in the kernel.  so you have to read `dmesg`.

 

if you look up -2 in the errno db you'll see it means file not found.  so double check your kernel and busybox mdev settings according to the documentation.  otherwise you'll have to add wrapper scripts around the hotplug steps to get userspace logging ... as shown in the documentation.

QuoteReplyEditDelete

 

 

2008-12-02 04:07:01     Re: uClinux firmware directory

Ammar Asi (PAKISTAN)

Message: 66128   

 

Please explain wat u have said. I dont have good concepts about all these kernel related issues. Just I want to get the wireless card running on blackfin board.

 

All the documentation I have seen tells that firmware has to be placed in lib/firmware directory. I have done so but to no avail.

 

[QUOTE]otherwise you'll have to add wrapper scripts around the hotplug steps to get userspace logging ... as shown in the documentation[/QUOTE]

 

which documentation u are talking about?

 

I just want to know that which directory it is accessing.

QuoteReplyEditDelete

 

 

2008-12-02 04:10:46     Re: uClinux firmware directory

Mike Frysinger (UNITED STATES)

Message: 66129   

 

i already posted a link to our wiki that covers this topic

QuoteReplyEditDelete

 

 

2008-12-02 04:19:29     Re: uClinux firmware directory

Michael Hennerich (GERMANY)

Message: 66147   

 

usb 1-1: firmware: requesting zd1211/zd1211b_ub

usb 1-1: firmware: requesting zd1211/zd1211b_uphr

 

place the firmware into folder /lib/firmware/zd1211/

 

-Michael

Attachments

    Outcomes