OpenWrt Forum Archive

Topic: Belkin F5D7230-4 v2000

The content of this topic has been archived between 20 Apr 2018 and 28 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

Hi,

I have a bunch of Belkin F5D7230-4 v2000 routers that I'd like to use.  I've added serial and USB ports to them, and even though they only have 2MB of flash, I expect they'll be useful for robotics control and other specialized applications.  I'd like to use the OpenWRT build environment, since it seems to be very well written and works great.

There are a few patches I'm working on to get these routers to work.  I am working against trunk.  I'll post them here as I put them together.

Kernel patch: Detect pflash before trying to use it.

This v2000 router doesn't have a parallel flash chip (the older v1444 revision apparently does).  The "whiterussian" branch detects whether it's available before using it, but "trunk" just tries to use it directly, which causes a hang.  This patch adds the check back in.

Index: trunk/openwrt/target/linux/brcm-2.4/patches/050-pflash-detect.patch
===================================================================
--- trunk/openwrt/target/linux/brcm-2.4/patches/050-pflash-detect.patch (revision 0)
+++ trunk/openwrt/target/linux/brcm-2.4/patches/050-pflash-detect.patch (revision 0)
@@ -0,0 +1,69 @@
+diff -urN --exclude='*.o*' linux-2.4.32.orig/drivers/mtd/maps/bcm947xx-flash.c linux-2.4.32/drivers/mtd/maps/bcm947xx-flash.c
+--- linux-2.4.32.orig/drivers/mtd/maps/bcm947xx-flash.c        2006-03-22 16:04:47.000000000 -0500
++++ linux-2.4.32/drivers/mtd/maps/bcm947xx-flash.c     2006-03-22 15:52:33.000000000 -0500
+@@ -48,8 +48,17 @@
+ #endif
+ #include <linux/config.h>
+ 
++#include <typedefs.h>
++#include <bcmnvram.h>
++#include <bcmutils.h>
++#include <sbconfig.h>
++#include <sbchipc.h>
+ #include <trxhdr.h>
+ 
++/* Global SB handle */
++extern void *bcm947xx_sbh;
++extern spinlock_t bcm947xx_sbh_lock;
++
+ #define WINDOW_ADDR 0x1c000000
+ #define WINDOW_SIZE (0x400000*2)
+ #define BUSWIDTH 2
+@@ -305,6 +314,11 @@
+ 
+ mod_init_t init_bcm947xx_map(void)
+ {
++      ulong flags;
++      uint coreidx;
++      chipcregs_t *cc;
++      uint32 fltype;
++      uint window_addr = 0, window_size = 0;
+       size_t size;
+       int ret = 0;
+ #ifdef CONFIG_MTD_PARTITIONS
+@@ -312,6 +326,35 @@
+       int i;
+ #endif
+ 
++      spin_lock_irqsave(&bcm947xx_sbh_lock, flags);
++      coreidx = sb_coreidx(bcm947xx_sbh);
++
++      /* Check strapping option if chipcommon exists */
++      if ((cc = sb_setcore(bcm947xx_sbh, SB_CC, 0))) {
++              fltype = readl(&cc->capabilities) & CAP_FLASH_MASK;
++              if (fltype == PFLASH) {
++                      bcm947xx_map.map_priv_2 = 1;
++                      window_addr = 0x1c000000;
++                      bcm947xx_map.size = window_size = 32 * 1024 * 1024;
++                      if ((readl(&cc->flash_config) & CC_CFG_DS) == 0)
++                              bcm947xx_map.buswidth = 1;
++              }
++      } else {
++              fltype = PFLASH;
++              bcm947xx_map.map_priv_2 = 0;
++              window_addr = WINDOW_ADDR;
++              window_size = WINDOW_SIZE;
++      }
++
++      sb_setcoreidx(bcm947xx_sbh, coreidx);
++      spin_unlock_irqrestore(&bcm947xx_sbh_lock, flags);
++
++      if (fltype != PFLASH) {
++              printk(KERN_ERR "pflash: found no supported devices\n");
++              ret = -ENODEV;
++              goto fail;
++      }
++
+       bcm947xx_map.map_priv_1 = (unsigned long) ioremap(WINDOW_ADDR, WINDOW_SIZE);
+ 
+       if (!bcm947xx_map.map_priv_1) {

Download: svn-01-pflash-detect.patch

(Last edited by jimparis on 22 Mar 2006, 23:09)

Build system: Create a Belkin-specific image for loading via TFTP.

This format is like trx, but also includes user configuration.  It is creating using the "belky.c" tool created by Ian Latter at midnightcode.org.  The output file "openwrt-f5d7230-squashfs.bin" is now generated alongside the other firmware images.

(Unnecessary patch removed.  You can still download it here).

(Last edited by jimparis on 23 Mar 2006, 00:29)

While the format allows you to specify extra data like the nvram, I question how much is required and how much of it is simply optional. The last time I looked at a similar device, it would happily accept normal trx files.

mbm wrote:

While the format allows you to specify extra data like the nvram, I question how much is required and how much of it is simply optional. The last time I looked at a similar device, it would happily accept normal trx files.

Uh, wow, that was dumb of me.  I thought I had tried this, but you're right, it takes the normal trx just fine.  Previous patch (svn-02-build-belkin-image) is unnecessary.

Kernel patch: Add driver for serial flash

The F5D7230-4 v2000 router has a serial flash chip rather than the much more common parallel flash.  The "sflash" MTD driver included in the original Broadcom and Belkin source releases is missing from OpenWRT.  This patch re-adds that driver.

Index: trunk/openwrt/target/linux/brcm-2.4/config
===================================================================
--- trunk/openwrt/target/linux/brcm-2.4/config  (revision 3440)
+++ trunk/openwrt/target/linux/brcm-2.4/config  (working copy)
@@ -246,6 +246,7 @@
 #
 # Self-contained MTD device drivers
 #
+CONFIG_MTD_SFLASH=y
 # CONFIG_MTD_PMC551 is not set
 # CONFIG_MTD_SLRAM is not set
 # CONFIG_MTD_MTDRAM is not set
Index: trunk/openwrt/target/linux/brcm-2.4/patches/051-sflash.patch
===================================================================
--- trunk/openwrt/target/linux/brcm-2.4/patches/051-sflash.patch        (revision 0)
+++ trunk/openwrt/target/linux/brcm-2.4/patches/051-sflash.patch        (revision 0)
@@ -0,0 +1,333 @@
+diff -urN linux-2.4.32.orig/drivers/mtd/devices/Config.in linux-2.4.32/drivers/mtd/devices/Config.in
+--- linux-2.4.32.orig/drivers/mtd/devices/Config.in    2006-03-22 18:16:57.000000000 -0500
++++ linux-2.4.32/drivers/mtd/devices/Config.in 2006-03-22 18:06:49.000000000 -0500
+@@ -5,6 +5,7 @@
+ mainmenu_option next_comment
+ 
+ comment 'Self-contained MTD device drivers'
++bool '  Broadcom Chipcommon Serial Flash support' CONFIG_MTD_SFLASH
+ dep_tristate '  Ramix PMC551 PCI Mezzanine RAM card support' CONFIG_MTD_PMC551 $CONFIG_MTD $CONFIG_PCI
+ if [ "$CONFIG_MTD_PMC551" = "y" -o  "$CONFIG_MTD_PMC551" = "m" ]; then
+    bool '    PMC551 256M DRAM Bugfix' CONFIG_MTD_PMC551_BUGFIX
+diff -urN linux-2.4.32.orig/drivers/mtd/devices/Makefile linux-2.4.32/drivers/mtd/devices/Makefile
+--- linux-2.4.32.orig/drivers/mtd/devices/Makefile     2006-03-22 18:16:57.000000000 -0500
++++ linux-2.4.32/drivers/mtd/devices/Makefile  2006-03-22 18:06:49.000000000 -0500
+@@ -3,6 +3,8 @@
+ #
+ # $Id: Makefile,v 1.4 2001/06/26 21:10:05 spse Exp $
+ 
++EXTRA_CFLAGS := -I$(TOPDIR)/arch/mips/bcm947xx/include
++
+ O_TARGET      := devlink.o
+ 
+ #                       *** BIG UGLY NOTE ***
+@@ -12,6 +14,7 @@
+ # here where previously there was none.  We now have to ensure that
+ # doc200[01].o are linked before docprobe.o
+ 
++obj-$(CONFIG_MTD_SFLASH)      += sflash.o
+ obj-$(CONFIG_MTD_DOC1000)     += doc1000.o
+ obj-$(CONFIG_MTD_DOC2000)     += doc2000.o
+ obj-$(CONFIG_MTD_DOC2001)     += doc2001.o
+diff -urN linux-2.4.32.orig/drivers/mtd/devices/sflash.c linux-2.4.32/drivers/mtd/devices/sflash.c
+--- linux-2.4.32.orig/drivers/mtd/devices/sflash.c     1969-12-31 19:00:00.000000000 -0500
++++ linux-2.4.32/drivers/mtd/devices/sflash.c  2006-03-22 18:17:12.000000000 -0500
+@@ -0,0 +1,298 @@
++/*
++ * Broadcom SiliconBackplane chipcommon serial flash interface
++ *
++ * Copyright 2001-2003, Broadcom Corporation   
++ * All Rights Reserved.   
++ *    
++ * THIS SOFTWARE IS OFFERED "AS IS", AND BROADCOM GRANTS NO WARRANTIES OF ANY   
++ * KIND, EXPRESS OR IMPLIED, BY STATUTE, COMMUNICATION OR OTHERWISE. BROADCOM   
++ * SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS   
++ * FOR A SPECIFIC PURPOSE OR NONINFRINGEMENT CONCERNING THIS SOFTWARE.   
++ *
++ * $Id: sflash.c,v 1.1.1.3 2003/11/10 17:43:38 hyin Exp $
++ */
++
++#include <linux/config.h>
++#include <linux/module.h>
++#include <linux/slab.h>
++#include <linux/ioport.h>
++#include <linux/mtd/compatmac.h>
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/errno.h>
++#include <linux/pci.h>
++#include <linux/delay.h>
++#include <asm/io.h>
++
++#ifdef CONFIG_MTD_PARTITIONS
++#include <linux/mtd/mtd.h>
++#include <linux/mtd/partitions.h>
++#include <linux/minix_fs.h>
++#include <linux/ext2_fs.h>
++#include <linux/romfs_fs.h>
++#include <linux/cramfs_fs.h>
++#include <linux/jffs2.h>
++#endif
++
++#include <typedefs.h>
++#include <bcmdevs.h>
++#include <bcmutils.h>
++#include <osl.h>
++#include <bcmutils.h>
++#include <bcmnvram.h>
++#include <sbconfig.h>
++#include <sbchipc.h>
++#include <sflash.h>
++#include <trxhdr.h>
++
++#ifdef CONFIG_MTD_PARTITIONS
++extern struct mtd_partition * init_mtd_partitions(struct mtd_info *mtd, size_t size);
++#endif
++
++struct sflash_mtd {
++      chipcregs_t *cc;
++      struct semaphore lock;
++      struct mtd_info mtd;
++      struct mtd_erase_region_info regions[1];
++};
++
++/* Private global state */
++static struct sflash_mtd sflash;
++
++static int
++sflash_mtd_poll(struct sflash_mtd *sflash, unsigned int offset, int timeout)
++{
++      int now = jiffies;
++      int ret = 0;
++
++      for (;;) {
++              if (!sflash_poll(sflash->cc, offset)) {
++                      ret = 0;
++                      break;
++              }
++              if (time_after(jiffies, now + timeout)) {
++                      printk(KERN_ERR "sflash: timeout\n");
++                      ret = -ETIMEDOUT;
++                      break;
++              }
++              if (current->need_resched) {
++                      set_current_state(TASK_UNINTERRUPTIBLE);
++                      schedule_timeout(timeout / 10);
++              } else
++                      udelay(1);
++      }
++
++      return ret;
++}
++
++static int
++sflash_mtd_read(struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf)
++{
++      struct sflash_mtd *sflash = (struct sflash_mtd *) mtd->priv;
++      int bytes, ret = 0;
++
++      /* Check address range */
++      if (!len)
++              return 0;
++      if ((from + len) > mtd->size)
++              return -EINVAL;
++
++      down(&sflash->lock);
++
++      *retlen = 0;
++      while (len) {
++              if ((bytes = sflash_read(sflash->cc, (uint) from, len, buf)) < 0) {
++                      ret = bytes;
++                      break;
++              }
++              from += (loff_t) bytes;
++              len -= bytes;
++              buf += bytes;
++              *retlen += bytes;
++      }
++
++      up(&sflash->lock);
++
++      return ret;
++}
++
++static int
++sflash_mtd_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf)
++{
++      struct sflash_mtd *sflash = (struct sflash_mtd *) mtd->priv;
++      int bytes, ret = 0;
++
++      /* Check address range */
++      if (!len)
++              return 0;
++      if ((to + len) > mtd->size)
++              return -EINVAL;
++
++      down(&sflash->lock);
++
++      *retlen = 0;
++      while (len) {
++              if ((bytes = sflash_write(sflash->cc, (uint) to, len, buf)) < 0) {
++                      ret = bytes;
++                      break;
++              }
++              if ((ret = sflash_mtd_poll(sflash, (unsigned int) to, HZ / 10)))
++                      break;
++              to += (loff_t) bytes;
++              len -= bytes;
++              buf += bytes;
++              *retlen += bytes;
++      }
++
++      up(&sflash->lock);
++
++      return ret;
++}
++
++static int
++sflash_mtd_erase(struct mtd_info *mtd, struct erase_info *erase)
++{
++      struct sflash_mtd *sflash = (struct sflash_mtd *) mtd->priv;
++      int i, j, ret = 0;
++      unsigned int addr, len;
++
++      /* Check address range */
++      if (!erase->len)
++              return 0;
++      if ((erase->addr + erase->len) > mtd->size)
++              return -EINVAL;
++
++      addr = erase->addr;
++      len = erase->len;
++
++      down(&sflash->lock);
++
++      /* Ensure that requested region is aligned */
++      for (i = 0; i < mtd->numeraseregions; i++) {
++              for (j = 0; j < mtd->eraseregions[i].numblocks; j++) {
++                      if (addr == mtd->eraseregions[i].offset + mtd->eraseregions[i].erasesize * j &&
++                          len >= mtd->eraseregions[i].erasesize) {
++                              if ((ret = sflash_erase(sflash->cc, addr)) < 0)
++                                      break;
++                              if ((ret = sflash_mtd_poll(sflash, addr, 10 * HZ)))
++                                      break;
++                              addr += mtd->eraseregions[i].erasesize;
++                              len -= mtd->eraseregions[i].erasesize;
++                      }
++              }
++              if (ret)
++                      break;
++      }
++
++      up(&sflash->lock);
++
++      /* Set erase status */
++      if (ret)
++              erase->state = MTD_ERASE_FAILED;
++      else 
++              erase->state = MTD_ERASE_DONE;
++
++      /* Call erase callback */
++      if (erase->callback)
++              erase->callback(erase);
++
++      return ret;
++}
++
++#if LINUX_VERSION_CODE < 0x20212 && defined(MODULE)
++#define sflash_mtd_init init_module
++#define sflash_mtd_exit cleanup_module
++#endif
++
++mod_init_t
++sflash_mtd_init(void)
++{
++      struct pci_dev *pdev;
++      int ret = 0;
++      struct sflash *info;
++      uint bank, i;
++#ifdef CONFIG_MTD_PARTITIONS
++      struct mtd_partition *parts;
++#endif
++
++      if (!(pdev = pci_find_device(VENDOR_BROADCOM, SB_CC, NULL))) {
++              printk(KERN_ERR "sflash: chipcommon not found\n");
++              return -ENODEV;
++      }
++
++      memset(&sflash, 0, sizeof(struct sflash_mtd));
++      init_MUTEX(&sflash.lock);
++
++      /* Map registers and flash base */
++      if (!(sflash.cc = ioremap_nocache(pci_resource_start(pdev, 0),
++                                        pci_resource_len(pdev, 0)))) {
++              printk(KERN_ERR "sflash: error mapping registers\n");
++              ret = -EIO;
++              goto fail;
++      }
++
++      /* Initialize serial flash access */
++      info = sflash_init(sflash.cc);
++
++      if (!info) {
++              printk(KERN_ERR "sflash: found no supported devices\n");
++              ret = -ENODEV;
++              goto fail;
++      }
++
++      /* Setup banks */
++      sflash.regions[0].offset = 0;
++      sflash.regions[0].erasesize = info->blocksize;
++      sflash.regions[0].numblocks = info->numblocks;
++      if (sflash.regions[0].erasesize > sflash.mtd.erasesize)
++              sflash.mtd.erasesize = sflash.regions[0].erasesize;
++      if (sflash.regions[0].erasesize * sflash.regions[0].numblocks) {
++              sflash.mtd.size += sflash.regions[0].erasesize * sflash.regions[0].numblocks;
++      }
++      sflash.mtd.numeraseregions = 1;
++      ASSERT(sflash.mtd.size == info->size);
++
++      /* Register with MTD */
++      sflash.mtd.name = "sflash";
++      sflash.mtd.type = MTD_NORFLASH;
++      sflash.mtd.flags = MTD_CAP_NORFLASH;
++      sflash.mtd.eraseregions = sflash.regions;
++      sflash.mtd.module = THIS_MODULE;
++      sflash.mtd.erase = sflash_mtd_erase;
++      sflash.mtd.read = sflash_mtd_read;
++      sflash.mtd.write = sflash_mtd_write;
++      sflash.mtd.priv = &sflash;
++
++#ifdef CONFIG_MTD_PARTITIONS
++      parts = init_mtd_partitions(&sflash.mtd, sflash.mtd.size);
++      for (i = 0; parts[i].name; i++);
++      ret = add_mtd_partitions(&sflash.mtd, parts, i);
++#else
++      ret = add_mtd_device(&sflash.mtd);
++#endif
++      if (ret) {
++              printk(KERN_ERR "sflash: add_mtd failed\n");
++              goto fail;
++      }
++
++      return 0;
++
++ fail:
++      if (sflash.cc)
++              iounmap((void *) sflash.cc);
++      return ret;
++}
++
++mod_exit_t
++sflash_mtd_exit(void)
++{
++#ifdef CONFIG_MTD_PARTITIONS
++      del_mtd_partitions(&sflash.mtd);
++#else
++      del_mtd_device(&sflash.mtd);
++#endif
++      iounmap((void *) sflash.cc);
++}
++
++module_init(sflash_mtd_init);
++module_exit(sflash_mtd_exit);

Download: svn-02-sflash.patch

Kernel patch: Fix MTD partition detection

The bootloader is only 128KiB on this device, so find_cfe_size() and find_root() are modified to look for the TRX magic beginning at that point.  Also, init_mtd_partitions() is cleaned up slightly and modified to treat 128KiB like the 256KiB case.

More importantly, the serial flash chip is unusual in that it gets erased a page at a time, which means mtd->erasesize is only 512 bytes (!).  To account for this,
- find_cfe_size() and find_root() now jump by a minimum of 64KiB at a time, even if erasesize is smaller, to speed up the search.
- init_mtd_partitions() ensures that at least NVRAM_SPACE is allocated for NVRAM, just as the old Broadcom source used to do, rather than assuming one erasesize is enough.

Note that the tiny erasesize means that jffs2 is hard to use with this chip -- at the very least, mkfs.jffs2 doesn't let you create a filesystem with erasesize < 4KiB.  A larger virtual erasesize, or rewriting the sflash driver to appear as NAND flash, would probably be useful.  squashfs works better.

Index: linux/brcm-2.4/patches/052-init_mtd_partitions.patch
===================================================================
--- linux/brcm-2.4/patches/052-init_mtd_partitions.patch        (revision 0)
+++ linux/brcm-2.4/patches/052-init_mtd_partitions.patch        (revision 0)
@@ -0,0 +1,108 @@
+diff -u linux-2.4.32.orig/drivers/mtd/maps/bcm947xx-flash.c linux-2.4.32/drivers/mtd/maps/bcm947xx-flash.c
+--- linux-2.4.32.orig/drivers/mtd/maps/bcm947xx-flash.c        2006-03-22 19:31:05.000000000 -0500
++++ linux-2.4.32/drivers/mtd/maps/bcm947xx-flash.c     2006-03-22 19:46:12.000000000 -0500
+@@ -158,13 +158,15 @@
+       unsigned char buf[512];
+       int off;
+       size_t len;
+-      int cfe_size_flag;
++      int blocksize;
+ 
+       trx = (struct trx_header *) buf;
+ 
+-      cfe_size_flag=0;
++      blocksize = mtd->erasesize;
++      if (blocksize < 0x10000)
++              blocksize = 0x10000;
+ 
+-      for (off = (256*1024); off < size; off += mtd->erasesize) {
++      for (off = (128*1024); off < size; off += blocksize) {
+               memset(buf, 0xe5, sizeof(buf));
+ 
+               /*
+@@ -178,7 +180,6 @@
+               if (le32_to_cpu(trx->magic) == TRX_MAGIC) {
+                       goto done;
+               }
+-              cfe_size_flag += 1;
+       }
+ 
+       printk(KERN_NOTICE
+@@ -187,8 +188,8 @@
+       return -1;
+ 
+  done:
+-      printk(KERN_NOTICE "bootloader size flag: %d\n", cfe_size_flag);
+-      return cfe_size_flag;
++      printk(KERN_NOTICE "bootloader size: %d\n", off);
++      return off;
+ 
+ }
+ 
+@@ -199,10 +200,15 @@
+       unsigned char buf[512];
+       int off;
+       size_t len;
++      int blocksize;
+ 
+       trx = (struct trx_header *) buf;
+ 
+-      for (off = (256*1024); off < size; off += mtd->erasesize) {
++      blocksize = mtd->erasesize;
++      if (blocksize < 0x10000)
++              blocksize = 0x10000;
++
++      for (off = (128*1024); off < size; off += blocksize) {
+               memset(buf, 0xe5, sizeof(buf));
+ 
+               /*
+@@ -237,32 +243,26 @@
+ struct mtd_partition * __init
+ init_mtd_partitions(struct mtd_info *mtd, size_t size)
+ {
++      int cfe_size;
+ 
+-      int cfe_size_flag;
+-
+-      /* if cfe_size_flag=0, cfe size is 256 kb, else 384 kb */
+-      cfe_size_flag = find_cfe_size(mtd,size); 
++      cfe_size = find_cfe_size(mtd,size); 
+ 
+       /* boot loader */
+       bcm947xx_parts[0].offset = 0;
+-      if (cfe_size_flag == 0) {
+-              bcm947xx_parts[0].size   = 1024*256;
+-      } else {
+-              /* netgear wgt634u has 384 kb bootloader */
+-              bcm947xx_parts[0].size   = 1024*384;
+-      }
++      bcm947xx_parts[0].size   = cfe_size;
+ 
+       /* nvram */
+-      if (cfe_size_flag == 0) {
+-              bcm947xx_parts[3].offset = size - mtd->erasesize;
++      if (cfe_size != 384 * 1024) {
++              bcm947xx_parts[3].offset = size - ROUNDUP(NVRAM_SPACE, mtd->erasesize);
++              bcm947xx_parts[3].size   = ROUNDUP(NVRAM_SPACE, mtd->erasesize);
+       } else {
+               /* nvram (old 128kb config partition on netgear wgt634u) */
+               bcm947xx_parts[3].offset = bcm947xx_parts[0].size;
++              bcm947xx_parts[3].size   = ROUNDUP(NVRAM_SPACE, mtd->erasesize);
+       }
+-      bcm947xx_parts[3].size = mtd->erasesize;
+ 
+       /* linux (kernel and rootfs) */
+-      if (cfe_size_flag == 0) {
++      if (cfe_size != 384 * 1024) {
+               bcm947xx_parts[1].offset = bcm947xx_parts[0].size;
+               bcm947xx_parts[1].size   = bcm947xx_parts[3].offset - 
+                       bcm947xx_parts[1].offset;
+@@ -285,7 +285,7 @@
+       } else {
+               /* legacy setup */
+               /* calculate leftover flash, and assign it to the jffs2 partition */
+-              if (cfe_size_flag == 0) {
++              if (cfe_size != 384 * 1024) {
+                       bcm947xx_parts[4].offset = bcm947xx_parts[2].offset + 
+                               bcm947xx_parts[2].size;
+                       if ((bcm947xx_parts[4].offset % mtd->erasesize) > 0) {

Download: svn-03-partitions.patch

Hi JimParis,

Just a bit off topic here. Currently, CompUSA has a US Robotics 5461 USB Printer Server/Router onsale for $70 - $55 rebates = $15. This router comes with a 2/8MB flash/RAM = a USB v2.0 port. Also, US Robotics has released the router firmware source code under GPL. I don't know if this will help you to get your robotics project going. I sure would like to see if you can get this unit to hack and make it to support a telnet login session + USB mass storage. This way, we can start to add more stuff to the router to run.

Yeah, sounds like that box is pretty similar.  Personally, we have about 10 of these Belkin ones between me and my friends, so we're probably not going be buying more anytime soon, but hopefully these patches can help you or anyone else using those.

Here's another patch.  This one is a bit strange -- I was always getting

CPU: BCM4712 rev 2 at 200 MHz
Using 100.000 MHz high precision timer.
Calibrating delay loop... 3.27 BogoMIPS

And this incorrect BogoMIPS was apparently affecting reliability of the wireless interface, as I was losing about 25% of my packets.  After stumbling across this note, I added "-fno-delayed-branch" to the kernel CFLAGS and I now get:

CPU: BCM4712 rev 2 at 200 MHz
Using 100.000 MHz high precision timer.
Calibrating delay loop... 199.47 BogoMIPS

And the wireless seems to be working great.  Upgrading gcc may fix this problem, but for now, this patch does the job.

Index: 080-bogomips-fix.patch
===================================================================
--- target/linux/brcm-2.4/patches/080-bogomips-fix.patch        (revision 0)
+++ target/linux/brcm-2.4/patches/080-bogomips-fix.patch        (revision 0)
@@ -0,0 +1,11 @@
+--- linux-2.4.32.orig/Makefile 2006-03-25 02:25:31.000000000 -0500
++++ linux-2.4.32/Makefile      2006-03-25 02:31:32.000000000 -0500
+@@ -38,7 +38,7 @@
+ GENKSYMS      = /sbin/genksyms
+ DEPMOD                = /sbin/depmod
+ MODFLAGS      = -DMODULE
+-CFLAGS_KERNEL =
++CFLAGS_KERNEL = "-fno-delayed-branch"
+ PERL          = perl
+ AWK           = awk
+ RPM           := $(shell if [ -x "/usr/bin/rpmbuild" ]; then echo rpmbuild; \

Download: svn-04-bogomips.patch

(Last edited by jimparis on 26 Mar 2006, 20:55)

Anyone can post an how-to about installing openwrt on the belkin v2000? Also:

-What are main the features added?
-Is it possible to set up the power of wifi?
-what are the encryption provided?
-Is it possible to easy reinstall belkin original firmware after installing openwrt?
-Is it a low risk operation to update firmware?

Sorry if i am doing too many questions, but before doing modify i would like to know what i am doing smile

Tnx all!

(Last edited by malbert76 on 26 Mar 2006, 12:58)

What's the part number of the Flash chip? I want to know if it's possible to replace it with a standard memory card.

malbert76 wrote:

Anyone can post an how-to about installing openwrt on the belkin v2000?

You won't be able to run the full OpenWRT without a lot of work. I'm not using it as a router.

-Is it possible to easy reinstall belkin original firmware after installing openwrt?
-Is it a low risk operation to update firmware?

boot_wait is on in nvram, so yes, you can just tftp new firmware and restore it just as easily.

star882 wrote:

What's the part number of the Flash chip? I want to know if it's possible to replace it with a standard memory card.

It's an Atmel AT45DB161 DataFlash, so yes, it should be easy to put a bigger chip in there.  There is no support in Linux 2.4 for using DataFlash with JFFS2, unfortunately.  I haven't tried 2.6 yet.

jimparis wrote:
malbert76 wrote:

Anyone can post an how-to about installing openwrt on the belkin v2000?

You won't be able to run the full OpenWRT without a lot of work. I'm not using it as a router.

-Is it possible to easy reinstall belkin original firmware after installing openwrt?
-Is it a low risk operation to update firmware?

boot_wait is on in nvram, so yes, you can just tftp new firmware and restore it just as easily.

If i understand well, there is no complete pack for this router (i mean all necessary to replace firmware)....

Anyone also know when openwrt will work on this router (it would be great)?

(Last edited by malbert76 on 27 Mar 2006, 14:02)

I am also very interested in your progress on this device. I want to use it as an AP in a WDS. Since WDS+WPA does not work with stock firmware, I'd like to have openWRT running on it (I also have a wl-500gx running it).

Any hints where to start if I want openWRT running on it? Serial console necessary?

(Last edited by TheEagle on 27 Mar 2006, 15:46)

I added the mtd patches today. Can you try the changes with a fresh kamikaze brcm-2.4 build?

We can not add the compiler flag (-fno-delayed-branch), because then you loose some advantages and performance with your MIPS CPU. Please contact us via IRC, there might be another solution.

bye
wbx

It seems we are many waiting for openwrt running on it. I hope it would be easy to install without any hardware modifies!

even i will keep waiting for it!!!!

TheEagle wrote:

I am also very interested in your progress on this device. I want to use it as an AP in a WDS. Since WDS+WPA does not work with stock firmware, I'd like to have openWRT running on it (I also have a wl-500gx running it).

Any hints where to start if I want openWRT running on it? Serial console necessary?

We've to wait some more............and hope it will works!

I won't keep waiting, but try some things myself (as much as my limited knowledge allows). Ordered a Siemens mobile phone data cable (cause I read I can use that as RS232 adapter). And I already build an image from latest trunk, but at least the network doesn't come up. Think I need access to the serial console first before can tell anything more.

Here are our hardware modifications.  For serial:

Serial port ttyS0 is available at J2:
  1 Router RX (3.3V)
  2 Router TX (3.3V)
  3 GND
  4 3.3v
Pin 1 is closest to the C316 label.

For USB, you first need to supply 5V to the board:

Change the power supply to 8-14V, then add a 7805:
  Input comes from pad closest to label R905
  Ground to ground
  Output goes to pad closest to label C987

Then put in the USB components:

Add 1A fuse at F51
Add 24.3R 1% resistor at R731
Add 24.3R 1% resistor at R732
Add 15.0K 1% resistor at R722
Add 15.0K 1% resistor at R721
Add USB connector at J51:
  5V (red)   to 1
  D- (white) to 2
  D+ (green) to 3
  0V (black) to 4
  Shield to shield

(Last edited by jimparis on 28 Mar 2006, 19:52)

Any hints where to start if I want openWRT running on it? Serial console necessary?

still not clear that!

I can tell you i had it kind of running today (without serial console) ... sadly only with read-only filesystem. Doing some more testing currently.

TheEagle wrote:

I can tell you i had it kind of running today (without serial console) ... sadly only with read-only filesystem. Doing some more testing currently.

so it's a matter of time, one day we will see a new firmware born, giving to our Belkin a new life!

jimparis wrote:
star882 wrote:

What's the part number of the Flash chip? I want to know if it's possible to replace it with a standard memory card.

It's an Atmel AT45DB161 DataFlash, so yes, it should be easy to put a bigger chip in there.  There is no support in Linux 2.4 for using DataFlash with JFFS2, unfortunately.  I haven't tried 2.6 yet.

I haven't looked at the complete timing information, but it seems like it's possible to replace it with a MMC/SD card. And at 7 wires, it's much easier to replace than parallel Flash. (The chip has a voltage range of 2.7-3.6v, so it's very likely it runs on the 3.3v supply.)
Then JTAG the router and it should work! Or read out the Flash using a card reader, transfer to the new chip, and not need to use JTAG!

malbert76 wrote:
TheEagle wrote:

I can tell you i had it kind of running today (without serial console) ... sadly only with read-only filesystem. Doing some more testing currently.

so it's a matter of time, one day we will see a new firmware born, giving to our Belkin a new life!

Oh well .. I'm afraid you might be wrong. I finally reached my target (without ever having a serial console). That means my Belkin 7230-4 is set up as "repeater" --> it's now only an AP in a WDS with WPA-PSK (that was the reason I wanted openWRT on it at all). It's running a current kamikaze build (everything not REALLY needed is stripped off, so no dnsmasq, no iptables, no dropbear, no log, in the end even telnet will not run ... just plug in and pray smile  ). And NO, it doesn't even have a writeable partition. I pre-configure all needed files and put them into ImageBuilder, and make a new image.

And seriously, I don't think it makes any sense to try and get more out of it. The 2MB flash are filled faster than one might think, and the RAM is almost full even with a very minimum installation. Even if one manages to replace the flash with a bigger one, the RAM is still a very big problem. Don't know how good swapping would work if you add the USB port and connect a hard disk.

Now after 2 days of flashing and waiting and flashing and waiting I look back and say: next time I spend 20€ more and buy a wl-500g or so,and have it working out of the box. Still I'm somehow glad I did it the way I did it, cause I learned a lot from it (and probably will learn a lot more when that guy from ebay finally sends me my serial cable).

I'm also worried about how stable the Belkin repeater will be (cause I read kamikaze is not really stable yet) ... only time will tell I guess.

However, if you want to try yourself, malbert, feel free to ask. I'll try and provide help if I can. Getting it to work is easy ... makin it do the things you want is another thing.

(Last edited by TheEagle on 30 Mar 2006, 23:28)

Sorry, posts 26 to 25 are missing from our archive.