OpenWrt Forum Archive

Topic: OpenWRT for Atheros based devices...

The content of this topic has been archived between 26 Apr 2018 and 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hi!
why is it possible to flash an image on serial console?!
somewhere i read that you need a key to flash an image.

how is this working?
doesnt the bootloader matter about the key?

if your atheros based device is using redboot (fonera and meraki, among others), you most likely can. documentation on redboot is here, read it before doing anything, as generally redboot will do stupid things if you tell it to, and if you erase or badly screw up redboot, you will probably need jtag to fix it:
http://ecos.sourceware.org/docs-latest/ … guide.html

thx casperado, now i have one error with your patches. Compiling on debian system

Applying ./patches/104-autocreate_none.patch using plaintext:
patching file ath/if_ath.c
Hunk #1 FAILED at 387.
1 out of 1 hunk FAILED -- saving rejects to file ath/if_ath.c.rej
Patch failed!  Please fix ./patches/104-autocreate_none.patch!

do you know why ?¿

Hi,

thanks casper!

I tried to compile and flash kamikaze according to your litte "how-to-do"
and I have the same problem as pax0r. I tried to fix it myself, but there are many troubles with the patches for the madwifi-modules. Should they really be applied to the Version 0.9.0? because they often reference to the wrong line-numbers and thing like that.
I gave up fixing it myself for now, but I compiled kamikaze without the madwifi-driver, and had no problem at all.
I flashed it and now it´s working on my la fonera.
Ok, an accesspoint without an wlan-interface isn´t that useful smile , but it´s  good to see, that it is possible the put openwrt on it.
the last thing that´s missing is a working madwifi driver. so maybe someone has an idea, how to fix this?

Yo,

I forgot to mention that before unpacking my patch you have to delete the madwifi package that comes with kamikaze,
eg.

 rm -Rf packages/madwifi

Casper

(Last edited by casperado on 21 Dec 2006, 00:41)

Hi Casperado,
Your firmware is not perfect but it's better than mine for sure :-P
But I don't understand why to pass from the serial console. It's better to use the a lan cross  cable...

Cris

I am building your code now to try it on a Meraki Mini...

casperado wrote:

I forgot to mention that before unpacking my patch you have to delete the madwifi package that comes with kamikaze,
eg.

 rm -Rf packages/madwifi

Casper

That begs the question of how we deal with this going forward when integrating this work into the tree. Should there be separate packages "madwifi" and "madwifi-ar531x" for example? This seems to be necessary, at least because of the base address changes in ath/if_ath_ahb.c, unless we can (safely) make a single module that probes both ranges.

Also, your package seems to be based on madwifi-ng-r1486, which is 9 months old - presumably because fon's was. I expect it would be better to use say madwifi 0.9.2.1 as a base, but then you have to identify which of fon's patches still need to be applied to this.

Ultimately such patches, if important or useful, ought to find there way back into the main madwifi tree. If fon won't do this, then maybe we should submit them.

One other thing - any reason why this needs a 2.4 kernel? I've read here that 2.4 kernel support will be dropped from Kamikaze as soon as there's a working 2.6 broadcom driver.

Anyway, thanks for the great work! - Brian.

Well as it stands the elf image doesn't work on a Meraki. I copied bin/openwrt-ar531x-2.4-vmlinux.elf onto a TFTP server, then:

