Project

General

Profile

WZR-HP-AG300H » History » Version 3

Version 2 (Alexey Trenikhin, 10/10/2012 02:44 PM) → Version 3/5 (Alexey Trenikhin, 10/10/2012 03:16 PM)

h1. WZR-HP-AG300H

* Get zrouter and zrouter's FreeBSD source trees as described in [[Quickstart]]
Getting sources
* Copy zrouter/boards/D-Link/DIR-825/* to zrouter/boards/Buffalo/WZR-HP-AG300H
* Edit zrouter/boards/Buffalo/WZR-HP-AG300H/boards.hints
** hint.map.* (GEOM MAP)
<pre>
hint.map.0.at="flash/spi0"
hint.map.0.start=0x00000000
hint.map.0.end=0x00040000
hint.map.0.name="bootloader"
hint.map.0.readonly=1

hint.map.1.at="flash/spi0"
hint.map.1.start=0x00040000
hint.map.1.end=0x00050000
hint.map.1.name="bootloader-env"
hint.map.1.readonly=1

hint.map.2.at="flash/spi0"
hint.map.2.start=0x00050000
hint.map.2.end=0x00060000
hint.map.2.name="art"
hint.map.2.readonly=1

hint.map.3.at="flash/spi0"
hint.map.3.start=0x00060000
hint.map.3.end=0x007c0000
hint.map.3.name="upgrade"

hint.map.4.at="flash/spi0"
hint.map.4.start=0x00060000
hint.map.4.end="search:0x00100000:0x10000:.!/bin/sh"
hint.map.4.name="kernel"

hint.map.5.at="flash/spi0"
hint.map.5.start="search:0x00100000:0x10000:.!/bin/sh"
hint.map.5.end=0x007c0000
hint.map.5.name="rootfs"

hint.map.6.start=0x007c0000
hint.map.6.end=0x007f0000
hint.map.6.name="config"
#hint.map.6.readonly=1
</pre>
** Edit zrouter/boards/Buffalo/WZR-HP-AG300H/board.mk
Specify board flash size
<pre>
BOARD_FLASH_SIZE=32M
</pre>
Specify board memory
<pre>
# Board have 128M of RAM
KERNCONF_OPTIONS+= AR71XX_REALMEM=128*1024*1024
</pre>
Set maximum firmware size
<pre>
# Image must not be biggest than GEOM_MAP_P2 (upgrade part.)
FIRMWARE_IMAGE_SIZE_MAX=0x00760000
</pre>
* Build
** make TARGET_PAIR=Buffalo/WZR-HP-AG300H. This will produce Buffalo_WZR-HP-AG300H.zimage under $OBJ_DIR/...
**
Prepare TFTP image. I have used buffaulo-tftp utility from OpenWRT (in future should be included into build) image (buffaulo-tftp)
<pre>
(echo -n "# Airstation FirmWareNrun u_fwNresetNN" | tr "N" "\012" | dd bs=512 count=1 conv=sync; dd if=Buffalo_WZR-HP-AG300H.zimage) > tftp.tmp
buffalo-tftp -i tftp.tmp -o Buffalo_WZR-HP-AG300H-tftp.bin
</pre>
Resulting Buffalo_WZR-HP-AG300H-tftp.bin can be flashed via tftp. (I believe Buffalo_WZR-HP-AG300H.zimage can be flashed via OpenWRT upgrade utility, but I never tried)
* flash
** TFTP flash procedure described in http://wiki.openwrt.org/toh/buffalo/wzr-hp-ag300h