OpenWrt Forum Archive

Topic: Installing openwrt on AP135

The content of this topic has been archived on 3 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello everyone,
I'am working on Atheros ap135 evaluation board. I found barrier breaker openwrt for the board at
https://downloads.openwrt.org/barrier_b … x/generic/
I used the following commands to flash openwrt (I have changed the name)

tftp 0x80060000 ap135kernel.bin
erase 0x9f680000 +$filesize
cp.b $fileaddr 0x9f680000 $filesize

tftp 0x80060000 ap135rootfs.bin
erase 0x9f050000 +0x630000
cp.b $fileaddr 0x9f050000 $filesize

reset
After this openwrt was flashed and working but as soon as I restarted the board the openwrt was I got the following message

Booting image at 9f680000...
Bad magic number

Can anyone please help me with this
Thank you

(Last edited by pramod.j94 on 19 May 2015, 06:06)

please show printenv. You can try to flash to 0x9f050000 kernel and place rootfs after kernel. After this you need setup bootm 0x9f050000. Kernel always will be the same length, so you magic number never change.

Hello,
My prinenv is

dir=
lu=tftp 0x80060000 ${dir}u-boot.bin&&erase 0x9f000000 +$filesize&&cp.b $fileaddr 0x9f000000 $filesize
lf=tftp 0x80060000 ${dir}ap135${bc}-jffs2&&erase 0x9f050000 +0x630000&&cp.b $fileaddr 0x9f050000 $filesize
lk=tftp 0x80060000 ${dir}vmlinux${bc}.lzma.uImage&&erase 0x9f680000 +$filesize&&cp.b $fileaddr 0x9f680000 $filesize
ethact=eth0
ipaddr=192.168.2.1
serverip=192.168.2.10
stdin=serial
stdout=serial
stderr=serial

I did change as you said and i got the following message

VFS: Cannot open root device "null" or unknown-block(31,2): error -5
Please append a correct "root=" boot option; here are the available partitions:
1f00             256 mtdblock0 (driver?)
1f01            64 mtdblock1 (driver?)
1f02          14528 mtdblock2 (driver?)
1f03              1472 mtdblock3 (driver?)
1f04             64   mtdblock4 (driver?)
1f05            1600 mtdblock5 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)

Thank you

hmm, may be I am wrong. But kernel what you use for 16Mb flash. RootFS have size 14528 or in hex E30000 it is more bigger then +0x630000. But yours device seems to be 8Mb, so device creates magic from 14528k size which is wrong.  Is it really your device only have 8Mb?

The size of openwrt-ar71xx-generic-ap135-020-squashfs-sysupgrade.bin it is 14Mb.

No the AP 135 board has 16MB NOR flash (boot), 128MB RAM, 128MB NAND flash.

Yours device starting booting at 9f680000, but partition table in openwrt image place kernel at 9fE80000. https://dev.openwrt.org/browser/branche … efile#L253
Booting point is written on u-boot.
You have min 3 ways how to try solve this:
1.Create openwrt image with kernel on this position.
2.Creates new uboot image with correct booting position
3. Try this(before that make copy of art partition):

tftp 0x80060000 openwrt-ar71xx-generic-ap135-020-squashfs-sysupgrade.bin
erase 0x9f50000 +$filesize
cp.b $fileaddr 0x9f50000 $filesize
setenv boot bootm 0x9fE80000
savenv
bootm 0x9fE80000
pramod.j94 wrote:

Hello,
My prinenv is

dir=
lu=tftp 0x80060000 ${dir}u-boot.bin&&erase 0x9f000000 +$filesize&&cp.b $fileaddr 0x9f000000 $filesize
lf=tftp 0x80060000 ${dir}ap135${bc}-jffs2&&erase 0x9f050000 +0x630000&&cp.b $fileaddr 0x9f050000 $filesize
lk=tftp 0x80060000 ${dir}vmlinux${bc}.lzma.uImage&&erase 0x9f680000 +$filesize&&cp.b $fileaddr 0x9f680000 $filesize
ethact=eth0
ipaddr=192.168.2.1
serverip=192.168.2.10
stdin=serial
stdout=serial
stderr=serial

I did change as you said and i got the following message

VFS: Cannot open root device "null" or unknown-block(31,2): error -5
Please append a correct "root=" boot option; here are the available partitions:
1f00             256 mtdblock0 (driver?)
1f01            64 mtdblock1 (driver?)
1f02          14528 mtdblock2 (driver?)
1f03              1472 mtdblock3 (driver?)
1f04             64   mtdblock4 (driver?)
1f05            1600 mtdblock5 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)

Thank you

R u resolved ur issues?

Sorry for late reply. I have not fixed the issue yet. I tried using the sysupgrade file but it gave me the same result.

Thank you

pramod.j94 wrote:

Sorry for late reply. I have not fixed the issue yet. I tried using the sysupgrade file but it gave me the same result.

Thank you

Try the follow steps
1. calculate the size of rootfs & kernel you build(bypass...)
2. Modify the file ~/target/linux/ar71xx/image/Makefile
    search
"ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,14528k(rootfs),1472k(kernel),64k(art)ro,16000k@0x50000(firmware)"
and modify to
"ap135_mtdlayout=mtdparts=spi0.0:256k(u-boot)ro,64k(u-boot-env)ro,7168k(rootfs),8832k(kernel),64k(art)ro,16000k@0x50000(firmware)"
    then rebuild
3. user the following step to upload your kernel & rootfs
3.1 tftp 80060000 openwrt-ar71xx-generic-ap135-020-kernel.bin
3.2 erase 0x9f050000 +0x700000
3.3 cp.b 80060000 0x9f050000 700000
3.4 tftp 80060000 openwrt-ar71xx-generic-ap135-020-rootfs-squashfs.bin
3.5 erase 0x9f680000 +0x8a0000
3.6 cp.b 80060000 0x9f680000 +0x8a0000

The discussion might have continued from here.