Modify

Opened 5 years ago

Closed 2 years ago

#10741 closed enhancement (fixed)

bcm63xx: new board HW556

Reported by: danitool <dgcbueu@…> Owned by: florian
Priority: normal Milestone: Chaos Calmer 15.05
Component: kernel Version: Trunk
Keywords: bcm63xx HW556 art ath_data ath9k Cc:

Description

It's a huawei hg556a.
Details about this router here: http://wiki.openwrt.org/toh/huawei/hg556a

This board has an onboard Atheros AR9223 wifi. The calibration data lives in the flash chip of the board like the WAG160NV2 router and probably other routers.

I've made the patch based on the someone's posted elsewhere. Obviously this patch cannot be merged into the Openwrt trunk (the partitions are slightly hardcoded into the bcm63xx flash driver).

It must be considered just a draft if you want to add support for this router. Btw, with this patch the router works quite fine.

bootlog with openwrt working:
http://pastebin.com/KSRX7417

Notes:

- The board is branded with two different flash-chips (MX29GL128EH and MX29LV128DB). That's because we'll need to choose between two different offsets where the calibration data is located (a conditional is needed based on the chip ID)

- The MX29LV128DB is partitioned wrongly, this is because I needed to hardcode: master->erasesize = 0x20000

Patch made against r29606.

Please comment on any additional suggestions.

Attachments (5)

bcm63xx_hg556a.patch (12.7 KB) - added by danitool <dgcbueu@…> 5 years ago.
bcm63xx_hg556a.2.patch (13.2 KB) - added by danitool <dgcbueu@…> 5 years ago.
hw556_svn_all.patch (13.7 KB) - added by noltari@… 4 years ago.
Patches v3 (Supports atheros and ralink)
rt3062_eeprom.zip (1.0 KB) - added by noltari@… 4 years ago.
Ralink eeprom firmware.
hw556_svn_all.2.patch (15.4 KB) - added by noltari@… 4 years ago.
Patches v3 (Supports atheros and ralink). Avoids removing caldata on any device.

Download all attachments as: .zip

Change History (17)

Changed 5 years ago by danitool <dgcbueu@…>

comment:1 Changed 5 years ago by danitool <dgcbueu@…>

I've made the patch again with minor changes. The atheros calibration data now is detected for all known flash chips (two addresses hardcoded).

++	unsigned int BCM96358_ATH_DATA_ADDR = 0x1EEFE000; 
++	u8 *artva;
++	const ushort cal_data0 = 0xa55a;
++
++	artva = (u8 *)KSEG1ADDR(BCM96358_ATH_DATA_ADDR);
++	if (memcmp(artva, &cal_data0, 2) != 0) {
++		printk("cal_data0 = 0x%x%x ≠ 0xa55a\n", artva[0], artva[1]);
++		BCM96358_ATH_DATA_ADDR = 0x1EF7E000;
++		}

The patch brakes other bcm63xx boards, due flash map driver, I don't know what is the best approach to solve it. But at least it works without problems in this particular router.

This time the patch should work for people who wants to use it for installing Openwrt in the hg556a. And thats's because I've sent the patch again spite still can't be merged.

Changed 5 years ago by danitool <dgcbueu@…>

comment:2 Changed 5 years ago by swalker

  • Owner changed from developers to florian
  • Status changed from new to assigned

comment:3 Changed 5 years ago by andrew@…

Hi,

I'm trying to build this patch in to trunk and I'm getting the following error:

