phy.h
Go to the documentation of this file.
00001
00040 #ifndef DRV_PHY_H
00041 #define DRV_PHY_H
00042 
00043 #include <cfg/cfg_eth.h>
00044
00045 /*
00046  * Common PHY settings
00047  */
00048
00054 #define NIC_PHY_BMCR            0x00    ///<  Basic mode control register address.
00055 
00056 #define NIC_PHY_BMCR_COLTEST    BV(7)   ///<  Collision test.
00057 #define NIC_PHY_BMCR_FDUPLEX    BV(8)   ///<  Full duplex mode.
00058 #define NIC_PHY_BMCR_ANEGSTART  BV(9)   ///<  Restart auto negotiation.
00059 #define NIC_PHY_BMCR_ISOLATE    BV(10)  ///<  Isolate from MII.
00060 #define NIC_PHY_BMCR_PWRDN      BV(11)  ///<  Power-down.
00061 #define NIC_PHY_BMCR_ANEGENA    BV(12)  ///<  Enable auto negotiation.
00062 #define NIC_PHY_BMCR_100MBPS    BV(13)  ///<  Select 100 Mbps.
00063 #define NIC_PHY_BMCR_LOOPBACK   BV(14)  ///<  Enable loopback mode.
00064 #define NIC_PHY_BMCR_RESET      BV(15)  ///<  Software reset.
00065 /* \} */
00066
00072 #define NIC_PHY_BMSR             0x01    ///<  Basic mode status register.
00073 
00074 #define NIC_PHY_BMSR_ANCOMPL     BV(5)  ///< Auto negotiation complete.
00075 #define NIC_PHY_BMSR_ANEGCAPABLE BV(3)  ///< Able to do auto-negotiation
00076 #define NIC_PHY_BMSR_LINKSTAT    BV(2)  ///<  Link status.
00077 /* \} */
00078
00079 #define NIC_PHY_ID1              0x02    ///<  PHY identifier register 1.
00080 #define NIC_PHY_ID2              0x03    ///<  PHY identifier register 2.
00081 #define NIC_PHY_ANAR             0x04    ///<  Auto negotiation advertisement register.
00082 #define NIC_PHY_ANLPAR           0x05    ///<  Auto negotiation link partner availability register.
00083 
00089 #define NIC_PHY_ANER            0x06    //  Auto negotiation expansion register address.
00090 
00091 #define NIC_PHY_ANLPAR_10_HDX   BV(5)   ///<  10BASE-T half duplex
00092 #define NIC_PHY_ANLPAR_10_FDX   BV(6)   ///<  10BASE-T full duplex
00093 #define NIC_PHY_ANLPAR_TX_HDX   BV(7)   ///<  100BASE-TX half duplex
00094 #define NIC_PHY_ANLPAR_TX_FDX   BV(8)   ///<  100BASE-TX full duplex
00095 /* \} */
00096
00097
00106 #define DAVICOM_DM9161A          0
00107 #define NATIONAL_DP3848I         1
00108 
00110 #if CONFIG_PHY_CHIP == DAVICOM_DM9161A
00111     #include <drv/dm9161a.h>
00112 #elif CONFIG_PHY_CHIP == NATIONAL_DP3848I
00113     #include <drv/dp83848i.h>
00114 #else
00115     #error No supported PHY chip was select.
00116 #endif
00117 
00118 #endif /* DRV_PHY_H */