diff options
Diffstat (limited to 'nuttx/arch/arm/src/tiva/tm4c_ethernet.c')
-rw-r--r-- | nuttx/arch/arm/src/tiva/tm4c_ethernet.c | 37 |
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 |