Board: Meraki Mini
RAM: 0x80000000-0x82000000, [0x8003d110-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87e0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 2.000 seconds - enter ^C to abort
RedBoot> check_mac
Lan Mac address is  : 00:18:0a:XX:XX:XX
Wlan Mac address is : 00:18:0a:XX:XX:XX
Serial Number is    : XXX-XXX-XXX
RedBoot> load art_ap51.elf
Using default protocol (TFTP)
Entry point: 0x8019a040, address range: 0x80041000-0x801c4000
/home/alfa/Atheros/linuxsrc/src/redboot_cobra_mit/ecos/packages/devs/eth/mips/ar531x/current/src/ae531xecos.c#384:ae531x_send AHB ERROR: AR531X_DEBUG_ERROR = 38303163
/home/alfa/Atheros/linuxsrc/src/redboot_cobra_mit/ecos/packages/devs/eth/mips/ar531x/current/src/ae531xecos.c#387:ae531x_send AHB ERROR status_4 = 00000555
RedBoot> go

at which point it freezes.

A tcpdump of the tftp traffic shows what appears to be some retries from the TFTP server:

...
11:02:10.333509 192.168.84.1.7700 > 192.168.84.9.15382: udp 4
11:02:10.333529 192.168.84.9.15382 > 192.168.84.1.7700: udp 516
11:02:10.334234 192.168.84.1.7700 > 192.168.84.9.15382: udp 4
11:02:10.334254 192.168.84.9.15382 > 192.168.84.1.7700: udp 516
11:02:10.367955 192.168.84.1.7700 > 192.168.84.9.15382: udp 4
11:02:10.367976 192.168.84.9.15382 > 192.168.84.1.7700: udp 516
11:02:15.370016 192.168.84.9.15382 > 192.168.84.1.7700: udp 516
11:02:20.380015 192.168.84.9.15382 > 192.168.84.1.7700: udp 516
11:02:25.390014 192.168.84.9.15382 > 192.168.84.1.7700: udp 516
11:02:30.400021 192.168.84.9.15382 > 192.168.84.1.7700: udp 516

Making it available as /meraki/mini.1.img on a webserver is no better:

Board: Meraki Mini
RAM: 0x80000000-0x82000000, [0x8003d110-0x80fe1000] available
FLASH: 0xa8000000 - 0xa87e0000, 128 blocks of 0x00010000 bytes each.
== Executing boot script in 2.000 seconds - enter ^C to abort
RedBoot> check_mac
Lan Mac address is  : 00:18:0a:01:12:c8
Wlan Mac address is : 00:18:0a:01:12:c8
Serial Number is    : 048-b14-a49
RedBoot> load art_ap51.elf
Using default protocol (TFTP)
Can't load 'art_ap51.elf': file not found
RedBoot> go
No entry point known - aborted
RedBoot> load -h 192.168.84.9 -p 80 -m http /meraki/mini.1.img
Entry point: 0x8019a040, address range: 0x80041000-0x801c4000
RedBoot> exec
Now booting linux kernel:
 Base address 0x80030000 Entry 0x8019a040
 Cmdline :

But loading an ELF image in this way worked for me when building from Meraki's own source tarball - the only problem being that there was a panic in the wifi driver a few seconds after starting up.

I am rather loathe to try burning this into flash, given that the partitions have different names to those on your fon; I don't know if these names are significant or not, and I'd rather not change the flash partitioning without being sure I could get back to how it was.

RedBoot> fis list
Name              FLASH addr  Mem addr    Length      Entry point
RedBoot           0xA8000000  0xA8000000  0x00030000  0x00000000
stage2            0xA8030000  0x80100000  0x00020000  0x80100000
FIS directory     0xA87D0000  0xA87D0000  0x0000F000  0x00000000
RedBoot config    0xA87DF000  0xA87DF000  0x00001000  0x00000000

I've documented the full partition structure of the Meraki at http://wiki.openwrt.org/OpenWrtDocs/Har … eraki/Mini

The Meraki firmware "image" (in part1 or part2) seems to combine a kernel and a ramdisk root filesystem. Another partition holds persistent data on /storage. It would certainly make firmware upgrading easier if you didn't have to upload the kernel into one partition and separately a new jffs2 into another partition.

Meraki's stage2 bootloader doesn't seem to do very much, apart from checking CRCs to decide whether to run part1 or part2, and LZMA decompression of the kernel. I presume this is just to idiot-proof the system against people unplugging the power while a flash upgrade takes place.

However, perhaps stage2 could be modified to read a TRX file so this becomes much more like the normal OpenWrt way of working: i.e. kernel+squashfs in one image file, and a mini_fo union mount of jffs2.

Hi,

But I don't understand why to pass from the serial console. It's better to use the a lan cross  cable...

Cris, do you mean The Fonera will get the firmware via crossover cable without opening and connecting a serial-ttl adapter?


In the software side...
I have been trying to compile kamikaze for La Fonera, but I get errors on the package openswan.
Is there a magic formula / compiler+tools version ?
I'm using a basic installation of Ubuntu 6.06-1 server with the following additional packages:

autoconf
libncurses-dev
g++
libz-dev
bison
flex
unzip
gettext
automake
build-essential

I think all are latest stable versions, if you think there must be some additional packages installed, please feel free to tell me which specific versions.

Thanks in advance!

(Last edited by chavaldelapeca on 21 Dec 2006, 17:08)

candlerb wrote:

Also, your package seems to be based on madwifi-ng-r1486, which is 9 months old - presumably because fon's was. I expect it would be better to use say madwifi 0.9.2.1 as a base, but then you have to identify which of fon's patches still need to be applied to this.

You're right. Actually I just integrated fon's stuff into the newer kamikaze revision.
Fon had their own patches to the kernel as well as a lot of patches for madwifi.
I spend a week on trying to find which of fon's patches are needed to get a newer, working madwifi on the fonera. Actually there is some progress in the madwifi-svn, that compiles but hangs on module load. I got a dump of the kernel-panic and will send it to them.

candlerb wrote:

One other thing - any reason why this needs a 2.4 kernel? I've read here that 2.4 kernel support will be dropped from Kamikaze as soon as there's a working 2.6 broadcom driver.

The reason is that this is just the working fon stuff. Their kernel-patch for the 531x soc is only for 2.4.

When I asked on where to put my patch, the openwrt-devs said there's work going on for atheros 531x soc with kernel 2.6 so they won't integrate 2.4-stuff.

Casper

could someone upload a working image of this patched openwrt kamikaze version?

chavaldelapeca: Do you see? Jasonp has made his own researches and maybe he will learn something ;-)

