diff mbox

[v6,06/10] i.MX: reset TX/RX descriptors when FEC is disabled.

Message ID d9c4783fe8f42d55f176e4ab01664bcb46dd37a5.1464588471.git.jcd@tribudubois.net
State New
Headers show

Commit Message

Jean-Christophe DUBOIS May 30, 2016, 5:26 p.m. UTC
According to the FEC chapter of i.MX25 reference manual

RX adn TX descriptors are reseted when the FEC device is disabled through ECR.

Signed-off-by: Jean-Christophe Dubois <jcd@tribudubois.net>
---

Changes since v1:
 * Not present on v1
 
Changes since v2:
 * Not present on v2
 
Changes since v3:
 * Not present on v3
 
Changes since v4:
 * Not present on v4

Changes since v5:
 * None

 hw/net/imx_fec.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/hw/net/imx_fec.c b/hw/net/imx_fec.c
index 768181e..7369cfa 100644
--- a/hw/net/imx_fec.c
+++ b/hw/net/imx_fec.c
@@ -454,6 +454,8 @@  static void imx_fec_write(void *opaque, hwaddr addr,
         }
         if ((s->ecr & FEC_EN) == 0) {
             s->rx_enabled = 0;
+            s->rx_descriptor = s->erdsr;
+            s->tx_descriptor = s->etdsr;
         }
         break;
     case 0x040: /* MMFR */