summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/tiva/tm4c_ethernet.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-01-01 08:11:17 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-01-01 08:11:17 -0600
commit56fc3cf880b48273888b8b77f18597d754cc9647 (patch)
tree61609225fdaf26d20aea16c1c564125fc903f297 /nuttx/arch/arm/src/tiva/tm4c_ethernet.c
parent3805e100a9d28dde7849df57a9691dc150ec6518 (diff)
downloadnuttx-56fc3cf880b48273888b8b77f18597d754cc9647.tar.gz
nuttx-56fc3cf880b48273888b8b77f18597d754cc9647.tar.bz2
nuttx-56fc3cf880b48273888b8b77f18597d754cc9647.zip
Tiva PHY: Hard code some properties of the internal PHY
Diffstat (limited to 'nuttx/arch/arm/src/tiva/tm4c_ethernet.c')
-rw-r--r--nuttx/arch/arm/src/tiva/tm4c_ethernet.c37
1 files changed, 34 insertions, 3 deletions
diff --git a/nuttx/arch/arm/src/tiva/tm4c_ethernet.c b/nuttx/arch/arm/src/tiva/tm4c_ethernet.c
index cdb1bb0fb..17ae77bc6 100644
--- a/nuttx/arch/arm/src/tiva/tm4c_ethernet.c
+++ b/nuttx/arch/arm/src/tiva/tm4c_ethernet.c
@@ -102,17 +102,44 @@
# error High priority work queue support is required
#endif
-#ifndef CONFIG_TIVA_PHYADDR
-# error CONFIG_TIVA_PHYADDR must be defined in the NuttX configuration
-#endif
+/* Are we using the internal PHY or an external PHY? */
#if defined(CONFIG_TIVA_PHY_INTERNAL)
+
+/* Internal PHY */
+
# if defined(CONFIG_TIVA_PHY_MII) ||defined(CONFIG_TIVA_PHY_RMII)
# warning CONFIG_TIVA_PHY_MII or CONFIG_TIVA_PHY_RMII defined with internal PHY
# endif
+
# undef CONFIG_TIVA_PHY_MII
# undef CONFIG_TIVA_PHY_RMII
+
+/* Properties of the internal PHY are hard-coded */
+
+# undef CONFIG_TIVA_PHYADDR
+# undef CONFIG_TIVA_PHYSR_ALTCONFIG
+# undef CONFIG_TIVA_PHYSR_ALTMODE
+# undef CONFIG_TIVA_PHYSR_10HD
+# undef CONFIG_TIVA_PHYSR_100HD
+# undef CONFIG_TIVA_PHYSR_10FD
+# undef CONFIG_TIVA_PHYSR_100FD
+# undef CONFIG_TIVA_PHYSR_SPEED
+# undef CONFIG_TIVA_PHYSR_100MBPS
+# undef CONFIG_TIVA_PHYSR_MODE
+# undef CONFIG_TIVA_PHYSR_FULLDUPLEX
+
+# define CONFIG_TIVA_PHYADDR 1
+# define CONFIG_TIVA_PHYSR TIVA_EPHY_STS
+# define CONFIG_TIVA_PHYSR_SPEED EPHY_STS_SPEED
+# define CONFIG_TIVA_PHYSR_100MBPS 0
+# define CONFIG_TIVA_PHYSR_MODE EPHY_STS_DUPLEX
+# define CONFIG_TIVA_PHYSR_FULLDUPLEX EPHY_STS_DUPLEX
+
#else
+
+/* External PHY. Properties must be provided in the configuration */
+
# if !defined(CONFIG_TIVA_PHY_MII) && !defined(CONFIG_TIVA_PHY_RMII)
# warning None of CONFIG_TIVA_PHY_INTERNAL, CONFIG_TIVA_PHY_MII, or CONFIG_TIVA_PHY_RMII defined
# endif
@@ -122,6 +149,10 @@
# endif
#endif
+#ifndef CONFIG_TIVA_PHYADDR
+# error CONFIG_TIVA_PHYADDR must be defined in the NuttX configuration
+#endif
+
#ifdef CONFIG_TIVA_AUTONEG
# ifndef CONFIG_TIVA_PHYSR
# error CONFIG_TIVA_PHYSR must be defined in the NuttX configuration