Opened 5 years ago

Last modified 2 years ago

#13924 new defect

EEPROM contents possibly parsed wrongly for Atheros AR9287/AR9227

Reported by: sailer.aleks@… Owned by: developers
Priority: normal Milestone: Attitude Adjustment 12.09.1
Component: kernel Version: Attitude Adjustment 12.09
Keywords: ath9k EEPROM BIG_ENDIAN swab Atheros AR9287 AR9227 Cc:


I am trying to compile Attitude Adjustment 12.09.1 for a BT Home Hub 3a router. (Lantiq ARX168 / Atheros AR9227 (0x002d))

I am in trouble with activating of wifi interface. The problem is in EEPROM contents.
For r31084 I used an original EEPROM file from my unlocked router and a file taken from HH2b_4EVER project.
Both of them are swapped (Atheros EEPROM MAGIC = 0xa55a). Both worked fine with r31084.
Now (AA 12.09.1 and current Trunk) I receive error "both bands are disabled".
I've found that opCapFlags=0 and conjectured that a native format (Atheros EEPROM MAGIC = 0x5aa5) was expected.
Just because of curiosity I replaced opCapFlags (byte 0x106 in EEPROM file) to 0x16 (2G only) and recalculated checksum.
Unexpectedly ath9k started with the only error "bad mac address" (it was swapped).
/sys/kernel/debug/ieee80211/phy0/ath9k/modal_eeprom and base_eeprom files looked very strange. Some fields (Versions, RegDomain) were normal but most of other were swapped. wifi worked but Tx power was dramatically weak.

I converted my file to a native format (0x5aa5) and received an error "ath: phy0: Bad EEPROM checksum 0xffff or revision 0x0000".
Remembering my strange base_eeprom file I swapped the field "Version" (offset 0x104,0x105) in my EEPROM file back and avoided this error.
The next error was "invalid EEPROM data". I swapped regDmn[2].
The router started without any errors but Tx power was still weak. Thanks to modal_eeprom and base_eeprom files I found the only wrong parsed field within base_epp_header and modal_epp_header was antCtrlCommon.
I swapped it (swab32) and Tx power increased.

Now my router looks working. But contents of EEPROM is irregular. The file is in 0x5aa5 format but fields U16 version, U16 regDmn[2] are in 0xa55a format, U32 antCtrlCommon - swab32 .
I've no idea how correctly structures outside base and modal headers are parsed.

Attachments (1)

ath9k-eeprom.bin (4.0 KB) - added by sailer.aleks@… 5 years ago.
EEPROM in 0xa55a format

Download all attachments as: .zip

Change History (3)

Changed 5 years ago by sailer.aleks@…

EEPROM in 0xa55a format

comment:2 Changed 2 years ago by anonymous

this is fixed with r48247 which contains (some devices with broken EEPROM also need r48438).

Add Comment

Modify Ticket

as new .

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.