summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/tiva/tm4c_ethernet.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-12-31 11:40:01 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-12-31 11:40:01 -0600
commitb95e1301e0a1d985c7c60927762025e5e4ab3b05 (patch)
tree1e7d997e218298e8c27f03f7de8e96c26b7364b4 /nuttx/arch/arm/src/tiva/tm4c_ethernet.c
parent577ae908a83960d65d4f826ea8ac2cc696115c65 (diff)
downloadnuttx-b95e1301e0a1d985c7c60927762025e5e4ab3b05.tar.gz
nuttx-b95e1301e0a1d985c7c60927762025e5e4ab3b05.tar.bz2
nuttx-b95e1301e0a1d985c7c60927762025e5e4ab3b05.zip
Tiva Ethernet: Add basic clock/power controls for Ethernet and internal PHY
Diffstat (limited to 'nuttx/arch/arm/src/tiva/tm4c_ethernet.c')
-rw-r--r--nuttx/arch/arm/src/tiva/tm4c_ethernet.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/nuttx/arch/arm/src/tiva/tm4c_ethernet.c b/nuttx/arch/arm/src/tiva/tm4c_ethernet.c
index 674595fc9..9c3900655 100644
--- a/nuttx/arch/arm/src/tiva/tm4c_ethernet.c
+++ b/nuttx/arch/arm/src/tiva/tm4c_ethernet.c
@@ -3369,6 +3369,20 @@ int tiva_ethinitialize(int intf)
priv->txpoll = wd_create(); /* Create periodic poll timer */
priv->txtimeout = wd_create(); /* Create TX timeout timer */
+ /* Enable power and clocking to the Ethernet MAC
+ *
+ * - Enable Power: Applies power (only) to the UART peripheral. This is not
+ * an essential step since enabling clocking will also apply power. The
+ * only significance is that the EMAC state will be retained if the EMAC
+ * clocking is subsequently disabled.
+ * - Enable Clocking: Applies both power and clocking to the EMAC peripheral,
+ * bringing it a fully functional state.
+ */
+
+ tiva_emac_enablepwr(); /* Ethernet MAC Power Control */
+ tiva_emac_enableclk(); /* Ethernet MAC Run Mode Clock Gating Control */
+
+#ifdef CONFIG_TIVA_PHY_INTERNAL
/* Integrated PHY:
*
* "The Ethernet Controller Module and Integrated PHY receive two clock inputs:
@@ -3386,9 +3400,15 @@ int tiva_ethinitialize(int intf)
* External PHY support is not yet implemented.
*/
+ /* Enable power and clocking to the Integrated PHY */
+
+ tiva_ephy_enablepwr(); /* Ethernet PHY Power Control */
+ tiva_ephy_enableclk(); /* Ethernet PHY Run Mode Clock Gating Control */
+#else
/* Configure GPIO pins to support Ethernet */
tiva_ethgpioconfig(priv);
+#endif
/* Attach the IRQ to the driver */