OUR NETWORK:TiVo Community TechLore Sling Community My DigitalEntertainer MotoDash See all... About UsAdvertiseContact Us

Under the Hood RSS Feed

A MyOpenRouter Blog By Nachi

Blog Avatar Nachiketa Prachanda discusses the hardware and software in NETGEAR routers, new processors, open source firmware, Linux, and much more.


WGR614L Firmware Upgrade Using Console and Bootloader

As a developer what saves my board and day most of the time is the serial console and boot-loaders’ ability to download/upload firmware. Even when the something goes badly wrong with the firmware you just compiled - you can use the boot loader to get back to a running firmware and try to debug your under development firmwares. WGR614L open source router uses the CFE boot loader and amazingly the boot loader is powerful enough (and yet small enough) to be extremely useful for most of the developers. Here I will go through the basic steps that I use for upgrading firmware using the serial console.

Although CFE bootloader provides many options to burn a firmware image into the flash, we will only discuss the tftpd command. Basic CFE command for firmware upgrade is flash and tftpd is nothing more than an alias to the flash command and some options. that starts a tftp server and waits for a remote tftp client to send the firmware to it and once the firmware is received, after doing the checksum validations the firmware is loaded into the flash.

Let us quickly go through the steps for using this tftpd command.

I am assuming the CFE bootloader's IP address is set 192.168.1.1 (the default).

1. Make sure you have PC connected (we will assume it is linux) to the LAN ports of the WGR614L and set ip address of the PC as 192.168.1.100 (or something else you prefer - make sure it different than that of the router and is in 192.168.1.0/24 subnet).

2. Power cycle the board and press ctrl-C at the time of load to get the CFE prompt.

3. At the CFE prompt type "tftpd" and the following message should be printed at the Console

CFE> tftpd

Start TFTP server

Reading::

4. On the PC start a tftp session to server 192.168.1.1 and send the required firmware file. You may use the following command on a linux shell

tftp -m binary 192.168.1.1 -c put wgr614v8_1_1_2_1_0_23_na.chk

5. On the console you should see the following

Loading...................................

Programming...

6. You should not power cycle the system before completion of flash programming to be completed and in some cases it may take about 5 minutes. After completion of flash writing you should see the following messages.

Wrire len/cksum offset @ 0x0038FFF8...done

7. After step 6 WGR614L should automatically reboot with the new firmware image.


WGR614L Firmware Image Creation

Some of you have already noticed that WGR614L firmware uses a .chk extension. Let us go through the steps that is needed to create a firmware image in .chk format.

Most of the broadcom hardware uses a TRX style fimware. Netgear's WGR614L linux based open source router's .chk is also based on the same TRX format - but does add the following interesting improvements

First, the kernel is compressed using LZMA which achieves a better compression than the usual gzip or bzip2 compression. This improvement does need an addition to the CFE bootloader to support uncompression of LZMA encoded kernel

Second, this formats adds a header to trx format, that has the checksum, length, and a compatible board identifier. These checksum and length information makes the job ensuring image integrity much easier and since these checksums are stored in the flash and also checked at each system boot, boot-loader can also identify if the flashed image gets corrupted.

So to pack a image in the .chk format you will need the following files at hand Thee files are generated when you compile the downloaded linux opensource codes for WGR614L

  1. Download the source code the Netgear WGR614L
  2. Linux Kernel - vmlunx -usually compiled at the top directory of the linux kernel source.
  3. compatible.txt containing the boardid of the netgear boards this fimeware is targeted for.
  4. Root File System image - target.squashfs - usually a LZMA Squashfs file system.
  5. Make sure you have added the bcm5354/tools directory into the PATH
$ export PATH=$PATH:$(SRCDIR)/bcm5354/tools

And you will need to follow these steps

1. Trim vmlinux by removing unneccessary sections in the object code

$ mipsel-linux-strip vmlinux

2. Convert to Binary format from the ELF format

$ mipsel-linux-objcopy -O binary -g vmlinux vmlinux.bin

3. Compress using lzma

$ ../../tools/lzma e vmlinux.bin vmlinux.lzma

4. Create the trx image

$ trx -o linux.trx vmlinux.lzma target.squashfs

5. Append the ".chk" header.

$ touch emptyfile; packet -k linux.trx -f emptyfile -b compatible.txt -ok kernel_image \

