dv-bfin_emac.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Blackfin Ethernet Media Access Controller (EMAC) model.
  2. Copyright (C) 2010-2015 Free Software Foundation, Inc.
  3. Contributed by Analog Devices, Inc.
  4. This file is part of simulators.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #ifndef DV_BFIN_EMAC_H
  16. #define DV_BFIN_EMAC_H
  17. /* EMAC_OPMODE Masks */
  18. #define RE (1 << 0)
  19. #define ASTP (1 << 1)
  20. #define PR (1 << 7)
  21. #define TE (1 << 16)
  22. /* EMAC_STAADD Masks */
  23. #define STABUSY (1 << 0)
  24. #define STAOP (1 << 1)
  25. #define STADISPRE (1 << 2)
  26. #define STAIE (1 << 3)
  27. #define REGAD_SHIFT 6
  28. #define REGAD_MASK (0x1f << REGAD_SHIFT)
  29. #define REGAD(val) (((val) & REGAD_MASK) >> REGAD_SHIFT)
  30. #define PHYAD_SHIFT 11
  31. #define PHYAD_MASK (0x1f << PHYAD_SHIFT)
  32. #define PHYAD(val) (((val) & PHYAD_MASK) >> PHYAD_SHIFT)
  33. /* EMAC_SYSCTL Masks */
  34. #define PHYIE (1 << 0)
  35. #define RXDWA (1 << 1)
  36. #define RXCKS (1 << 2)
  37. #define TXDWA (1 << 4)
  38. /* EMAC_RX_STAT Masks */
  39. #define RX_FRLEN 0x7ff
  40. #define RX_COMP (1 << 12)
  41. #define RX_OK (1 << 13)
  42. #define RX_ACCEPT (1 << 31)
  43. /* EMAC_TX_STAT Masks */
  44. #define TX_COMP (1 << 0)
  45. #define TX_OK (1 << 1)
  46. #endif