OpenWrt Forum Archive

Topic: Linux on MikroTik Routerboard RB600 (and maybe RB333)

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

I've tested this for a few days now and it looks like, there are some issues with the network drivers.

eth0      Link encap:Ethernet  HWaddr 00:0x:xx:xx:xx:43
          inet addr:x.x.x.x  Bcast:x.x.x.x  Mask:255.255.255.0
          inet6 addr: xxxx:xxx:1::42/64 Scope:Global
          inet6 addr: fe80::20c:42ff:fexx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:43435977 errors:0 dropped:0 overruns:0 frame:2751
          TX packets:35620156 errors:0 dropped:0 overruns:14348 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2570420919 (2.3 GiB)  TX bytes:3647902339 (3.3 GiB)
          Base address:0xa000

eth2      Link encap:Ethernet  HWaddr 00:0x:xx:xx:xx:xx
          inet addr:x.x.x.x  Bcast:x.x.x.x  Mask:255.255.255.128
          inet6 addr: xxxx:xxx:xx:xx::xx/64 Scope:Global
          inet6 addr: fe80::20c:42ff:fexx:xxxx/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36138611 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42434348 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3811624008 (3.5 GiB)  TX bytes:2399071949 (2.2 GiB)
          Interrupt:21 Base address:0x1000

eth2 is set fixed at 100-FD, mii-tool does not allow to set eth0 or eth1.

See the "overruns" on eth0 ?

dmesg output for interfaces:

[   21.444752] ADDRCONF(NETDEV_UP): eth0: link is not ready
[   24.466244] PHY: 24520:00 - Link is Up - 100/Full
[   24.471102] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   25.378842] Velocity is AUTO mode
[   25.386192] ADDRCONF(NETDEV_UP): eth2: link is not ready
[   25.618960] eth2: Link auto-negotiation speed 100M bps half duplex
[   25.626259] ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready

You can ignore eth2 coming up as half duplex, because mii-tool outputs this:

SIOCGMIIPHY on 'eth0' failed: Operation not supported
SIOCGMIIPHY on 'eth1' failed: Operation not supported
eth2: 100 Mbit, full duplex, link ok

Unless it's lying.

The issue is now, if I download a file from a host on eth2 to a host on eth0, I get full 100 mbit. If I transfer a file from a host on eth0 to host on eth2 i get 10 mbit.

That's not precisely good.

Any suggestions. Could the network patches, that were left our maybe fix that ?

/M

(Last edited by Marlow on 19 Feb 2009, 16:38)

Hi Marlow,

I'm not quite sure what's going on here. You're using the 2.6.28.2 patch, right?

I'm not using the velocity port on my device at the moment, but for the two on-chip ports I'm getting no TX overruns at all.

In the original kernel patch, there are several changes to the PHY handling as well as to the Gianfar (controller for the on-chip) and Velocity drivers. It looks like some of the changes to the Gianfar controller might be relevant to your problem, but I'm not going to have a chance to look into this much further until this weekend. I'm duplicating the relevant portions of the patches below.

Keep in mind that a bunch of the kernel APIs have changed between when this patch was released (for 2.6.22.14) and the current kernel version. So you unfortunately likely won't just be able to apply the patches, and even then they probably won't 'just work' anyway.

diff -puNrb linux-2.6.22.14/drivers/net/gianfar.c linux/drivers/net/gianfar.c
--- linux-2.6.22.14/drivers/net/gianfar.c    2008-01-22 14:03:03.000000000 +0200
+++ linux/drivers/net/gianfar.c    2008-01-15 11:04:02.000000000 +0200
@@ -88,11 +88,13 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 #include <asm/uaccess.h>
+#include <asm/reg.h>
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
 #include <linux/crc32.h>
 #include <linux/mii.h>
 #include <linux/phy.h>
+#include <sysdev/fsl_soc.h>
 
 #include "gianfar.h"
 #include "gianfar_mii.h"
@@ -138,8 +140,10 @@ static void gfar_netpoll(struct net_devi
 #endif
 int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit);
 static int gfar_process_frame(struct net_device *dev, struct sk_buff *skb, int length);
+#ifdef GIANFAR_ENABLE_VLAN_ACCEL
 static void gfar_vlan_rx_register(struct net_device *netdev,
                         struct vlan_group *grp);
+#endif
 void gfar_halt(struct net_device *dev);
 void gfar_start(struct net_device *dev);
 static void gfar_clear_exact_match(struct net_device *dev);
@@ -157,6 +161,13 @@ static inline int gfar_uses_fcb(struct g
     return (priv->vlan_enable || priv->rx_csum_enable);
 }
 
+static int is_mpc83xx(void) {
+    unsigned version = mfspr(SPRN_PVR);
+
+    if ((version & 0xFFF00000) == 0x80300000) return 1;
+    return 0;
+}
+
 /* Set up the ethernet device structure, private data,
  * and anything else we need before we start */
 static int gfar_probe(struct platform_device *pdev)
