mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 03:05:40 +08:00
Tiva Ethernet: Add basic clock/power controls for Ethernet and internal PHY
This commit is contained in:
@@ -151,8 +151,8 @@
|
|||||||
/* μDMA Power Control */
|
/* μDMA Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCDMA
|
#ifdef TIVA_SYSCON_PCDMA
|
||||||
# define tiva_udma_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCDMA,SYSCON_PCDMA_R0)
|
# define tiva_udma_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCDMA,SYSCON_PCDMA_P0)
|
||||||
# define tiva_udma_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCDMA,SYSCON_PCDMA_R0)
|
# define tiva_udma_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCDMA,SYSCON_PCDMA_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_udma_enablepwr()
|
# define tiva_udma_enablepwr()
|
||||||
# define tiva_udma_disablepwr()
|
# define tiva_udma_disablepwr()
|
||||||
@@ -161,8 +161,8 @@
|
|||||||
/* EPI Power Control */
|
/* EPI Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCEPI
|
#ifdef TIVA_SYSCON_PCEPI
|
||||||
# define tiva_epi_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCEPI,SYSCON_PCEPI_R0)
|
# define tiva_epi_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCEPI,SYSCON_PCEPI_P0)
|
||||||
# define tiva_epi_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCEPI,SYSCON_PCEPI_R0)
|
# define tiva_epi_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCEPI,SYSCON_PCEPI_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_epi_enablepwr()
|
# define tiva_epi_enablepwr()
|
||||||
# define tiva_epi_disablepwr()
|
# define tiva_epi_disablepwr()
|
||||||
@@ -171,8 +171,8 @@
|
|||||||
/* Hibernation Power Control */
|
/* Hibernation Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCHIB
|
#ifdef TIVA_SYSCON_PCHIB
|
||||||
# define tiva_hib_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCHIB,SYSCON_PCHIB_R0)
|
# define tiva_hib_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCHIB,SYSCON_PCHIB_P0)
|
||||||
# define tiva_hib_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCHIB,SYSCON_PCHIB_R0)
|
# define tiva_hib_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCHIB,SYSCON_PCHIB_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_hib_enablepwr()
|
# define tiva_hib_enablepwr()
|
||||||
# define tiva_hib_disablepwr()
|
# define tiva_hib_disablepwr()
|
||||||
@@ -261,8 +261,8 @@
|
|||||||
/* USB Power Control */
|
/* USB Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCUSB
|
#ifdef TIVA_SYSCON_PCUSB
|
||||||
# define tiva_usb_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCUSB,SYSCON_PCUSB_R0)
|
# define tiva_usb_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCUSB,SYSCON_PCUSB_P0)
|
||||||
# define tiva_usb_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCUSB,SYSCON_PCUSB_R0)
|
# define tiva_usb_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCUSB,SYSCON_PCUSB_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_usb_enablepwr()
|
# define tiva_usb_enablepwr()
|
||||||
# define tiva_usb_disablepwr()
|
# define tiva_usb_disablepwr()
|
||||||
@@ -271,8 +271,8 @@
|
|||||||
/* Ethernet PHY Power Control */
|
/* Ethernet PHY Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCEPHY
|
#ifdef TIVA_SYSCON_PCEPHY
|
||||||
# define tiva_ephy_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCEPHY,SYSCON_PCEPHY_R0)
|
# define tiva_ephy_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCEPHY,SYSCON_PCEPHY_P0)
|
||||||
# define tiva_ephy_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCEPHY,SYSCON_PCEPHY_R0)
|
# define tiva_ephy_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCEPHY,SYSCON_PCEPHY_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_ephy_enablepwr()
|
# define tiva_ephy_enablepwr()
|
||||||
# define tiva_ephy_disablepwr()
|
# define tiva_ephy_disablepwr()
|
||||||
@@ -313,8 +313,8 @@
|
|||||||
/* ACMP Power Control */
|
/* ACMP Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCACMP
|
#ifdef TIVA_SYSCON_PCACMP
|
||||||
# define tiva_acmp_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCACMP,SYSCON_PCACMP_R0)
|
# define tiva_acmp_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCACMP,SYSCON_PCACMP_P0)
|
||||||
# define tiva_acmp_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCACMP,SYSCON_PCACMP_R0)
|
# define tiva_acmp_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCACMP,SYSCON_PCACMP_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_acmp_enablepwr()
|
# define tiva_acmp_enablepwr()
|
||||||
# define tiva_acmp_disablepwr()
|
# define tiva_acmp_disablepwr()
|
||||||
@@ -355,8 +355,8 @@
|
|||||||
/* EEPROM Power Control */
|
/* EEPROM Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCEEPROM
|
#ifdef TIVA_SYSCON_PCEEPROM
|
||||||
# define tiva_eeprom_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCEEPROM,SYSCON_PCEEPROM_R0)
|
# define tiva_eeprom_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCEEPROM,SYSCON_PCEEPROM_P0)
|
||||||
# define tiva_eeprom_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCEEPROM,SYSCON_PCEEPROM_R0)
|
# define tiva_eeprom_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCEEPROM,SYSCON_PCEEPROM_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_eeprom_enablepwr()
|
# define tiva_eeprom_enablepwr()
|
||||||
# define tiva_eeprom_disablepwr()
|
# define tiva_eeprom_disablepwr()
|
||||||
@@ -389,8 +389,8 @@
|
|||||||
/* CRC/Crypto Modules RunMode ClockGating Control */
|
/* CRC/Crypto Modules RunMode ClockGating Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCCCM
|
#ifdef TIVA_SYSCON_PCCCM
|
||||||
# define tiva_ccm_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCCCM,SYSCON_PCCCM_R0)
|
# define tiva_ccm_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCCCM,SYSCON_PCCCM_P0)
|
||||||
# define tiva_ccm_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCCCM,SYSCON_PCCCM_R0)
|
# define tiva_ccm_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCCCM,SYSCON_PCCCM_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_ccm_enablepwr()
|
# define tiva_ccm_enablepwr()
|
||||||
# define tiva_ccm_disablepwr()
|
# define tiva_ccm_disablepwr()
|
||||||
@@ -399,8 +399,8 @@
|
|||||||
/* LCD Controller Power Control */
|
/* LCD Controller Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCLCD
|
#ifdef TIVA_SYSCON_PCLCD
|
||||||
# define tiva_lcd_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCLCD,SYSCON_PCLCD_R0)
|
# define tiva_lcd_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCLCD,SYSCON_PCLCD_P0)
|
||||||
# define tiva_lcd_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCLCD,SYSCON_PCLCD_R0)
|
# define tiva_lcd_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCLCD,SYSCON_PCLCD_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_lcd_enablepwr()
|
# define tiva_lcd_enablepwr()
|
||||||
# define tiva_lcd_disablepwr()
|
# define tiva_lcd_disablepwr()
|
||||||
@@ -409,8 +409,8 @@
|
|||||||
/* 1-Wire Power Control */
|
/* 1-Wire Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCOWIRE
|
#ifdef TIVA_SYSCON_PCOWIRE
|
||||||
# define tiva_owire_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCOWIRE,SYSCON_PCOWIRE_R0)
|
# define tiva_owire_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCOWIRE,SYSCON_PCOWIRE_P0)
|
||||||
# define tiva_owire_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCOWIRE,SYSCON_PCOWIRE_R0)
|
# define tiva_owire_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCOWIRE,SYSCON_PCOWIRE_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_owire_enablepwr()
|
# define tiva_owire_enablepwr()
|
||||||
# define tiva_owire_disablepwr()
|
# define tiva_owire_disablepwr()
|
||||||
@@ -419,8 +419,8 @@
|
|||||||
/* Ethernet MAC Power Control */
|
/* Ethernet MAC Power Control */
|
||||||
|
|
||||||
#ifdef TIVA_SYSCON_PCEMAC
|
#ifdef TIVA_SYSCON_PCEMAC
|
||||||
# define tiva_emac_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCEMAC,SYSCON_PCEMAC_R0)
|
# define tiva_emac_enablepwr() tiva_enablepwr(TIVA_SYSCON_PCEMAC,SYSCON_PCEMAC_P0)
|
||||||
# define tiva_emac_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCEMAC,SYSCON_PCEMAC_R0)
|
# define tiva_emac_disablepwr() tiva_disablepwr(TIVA_SYSCON_PCEMAC,SYSCON_PCEMAC_P0)
|
||||||
#else
|
#else
|
||||||
# define tiva_emac_enablepwr()
|
# define tiva_emac_enablepwr()
|
||||||
# define tiva_emac_disablepwr()
|
# define tiva_emac_disablepwr()
|
||||||
|
|||||||
@@ -3369,6 +3369,20 @@ int tiva_ethinitialize(int intf)
|
|||||||
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
priv->txpoll = wd_create(); /* Create periodic poll timer */
|
||||||
priv->txtimeout = wd_create(); /* Create TX timeout 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:
|
/* Integrated PHY:
|
||||||
*
|
*
|
||||||
* "The Ethernet Controller Module and Integrated PHY receive two clock inputs:
|
* "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.
|
* 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 */
|
/* Configure GPIO pins to support Ethernet */
|
||||||
|
|
||||||
tiva_ethgpioconfig(priv);
|
tiva_ethgpioconfig(priv);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Attach the IRQ to the driver */
|
/* Attach the IRQ to the driver */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user