From 7815c3a720bf2f4eada638124885f950a1c5a7b4 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Wed, 3 Jul 2019 00:28:15 +0000 Subject: [PATCH] Merged in masayuki2009/nuttx.nuttx/tiva_with_qemu (pull request #927) arch/arm/src/tiva: Add a workaround for tiva with qemu With qemu, tiva_ifup() hangs because ethernet link status can not be set correctly. This PR is a workaround to avoid this issue. Signed-off-by: Masayuki Ishikawa Approved-by: Gregory Nutt --- arch/arm/src/tiva/Kconfig | 4 ++++ arch/arm/src/tiva/lm/lm3s_ethernet.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/arch/arm/src/tiva/Kconfig b/arch/arm/src/tiva/Kconfig index 82a1aeea0dc..c875f8f7eea 100644 --- a/arch/arm/src/tiva/Kconfig +++ b/arch/arm/src/tiva/Kconfig @@ -1381,6 +1381,10 @@ config TIVA_DUMPPACKET ---help--- Dump each packet received/sent to the console. +config TIVA_WITH_QEMU + bool "Workaround for tiva with qemu" + default n + endmenu # Stellaris Ethernet Configuration menu "Ethernet Configuration" diff --git a/arch/arm/src/tiva/lm/lm3s_ethernet.c b/arch/arm/src/tiva/lm/lm3s_ethernet.c index 8c73389102f..a895259b201 100644 --- a/arch/arm/src/tiva/lm/lm3s_ethernet.c +++ b/arch/arm/src/tiva/lm/lm3s_ethernet.c @@ -1345,6 +1345,7 @@ static int tiva_ifup(struct net_driver_s *dev) * set */ +#ifndef CONFIG_TIVA_WITH_QEMU ninfo("Waiting for link\n"); do { @@ -1352,6 +1353,7 @@ static int tiva_ifup(struct net_driver_s *dev) } while ((phyreg & MII_MSR_LINKSTATUS) == 0); ninfo("Link established\n"); +#endif /* Reset the receive FIFO */