Subversion Repositories HomeAutomation

Rev

Rev 363 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /*********************************************************************
  2.  *
  3.  *            ENC28J60 registers/bits
  4.  *
  5.  *********************************************************************
  6.  * FileName:        ENC28J60.h
  7.  * Description:     Include file for ENC28J60 control registers
  8.  * Company:         Microchip Technology, Inc.
  9.  *
  10.  * Software License Agreement
  11.  *
  12.  * This software is owned by Microchip Technology Inc. ("Microchip")
  13.  * and is supplied to you for use exclusively as described in the
  14.  * associated software agreement.  This software is protected by
  15.  * software and other intellectual property laws.  Any use in
  16.  * violation of the software license may subject the user to criminal
  17.  * sanctions as well as civil liability.  Copyright 2006 Microchip
  18.  * Technology Inc.  All rights reserved.
  19.  *
  20.  * This software is provided "AS IS."  MICROCHIP DISCLAIMS ALL
  21.  * WARRANTIES, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, NOT LIMITED
  22.  * TO MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
  23.  * INFRINGEMENT.  Microchip shall in no event be liable for special,
  24.  * incidental, or consequential damages.
  25.  *
  26.  *
  27.  * Author               Date        Comment
  28.  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  29.  * Howard Schlunder     06/01/04    Original
  30.  * Howard Schlunder     06/29/04    Fixed byte boundary problems on a
  31.  *                                  couple of PHY register structs.
  32.  * Howard Schlunder     09/29/04    Matched with data sheet
  33.  * Howard Schlunder     01/04/06    Matched with new data sheet
  34.  * Howard Schlunder     06/29/06    Changed MACON3.PHDRLEN to PHDREN
  35.  * Howard Schlunder     07/21/06    Several bits removed to match now
  36.  *                                  reserved bits in rev. B data sheet
  37.  *                                  (DS39662B)
  38.  ********************************************************************/
  39.  
  40. #ifndef ENC28J60_H
  41. #define ENC28J60_H
  42.  
  43. typedef union {
  44.     BYTE v[7];
  45.     struct {
  46.         WORD     ByteCount;
  47.         unsigned CollisionCount:4;
  48.         unsigned CRCError:1;
  49.         unsigned LengthCheckError:1;
  50.         unsigned LengthOutOfRange:1;
  51.         unsigned Done:1;
  52.         unsigned Multicast:1;
  53.         unsigned Broadcast:1;
  54.         unsigned PacketDefer:1;
  55.         unsigned ExcessiveDefer:1;
  56.         unsigned MaximumCollisions:1;
  57.         unsigned LateCollision:1;
  58.         unsigned Giant:1;
  59.         unsigned Underrun:1;
  60.         WORD     BytesTransmittedOnWire;
  61.         unsigned ControlFrame:1;
  62.         unsigned PAUSEControlFrame:1;
  63.         unsigned BackpressureApplied:1;
  64.         unsigned VLANTaggedFrame:1;
  65.         unsigned Zeros:4;
  66.     } bits;
  67. } TXSTATUS;
  68.  
  69. typedef union {
  70.     BYTE v[4];
  71.     struct {
  72.         WORD     ByteCount;
  73.         unsigned PreviouslyIgnored:1;
  74.         unsigned RXDCPreviouslySeen:1;
  75.         unsigned CarrierPreviouslySeen:1;
  76.         unsigned CodeViolation:1;
  77.         unsigned CRCError:1;
  78.         unsigned LengthCheckError:1;
  79.         unsigned LengthOutOfRange:1;
  80.         unsigned ReceiveOk:1;
  81.         unsigned Multicast:1;
  82.         unsigned Broadcast:1;
  83.         unsigned DribbleNibble:1;
  84.         unsigned ControlFrame:1;
  85.         unsigned PauseControlFrame:1;
  86.         unsigned UnsupportedOpcode:1;
  87.         unsigned VLANType:1;
  88.         unsigned Zero:1;
  89.     } bits;
  90. } RXSTATUS;
  91.  
  92. /******************************************************************************
  93. * Register locations
  94. ******************************************************************************/
  95. // Bank 0 registers --------
  96. #define ERDPTL      0x00
  97. #define ERDPTH      0x01
  98. #define EWRPTL      0x02
  99. #define EWRPTH      0x03
  100. #define ETXSTL      0x04
  101. #define ETXSTH      0x05
  102. #define ETXNDL      0x06
  103. #define ETXNDH      0x07
  104. #define ERXSTL      0x08
  105. #define ERXSTH      0x09
  106. #define ERXNDL      0x0A
  107. #define ERXNDH      0x0B
  108. #define ERXRDPTL    0x0C
  109. #define ERXRDPTH    0x0D
  110. #define ERXWRPTL    0x0E
  111. #define ERXWRPTH    0x0F
  112. #define EDMASTL     0x10
  113. #define EDMASTH     0x11
  114. #define EDMANDL     0x12
  115. #define EDMANDH     0x13
  116. #define EDMADSTL    0x14
  117. #define EDMADSTH    0x15
  118. #define EDMACSL     0x16
  119. #define EDMACSH     0x17
  120. //#define           0x18
  121. //#define           0x19
  122. //#define r         0x1A
  123. #define EIE         0x1B
  124. #define EIR         0x1C
  125. #define ESTAT       0x1D
  126. #define ECON2       0x1E
  127. #define ECON1       0x1F
  128.  
  129. // Bank 1 registers -----
  130. #define EHT0        0x100
  131. #define EHT1        0x101
  132. #define EHT2        0x102
  133. #define EHT3        0x103
  134. #define EHT4        0x104
  135. #define EHT5        0x105
  136. #define EHT6        0x106
  137. #define EHT7        0x107
  138. #define EPMM0       0x108
  139. #define EPMM1       0x109
  140. #define EPMM2       0x10A
  141. #define EPMM3       0x10B
  142. #define EPMM4       0x10C
  143. #define EPMM5       0x10D
  144. #define EPMM6       0x10E
  145. #define EPMM7       0x10F
  146. #define EPMCSL      0x110
  147. #define EPMCSH      0x111
  148. //#define           0x112
  149. //#define           0x113
  150. #define EPMOL       0x114
  151. #define EPMOH       0x115
  152. //#define r         0x116
  153. //#define r         0x117
  154. #define ERXFCON     0x118
  155. #define EPKTCNT     0x119
  156. //#define r         0x11A
  157. //#define EIE       0x11B
  158. //#define EIR       0x11C
  159. //#define ESTAT     0x11D
  160. //#define ECON2     0x11E
  161. //#define ECON1     0x11F
  162.  
  163. // Bank 2 registers -----
  164. #define MACON1      0x200
  165. //#define r         0x201
  166. #define MACON3      0x202
  167. #define MACON4      0x203
  168. #define MABBIPG     0x204
  169. //#define           0x205
  170. #define MAIPGL      0x206
  171. #define MAIPGH      0x207
  172. #define MACLCON1    0x208
  173. #define MACLCON2    0x209
  174. #define MAMXFLL     0x20A
  175. #define MAMXFLH     0x20B
  176. //#define r         0x20C
  177. //#define r         0x20D
  178. //#define r         0x20E
  179. //#define           0x20F
  180. //#define r         0x210
  181. //#define r         0x211
  182. #define MICMD       0x212
  183. //#define r         0x213
  184. #define MIREGADR    0x214
  185. //#define r         0x215
  186. #define MIWRL       0x216
  187. #define MIWRH       0x217
  188. #define MIRDL       0x218
  189. #define MIRDH       0x219
  190. //#define r         0x21A
  191. //#define EIE       0x21B
  192. //#define EIR       0x21C
  193. //#define ESTAT     0x21D
  194. //#define ECON2     0x21E
  195. //#define ECON1     0x21F
  196.  
  197. // Bank 3 registers -----
  198. #define MAADR5      0x300
  199. #define MAADR6      0x301
  200. #define MAADR3      0x302
  201. #define MAADR4      0x303
  202. #define MAADR1      0x304
  203. #define MAADR2      0x305
  204. #define EBSTSD      0x306
  205. #define EBSTCON     0x307
  206. #define EBSTCSL     0x308
  207. #define EBSTCSH     0x309
  208. #define MISTAT      0x30A
  209. //#define           0x30B
  210. //#define           0x30C
  211. //#define           0x30D
  212. //#define           0x30E
  213. //#define           0x30F
  214. //#define           0x310
  215. //#define           0x311
  216. #define EREVID      0x312
  217. //#define           0x313
  218. //#define           0x314
  219. #define ECOCON      0x315
  220. //#define           0x316
  221. #define EFLOCON     0x317
  222. #define EPAUSL      0x318
  223. #define EPAUSH      0x319
  224. //#define r         0x31A
  225. //#define EIE       0x31B
  226. //#define EIR       0x31C
  227. //#define ESTAT     0x31D
  228. //#define ECON2     0x31E
  229. //#define ECON1     0x31F
  230.  
  231.  
  232.  
  233. // Structures
  234. typedef union _REG
  235. {
  236.     BYTE Val;
  237.  
  238.     // EIE bits ----------
  239.     struct {
  240.         unsigned char RXERIE:1;
  241.         unsigned char TXERIE:1;
  242.         unsigned char :1;
  243.         unsigned char TXIE:1;
  244.         unsigned char LINKIE:1;
  245.         unsigned char DMAIE:1;
  246.         unsigned char PKTIE:1;
  247.         unsigned char INTIE:1;
  248.     } EIEbits;
  249.  
  250.     // EIR bits ----------
  251.     struct {
  252.         unsigned char RXERIF:1;
  253.         unsigned char TXERIF:1;
  254.         unsigned char :1;
  255.         unsigned char TXIF:1;
  256.         unsigned char LINKIF:1;
  257.         unsigned char DMAIF:1;
  258.         unsigned char PKTIF:1;
  259.         unsigned char :1;
  260.     } EIRbits;
  261.  
  262.     // ESTAT bits ---------
  263.     struct {
  264.         unsigned char CLKRDY:1;
  265.         unsigned char TXABRT:1;
  266.         unsigned char RXBUSY:1;
  267.         unsigned char :1;
  268.         unsigned char LATECOL:1;
  269.         unsigned char :1;
  270.         unsigned char BUFER:1;
  271.         unsigned char INT:1;
  272.     } ESTATbits;
  273.  
  274.     // ECON2 bits --------
  275.     struct {
  276.         unsigned char :3;
  277.         unsigned char VRPS:1;
  278.         unsigned char :1;
  279.         unsigned char PWRSV:1;
  280.         unsigned char PKTDEC:1;
  281.         unsigned char AUTOINC:1;
  282.     } ECON2bits;
  283.        
  284.     // ECON1 bits --------
  285.     struct {
  286.         unsigned char BSEL0:1;
  287.         unsigned char BSEL1:1;
  288.         unsigned char RXEN:1;
  289.         unsigned char TXRTS:1;
  290.         unsigned char CSUMEN:1;
  291.         unsigned char DMAST:1;
  292.         unsigned char RXRST:1;
  293.         unsigned char TXRST:1;
  294.     } ECON1bits;
  295.        
  296.     // ERXFCON bits ------
  297.     struct {
  298.         unsigned char BCEN:1;
  299.         unsigned char MCEN:1;
  300.         unsigned char HTEN:1;
  301.         unsigned char MPEN:1;
  302.         unsigned char PMEN:1;
  303.         unsigned char CRCEN:1;
  304.         unsigned char ANDOR:1;
  305.         unsigned char UCEN:1;
  306.     } ERXFCONbits;
  307.        
  308.     // MACON1 bits --------
  309.     struct {
  310.         unsigned char MARXEN:1;
  311.         unsigned char PASSALL:1;
  312.         unsigned char RXPAUS:1;
  313.         unsigned char TXPAUS:1;
  314.         unsigned char :4;
  315.     } MACON1bits;
  316.        
  317.  
  318.     // MACON3 bits --------
  319.     struct {
  320.         unsigned char FULDPX:1;
  321.         unsigned char FRMLNEN:1;
  322.         unsigned char HFRMEN:1;
  323.         unsigned char PHDREN:1;
  324.         unsigned char TXCRCEN:1;
  325.         unsigned char PADCFG0:1;
  326.         unsigned char PADCFG1:1;
  327.         unsigned char PADCFG2:1;
  328.     } MACON3bits;
  329.     struct {
  330.         unsigned char FULDPX:1;
  331.         unsigned char FRMLNEN:1;
  332.         unsigned char HFRMEN:1;
  333.         unsigned char PHDREN:1;
  334.         unsigned char TXCRCEN:1;
  335.         unsigned char PADCFG:3;
  336.     } MACON3bits2;
  337.        
  338.     // MACON4 bits --------
  339.     struct {
  340.         unsigned char :4;
  341.         unsigned char NOBKOFF:1;
  342.         unsigned char BPEN:1;
  343.         unsigned char DEFER:1;
  344.         unsigned char :1;
  345.     } MACON4bits;
  346.        
  347.     // MICMD bits ---------
  348.     struct {
  349.         unsigned char MIIRD:1;
  350.         unsigned char MIISCAN:1;
  351.         unsigned char :6;
  352.     } MICMDbits;
  353.  
  354.     // EBSTCON bits -----
  355.     struct {
  356.         unsigned char BISTST:1;
  357.         unsigned char TME:1;
  358.         unsigned char TMSEL0:1;
  359.         unsigned char TMSEL1:1;
  360.         unsigned char PSEL:1;
  361.         unsigned char PSV0:1;
  362.         unsigned char PSV1:1;
  363.         unsigned char PSV2:1;
  364.     } EBSTCONbits;
  365.     struct {
  366.         unsigned char BISTST:1;
  367.         unsigned char TME:1;
  368.         unsigned char TMSEL:2;
  369.         unsigned char PSEL:1;
  370.         unsigned char PSV:3;
  371.     } EBSTCONbits2;
  372.        
  373.     // MISTAT bits --------
  374.     struct {
  375.         unsigned char BUSY:1;
  376.         unsigned char SCAN:1;
  377.         unsigned char NVALID:1;
  378.         unsigned char :5;
  379.     } MISTATbits;
  380.        
  381.     // ECOCON bits -------
  382.     struct {
  383.         unsigned char COCON0:1;
  384.         unsigned char COCON1:1;
  385.         unsigned char COCON2:1;
  386.         unsigned char :5;
  387.     } ECOCONbits;
  388.     struct {
  389.         unsigned char COCON:3;
  390.         unsigned char :5;
  391.     } ECOCONbits2;
  392.        
  393.     // EFLOCON bits -----
  394.     struct {
  395.         unsigned char FCEN0:1;
  396.         unsigned char FCEN1:1;
  397.         unsigned char FULDPXS:1;
  398.         unsigned char :5;
  399.     } EFLOCONbits;
  400.     struct {
  401.         unsigned char FCEN:2;
  402.         unsigned char FULDPXS:1;
  403.         unsigned char :5;
  404.     } EFLOCONbits2;
  405. } REG;
  406.  
  407.  
  408. /******************************************************************************
  409. * PH Register Locations
  410. ******************************************************************************/
  411. #define PHCON1  0x00
  412. #define PHSTAT1 0x01
  413. #define PHID1   0x02
  414. #define PHID2   0x03
  415. #define PHCON2  0x10
  416. #define PHSTAT2 0x11
  417. #define PHIE    0x12
  418. #define PHIR    0x13
  419. #define PHLCON  0x14
  420.  
  421.  
  422. typedef union {
  423.     WORD Val;
  424.     WORD_VAL VAL;
  425.  
  426.     // PHCON1 bits ----------
  427.     struct {
  428.         unsigned :8;
  429.         unsigned PDPXMD:1;
  430.         unsigned :2;
  431.         unsigned PPWRSV:1;
  432.         unsigned :2;
  433.         unsigned PLOOPBK:1;
  434.         unsigned PRST:1;
  435.     } PHCON1bits;
  436.  
  437.     // PHSTAT1 bits --------
  438.     struct {
  439.         unsigned :1;
  440.         unsigned JBSTAT:1;
  441.         unsigned LLSTAT:1;
  442.         unsigned :5;
  443.         unsigned :3;
  444.         unsigned PHDPX:1;
  445.         unsigned PFDPX:1;
  446.         unsigned :3;
  447.     } PHSTAT1bits;
  448.  
  449.     // PHID2 bits ----------
  450.     struct {
  451.         unsigned PREV0:1;
  452.         unsigned PREV1:1;
  453.         unsigned PREV2:1;
  454.         unsigned PREV3:1;
  455.         unsigned PPN0:1;
  456.         unsigned PPN1:1;
  457.         unsigned PPN2:1;
  458.         unsigned PPN3:1;
  459.         unsigned PPN4:1;
  460.         unsigned PPN5:1;
  461.         unsigned PID19:1;
  462.         unsigned PID20:1;
  463.         unsigned PID21:1;
  464.         unsigned PID22:1;
  465.         unsigned PID23:1;
  466.         unsigned PID24:1;
  467.     } PHID2bits;
  468.     struct {
  469.         unsigned PREV:4;
  470.         unsigned PPNL:4;
  471.         unsigned PPNH:2;
  472.         unsigned PID:6;
  473.     } PHID2bits2;
  474.  
  475.     // PHCON2 bits ----------
  476.     struct {
  477.         unsigned :8;
  478.         unsigned HDLDIS:1;
  479.         unsigned :1;
  480.         unsigned JABBER:1;
  481.         unsigned :2;
  482.         unsigned TXDIS:1;
  483.         unsigned FRCLNK:1;
  484.         unsigned :1;
  485.     } PHCON2bits;
  486.  
  487.     // PHSTAT2 bits --------
  488.     struct {
  489.         unsigned :5;
  490.         unsigned PLRITY:1;
  491.         unsigned :2;
  492.         unsigned :1;
  493.         unsigned DPXSTAT:1;
  494.         unsigned LSTAT:1;
  495.         unsigned COLSTAT:1;
  496.         unsigned RXSTAT:1;
  497.         unsigned TXSTAT:1;
  498.         unsigned :2;
  499.     } PHSTAT2bits;
  500.  
  501.     // PHIE bits -----------
  502.     struct {
  503.         unsigned :1;
  504.         unsigned PGEIE:1;
  505.         unsigned :2;
  506.         unsigned PLNKIE:1;
  507.         unsigned :3;
  508.         unsigned :8;
  509.     } PHIEbits;
  510.  
  511.     // PHIR bits -----------
  512.     struct {
  513.         unsigned :2;
  514.         unsigned PGIF:1;
  515.         unsigned :1;
  516.         unsigned PLNKIF:1;
  517.         unsigned :3;
  518.         unsigned :8;
  519.     } PHIRbits;
  520.  
  521.     // PHLCON bits -------
  522.     struct {
  523.         unsigned :1;
  524.         unsigned STRCH:1;
  525.         unsigned LFRQ0:1;
  526.         unsigned LFRQ1:1;
  527.         unsigned LBCFG0:1;
  528.         unsigned LBCFG1:1;
  529.         unsigned LBCFG2:1;
  530.         unsigned LBCFG3:1;
  531.         unsigned LACFG0:1;
  532.         unsigned LACFG1:1;
  533.         unsigned LACFG2:1;
  534.         unsigned LACFG3:1;
  535.         unsigned :4;
  536.     } PHLCONbits;
  537.     struct {
  538.         unsigned :1;
  539.         unsigned STRCH:1;
  540.         unsigned LFRQ:2;
  541.         unsigned LBCFG:4;
  542.         unsigned LACFG:4;
  543.         unsigned :4;
  544.     } PHLCONbits2;
  545. } PHYREG;
  546.  
  547.  
  548. /******************************************************************************
  549. * Individual Register Bits
  550. ******************************************************************************/
  551. // ETH/MAC/MII bits
  552.  
  553. // EIE bits ----------
  554. #define EIE_INTIE       (1<<7)
  555. #define EIE_PKTIE       (1<<6)
  556. #define EIE_DMAIE       (1<<5)
  557. #define EIE_LINKIE      (1<<4)
  558. #define EIE_TXIE        (1<<3)
  559. #define EIE_TXERIE      (1<<1)
  560. #define EIE_RXERIE      (1)
  561.  
  562. // EIR bits ----------
  563. #define EIR_PKTIF       (1<<6)
  564. #define EIR_DMAIF       (1<<5)
  565. #define EIR_LINKIF      (1<<4)
  566. #define EIR_TXIF        (1<<3)
  567. #define EIR_TXERIF      (1<<1)
  568. #define EIR_RXERIF      (1)
  569.    
  570. // ESTAT bits ---------
  571. #define ESTAT_INT       (1<<7)
  572. #define ESTAT_BUFER     (1<<6)
  573. #define ESTAT_LATECOL   (1<<4)
  574. #define ESTAT_RXBUSY    (1<<2)
  575. #define ESTAT_TXABRT    (1<<1)
  576. #define ESTAT_CLKRDY    (1)
  577.    
  578. // ECON2 bits --------
  579. #define ECON2_AUTOINC   (1<<7)
  580. #define ECON2_PKTDEC    (1<<6)
  581. #define ECON2_PWRSV     (1<<5)
  582. #define ECON2_VRPS      (1<<3)
  583.    
  584. // ECON1 bits --------
  585. #define ECON1_TXRST     (1<<7)
  586. #define ECON1_RXRST     (1<<6)
  587. #define ECON1_DMAST     (1<<5)
  588. #define ECON1_CSUMEN    (1<<4)
  589. #define ECON1_TXRTS     (1<<3)
  590. #define ECON1_RXEN      (1<<2)
  591. #define ECON1_BSEL1     (1<<1)
  592. #define ECON1_BSEL0     (1)
  593.    
  594. // ERXFCON bits ------
  595. #define ERXFCON_UCEN    (1<<7)
  596. #define ERXFCON_ANDOR   (1<<6)
  597. #define ERXFCON_CRCEN   (1<<5)
  598. #define ERXFCON_PMEN    (1<<4)
  599. #define ERXFCON_MPEN    (1<<3)
  600. #define ERXFCON_HTEN    (1<<2)
  601. #define ERXFCON_MCEN    (1<<1)
  602. #define ERXFCON_BCEN    (1)
  603.    
  604. // MACON1 bits --------
  605. #define MACON1_TXPAUS   (1<<3)
  606. #define MACON1_RXPAUS   (1<<2)
  607. #define MACON1_PASSALL  (1<<1)
  608. #define MACON1_MARXEN   (1)
  609.    
  610. // MACON3 bits --------
  611. #define MACON3_PADCFG2  (1<<7)
  612. #define MACON3_PADCFG1  (1<<6)
  613. #define MACON3_PADCFG0  (1<<5)
  614. #define MACON3_TXCRCEN  (1<<4)
  615. #define MACON3_PHDREN   (1<<3)
  616. #define MACON3_HFRMEN   (1<<2)
  617. #define MACON3_FRMLNEN  (1<<1)
  618. #define MACON3_FULDPX   (1)
  619.    
  620. // MACON4 bits --------
  621. #define MACON4_DEFER    (1<<6)
  622. #define MACON4_BPEN     (1<<5)
  623. #define MACON4_NOBKOFF  (1<<4)
  624.    
  625. // MICMD bits ---------
  626. #define MICMD_MIISCAN   (1<<1)
  627. #define MICMD_MIIRD     (1)
  628.  
  629. // EBSTCON bits -----
  630. #define EBSTCON_PSV2    (1<<7)
  631. #define EBSTCON_PSV1    (1<<6)
  632. #define EBSTCON_PSV0    (1<<5)
  633. #define EBSTCON_PSEL    (1<<4)
  634. #define EBSTCON_TMSEL1  (1<<3)
  635. #define EBSTCON_TMSEL0  (1<<2)
  636. #define EBSTCON_TME     (1<<1)
  637. #define EBSTCON_BISTST  (1)
  638.  
  639. // MISTAT bits --------
  640. #define MISTAT_NVALID   (1<<2)
  641. #define MISTAT_SCAN     (1<<1)
  642. #define MISTAT_BUSY     (1)
  643.    
  644. // ECOCON bits -------
  645. #define ECOCON_COCON2   (1<<2)
  646. #define ECOCON_COCON1   (1<<1)
  647. #define ECOCON_COCON0   (1)
  648.    
  649. // EFLOCON bits -----
  650. #define EFLOCON_FULDPXS (1<<2)
  651. #define EFLOCON_FCEN1   (1<<1)
  652. #define EFLOCON_FCEN0   (1)
  653.  
  654.  
  655.  
  656. // PHY bits
  657.  
  658. // PHCON1 bits ----------
  659. #define PHCON1_PRST     (1ul<<15)
  660. #define PHCON1_PLOOPBK  (1ul<<14)
  661. #define PHCON1_PPWRSV   (1ul<<11)
  662. #define PHCON1_PDPXMD   (1ul<<8)
  663.  
  664. // PHSTAT1 bits --------
  665. #define PHSTAT1_PFDPX   (1ul<<12)
  666. #define PHSTAT1_PHDPX   (1ul<<11)
  667. #define PHSTAT1_LLSTAT  (1ul<<2)
  668. #define PHSTAT1_JBSTAT  (1ul<<1)
  669.  
  670. // PHID2 bits --------
  671. #define PHID2_PID24     (1ul<<15)
  672. #define PHID2_PID23     (1ul<<14)
  673. #define PHID2_PID22     (1ul<<13)
  674. #define PHID2_PID21     (1ul<<12)
  675. #define PHID2_PID20     (1ul<<11)
  676. #define PHID2_PID19     (1ul<<10)
  677. #define PHID2_PPN5      (1ul<<9)
  678. #define PHID2_PPN4      (1ul<<8)
  679. #define PHID2_PPN3      (1ul<<7)
  680. #define PHID2_PPN2      (1ul<<6)
  681. #define PHID2_PPN1      (1ul<<5)
  682. #define PHID2_PPN0      (1ul<<4)
  683. #define PHID2_PREV3     (1ul<<3)
  684. #define PHID2_PREV2     (1ul<<2)
  685. #define PHID2_PREV1     (1ul<<1)
  686. #define PHID2_PREV0     (1ul)
  687.  
  688. // PHCON2 bits ----------
  689. #define PHCON2_FRCLNK   (1ul<<14)
  690. #define PHCON2_TXDIS    (1ul<<13)
  691. #define PHCON2_JABBER   (1ul<<10)
  692. #define PHCON2_HDLDIS   (1ul<<8)
  693.  
  694. // PHSTAT2 bits --------
  695. #define PHSTAT2_TXSTAT  (1ul<<13)
  696. #define PHSTAT2_RXSTAT  (1ul<<12)
  697. #define PHSTAT2_COLSTAT (1ul<<11)
  698. #define PHSTAT2_LSTAT   (1ul<<10)
  699. #define PHSTAT2_DPXSTAT (1ul<<9)
  700. #define PHSTAT2_PLRITY  (1ul<<5)
  701.  
  702. // PHIE bits -----------
  703. #define PHIE_PLNKIE     (1ul<<4)
  704. #define PHIE_PGEIE      (1ul<<1)
  705.  
  706. // PHIR bits -----------
  707. #define PHIR_PLNKIF     (1ul<<4)
  708. #define PHIR_PGIF       (1ul<<2)
  709.  
  710. // PHLCON bits -------
  711. #define PHLCON_LACFG3   (1ul<<11)
  712. #define PHLCON_LACFG2   (1ul<<10)
  713. #define PHLCON_LACFG1   (1ul<<9)
  714. #define PHLCON_LACFG0   (1ul<<8)
  715. #define PHLCON_LBCFG3   (1ul<<7)
  716. #define PHLCON_LBCFG2   (1ul<<6)
  717. #define PHLCON_LBCFG1   (1ul<<5)
  718. #define PHLCON_LBCFG0   (1ul<<4)
  719. #define PHLCON_LFRQ1    (1ul<<3)
  720. #define PHLCON_LFRQ0    (1ul<<2)
  721. #define PHLCON_STRCH    (1ul<<1)
  722.  
  723. #endif
  724.