From 533b67d4bf310c445745bdd605edc2ff9dc6b921 Mon Sep 17 00:00:00 2001
From: Daniel Hellstrom <daniel@gaisler.com>
Date: Fri, 22 Oct 2010 11:34:01 +0200
Subject: [PATCH] GRETH: Added extra RESET, this is needed if GRETH was stopped
 during an ethernet frame reception.

Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
---
 drivers/net/greth.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/net/greth.c b/drivers/net/greth.c
index cb68d45e02..f081855f26 100644
--- a/drivers/net/greth.c
+++ b/drivers/net/greth.c
@@ -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 */
-- 
2.39.5