
In our system using ZynqMP with an external SGMII PHY it's necessary to wait a short while after the configuration in zynq_gem_init() before the xfer starts. Otherwise the first packet(s) might get dropped, resulting in a delay at the start of the ethernet transfers.
This patch adds a minimal delay of 10ms which fixes problems of dropped first packages.
Signed-off-by: Stefan Roese sr@denx.de Cc: Michal Simek michal.simek@amd.com Cc: Ramon Fried rfried.dev@gmail.com Cc: Sean Anderson sean.anderson@seco.com --- drivers/net/zynq_gem.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 507b19b75975..26e468766871 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -522,6 +522,13 @@ static int zynq_gem_init(struct udevice *dev) return ret; } } + + /* + * Some additional minimal delay seems to be needed so that + * the first packet will be sent correctly + */ + mdelay(10); + setbits_le32(®s->nwctrl, ZYNQ_GEM_NWCTRL_RXEN_MASK | ZYNQ_GEM_NWCTRL_TXEN_MASK);