@@ -169,6 +180,13 @@ static int gfar_probe(struct platform_de
     int idx;
     int err = 0;
 
+    if (is_mpc83xx()) {
+        char *xxx = ioremap(0xe0000000, 0x1000);
+        gfar_write(xxx + 0x110, (gfar_read(xxx + 0x110) & 0xFFFF0000) | 0x0707);
+        gfar_write(xxx + 0xa08, (gfar_read(xxx + 0xa08) & 0x0FFFFFFF) | 0x50000000);
+        gfar_write(xxx + 0x800, gfar_read(xxx + 0x800) | 0x30000);
+    }
+
     einfo = (struct gianfar_platform_data *) pdev->dev.platform_data;
 
     if (NULL == einfo) {
@@ -235,8 +253,13 @@ static int gfar_probe(struct platform_de
     /* Reset MAC layer */
     gfar_write(&priv->regs->maccfg1, MACCFG1_SOFT_RESET);
 
-    tempval = (MACCFG1_TX_FLOW | MACCFG1_RX_FLOW);
-    gfar_write(&priv->regs->maccfg1, tempval);
+    if (is_mpc83xx()) {
+        gfar_write(&priv->regs->maccfg1,
+               MACCFG1_RX_FLOW | MACCFG1_TX_FLOW);
+    }
+    else {
+        gfar_write(&priv->regs->maccfg1, 0);
+    }
 
     /* Initialize MACCFG2. */
     gfar_write(&priv->regs->maccfg2, MACCFG2_INIT_SETTINGS);
@@ -281,6 +304,7 @@ static int gfar_probe(struct platform_de
 
     priv->vlgrp = NULL;
 
+#ifdef GIANFAR_ENABLE_VLAN_ACCEL
     if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_VLAN) {
         dev->vlan_rx_register = gfar_vlan_rx_register;
 
@@ -288,6 +312,7 @@ static int gfar_probe(struct platform_de
 
         priv->vlan_enable = 1;
     }
+#endif
 
     if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_EXTENDED_HASH) {
         priv->extended_hash = 1;
@@ -336,10 +361,10 @@ static int gfar_probe(struct platform_de
     priv->tx_ring_size = DEFAULT_TX_RING_SIZE;
     priv->rx_ring_size = DEFAULT_RX_RING_SIZE;
 
-    priv->txcoalescing = DEFAULT_TX_COALESCE;
+    priv->txcoalescing = is_mpc83xx() ? DEFAULT_TX_COALESCE : 0;
     priv->txcount = DEFAULT_TXCOUNT;
     priv->txtime = DEFAULT_TXTIME;
-    priv->rxcoalescing = DEFAULT_RX_COALESCE;
+    priv->rxcoalescing = is_mpc83xx() ? DEFAULT_RX_COALESCE : 0;
     priv->rxcount = DEFAULT_RXCOUNT;
     priv->rxtime = DEFAULT_RXTIME;
 
@@ -456,6 +481,8 @@ static int init_phy(struct net_device *d
         return PTR_ERR(phydev);
     }
 
+    phydev->drv->flags |= PHY_HAS_MAGICANEG;
+
     /* Remove any features not supported by the controller */
     phydev->supported &= (GFAR_SUPPORTED | gigabit_support);
     phydev->advertising = phydev->supported;
@@ -545,7 +572,7 @@ void gfar_halt(struct net_device *dev)
     gfar_write(&regs->maccfg1, tempval);
 }
 
-void stop_gfar(struct net_device *dev)
+void stop_gfar(struct net_device *dev, int irq)
 {
     struct gfar_private *priv = netdev_priv(dev);
     struct gfar __iomem *regs = priv->regs;
@@ -562,6 +589,7 @@ void stop_gfar(struct net_device *dev)
     spin_unlock(&priv->rxlock);
     spin_unlock_irqrestore(&priv->txlock, flags);
 
+    if (irq) {
     /* Free the IRQs */
     if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
         free_irq(priv->interruptError, dev);
@@ -570,6 +598,7 @@ void stop_gfar(struct net_device *dev)
     } else {
          free_irq(priv->interruptTransmit, dev);
     }
+    }
 
     free_skb_resources(priv);
 
@@ -636,11 +665,6 @@ void gfar_start(struct net_device *dev)
     struct gfar __iomem *regs = priv->regs;
     u32 tempval;
 
-    /* Enable Rx and Tx in MACCFG1 */
-    tempval = gfar_read(&regs->maccfg1);
-    tempval |= (MACCFG1_RX_EN | MACCFG1_TX_EN);
-    gfar_write(&regs->maccfg1, tempval);
-
     /* Initialize DMACTRL to have WWR and WOP */
     tempval = gfar_read(&priv->regs->dmactrl);
     tempval |= DMACTRL_INIT_SETTINGS;
@@ -657,10 +681,23 @@ void gfar_start(struct net_device *dev)
 
     /* Unmask the interrupts we look for */
     gfar_write(&regs->imask, IMASK_DEFAULT);
+
+    if (is_mpc83xx()) {
+        // magic to prevent rx hang
+        gfar_write(&regs->rxfifoalarm, 0x80);
+        gfar_write(&regs->rxfifoalarmshutoff, 0x40);
+        gfar_write(&regs->rxfifopanic, 0x100);
+        gfar_write(&regs->rxfifopanicshutoff, 0x80);
+    }
+
+    /* Enable Rx and Tx in MACCFG1 */
+    tempval = gfar_read(&regs->maccfg1);
+    tempval |= (MACCFG1_RX_EN | MACCFG1_TX_EN);
+    gfar_write(&regs->maccfg1, tempval);
 }
 
 /* Bring the controller up and running */
-int startup_gfar(struct net_device *dev)
+int startup_gfar(struct net_device *dev, int irq)
 {
     struct txbd8 *txbdp;
     struct rxbd8 *rxbdp;
@@ -679,7 +716,7 @@ int startup_gfar(struct net_device *dev)
     vaddr = (unsigned long) dma_alloc_coherent(NULL,
             sizeof (struct txbd8) * priv->tx_ring_size +
             sizeof (struct rxbd8) * priv->rx_ring_size,
-            &addr, GFP_KERNEL);
+            &addr, GFP_ATOMIC);
 
     if (vaddr == 0) {
         if (netif_msg_ifup(priv))
@@ -702,7 +739,7 @@ int startup_gfar(struct net_device *dev)
     /* Setup the skbuff rings */
     priv->tx_skbuff =
         (struct sk_buff **) kmalloc(sizeof (struct sk_buff *) *
-                    priv->tx_ring_size, GFP_KERNEL);
+                    priv->tx_ring_size, GFP_ATOMIC);
 
     if (NULL == priv->tx_skbuff) {
         if (netif_msg_ifup(priv))
@@ -717,7 +754,7 @@ int startup_gfar(struct net_device *dev)
 
     priv->rx_skbuff =
         (struct sk_buff **) kmalloc(sizeof (struct sk_buff *) *
-                    priv->rx_ring_size, GFP_KERNEL);
+                    priv->rx_ring_size, GFP_ATOMIC);
 
     if (NULL == priv->rx_skbuff) {
         if (netif_msg_ifup(priv))
@@ -768,11 +805,12 @@ int startup_gfar(struct net_device *dev)
 
     /* If the device has multiple interrupts, register for
      * them.  Otherwise, only register for the one */
+    if (irq) {
     if (priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) {
         /* Install our interrupt handlers for Error,
          * Transmit, and Receive */
         if (request_irq(priv->interruptError, gfar_error,
-                0, "enet_error", dev) < 0) {
+                    0, dev->name, dev) < 0) {
             if (netif_msg_intr(priv))
                 printk(KERN_ERR "%s: Can't get IRQ %d\n",
                     dev->name, priv->interruptError);
@@ -782,18 +820,17 @@ int startup_gfar(struct net_device *dev)
         }
 
         if (request_irq(priv->interruptTransmit, gfar_transmit,
-                0, "enet_tx", dev) < 0) {
+                    0, dev->name, dev) < 0) {
             if (netif_msg_intr(priv))
                 printk(KERN_ERR "%s: Can't get IRQ %d\n",
                     dev->name, priv->interruptTransmit);
 
             err = -1;
-
             goto tx_irq_fail;
         }
 
         if (request_irq(priv->interruptReceive, gfar_receive,
-                0, "enet_rx", dev) < 0) {
+                    0, dev->name, dev) < 0) {
             if (netif_msg_intr(priv))
                 printk(KERN_ERR "%s: Can't get IRQ %d (receive0)\n",
                         dev->name, priv->interruptReceive);
@@ -812,6 +849,7 @@ int startup_gfar(struct net_device *dev)
             goto err_irq_fail;
         }
     }
+    }
 
     phy_start(priv->phydev);
 
@@ -901,6 +939,7 @@ tx_skb_fail:
 static int gfar_enet_open(struct net_device *dev)
 {
     int err;
+    printk("gfar: open %s\n", dev->name);
 
     /* Initialize a bunch of registers */
     init_registers(dev);
@@ -912,7 +951,7 @@ static int gfar_enet_open(struct net_dev
     if(err)
         return err;
 
-    err = startup_gfar(dev);
+    err = startup_gfar(dev, 1);
 
     netif_start_queue(dev);
 
@@ -921,7 +960,10 @@ static int gfar_enet_open(struct net_dev
 
 static inline struct txfcb *gfar_add_fcb(struct sk_buff *skb, struct txbd8 *bdp)
 {
-    struct txfcb *fcb = (struct txfcb *)skb_push (skb, GMAC_FCB_LEN);
+    struct txfcb *fcb;
+
+    if (skb_headroom(skb) < GMAC_FCB_LEN) return NULL;
+    fcb = (struct txfcb *)skb_push (skb, GMAC_FCB_LEN);
 
     memset(fcb, 0, GMAC_FCB_LEN);
 
@@ -988,8 +1030,15 @@ static int gfar_start_xmit(struct sk_buf
     if (likely((dev->features & NETIF_F_IP_CSUM)
             && (CHECKSUM_PARTIAL == skb->ip_summed))) {
         fcb = gfar_add_fcb(skb, txbdp);
+        if (fcb) {
         status |= TXBD_TOE;
         gfar_tx_checksum(skb, fcb);
+        } else {
+            if (skb_checksum_help(skb) != 0) {
+                dev_kfree_skb_any(skb);
+                return 0;
+            }
+        }
     }
 
     if (priv->vlan_enable &&
@@ -1065,7 +1114,7 @@ static int gfar_start_xmit(struct sk_buf
 static int gfar_close(struct net_device *dev)
 {
     struct gfar_private *priv = netdev_priv(dev);
-    stop_gfar(dev);
+    stop_gfar(dev, 1);
 
     /* Disconnect from the PHY */
     phy_disconnect(priv->phydev);
@@ -1093,6 +1142,7 @@ int gfar_set_mac_address(struct net_devi
 }
 
 
+#ifdef GIANFAR_ENABLE_VLAN_ACCEL
 /* Enables and disables VLAN insertion/extraction */
 static void gfar_vlan_rx_register(struct net_device *dev,
         struct vlan_group *grp)
@@ -1130,6 +1180,7 @@ static void gfar_vlan_rx_register(struct
 
     spin_unlock_irqrestore(&priv->rxlock, flags);
 }
+#endif
 
 static int gfar_change_mtu(struct net_device *dev, int new_mtu)
 {
@@ -1160,7 +1211,7 @@ static int gfar_change_mtu(struct net_de
     /* Only stop and start the controller if it isn't already
      * stopped, and we changed something */
     if ((oldsize != tempsize) && (dev->flags & IFF_UP))
-        stop_gfar(dev);
+        stop_gfar(dev, 1);
 
     priv->rx_buffer_size = tempsize;
 
@@ -1182,7 +1233,7 @@ static int gfar_change_mtu(struct net_de
     gfar_write(&priv->regs->maccfg2, tempval);
 
     if ((oldsize != tempsize) && (dev->flags & IFF_UP))
-        startup_gfar(dev);
+        startup_gfar(dev, 1);
 
     return 0;
 }
@@ -1194,29 +1245,28 @@ static int gfar_change_mtu(struct net_de
 static void gfar_timeout(struct net_device *dev)
 {
     struct gfar_private *priv = netdev_priv(dev);
+    printk("gfar: %s tx timeout\n", dev->name);
 
     priv->stats.tx_errors++;
 
     if (dev->flags & IFF_UP) {
-        stop_gfar(dev);
-        startup_gfar(dev);
+        stop_gfar(dev, 0);
+        phy_disconnect(priv->phydev);
+        priv->phydev = NULL;
+
+        init_registers(dev);
+        gfar_set_mac_address(dev);
+        init_phy(dev);
+        startup_gfar(dev, 0);
     }
 
     netif_schedule(dev);
 }
 
-/* Interrupt Handler for Transmit complete */
-static irqreturn_t gfar_transmit(int irq, void *dev_id)
-{
-    struct net_device *dev = (struct net_device *) dev_id;
+static void gfar_tx(struct net_device *dev) {
     struct gfar_private *priv = netdev_priv(dev);
     struct txbd8 *bdp;
 
-    /* Clear IEVENT */
-    gfar_write(&priv->regs->ievent, IEVENT_TX_MASK);
-
-    /* Lock priv */
-    spin_lock(&priv->txlock);
     bdp = priv->dirty_tx;
     while ((bdp->status & TXBD_READY) == 0) {
         /* If dirty_tx and cur_tx are the same, then either the */
@@ -1260,8 +1310,42 @@ static irqreturn_t gfar_transmit(int irq
                mk_ic_value(priv->txcount, priv->txtime));
     else
         gfar_write(&priv->regs->txic, 0);
+}
+
+/* Interrupt Handler for Transmit complete */
+static irqreturn_t gfar_transmit(int irq, void *dev_id)
+{
+    struct net_device *dev = (struct net_device *) dev_id;
+    struct gfar_private *priv = netdev_priv(dev);
 
+/*
+    printk("gfar: transmit %s %08x %08x %lu\n",
+           dev->name,
+           gfar_read(&priv->regs->ievent),
+           gfar_read(&priv->regs->imask), jiffies);
+*/
+    /* Clear IEVENT */
+    gfar_write(&priv->regs->ievent, IEVENT_TX_MASK);
+
+#ifdef CONFIG_GFAR_NAPI
+    if (netif_rx_schedule_prep(dev)) {
+        u32 tempval = gfar_read(&priv->regs->imask);
+        tempval &= IMASK_RXTX_DISABLED;
+        gfar_write(&priv->regs->imask, tempval);
+
+        __netif_rx_schedule(dev);
+    } else {
+        if (netif_msg_rx_err(priv))
+            printk(KERN_DEBUG "%s: scheduled twice (%x)[%x]\n",
+                dev->name, gfar_read(&priv->regs->ievent),
+                gfar_read(&priv->regs->imask));
+    }
+#else
+    /* Lock priv */
+    spin_lock(&priv->txlock);
+    gfar_tx(dev);
     spin_unlock(&priv->txlock);
+#endif
 
     return IRQ_HANDLED;
 }
@@ -1341,31 +1425,31 @@ irqreturn_t gfar_receive(int irq, void *
 {
     struct net_device *dev = (struct net_device *) dev_id;
     struct gfar_private *priv = netdev_priv(dev);
-#ifdef CONFIG_GFAR_NAPI
-    u32 tempval;
-#else
-    unsigned long flags;
-#endif
 
+//    printk("gfar: receive %s\n", dev->name);
+#ifdef CONFIG_GFAR_NAPI
     /* Clear IEVENT, so rx interrupt isn't called again
      * because of this interrupt */
     gfar_write(&priv->regs->ievent, IEVENT_RX_MASK);
 
-    /* support NAPI */
-#ifdef CONFIG_GFAR_NAPI
     if (netif_rx_schedule_prep(dev)) {
-        tempval = gfar_read(&priv->regs->imask);
-        tempval &= IMASK_RX_DISABLED;
+        u32 tempval = gfar_read(&priv->regs->imask);
+        tempval &= IMASK_RXTX_DISABLED;
         gfar_write(&priv->regs->imask, tempval);
 
         __netif_rx_schedule(dev);
     } else {
         if (netif_msg_rx_err(priv))
-            printk(KERN_DEBUG "%s: receive called twice (%x)[%x]\n",
+            printk(KERN_DEBUG "%s: scheduled twice (%x)[%x]\n",
                 dev->name, gfar_read(&priv->regs->ievent),
                 gfar_read(&priv->regs->imask));
     }
 #else
+    unsigned long flags;
+
+    /* Clear IEVENT, so rx interrupt isn't called again
+     * because of this interrupt */
+    gfar_write(&priv->regs->ievent, IEVENT_RX_MASK);
 
     spin_lock_irqsave(&priv->rxlock, flags);
     gfar_clean_rx_ring(dev, priv->rx_ring_size);
@@ -1485,16 +1569,23 @@ int gfar_clean_rx_ring(struct net_device
               (RXBD_LARGE | RXBD_SHORT | RXBD_NONOCTET
                | RXBD_CRCERR | RXBD_OVERRUN | RXBD_TRUNCATED))) {
             /* Increment the number of packets */
-            priv->stats.rx_packets++;
-            howmany++;
+            ++howmany;
 
             /* Remove the FCS from the packet length */
             pkt_len = bdp->length - 4;
+            if (!bdp->length) {
+                printk("gfar: received zero size frame\n");
+                if (skb) dev_kfree_skb_any(skb);
+            }
+            else {
+                priv->stats.rx_packets++;
+                priv->stats.rx_bytes += pkt_len;
 
             gfar_process_frame(dev, skb, pkt_len);
-
-            priv->stats.rx_bytes += pkt_len;
+            }
         } else {
+//            printk("gfar %s rx err %08x\n",
+//                   dev->name, bdp->status);
             count_errors(bdp->status, priv);
 
             if (skb)
@@ -1523,6 +1614,8 @@ int gfar_clean_rx_ring(struct net_device
             (priv->skb_currx +
              1) & RX_RING_MOD_MASK(priv->rx_ring_size);
 
+        /* Clear the halt bit in RSTAT */
+        gfar_write(&priv->regs->rstat, RSTAT_CLEAR_RHALT);
     }
 
     /* Update the current rxbd pointer to be the next one */
@@ -1538,23 +1631,41 @@ static int gfar_poll(struct net_device *
     struct gfar_private *priv = netdev_priv(dev);
     int rx_work_limit = *budget;
 
+//    printk("gfar: poll %s\n", dev->name);
+
+    /* Clear IEVENT */
+    gfar_write(&priv->regs->ievent, IEVENT_TX_MASK | IEVENT_RX_MASK);
+
+    /* Lock priv */
+    spin_lock(&priv->txlock);
+    gfar_tx(dev);
+    spin_unlock(&priv->txlock);
+
     if (rx_work_limit > dev->quota)
         rx_work_limit = dev->quota;
 
     howmany = gfar_clean_rx_ring(dev, rx_work_limit);
 
     dev->quota -= howmany;
-    rx_work_limit -= howmany;
     *budget -= howmany;
 
-    if (rx_work_limit > 0) {
-        netif_rx_complete(dev);
+    if (howmany >= rx_work_limit) {
+//        printk("gfar: poll more1 %s\n", dev->name);
+        return 1;
+    }
 
-        /* Clear the halt bit in RSTAT */
-        gfar_write(&priv->regs->rstat, RSTAT_CLEAR_RHALT);
+    if (gfar_read(&priv->regs->ievent) &
+        (IEVENT_TX_MASK | IEVENT_RX_MASK)) {
+//        printk("gfar: poll more2 %s %08x\n",
+//               dev->name, gfar_read(&priv->regs->ievent));
+        return 1;
+    }
+
+    netif_rx_complete(dev);
 
         gfar_write(&priv->regs->imask, IMASK_DEFAULT);
 
+    if (howmany) {
         /* If we are coalescing interrupts, update the timer */
         /* Otherwise, clear it */
         if (priv->rxcoalescing)
@@ -1564,8 +1675,8 @@ static int gfar_poll(struct net_device *
             gfar_write(&priv->regs->rxic, 0);
     }
 
-    /* Return 1 if there's more work to do */
-    return (rx_work_limit > 0) ? 0 : 1;
+//    printk("gfar: poll done %s\n", dev->name);
+    return 0;
 }
 #endif
 
diff -puNrb linux-2.6.22.14/drivers/net/gianfar.h linux/drivers/net/gianfar.h
--- linux-2.6.22.14/drivers/net/gianfar.h    2008-01-22 14:03:03.000000000 +0200
+++ linux/drivers/net/gianfar.h    2008-01-15 11:04:02.000000000 +0200
@@ -124,12 +124,12 @@ extern const char gfar_driver_version[];
 #define GFAR_10_TIME    25600
 
 #define DEFAULT_TX_COALESCE 1
-#define DEFAULT_TXCOUNT    16
-#define DEFAULT_TXTIME    4
+#define DEFAULT_TXCOUNT    64
+#define DEFAULT_TXTIME    0x1000
 
 #define DEFAULT_RX_COALESCE 1
-#define DEFAULT_RXCOUNT    16
-#define DEFAULT_RXTIME    4
+#define DEFAULT_RXCOUNT    64
+#define DEFAULT_RXTIME    0x1000
 
 #define TBIPA_VALUE        0x1f
 #define MIIMCFG_INIT_VALUE    0x00000007
@@ -264,7 +264,8 @@ extern const char gfar_driver_version[];
 #define IMASK_FIQ        0x00000004
 #define IMASK_DPE        0x00000002
 #define IMASK_PERR        0x00000001
-#define IMASK_RX_DISABLED ~(IMASK_RXFEN0 | IMASK_BSY)
+#define IMASK_RXTX_DISABLED \
+        ~(IMASK_RXFEN0 | IMASK_BSY | IMASK_TXBEN | IMASK_TXFEN)
 #define IMASK_DEFAULT  (IMASK_TXEEN | IMASK_TXFEN | IMASK_TXBEN | \
         IMASK_RXFEN0 | IMASK_BSY | IMASK_EBERR | IMASK_BABR | \
         IMASK_XFUN | IMASK_RXC | IMASK_BABT | IMASK_DPE \
@@ -475,7 +476,13 @@ struct gfar {
     u32    ptv;        /* 0x.028 - Pause Time Value Register */
     u32    dmactrl;    /* 0x.02c - DMA Control Register */
     u32    tbipa;        /* 0x.030 - TBI PHY Address Register */
-    u8    res3[88];
+//    u8    res3[88];
+    u8    res3[28];
+    u32    rxfifoalarm;
+    u32    rxfifoalarmshutoff;
+    u32    rxfifopanic;
+    u32    rxfifopanicshutoff;
+    u8    res33[44];
     u32    fifo_tx_thr;    /* 0x.08c - FIFO transmit threshold register */
     u8    res4[8];
     u32    fifo_tx_starve;    /* 0x.098 - FIFO transmit starve register */
@@ -758,8 +765,8 @@ static inline void gfar_write(volatile u
 }
 
 extern irqreturn_t gfar_receive(int irq, void *dev_id);
-extern int startup_gfar(struct net_device *dev);
-extern void stop_gfar(struct net_device *dev);
+extern int startup_gfar(struct net_device *dev, int irq);
+extern void stop_gfar(struct net_device *dev, int irq);
 extern void gfar_halt(struct net_device *dev);
 extern void gfar_phy_test(struct mii_bus *bus, struct phy_device *phydev,
         int enable, u32 regnum, u32 read);
diff -puNrb linux-2.6.22.14/drivers/net/gianfar_ethtool.c linux/drivers/net/gianfar_ethtool.c
--- linux-2.6.22.14/drivers/net/gianfar_ethtool.c    2008-01-22 14:03:03.000000000 +0200
+++ linux/drivers/net/gianfar_ethtool.c    2008-01-15 11:04:02.000000000 +0200
@@ -168,10 +168,13 @@ static int gfar_stats_count(struct net_d
 static void gfar_gdrvinfo(struct net_device *dev, struct
           ethtool_drvinfo *drvinfo)
 {
+    char busID[32];
+    sprintf(busID, "%u", ((struct gfar_private *)dev->priv)->einfo->phy_id);
+
     strncpy(drvinfo->driver, DRV_NAME, GFAR_INFOSTR_LEN);
     strncpy(drvinfo->version, gfar_driver_version, GFAR_INFOSTR_LEN);
     strncpy(drvinfo->fw_version, "N/A", GFAR_INFOSTR_LEN);
-    strncpy(drvinfo->bus_info, "N/A", GFAR_INFOSTR_LEN);
+    strncpy(drvinfo->bus_info, busID, GFAR_INFOSTR_LEN);
     drvinfo->n_stats = GFAR_STATS_LEN;
     drvinfo->testinfo_len = 0;
     drvinfo->regdump_len = 0;
@@ -461,7 +464,7 @@ static int gfar_sringparam(struct net_de
         spin_unlock_irqrestore(&priv->txlock, flags);
 
         /* Now we take down the rings to rebuild them */
-        stop_gfar(dev);
+        stop_gfar(dev, 1);
     }
 
     /* Change the size */
@@ -470,7 +473,7 @@ static int gfar_sringparam(struct net_de
 
     /* Rebuild the rings with the new size */
     if (dev->flags & IFF_UP)
-        err = startup_gfar(dev);
+        err = startup_gfar(dev, 1);
 
     return err;
 }
@@ -498,13 +501,13 @@ static int gfar_set_rx_csum(struct net_d
         spin_unlock_irqrestore(&priv->txlock, flags);
 
         /* Now we take down the rings to rebuild them */
-        stop_gfar(dev);
+        stop_gfar(dev, 1);
     }
 
     priv->rx_csum_enable = data;
 
     if (dev->flags & IFF_UP)
-        err = startup_gfar(dev);
+        err = startup_gfar(dev, 1);
 
     return err;
 }

There are also some minimal changes to the Velocity driver:

diff -puNrb linux-2.6.22.14/drivers/net/via-velocity.c linux/drivers/net/via-velocity.c
--- linux-2.6.22.14/drivers/net/via-velocity.c    2008-01-22 14:03:03.000000000 +0200
+++ linux/drivers/net/via-velocity.c    2008-01-15 11:04:02.000000000 +0200
@@ -596,7 +596,7 @@ static void velocity_init_registers(stru
         /*
          *    Init CAM filter
          */
-        velocity_init_cam_filter(vptr);
+//        velocity_init_cam_filter(vptr);
 
         /*
          *    Set packet filter: Receive directed and broadcast address
@@ -1253,7 +1253,7 @@ static int velocity_rx_srv(struct veloci
         /*
          *    Don't drop CE or RL error frame although RXOK is off
          */
-        if ((rd->rdesc0.RSR & RSR_RXOK) || (!(rd->rdesc0.RSR & RSR_RXOK) && (rd->rdesc0.RSR & (RSR_CE | RSR_RL)))) {
+        if ((rd->rdesc0.RSR & RSR_RXOK) || (rd->rdesc0.RSR & (RSR_CE | RSR_RL | RSR_VIDM))) {
             if (velocity_receive_frame(vptr, rd_curr) < 0)
                 stats->rx_dropped++;
         } else {

Like I said, I'll try to do some further analysis this weekend and possibly port these patches into the current release to see if it helps any. I'll also try testing packet transfer from an on-chip port to the Velocity port and see if anything funny happens.

Yep.

I'm using the unmodified 2.6.28.2 patch on a vanilla 2.6.28.2 kernel (from kernel.org). I've got a few boxes here, where I can test things, so I'll try apply the patches, recompile and see, if that makes a difference to performance or stability.

I can for sure say, that it's not a once off behaviour, because I've got the issue on two boxes.

Also, the reason for fixing the speed and duplex on eth2, is because on places like internet exchanges and with some carriers, it's a requirement.

I can also try move the cable on eth2 to eth1, go back to autonegotiation and see, if i get the same behaviour.

/M

(Last edited by Marlow on 20 Feb 2009, 02:32)

Hi everyone!

With the help of Michael Guntsche (maru), whose insight made this release possible, I'm happy to present a release for kernel 2.6.30.1. This release basically has three components:

* Support for the board
* Support for the ATA interface for CompactFlash cards
* Support for the onboard NAND chip

Note that in order to take advantage of the NAND chip, you *must* use the YAFFS configuration exactly as specified in the .config, otherwise it will get corrupted. If you'd like to see it in action, try running mount /dev/mtdblock1 /mnt once you get it up and running and you'll have access to the RouterOS filesystem. smile

(EDIT: Note that you have to patch the kernel with YAFFS2 from CVS before you build it. That isn't included with the patch I distribute. You can get details at http://www.yaffs.net/ -- simply running their automatic patch script works great.)

We've removed almost all of the crud from the patch, and we now use a devicetree blob to bootstrap the kernel. Board-specific features like MAC addresses and CPU clock speeds are automatically determined and set. maru did most of the work there, so hats off to him for that effort.

I think the Gianfar driver in 2.6.30.1 fixes the weird problems that some of you were experiencing with bandwidth rates. Please give it a try and let me know how it goes.

The next step for us is going to be getting a tiny Linux image running for the NAND and seeing if we can boot the entire system without a CompactFlash card. It should theoretically work right now, but it hasn't been tested much.

Installing the kernel is a bit different than in previous releases due to the device tree feature. Here's some quick instructions:

1. make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- dtbImage.rb600
2. make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- modules
3. make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- INSTALL_MOD_PATH=/somewhere/handy modules_install

The new ELF image that you need to dd to the device is not vmlinux, but rather arch/powerpc/boot/dtbImage.rb600.elf. Use the same procedure as before with this file (i.e., append kernel parameters using objcopy).

You'll want to make sure that your kernel image is under about 2MB, otherwise it simply won't boot. I think this is not a problem when booting from NAND though (if memory serves me right from what maru told me). That said, you'll definitely want to move a lot of stuff to modules anyway and make sure you move the modules directory to your device (in /lib/modules) after running modules_install.

A few other things: I do plan to set up a more formal project for this at some point, and potentially start supporting other MikroTik devices too. (Especially so I can stop bringing up this thread. smile So stay tuned for that. I also plan to have a tutorial up detailing how to patch everything properly, and also a tutorial for creating a cross-compiling toolchain because-the-bloody-one-in-emdebian-is-bloody-broken.

And now, without further ado, the files:

http://cynigram.com/~nfontes/rb600/linu … 600.config
http://cynigram.com/~nfontes/rb600/linu … b600.patch
http://cynigram.com/~nfontes/rb600/dtbI … +rb600.elf

Again, a huge thanks to maru for helping out with this. Happy hacking, all!

(Last edited by impl on 13 Jul 2009, 01:59)

First of all I'd like to thank you guys for all the work you've done and shared with us.

I've been searching for a way to use GNU/Debian on a RB600 1Gb. CF for about three days now. The results have so far been very disappointing sad

Yes, I know how to use Google smile
Yes, I know how to search forums

Most of the results I got from Google, forums are:

- In Russian, french, and other languages I don't understand
- So outdated it's not even worth trying
- Written for linux experts (I'm NOT one), and taking for granted the reader has a working knowledge of the whole operating system, C programming and kernel.

So far this is the only forum post that has been of any help. I've been reading it for a long time and:

- I've been using linux for a long time but for basic stuff like seting up/securing/administering a server (MySQL, Apache, etc). I don't have experience in chain-tools and some other advanced commands-functions.

- I tried to follow the tutorial at: http://www.marlow.dk/wiki/index.php/RouterboardPPC to the letter but unfortunatelly it seems to be written for experts only...
. the second step ("and run apt-get update") fails on my clean Debian installation with an error: GPG ERROR ... http://www.emdebian.org ... NO_PUBKEY
. the third step ("apt-get install binutils-powerpc-linux-gnu cpp-4.2-powerpc-linux-gnu gcc-4.2-powerpc-linux-gnu-base gcc-4.2-powerpc-linux-gnu libc6-dev-powerpc-cross libc6-powerpc-cross libgcc1-powerpc-cross linux-libc-dev-powerpc-cross") fails with an error: libgcc1-powerpc-cross: Depends: gcc-4.4-powerpc-linux-gnu-base...
. And this is as far as I dared to go...

So bottom line: I know Linux is not "click next, next, next, finish" and the installation is complete. I love linux and have been reading manpages, howtos, tutorials, etc to learn how to set it up and how to configure servers, networking and security. So I know the solution to my problem right now should be to read some obscure articles about kernel cross-tools, embedding debian, kernel patching, etc. until finally I will figure it out. The problem is that I have to get this RB600 Debian on 1GB CF working ASAP and have not time to take a self-training course for the next 2 weeks.

Is there a way that you guys, who have done so much already, could write a simple step-by-step for dummies (like me) about how to get gnu/debian running on a CF in a RB600 with no obscure instructions like for instance "now you have to compile the conf for source of deb-apt and link it to the /dev of the &HF6A0122 for the dark side of the moon" smile?

I would be really thankful for something like that, and something tells me (given the LARGE amount of pages and forums I've been reading) that A LOT of people would benefit for a tutorial like that.

Sorry for my poor english.

Regards and thanks again.

elfalaXia

Hi elfalaXia,

With regards to your problems there, that GPG error is actually not terribly important (it only verifies the integrity of packages). You can resolve it using apt-get install emdebian-archive-keyring.

The other problem, however, is somewhat of a blocker. Basically, emdebian screwed up. For some reason, there are no cross-compilation packages available for powerpc on i386 for gcc 4.4. I tried to build them myself without much luck. I eventually reverted to gcc 4.3, and hacked a bit, to build my own libgcc1 + supporting cross-compilation packages. As I mentioned in the previous post, I'll try to put up a tutorial outlining how to do that soonish. For now, sans the tutorial itself, here's the steps I took to build the packages, in a chrooted environment so as to not completely botch my own machine:

~# mkdir root
~# debootstrap squeeze root http://ftp.us.debian.org/debian
~# for MOUNTPOINT in {/dev,/dev/pts,/proc}; do
> mount -t none -o rw,bind $MOUNTPOINT root/$MOUNTPOINT
> done
~# env -i TERM=$TERM /usr/sbin/chroot root

/# echo "127.0.0.1 localhost" > /etc/hosts
/# echo "127.0.1.1 $(hostname) $(hostname)." >> /etc/hosts
/# . /etc/profile
/# echo "deb http://ftp.us.debian.org/debian unstable main" >> /etc/apt/sources.list
/# echo "deb-src http://ftp.us.debian.org/debian unstable main" >> /etc/apt/sources.list
/# editor /etc/apt/preferences
> Package: *
> Pin: release o=Debian,a=testing
> Pin-Priority: 900
> 
> Package: *
> Pin: release o=Debian,a=squeeze
> Pin-Priority: 900
> 
> Package: *
> Pin: release o=Debian,a=unstable
> Pin-Priority: 500
> 
> Package: *
> Pin: release o=Debian,a=sid
> Pin-Priority: 500
/# apt-get update
/# apt-get upgrade
/# apt-get install locales
/# dpkg-reconfigure locales
/# tasksel install standard
/# apt-get install build-essential dpkg-cross fakeroot dpatch gawk flex bison realpath automake debhelper cdbs
/# apt-get install -o APT::Install-Recommends=0 gcc-multilib libc6-dev-amd64 lib64gcc1 autogen autoconf2.59 automake1.9 libtool gperf libmpfr-dev sharutils dejagnu chrpath lsb-release doxygen graphviz gsfonts-x11 texlive-latex-base
/# mkdir -p /toolchain/binutils /toolchain/libraries /toolchain/gcc
/toolchain# cd /toolchain/binutils
/toolchain/binutils# apt-get source -t unstable binutils
/toolchain/binutils# cd binutils-<VERSION>
/toolchain/binutils/binutils-<VERSION># TARGET=powerpc-linux-gnu debian/rules binary-cross
/toolchain/binutils/binutils-<VERSION># cd ..
/toolchain/binutils# dpkg -i binutils-powerpc-linux-gnu_<VERSION>_i386.deb
/toolchain/binutils# cd ..
/toolchain# cd libraries
/toolchain/libraries# for PACKAGE in {libc6,linux-libc-dev,libc6-dev}; do
> wget -q -O - http://packages.debian.org/unstable/powerpc/${PACKAGE}/download | grep 'ftp.us.debian.org' | cut -d\" -f2 | xargs wget
> dpkg-cross --arch powerpc --build ${PACKAGE}_*_powerpc.deb
> dpkg -i --force-depends ${PACKAGE}-powerpc-cross_*.deb
> done
/toolchain/libraries# cd ..
/toolchain# cd gcc
/toolchain/gcc# apt-get source -t unstable gcc-4.3
/toolchain/gcc# cd gcc-4.3-<VERSION>
/toolchain/gcc/gcc-4.3-<VERSION># sed -i.bak -e 's/^with_common_libs := .*/with_common_libs := yes/' debian/rules.defs
/toolchain/gcc/gcc-4.3-<VERSION># GCC_TARGET=powerpc DEB_CROSS_NO_BIARCH=yes WITHOUT_LANG=java,fortran,pascal,obj,obj-c++,ada,treelang dpkg-buildpackage -us -uc -b
/toolchain/gcc/gcc-4.3-<VERSION># cd ..
/toolchain/gcc# dpkg -i libgcc1-powerpc-cross_<VERSION>_all.deb gcc-4.3-powerpc-linux-gnu-base_<VERSION>_i386.deb cpp-4.3-powerpc-linux-gnu_<VERSION>_i386.deb g++-4.3-powerpc-linux-gnu_<VERSION>_i386.deb gcc-4.3-powerpc-linux-gnu_<VERSION>_i386.deb libstdc++6-powerpc-cross_<VERSION>_all.deb libstdc++6-4.3-dev-powerpc-cross_<VERSION>_all.deb libstdc++6-4.3-pic-powerpc-cross_<VERSION>_all.deb

This took me quite a while to figure out. tongue

I'll update this when I get the tutorial online. HTH.

Thanks so much! I'll try it right now.

Hi everyone,
I've configured 4GB CF and I wanted to test it on RB1000 but it was unable to boot properly...loads to "Loading kernel" and stops there.
Has anyone tested it on routerboard 1000 hardware?
Also does anyone have bootable images of CF cards?
Thanks in advance.

I am starting again to play with my dusty rb333.

I've created four different directories in order to better track changes that happen on this tree.

* rb333/rb600 mikrotik patches.
* mpc83xx openwrt patches with support to ?rb600?
* rb600 debian patches for rb600
* mikrotik 2.6.22.14 to openwrt 2.6.31.12 port

so far I was only able to partially netboot this kernel from the last debian rb600 works.

RouterBOOT booter 2.18

RouterBoard 333

CPU frequency: 333 MHz
  Memory size:  64 MB

Press any key within 2 seconds to enter setup..
trying bootp protocol................................................................. OK
Got IP address: 212.70.193.245
resolved mac address 90:E6:BA:D6:3A:3C
Gateway: 212.70.193.241
transfer started ............... transfer ok, time=0.55s
setting up elf image... OK
jumping to kernel code
Memory <- <0x0 0x4000000> (64MB)
ethernet1: local-mac-address <- 7d:e0:b4:2c:3a:d6
ethernet0: local-mac-address <- 7d:e0:b4:2c:3a:d6
CPU clock-frequency <- 0x13de3650 (333MHz)
CPU timebase-frequency <- 0x1fc9f08 (33MHz)

zImage starting: loaded at 0x00400000 (sp: 0x005ddfc0)
Allocating 0x42ad30 bytes for kernel ...
gunzipping (0x00000000 <- 0x0040d000:0x005dc853)...done 0x3eb1bc bytes

Linux/PowerPC load: console=ttyS0,115200 board=mpc8323 boot=1
Finalizing device tree... flat tree at 0x5ea300
[    0.000000] Using MikroTik RouterBOARD 600 series machine description
[    0.000000] Linux version 2.6.30.1-kansascity0 (root@godspeed) (gcc version 4.3.3 (Debian 4.3.3-13) ) #1 Sun Jul 12 23:50:11 UTC 2009
[    0.000000] console [udbg0] enabled
[    0.000000] Found FSL PCI host bridge at 0x00000000e0008500. Firmware bus number: 0->0
[    0.000000] PCI host bridge /pci@e0008500 (primary) ranges:
[    0.000000]  MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000 
[    0.000000]   IO 0x00000000d0000000..0x00000000d3ffffff -> 0x0000000000000000
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x00004000
[    0.000000]   Normal   0x00004000 -> 0x00004000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00004000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 board=mpc8323 boot=1
[    0.000000] NR_IRQS:512
[    0.000000] IPIC (128 IRQ sources) at fcffc700
[    0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
[    0.000000] clocksource: timebase mult[78004ea] shift[22] registered
[    0.006569] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.013705] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.028691] Memory: 60596k/65536k available (3804k kernel code, 4872k reserved, 176k data, 251k bss, 164k init)
[    0.038692] Kernel virtual memory layout:
[    0.042636]   * 0xffffe000..0xfffff000  : fixmap
[    0.047243]   * 0xfcffb000..0xfe000000  : early ioremap
[    0.052428]   * 0xc5000000..0xfcffb000  : vmalloc & ioremap
[    0.058097] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.065702] Calibrating delay loop... 66.56 BogoMIPS (lpj=133120)
[    0.156385] Security Framework initialized
[    0.160478] Mount-cache hash table entries: 512
[    0.166904] Initializing cgroup subsys ns
[    0.170887] Initializing cgroup subsys cpuacct
[    0.178423] net_namespace: 996 bytes
[    0.183643] NET: Registered protocol family 16
[    0.194195] PCI: Probing PCI hardware
[    0.227361] bio: create slab <bio-0> at 0
[    0.234309] SCSI subsystem initialized
[    0.241764] Freescale Elo / Elo Plus DMA driver
[    0.249494] cfg80211: Using static regulatory domain info
[    0.254852] cfg80211: Regulatory domain: US
[    0.259066]  (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[    0.266230]  (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
[    0.272960]  (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[    0.279699]  (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[    0.286438]  (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[    0.293177]  (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[    0.299916]  (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
[    0.306699] cfg80211: Calling CRDA for country: US
[    0.319254] NET: Registered protocol family 2
[    0.324180] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.332903] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    0.340081] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.346474] TCP: Hash tables configured (established 2048 bind 2048)
[    0.352773] TCP reno registered
[    0.356359] NET: Registered protocol family 1
[    0.366726] Freescale PowerQUICC MII Bus: probed
[    0.392867] Freescale PowerQUICC MII Bus: probed
[    0.399995] WDT driver for MPC8xxx initialized. mode:reset timeout=65535 (-65536 seconds)
[    0.412221] audit: initializing netlink socket (disabled)
[    0.417724] type=2000 audit(0.342:1): initialized
[    0.423778] VFS: Disk quotas dquot_6.5.2
[    0.428010] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.434907] yaffs Jul 12 2009 23:47:17 Installing. 
[    0.439841] msgmni has been set to 118
[    0.453294] alg: No test for stdrng (krng)
[    0.457531] io scheduler noop registered
[    0.461488] io scheduler anticipatory registered
[    0.466065] io scheduler deadline registered
[    0.470327] io scheduler cfq registered (default)
[    0.477076] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.486983] serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A
?f?`???x~??~??????????????f???`??xfx?~?????`??f~`???x?~???fx???~`f???~f????f?f??`??f??????~????`f~??f???xfx???f?fx?f????????f??~`?????ffxf?xfx?~f????f???????f?xxx~?f??ff~fx`?f?x??????????f???x?x??????~???

it looks there is an issue on the serial driver or wrong baud settings

some of my work/experimentation on this platform is here.

(Last edited by acoul on 17 Mar 2010, 11:52)

acoul wrote:

I am starting again to play with my dusty rb333.

I've created four different directories in order to better track changes that happen on this tree.

* rb333/rb600 mikrotik patches.
* mpc83xx openwrt patches with support to ?rb600?
* rb600 debian patches for rb600
* mikrotik 2.6.22.14 to openwrt 2.6.31.12 port

What about rb800? Is this routerboard supported?

I was able to partially netboot this image with the following results:

RouterBOOT booter 2.18

RouterBoard 333

CPU frequency: 333 MHz
  Memory size:  64 MB

Press any key within 2 seconds to enter setup..
trying bootp protocol... OK
Got IP address: 212.70.193.245
resolved mac address 90:E6:BA:D6:3A:3C
Gateway: 212.70.193.241
transfer started ............... transfer ok, time=0.53s
setting up elf image... OK
jumping to kernel code
Memory <- <0x0 0x4000000> (64MB)
ethernet1: local-mac-address <- 7d:e0:b4:2c:3a:d6
ethernet0: local-mac-address <- 7d:e0:b4:2c:3a:d6
CPU clock-frequency <- 0x13de3650 (333MHz)
CPU timebase-frequency <- 0x1fc9f08 (33MHz)

zImage starting: loaded at 0x00400000 (sp: 0x005ddfc0)
Allocating 0x42ad30 bytes for kernel ...
gunzipping (0x00000000 <- 0x0040d000:0x005dc853)...done 0x3eb1bc bytes

Linux/PowerPC load: console=ttyS0,115200 board=mpc8323 boot=1
Finalizing device tree... flat tree at 0x5ea300
[    0.000000] Using MikroTik RouterBOARD 600 series machine description
[    0.000000] Linux version 2.6.30.1-kansascity0 (root@godspeed) (gcc version 4.3.3 (Debian 4.3.3-13) ) #1 Sun Jul 12 23:50:11 UTC 2009
[    0.000000] console [udbg0] enabled
[    0.000000] Found FSL PCI host bridge at 0x00000000e0008500. Firmware bus number: 0->0
[    0.000000] PCI host bridge /pci@e0008500 (primary) ranges:
[    0.000000]  MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000 
[    0.000000]   IO 0x00000000d0000000..0x00000000d3ffffff -> 0x0000000000000000
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x00004000
[    0.000000]   Normal   0x00004000 -> 0x00004000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00004000
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
[    0.000000] Kernel command line: console=ttyS0,115200 board=mpc8323 boot=1
[    0.000000] NR_IRQS:512
[    0.000000] IPIC (128 IRQ sources) at fcffc700
[    0.000000] PID hash table entries: 256 (order: 8, 1024 bytes)
[    0.000000] clocksource: timebase mult[78004ea] shift[22] registered
[    0.006569] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.013705] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
[    0.028691] Memory: 60596k/65536k available (3804k kernel code, 4872k reserved, 176k data, 251k bss, 164k init)
[    0.038692] Kernel virtual memory layout:
[    0.042636]   * 0xffffe000..0xfffff000  : fixmap
[    0.047243]   * 0xfcffb000..0xfe000000  : early ioremap
[    0.052428]   * 0xc5000000..0xfcffb000  : vmalloc & ioremap
[    0.058097] SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.065702] Calibrating delay loop... 66.56 BogoMIPS (lpj=133120)
[    0.156385] Security Framework initialized
[    0.160478] Mount-cache hash table entries: 512
[    0.166904] Initializing cgroup subsys ns
[    0.170887] Initializing cgroup subsys cpuacct
[    0.178423] net_namespace: 996 bytes
[    0.183643] NET: Registered protocol family 16
[    0.194195] PCI: Probing PCI hardware
[    0.227361] bio: create slab <bio-0> at 0
[    0.234309] SCSI subsystem initialized
[    0.241764] Freescale Elo / Elo Plus DMA driver
[    0.249494] cfg80211: Using static regulatory domain info
[    0.254852] cfg80211: Regulatory domain: US
[    0.259066]  (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[    0.266230]  (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm)
[    0.272960]  (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[    0.279699]  (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[    0.286438]  (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[    0.293177]  (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm)
[    0.299916]  (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm)
[    0.306699] cfg80211: Calling CRDA for country: US
[    0.319254] NET: Registered protocol family 2
[    0.324180] IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.332903] TCP established hash table entries: 2048 (order: 2, 16384 bytes)
[    0.340081] TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
[    0.346474] TCP: Hash tables configured (established 2048 bind 2048)
[    0.352773] TCP reno registered
[    0.356359] NET: Registered protocol family 1
[    0.366726] Freescale PowerQUICC MII Bus: probed
[    0.392867] Freescale PowerQUICC MII Bus: probed
[    0.399995] WDT driver for MPC8xxx initialized. mode:reset timeout=65535 (-65536 seconds)
[    0.412221] audit: initializing netlink socket (disabled)
[    0.417724] type=2000 audit(0.342:1): initialized
[    0.423778] VFS: Disk quotas dquot_6.5.2
[    0.428010] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.434907] yaffs Jul 12 2009 23:47:17 Installing. 
[    0.439841] msgmni has been set to 118
[    0.453294] alg: No test for stdrng (krng)
[    0.457531] io scheduler noop registered
[    0.461488] io scheduler anticipatory registered
[    0.466065] io scheduler deadline registered
[    0.470327] io scheduler cfq registered (default)
[    0.477076] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    0.486983] serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A
?f?`???x~??~??????????????f???`??xfx?~?????`??f~`???x?~???fx???~`f???~f????f?f??`??f??????~????`f~??f???xfx???f?fxf?f????????f??~`?????ffxf?xfx?~f????f????????f?xxx~?f??ff~fx`?f?x??????????f???x?x???????

Issuing a file  dtbImage.rb600-2.6.30.1+rb600.elf I get the following:

dtbImage.rb600-2.6.30.1+rb600.elf: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, with unknown capability 0x41000000 = 0x11676e75, with unknown capability 0x10000 = 0x90402, not stripped

booting an openwrt generated image gives the following:

RouterBOOT booter 2.18

RouterBoard 333

CPU frequency: 333 MHz
  Memory size:  64 MB

Press any key within 2 seconds to enter setup..
trying bootp protocol... OK
Got IP address: 212.70.193.245
resolved mac address 90:E6:BA:D6:3A:3C
Gateway: 212.70.193.241
transfer started .................. transfer ok, time=0.65s
setting up elf image... OK
jumping to kernel code
Memory <- <0x0 0x4000000> (64MB)
ethernet1: local-mac-address <- 7d:e0:b4:2c:3a:d6
ethernet0: local-mac-address <- 7d:e0:b4:2c:3a:d6
CPU clock-frequency <- 0x13de3650 (333MHz)
CPU timebase-frequency <- 0x1fc9f08 (33MHz)

zImage starting: loaded at 0x00400000 (sp: 0x00646fb0)
Allocating 0x50a0d4 bytes for kernel ...
Insufficient memory for kernel at address 0! (_start=00400000, uncompressed size=004ce3c8)

Issuing a file openwrt-mpc83xx-rb600.elf  I get the following:

openwrt-mpc83xx-rb600.elf: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, with unknown capability 0x41000000 = 0x13676e75, with unknown capability 0x10000 = 0xb0402, not stripped

(Last edited by acoul on 22 Mar 2010, 21:29)

ok, found little time to further play with my rb333.

kaloz suggested to patch the wrapper, so searching the net got me here which resulted in this patch which gave a partially working openwrt kernel:

RouterBOOT booter 2.18

RouterBoard 333

CPU frequency: 333 MHz
  Memory size:  64 MB

Press any key within 2 seconds to enter setup..
trying bootp protocol... OK
Got IP address: 212.70.193.245
resolved mac address 90:E6:BA:D6:3A:3C
Gateway: 212.70.193.241
transfer started ............... transfer ok, time=0.54s
setting up elf image... OK
jumping to kernel code
Memory <- <0x0 0x4000000> (64MB)
ethernet1: local-mac-address <- 7d:e0:b4:2c:3a:d6
ethernet0: local-mac-address <- 7d:e0:b4:2c:3a:d6
CPU clock-frequency <- 0x13de3650 (333MHz)
CPU timebase-frequency <- 0x1fc9f08 (33MHz)

zImage starting: loaded at 0x00470000 (sp: 0x0065dfb0)
Allocating 0x420b84 bytes for kernel ...
gunzipping (0x00000000 <- 0x0047e000:0x0065c9e7)...done 0x40ba9c bytes

Linux/PowerPC load: console=ttyS0,115200 board=mpc8323 boot=1
Finalizing device tree... flat tree at 0x66a300
Using MikroTik RouterBOARD 600 series machine description
Linux version 2.6.30.10 (alex@aifnis) (gcc version 4.4.3 (GCC) ) #4 Wed Mar 24 20:56:51 EET 2010
console [udbg0] enabled
Found FSL PCI host bridge at 0x00000000e0008500. Firmware bus number: 0->0
PCI host bridge /pci@e0008500 (primary) ranges:
 MEM 0x0000000080000000..0x000000009fffffff -> 0x0000000080000000 
  IO 0x00000000d0000000..0x00000000d3ffffff -> 0x0000000000000000
Zone PFN ranges:
  DMA      0x00000000 -> 0x00004000
  Normal   0x00004000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttyS0,115200 board=mpc8323 boot=1
NR_IRQS:512
IPIC (128 IRQ sources) at fcffc700
PID hash table entries: 256 (order: 8, 1024 bytes)
clocksource: timebase mult[78004ea] shift[22] registered
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 60644k/65536k available (3968k kernel code, 4832k reserved, 148k data, 82k bss, 1596k init)
Kernel virtual memory layout:
  * 0xffffe000..0xfffff000  : fixmap
  * 0xfcffb000..0xfe000000  : early ioremap
  * 0xc5000000..0xfcffb000  : vmalloc & ioremap
Calibrating delay loop... 66.56 BogoMIPS (lpj=133120)
Mount-cache hash table entries: 512
net_namespace: 332 bytes
NET: Registered protocol family 16
PCI: Probing PCI hardware
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Freescale Elo / Elo Plus DMA driver
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
Freescale PowerQUICC MII Bus: probed
Freescale PowerQUICC MII Bus: probed
WDT driver for MPC8xxx initialized. mode:reset timeout=65535 (-65536 seconds)
Registering mini_fo version $Id$
yaffs Mar 24 2010 20:54:23 Installing. 
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A
????????f???`??xfx?~?????`??f~`???x?~???fx???~`f???~f???x??fxf????f?f?`ff???????~f???f?ff??fxf?~??fxxf?xfxf??????????~????`f~??f???xfx??`??f?xfx?x~?ffx`????x~????~???ff??fx????fx?f~?f~?fx??fx`???`??f?

next step is to port all my work to 2.6.33.1 and workout the dts & boot files for the rb333 board.

I followed Michael Guntsche suggestion to boot the vmlinux image isntead of the wrapped generated and:

RouterBOOT booter 2.18

RouterBoard 333

CPU frequency: 333 MHz
  Memory size:  64 MB

Press any key within 2 seconds to enter setup..
trying bootp protocol... OK
Got IP address: 212.70.193.245
resolved mac address 90:E6:BA:D6:3A:3C
Gateway: 212.70.193.241
transfer started ....................................... transfer ok, time=1.51s
setting up elf image... OK
jumping to kernel code
Using MikroTik RouterBOARD 600 series machine description
Linux version 2.6.30.10 (alex@aifnis) (gcc version 4.4.3 (GCC) ) #8 Thu Mar 25 16:14:29 EET 2010
console [udbg0] enabled
No pci config register base in dev tree, using default
Found FSL PCI host bridge at 0x00000000e0008500. Firmware bus number: 0->0
PCI host bridge /soc8323@e0000000/pci@8500 (primary) ranges:
Zone PFN ranges:
  DMA      0x00000000 -> 0x00004000
  Normal   0x00004000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttyS0,115200 board=mpc8323 boot=1
NR_IRQS:512
IPIC (128 IRQ sources) at fdef7700
PID hash table entries: 256 (order: 8, 1024 bytes)
clocksource: timebase mult[78004ea] shift[22] registered
Console: colour dummy device 80x25
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 60516k/65536k available (4080k kernel code, 4956k reserved, 164k data, 93k bss, 1600k init)
Kernel virtual memory layout:
  * 0xffffe000..0xfffff000  : fixmap
  * 0xfdef5000..0xfe000000  : early ioremap
  * 0xc5000000..0xfdef5000  : vmalloc & ioremap
Calibrating delay loop... 66.56 BogoMIPS (lpj=133120)
Mount-cache hash table entries: 512
net_namespace: 332 bytes
NET: Registered protocol family 16
PCI: Probing PCI hardware
PCI: I/O resource not set for host bridge /soc8323@e0000000/pci@8500 (domain 0)
PCI: Memory resource 0 not set for host bridge /soc8323@e0000000/pci@8500 (domain 0)
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Freescale Elo / Elo Plus DMA driver
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
WDT driver for MPC8xxx initialized. mode:reset timeout=65535 (-65536 seconds)
Registering mini_fo version $Id$
yaffs Mar 25 2010 16:11:53 Installing. 
msgmni has been set to 118
alg: No test for stdrng (krng)
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered (default)
Generic RTC Driver v1.07
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A
console handover: boot [udbg0] -> real [ttyS0]
Freescale QUICC Engine UART device driver
loop: module loaded
Driver 'sd' needs updating - please use bus_type methods
SSFDC read-only Flash Translation layer
slram: not enough parameters.
rbppc_nand_probe: MikroTik RouterBOARD 333/600 series NAND driver, version 0.0.2
NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 2810 at 0x000002be8000
Bad eraseblock 4046 at 0x000003f38000
Creating 2 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000400000 : "RouterBOARD NAND Boot"
ftl_cs: FTL header not found.
0x000000400000-0x000004000000 : "RouterBOARD NAND Main"
ftl_cs: FTL header not found.
TCP cubic registered
Freeing unused kernel memory: 1600k init
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
- init -

Please press Enter to activate this console. 


BusyBox v1.15.3 (2010-03-24 19:25:17 EET) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge, r20420) ------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#

today I ported the 2.6.30.10 patches to 2.6.33.1 and had success on booting that kernel:

RouterBOOT booter 2.18

RouterBoard 333

CPU frequency: 333 MHz
  Memory size:  64 MB

Press any key within 2 seconds to enter setup..
trying bootp protocol... OK
Got IP address: 212.70.193.245
resolved mac address 90:E6:BA:D6:3A:3C
Gateway: 212.70.193.241
transfer started ......................................... transfer ok, time=1.44s
setting up elf image... OK
jumping to kernel code
Using MikroTik RouterBOARD 600 series machine description
Linux version 2.6.33.1 (alex@aifnis) (gcc version 4.4.3 (GCC) ) #2 Sun Mar 28 16:43:17 EEST 2010
bootconsole [udbg0] enabled
No pci config register base in dev tree, using default
Found FSL PCI host bridge at 0x00000000e0008500. Firmware bus number: 0->0
PCI host bridge /soc8323@e0000000/pci@8500 (primary) ranges:
Zone PFN ranges:
  DMA      0x00000000 -> 0x00004000
  Normal   0x00004000 -> 0x00004000
Movable zone start PFN for each node
early_node_map[1] active PFN ranges
    0: 0x00000000 -> 0x00004000
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 16256
Kernel command line: console=ttyS0,115200 board=mpc8323 boot=1
PID hash table entries: 256 (order: -2, 1024 bytes)
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 60296k/65536k available (4348k kernel code, 5172k reserved, 124k data, 100k bss, 1608k init)
Kernel virtual memory layout:
  * 0xfffdf000..0xfffff000  : fixmap
  * 0xfdef8000..0xfe000000  : early ioremap
  * 0xc5000000..0xfdef8000  : vmalloc & ioremap
NR_IRQS:512 nr_irqs:512
IPIC (128 IRQ sources) at c5000700
clocksource: timebase mult[78004ea] shift[22] registered
Console: colour dummy device 80x25
Mount-cache hash table entries: 512
NET: Registered protocol family 16
PCI: Probing PCI hardware
PCI: I/O resource not set for host bridge /soc8323@e0000000/pci@8500 (domain 0)
PCI: Memory resource 0 not set for host bridge /soc8323@e0000000/pci@8500 (domain 0)
bio: create slab <bio-0> at 0
SCSI subsystem initialized
Freescale Elo / Elo Plus DMA driver
Switching to clocksource timebase
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
WDT driver for MPC8xxx initialized. mode:reset timeout=65535 (-65536 seconds)
Registering mini_fo version $Id$
JFFS2 version 2.2. (NAND) ?© 2001-2006 Red Hat, Inc.
yaffs Mar 28 2010 16:40:19 Installing. 
msgmni has been set to 117
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Generic RTC Driver v1.07
Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 16) is a 16550A
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
Freescale QUICC Engine UART device driver
loop: module loaded
rbppc_nand_probe: MikroTik RouterBOARD 333/600 series NAND driver, version 0.0.2
NAND device: Manufacturer ID: 0xad, Chip ID: 0x76 (Hynix NAND 64MiB 3,3V 8-bit)
Scanning device for bad blocks
Bad eraseblock 2810 at 0x000002be8000
Bad eraseblock 4046 at 0x000003f38000
Creating 2 MTD partitions on "NAND 64MiB 3,3V 8-bit":
0x000000000000-0x000000400000 : "RouterBOARD NAND Boot"
0x000000400000-0x000004000000 : "RouterBOARD NAND Main"
TCP cubic registered
Freeing unused kernel memory: 1608k init
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
- init -

Please press Enter to activate this console. 


BusyBox v1.15.3 (2010-03-28 14:34:07 EEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 KAMIKAZE (bleeding edge, r20534) ------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
 ---------------------------------------------------
root@OpenWrt:/#

no I just have to figure out how to create the dts file for the rb333.  any help is welcomed.

RB333 is finally supported as of trunk r20818.  too bad these devices are End of Life.

(Last edited by acoul on 16 Apr 2010, 11:30)

anyone can help me to create an image for rb800 ? I try to follow the steps, but the board is stuck at the jump to kernel code section..

Using Marlow's Kernel image and instructions everything works ok (except that 'cdebootstrap' should be replaced with 'debootstrap' if you're installing from an x86 machine I think - since --foreign is a debootstrap command), and the image boots fine but I'm unable to login.

Message is below regardless of username


[    1.901624] Freeing unused kernel memory: 228k init
INIT: version 2.86 booting
INIT: Entering runlevel: 2

Debian GNU/Linux 5.0 (none) console

(none) login:
Debian GNU/Linux 5.0 (none) console

(none) login: root
Unable to determine your tty name.

(none) login: admin
Unable to determine your tty name.

.config shows that kernel was compiled with console support

root@lamp:~/rb600# grep console linux-2.6.28.2-rb600-airwire1.config
CONFIG_CMDLINE="console=ttyS0,115200"

/etc/inittab
# The default runlevel.
id:2:initdefault:
T0:23:respawn:/sbin/getty -L console 115200 vt100

/etc/fstab
root@lamp:/media/cf/etc# cat fstab
proc    /proc   proc    default 0       0
/dev/sdb2       /       ext3    notail  0       0

/etc/securetty
root@lamp:/media/cf/etc# head securetty
# /etc/securetty: list of terminals on which root is allowed to login.
# See securetty(5) and login(1).
console

# Standard serial ports
ttyS0
ttyS1

root@lamp:/media/cf/dev# ls -la console
crw--w--w- 1 root root 5, 1 Aug 26 15:17 console
root@lamp:/media/cf/dev#

If I try changing
/etc/inittab
T0:23:respawn:/sbin/getty -L console 115200 vt100

To Be :
S0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

Then I get no login on the Serial in/output following 'Entering Runlevel'

Been beating on it for 2 days now and can't find an answer....

Thanks,
S

smile

RouterBOOT booter 2.30

RouterBoard 800

CPU frequency: 1000 MHz
  Memory size: 256 MB

Press any key within 9 seconds to enter setup.

RouterBOOT-2.30
What do you want to configure?
   d - boot delay
   k - boot key
   s - serial console
   n - silent boot
   o - boot device
   f - cpu frequency
   r - reset booter configuration
   e - format nand
   g - upgrade firmware
   i - board info
   p - boot protocol
   b - booter options
   t - do memory testing
   x - exit setup
your choice: o - boot device

Select boot device:
   e - boot over Ethernet
   n - boot from NAND, if fail then Ethernet
 * c - boot from CompactFlash only
   1 - boot Ethernet once, then NAND
   2 - boot Ethernet once, then CompactFlash
   o - boot from NAND only
   b - boot chosen device
   f - boot Flash Configure Mode
   3 - boot Flash Configure Mode once, then NAND
your choice: b - boot chosen device
Booting CF
Loading kernel... done
setting up elf image... OK
jumping to kernel code
[    0.000000] Using RB800 machine description
[    0.000000] Memory CAM mapping: 256 Mb, residual: 0Mb
[    0.000000] Linux version 2.6.34.8-svn16820 (XXXXXX) (gcc version 4.4.5 (GCC) ) #1 Sun May 15 15:48:40 CEST 2011
[    0.000000] bootconsole [udbg0] enabled
[    0.000000] Found FSL PCI host bridge at 0x00000000e0008000. Firmware bus number: 0->255
[    0.000000] PCI host bridge /pci@e0008000 (primary) ranges:
[    0.000000]  MEM 0x0000000080000000..0x000000008fffffff -> 0x0000000080000000 
[    0.000000]   IO 0x0000000090000000..0x000000009fffffff -> 0x0000000000000000
[    0.000000] /pci@e0008000: PCICSRBAR @ 0xfff00000
[    0.000000] Found FSL PCI host bridge at 0x00000000e0009000. Firmware bus number: 0->255
[    0.000000] PCI host bridge /pcie@e0009000  ranges:
[    0.000000]  MEM 0x00000000a0000000..0x00000000a1ffffff -> 0x00000000a0000000 
[    0.000000]   IO 0x00000000a2000000..0x00000000a3ffffff -> 0x0000000000000000
[    0.000000] /pcie@e0009000: PCICSRBAR @ 0xfff00000
[    0.000000] Found FSL PCI host bridge at 0x00000000e000a000. Firmware bus number: 0->255
[    0.000000] PCI host bridge /pcie@e000a000  ranges:
[    0.000000]  MEM 0x00000000a4000000..0x00000000a5ffffff -> 0x00000000a4000000 
[    0.000000]   IO 0x00000000a6000000..0x00000000a7ffffff -> 0x0000000000000000
[    0.000000] /pcie@e000a000: PCICSRBAR @ 0xfff00000
[    0.000000] Found FSL PCI host bridge at 0x00000000e000b000. Firmware bus number: 1->255
[    0.000000] PCI host bridge /pcie@e000b000  ranges:
[    0.000000]  MEM 0x00000000a8000000..0x00000000a9ffffff -> 0x00000000a8000000 
[    0.000000]   IO 0x00000000aa000000..0x00000000abffffff -> 0x0000000000000000
[    0.000000] /pcie@e000b000: PCICSRBAR @ 0xfff00000
[    0.000000] Zone PFN ranges:
[    0.000000]   DMA      0x00000000 -> 0x0000f000
[    0.000000]   Normal   0x0000f000 -> 0x00010000
[    0.000000] Movable zone start PFN for each node
[    0.000000] early_node_map[1] active PFN ranges
[    0.000000]     0: 0x00000000 -> 0x00010000
[    0.000000] MMU: Allocated 1088 bytes of context maps for 255 contexts
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 65024
[    0.000000] Kernel command line: console=ttyS0,115200 root=/dev/sda2 board=mpc8343 boot=1 mlc=2 noinitrd init=/bin/sh
[    0.000000] PID hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
[    0.000000] Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Memory: 252824k/262144k available (6532k kernel code, 9320k reserved, 120k data, 286k bss, 3584k init)
[    0.000000] Kernel virtual memory layout:
[    0.000000]   * 0xfffdf000..0xfffff000  : fixmap
[    0.000000]   * 0xebff6000..0xf0000000  : early ioremap
[    0.000000]   * 0xd1000000..0xebff6000  : vmalloc & ioremap
[    0.000000] NR_IRQS:512 nr_irqs:512
[    0.000000] mpic: Setting up MPIC " OpenPIC " version 1.2 at e0040000, max 1 CPUs
[    0.000000] mpic: ISU size: 4, shift: 2, mask: 3
[    0.000000] mpic: Initializing for 84 sources
[    0.000000] clocksource: timebase mult[5000347] shift[22] registered
[    0.006388] Mount-cache hash table entries: 512
[    0.011514] NET: Registered protocol family 16
[    0.016450] PCI: Probing PCI hardware
[    0.020400] pci 0001:01:00.0: ignoring class b20 (doesn't match header type 01)
[    0.027681] pci 0001:01:00.0: PCI bridge to [bus 02-ff]
[    0.033098] pci 0002:03:00.0: ignoring class b20 (doesn't match header type 01)
[    0.040372] pci 0002:03:00.0: PCI bridge to [bus 04-ff]
[    0.045803] pci 0003:05:00.0: ignoring class b20 (doesn't match header type 01)
[    0.053188] pci 0003:05:00.0: PCI bridge to [bus 06-ff]
[    0.058678] PCI: Cannot allocate resource region 2 of device 0003:06:00.0, will remap
[    0.066468] pci 0001:01:00.0: PCI bridge to [bus 02-02]
[    0.071621] pci 0001:01:00.0:   bridge window [io  0xfeffe000-0xffffdfff]
[    0.078395] pci 0001:01:00.0:   bridge window [mem 0xa0000000-0xa1ffffff]
[    0.085160] pci 0001:01:00.0:   bridge window [mem pref disabled]
[    0.091244] pci 0001:01:00.0: enabling device (0106 -> 0107)
[    0.096880] pci 0002:03:00.0: PCI bridge to [bus 04-04]
[    0.102090] pci 0002:03:00.0:   bridge window [io  0xfdffc000-0xfeffbfff]
[    0.108858] pci 0002:03:00.0:   bridge window [mem 0xa4000000-0xa5ffffff]
[    0.115629] pci 0002:03:00.0:   bridge window [mem pref disabled]
[    0.121706] pci 0002:03:00.0: enabling device (0106 -> 0107)
[    0.127354] pci 0003:06:00.0: BAR 2: assigned [io  0xfcffa000-0xfcffa07f]
[    0.134121] pci 0003:06:00.0: BAR 2: set to [io  0xfcffa000-0xfcffa07f] (PCI address [0x0-0x7f]
[    0.142800] pci 0003:05:00.0: PCI bridge to [bus 06-06]
[    0.148005] pci 0003:05:00.0:   bridge window [io  0xfcffa000-0xfdff9fff]
[    0.154778] pci 0003:05:00.0:   bridge window [mem 0xa8000000-0xa9ffffff]
[    0.161545] pci 0003:05:00.0:   bridge window [mem pref disabled]
[    0.167626] pci 0003:05:00.0: enabling device (0106 -> 0107)
[    0.178561] bio: create slab <bio-0> at 0
[    0.183047] SCSI subsystem initialized
[    0.187414] Switching to clocksource timebase
[    0.192479] NET: Registered protocol family 2
[    0.196797] IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
[    0.203725] TCP established hash table entries: 8192 (order: 4, 65536 bytes)
[    0.210812] TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
[    0.217230] TCP: Hash tables configured (established 8192 bind 8192)
[    0.223495] TCP reno registered
[    0.226619] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.232447] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.238780] NET: Registered protocol family 1
[    0.270509] squashfs: version 3.0 (2006/03/15) Phillip Lougher
[    0.276277] msgmni has been set to 493
[    0.280363] io scheduler noop registered
[    0.284196] io scheduler deadline registered (default)
[    0.289944] Serial: 8250/16550 driver, 2 ports, IRQ sharing enabled
[    0.296468] serial8250.0: ttyS0 at MMIO 0xe0004500 (irq = 42) is a 16550A
[    0.303179] console [ttyS0] enabled, bootconsole disabled
[    0.303179] console [ttyS0] enabled, bootconsole disabled
[    0.314419] RB_PPC CF
[    0.316714] CF: using Local-Bus clock 99999 kHz 10000 ps
[    0.322028] CF: irq level 1
[    0.325089] scsi0 : pata_rb_ppc
[    0.328453] ata1: PATA max PIO6 irq 17
[    0.332422] CF PIO mode changed to 0
[    0.336421] RB_PPC NAND
[    0.338923] NAND device: Manufacturer ID: 0xad, Chip ID: 0xdc (Hynix NAND 512MiB 3,3V 8-bit)
[    0.347371] Scanning device for bad blocks
[    0.377227] Bad eraseblock 367 at 0x000005bc0000
[    0.434368] Bad eraseblock 1124 at 0x000011900000
[    0.439147] Bad eraseblock 1125 at 0x000011940000
[    0.462069] Bad eraseblock 1390 at 0x000015b80000
[    0.466848] Bad eraseblock 1391 at 0x000015bc0000
[    0.516034] Creating 2 MTD partitions on "NAND 512MiB 3,3V 8-bit":
[    0.522213] 0x000000000000-0x000000400000 : "RouterBoard NAND Boot"
[    0.529075] 0x000000400000-0x000020000000 : "RouterBoard NAND Main"
[    0.538325] Fixed MDIO Bus: probed
[    0.542943] IMQ driver loaded successfully.
[    0.547121] Hooking IMQ before NAT on PREROUTING.
[    0.551915] Hooking IMQ after NAT on POSTROUTING.
[    0.556702] tun: Universal TUN/TAP device driver, 1.6
[    0.561749] tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
[    0.568216] ata1.00: CFA: CF CARD 4GB, 20090216, max UDMA/100
[    0.573963] ata1.00: 7847280 sectors, multi 0: LBA 
[    0.579109] Software Watchdog Timer: 0.07 initialized. soft_noboot=0 soft_margin=60 sec (nowayout= 0)
[    0.588882] netem: version 1.2
[    0.591944] u32 classifier
[    0.594641]     input device check on 
[    0.598381]     Actions configured 
[    0.601865] Netfilter messages via NETLINK v0.30.
[    0.606598] nf_conntrack version 0.5.0 (3950 buckets, 15800 max)
[    0.612695] CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use
[    0.620083] nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or
[    0.627997] sysctl net.netfilter.nf_conntrack_acct=1 to enable it.
[    0.634214] nf_conntrack_rtsp v0.6.21 loading
[    0.638744] nf_nat_rtsp v0.6.21 loading
[    0.642592] ip_tables: (C) 2000-2006 Netfilter Core Team
[    0.647951] IPP2P v0.8.2 loading
[    0.651178] TCP bic registered
[    0.654230] TCP cubic registered
[    0.657449] TCP westwood registered
[    0.660928] TCP highspeed registered
[    0.664497] TCP hybla registered
[    0.667716] TCP htcp registered
[    0.670848] TCP vegas registered
[    0.674070] TCP veno registered
[    0.677202] TCP scalable registered
[    0.680681] TCP lp registered
[    0.683642] TCP yeah registered
[    0.686774] TCP illinois registered
[    0.690255] NET: Registered protocol family 17
[    0.694729] 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
[    0.701509] All bugs added by David S. Miller <davem@redhat.com>
[    0.721964] ata1.00: configured for PIO6
[    0.781936] ata1.00: configured for PIO6
[    0.785854] ata1: EH complete
[    0.789000] scsi 0:0:0:0: Direct-Access     ATA      CF CARD 4GB      2009 PQ: 0 ANSI: 5
[    0.797709] sd 0:0:0:0: [sda] 7847280 512-byte logical blocks: (4.01 GB/3.74 GiB)
[    0.805276] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    0.810710] sd 0:0:0:0: [sda] Write Protect is off
[    0.815567] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[    0.824998]  sda: sda1 sda2
[    0.830050] sd 0:0:0:0: [sda] Attached SCSI disk
[    0.834681] Freeing unused kernel memory: 3584k init
- preinit -
Press the [f] key and hit [enter] to enter failsafe mode
- regular preinit -
- init -

Please press Enter to activate this console. 


BusyBox v1.18.4 (2011-05-15 15:37:26 CEST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 ATTITUDE ADJUSTMENT (bleeding edge, r26903) ----------
  * 1/4 oz Vodka      Pour all ingredients into mixing
  * 1/4 oz Gin        tin with ice, strain into glass.
  * 1/4 oz Amaretto
  * 1/4 oz Triple sec
  * 1/4 oz Peach schnapps
  * 1/4 oz Sour mix
  * 1 splash Cranberry juice
 -----------------------------------------------------
root@OpenWrt:/#

Hi everyone!

I also have RB800 and i want to run OpenWRT on routerboard but i don't know how. For a long time i am searching forums and web sites to found a way how to do that, but without success. S-g-r, would you please explain me how you do that?

Tnx very much!

It shouldn't be *too* hard to modify to work on an RB333 -- at least I don't think -- but you'll have to go back and copy some changes out of the original patch and maybe undo some of the things I put into the nand/cf/etc. files.

hiddensoulz

Hey everyone!

I don't know if there's still a lot of interest in this project -- it has been a few years, and there's better hardware out there. Nevertheless, most of the drivers are the same for the more modern MikroTik stuff, and I've recently been inspired to get everything up to date with modern kernel APIs. I also moved all of my development to GitHub to encourage collaboration. So, without further ado, I'd like to present a version compatible with Linux 3.0.x!

Here's the GitHub project: https://github.com/impl/rbppc-linux
The diff between v3.0 and my work is available here: https://github.com/impl/rbppc-linux/com … aster.diff
You can grab default configurations here: https://github.com/impl/rbppc-linux-sup … ster/conf/
And I've put some documentation up on the wiki as well regarding how to build and install it: https://github.com/impl/rbppc-linux/wiki

I rewrote pretty much everything, and there's a few cool new features too:
* It supports PIO modes other than 0, which means you can get relatively fast disk performance from your CF cards
* It provides access to the green LED on the RB600 via /sys/class/leds/user-led
* It provides access to the on-board speaker via /dev/input/event0 if you enable evdev

I only have an RB600, so my changes aren't actually tested with RB333; I'd definitely appreciate feedback from those of you running them.

I'd also love to support RB800 and RB1000. To kick that off, I need someone to provide a device tree dump for those devices; adding platform support after that should be trivial based on the 2.6.27 patches MikroTik has provided. Wiki contributions, bug reports, and pull requests will also be much appreciated.

I'll attach a pre-built ELF image shortly.

Enjoy, and happy hacking!

impi, the work you have done looks like exactly what I need.

I have been trying to follow this guide on recovering lost passwords: http://manio.skyboo.net/mikrotik/

But I got stuck because the elf images provided are only for RB411 boards.  Do you have an elf that I could try?

Thanks!

I second that.. thnx.

The discussion might have continued from here.