GRETH: Added extra RESET, this is needed if GRETH was stopped during an ethernet...
authorDaniel Hellstrom <daniel@gaisler.com>
Fri, 22 Oct 2010 09:34:01 +0000 (11:34 +0200)
committerDaniel Hellstrom <daniel@gaisler.com>
Thu, 18 Nov 2010 07:33:25 +0000 (08:33 +0100)
Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
drivers/net/greth.c

index cb68d45e0275f24cc49b076594a293d1e1f4a356..f081855f26e2c78fa17aea7caee37fc629320c45 100644 (file)
@@ -152,6 +152,16 @@ int greth_init(struct eth_device *dev, bd_t * bis)
 
        debug("greth_init\n");
 
+       /* Reset core */
+       GRETH_REGSAVE(&regs->control, (GRETH_RESET | (greth->gb << 8) |
+               (greth->sp << 7) | (greth->fd << 4)));
+
+       /* Wait for Reset to complete */
+       while ( GRETH_REGLOAD(&regs->control) & GRETH_RESET) ;
+
+       GRETH_REGSAVE(&regs->control,
+               ((greth->gb << 8) | (greth->sp << 7) | (greth->fd << 4)));
+
        if (!greth->rxbd_base) {
 
                /* allocate descriptors */