Just another thing to help you to figure out another way...
Downlaod http://downloads.fon.com/firmware/curre … .7.1.1.fon

Remove the useless first 519 bytes with the command:
dd if=fonera_0.7.1.1.fon of=fonera.tar.gz bs=519 skip=1

Or if you have Windows any hex editor can help you.

Uncompress the plain .tar.gz that you have obtain and look into the file "upgrade" :-P

Read the post by debianero at the beginneing of the thread. You maybe want to look at 0x007ef000-0x007f0000 : "RedBoot config".

Now be careful on what you are going to do with it.

Enjoy and Marry Christmas!

(Last edited by Cris on 22 Dec 2006, 11:25)

I should point out that the meraki firmware, and redboot, uses a serial rate of 115200, while the fon and most firmware for it (excluding my own, hehe), uses 9600. so you have to quickly switch to 9600 after you press enter on exec to get early output, or switch redboot to use 9600

I have my own kernel that boots on the fon and recognizes the partitions and such, based on meraki's 2.6.16.16 and it's associated drivers, but it's a messy hack, and has largly been superseded in functionality now.

my own flash layout uses a 2mb partition for linux kernels, and a 3mb jffs2 root partition, in addition to the redboot internal partitions (there is unused space, yes, I wanted to be able to test multiple things without erasing). since linux can automatically detect redboot partitions on boot, the flash layout isn't really much of a problem imo, provided you know how to use redboot smile

you can telnet into redboot on the stock meraki, if you are quick and configure your ip settings properly. only person I asked about the fon hardware has changed his settings too much to make a determination of whether it would work.

I've been watching this thread for a while, and it's great to see progress on this new platform.

Another Atheros base device is the Buffalo WHR-HP-AG108.  Has anyone working with the Atheros port poked around with this router? 

It would be great to see OpenWRT working on this router because it has two radios one 802.11g and one 802.11a.  These could be used to make a killer mesh network.

Cris:

Thanks for the advice, it was really possible to reflash a working fonera without opening/connecting serial-ttl adapters. Today is compile-time (the basic packages are there, but I miss some useful tools)...

About the Redboot_Config partition, I think we don't have avaliable tools to generate a default configuration "with fixed IP and telnet window after boot", I must read the Redboot documentation. These are completely new hardware and tools for me!

Best regards

Support for the AR2315 will be commited soon.

lschweiss wrote:

I've been watching this thread for a while, and it's great to see progress on this new platform.

Another Atheros base device is the Buffalo WHR-HP-AG108.  Has anyone working with the Atheros port poked around with this router? 

It would be great to see OpenWRT working on this router because it has two radios one 802.11g and one 802.11a.  These could be used to make a killer mesh network.

That one should be either AR5312 or some Xscale based device (the cost and feature set suggest the first, except the "MIMO" as that's not available on Atheros SoCs, yet).


P.S: did you try Kamikaze on the avila? wink

is there some flashable OpenWRT File for my Fonera?

Hello everybody!

Thanks for the port for the Atheros SoC. I have a little question. Is it possible to reflash the fonera using the mtd utility instead of the redboot utilities?

Thanks,

Xavi

Yea it should be, havent tried it tho but you should have a serial link anyway..just in case, if you are gonna mess with stuff tongue
trying to get my link working..

Cheers

Hi!

I say it because I have a working ssh server on the fonera and it would be nice to reflash it without using the serial link xD

srxavi and others, please read again Cris' instructions to see how Fon or anyone with shell access (serial, ssh) can reflash their La Foneras: http://forum.openwrt.org/viewtopic.php?pid=39463#p39463

Regards

(Last edited by chavaldelapeca on 25 Dec 2006, 22:07)

yea I saw that too yesterday so yes mtd works then but srxavi and others should still be careful cuz if something goes bad then you are screwed tongue

The discussion might have continued from here.