-oall kernel_rootfs_image -or rootfs_image -i emptyfile; rm -f emtyfile

And this will generate a new file "kernel_rootfs_image.chk" which can be uploaded to WGR614L using its Web UI or if you got the serial console you can also use the tftpd upgrade from the CFE firmware.

The format of a chk header is given below.

Type/Variable

Size (bytes)

Unsigned long magic

4

Unsigned header_len;

4

unsigned char reserved[8];

8

unsigned long kernel_chksum;

4

unsigned long rootfs_chksum;

4

unsigned long kernel_len;

4

unsigned long rootfs_len;

4

unsigned long image_chksum;

4

unsigned long header_chksum;

4

BOARD ID < 64 digits

variable length (max 64 bytes)


WGR614L - Router for developers

Happy New Year! A new router platform WGR614L is coming soon and what got me excited is that this new platform is well suited for many excellent community developed firmwares like like OpenWRT, Sveasoft, DD-WRT, Tomato. This Broadcom 5354 SoC based router has 4MB flash and 16MB SDRAM - good enough to run most of these popular firmwares. In fact most of the firmwares that runs on Linksys WRT54GL should be easily (relatively speaking) portable to WGR614L. Both the platforms uses the processor from Broadcom as well as the linux kernel source code is fairly similar. Netgear WGR614L’s BCM5354 is a newer generation SoC from Broadcom that has a 20% faster CPU and larger data and instruction caches than its predecessor BCM5352 used in Linksys WRT54GL. WGR614L also implements WPS and WPA2 standards to make it compatible with Windows Vista. But you will possibly miss these features when you install a third party firmware like Tomato. Let us have quick look at how this new router stands up against the present Netgear’s open source KWGR614 router.

 

WGR614L

KWGR614
CPU 240-MHz MIPS32® CPU core with 16-KB instruction cache, 16-KB data cache, and 1-KB pre-fetch cache LX5280 32-bit RISC CPU, clock rates up to 200MHz, Embedded 4K I-Cache, 4K D-Cache, 8K I-MEM, 4K D-MEM
WiFi Chipset Integrated Brodcom 5354 Realtek 8185L onboard.
RAM 16MB 16MB
FLASH 4MB 4MB
CPU MHZ 240MHZ (could be over clocked) 200MHZ
SYSTEM CLOCK 100MHZ 100MHZ
Ethernet 4+1 port 10/100 4+1 port 10/100
Hardware Switch Integrated L2 switch Only Integrated L2/L3/L4 switch forwarding, filtering and Access Control Accelerator in ROME Harfware. Frees up CPU for most of the traffic and allows wire speed forwarding
External Antenna Single Dipole
Antenna gain 2dBi Two (2) detachable 2dBi antenna
Replaceable Antennae Fixed Replaceable
  Both of the hardwares are based on MIPS architecture. WGR614L uses a 240 MHz MIPS4k based core in bcm5354 chipset whereas KWGR614 uses a little known MIPS like CPU Lexra LX5280 based core Realtek 8651B at 200 Mhz. The Processor in WGR614L does provide a slight edge over the KWGR614 with its higher MHz and larger data and instruction caches.  Both the processors have an MMU and can run standard Linux kernels.But interestingly the NAT and WLAN bridging throughput is significantly higher for KWGR614. Realtek RTL8651B uses a unique architecture with  a Layer2/3/4 switching in hardware. Only a few of the bridge and NAT traffic  reaches the CPU – most of it gets handled and forwarded by the hardware switching engines. The CPU is utilized much less for normal packet processing it has lots of free cycle to have more applications.

Unfortunately, KWGR614 have very few third party community firmware available.

So if you intend to use the router in a situation where the WAN speed is only a few MBPS, if you want to run a community firmware with a rich feature set you probably are better off with WGR614L. But if you need to deploy the router in an environment where you need close to 100MBPS throughput for the LAN-WAN traffic, you will need the KWGR614. Customization effort is higher – but definitely worth it in such a deployment.I would love to hear your opinions on these routers.

Browse all 4 entries in this blog

 
 
 

Please log in or register to participate in this community!

Log In

Remember

Not a member? Sign up!

Did you forget your password?

You can also log in using OpenID.

close this window
close this window