Applying ./patches/hg556a_athinit.patch using plaintext: 
patching file drivers/net/wireless/ath/ath9k/init.c
Hunk #1 FAILED at 526.
1 out of 1 hunk FAILED -- saving rejects to file drivers/net/wireless/ath/ath9k/init.c.rej
Patch failed!  Please fix ./patches/hg556a_athinit.patch!
make[3]: *** [/home/andrew/OpenWrt/build/tip/trunk/build_dir/linux-brcm47xx/compat-wireless-2012-04-17/.prepared_fb29fef3772f3acbdbb32569c6ff5fcc] Error 1
make[3]: Leaving directory `/home/andrew/OpenWrt/build/tip/trunk/package/mac80211'
make[2]: *** [package/mac80211/compile] Error 2
make[2]: Leaving directory `/home/andrew/OpenWrt/build/tip/trunk'
make[1]: *** [/home/andrew/OpenWrt/build/tip/trunk/staging_dir/target-mipsel_uClibc-0.9.33/stamp/.package_compile] Error 2
make[1]: Leaving directory `/home/andrew/OpenWrt/build/tip/trunk'
make: *** [world] Error 2

Any ideas?

Regards

Andrew

comment:4 Changed 5 years ago by danitool <dgcbueu@…>

comment:5 Changed 5 years ago by faithy

Hello,

Has anybody got patch for backfire version 31839 please? I tried to modify existing one but there are major changes since first patch as I saw that.

Thank you in advance!

Regards,
Krisztian

comment:6 Changed 5 years ago by florian

Your patch, in particular the ath9k look really hackish, please make it work with what's currently in trunk.

Changed 4 years ago by noltari@…

Patches v3 (Supports atheros and ralink)

Changed 4 years ago by noltari@…

Ralink eeprom firmware.

Changed 4 years ago by noltari@…

Patches v3 (Supports atheros and ralink). Avoids removing caldata on any device.

comment:7 Changed 4 years ago by anonymous

嘻嘻嘻

comment:8 Changed 4 years ago by jogo

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker (trunk)
  • Resolution set to fixed
  • Status changed from assigned to closed

HG556 support was added to trunk in r35011.

comment:9 Changed 4 years ago by router7

  • Resolution fixed deleted
  • Status changed from closed to reopened

I recompiled the trunk r35362 for HW556a and the network is down on startup, there is no file /etc/config/network, some other minor issues:

awk: /proc/cpuinfo: No such file or directory
[ 38.624000] ath: phy0: eeprom contains invalid mac address: ff:ff:ff:ff:ff:ff

some relevant information I gathered from the serial console:

@w45260flipCFIGeometry:0
Parallel flash device: name MX29LV128DB, id 0x227a, size 16384KB
* GetHG556aBoardVersion = <0> *

...

[ 0.000000] CPU revision is: 0002a010 (Broadcom BMIPS4350)
[ 0.000000] board_bcm963xx: board name: HW556_B

...

[ 0.372000] 0x000000000000-0x000000020000 : "CFE"
[ 0.380000] 0x000000020100-0x000000120000 : "kernel"
[ 0.384000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[ 0.400000] 0x000000120000-0x000000f70000 : "rootfs"
[ 0.412000] mtd: partition "rootfs" set to be root filesystem
[ 0.416000] mtd: partition "rootfs_data" created automatically, ofs=370000, len=C00000
[ 0.424000] 0x000000370000-0x000000f70000 : "rootfs_data"
[ 0.436000] 0x000000f70000-0x000000f80000 : "cal_data"
[ 0.444000] 0x000000ff0000-0x000001000000 : "nvram"
[ 0.452000] 0x000000020000-0x000000f70000 : "linux"
...

[ 0.492000] b53_common: found switch: BCM5325, rev 0
[ 0.496000] bcm63xx_enet bcm63xx_enet.1: attached PHY at address 0 [Broadcom B53 (1)]
[ 0.508000] bcm63xx-wdt bcm63xx-wdt: started, timer margin: 30 sec
[ 0.520000] TCP: cubic registered
[ 0.524000] NET: Registered protocol family 17
[ 0.532000] 8021q: 802.1Q VLAN Support v1.8
[ 0.548000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
[ 0.560000] Freeing unused kernel memory: 212k freed
awk: /proc/cpuinfo: No such file or directory
[ 4.616000] eth0: link UP - 100/full - flow control off
...

[ 38.624000] ath: phy0: eeprom contains invalid mac address: ff:ff:ff:ff:ff:ff
[ 38.632000] ath: phy0: random mac address will be used: e2:b6:5c:70:4f:77
[ 38.656000] ieee80211 phy0: Atheros AR9280 Rev:2 mem=0xc0400000, irq=39
...

[ 13.124000] hub 1-1:1.0: 2 ports detected
switching to jffs2

  • init -

[ 34.112000] eth0: link DOWN

Please press Enter to activate this console. [ 36.484000] Compat-drivers backport release: compat-drivers-2013-01-08-3
[ 36.488000] Backport based on wireless-testing.git master-2013-01-07

...

root@OpenWrt:/# ls -l /etc/config/
-rw-r--r-- 1 root root 885 Jan 28 2013 dhcp
-rw-r--r-- 1 root root 134 Jan 28 2013 dropbear
-rw-r--r-- 1 root root 862 Jan 28 2013 etherwake
-rw-r--r-- 1 root root 4244 Jan 28 2013 firewall
-rw-r--r-- 1 root root 335 Jan 28 2013 fstab
-rw-r--r-- 1 root root 566 Sep 10 2009 luci
-rw-r--r-- 1 root root 1773 Jan 28 2013 qos
-rw-r--r-- 1 root root 251 Jan 28 2013 system
-rw-r--r-- 1 root root 680 Feb 20 2011 ucitrack
-rw-r--r-- 1 root root 2407 Jan 28 2013 uhttpd

comment:10 Changed 4 years ago by router7

It's a bit weird but you need to enable Kernel modules -> Wireless drivers -> kmod-brcmfmac (Broadcom IEEE802.11n USB FullMAC WLAN driver) to make it work.

eth0 gets the MAC address given by the CFE (base MAC address) and the wlan the base MAC address + 1, it never uses the random MAC address (which is good ;)

[ 38.624000] ath: phy0: eeprom contains invalid mac address: ff:ff:ff:ff:ff:ff
[ 38.632000] ath: phy0: random mac address will be used: e2:b6:5c:70:4f:77

so you don't need to get it from the eeprom.

comment:11 Changed 4 years ago by swlepus

this maybe not CFE MAC bug, I check out the newest snapshot and flash my HG556a, then the device lan blocked.

comment:12 Changed 2 years ago by florian

  • Resolution set to fixed
  • Status changed from reopened to closed

Support for HW556 has been added a while ago, and the calibration partition should also be fed correctly to the relevant WLAN drivers.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.