dm9161.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #ifndef __DM9000_H__
  10. #define __DM9000_H__
  11. /*MACRO DEFINATIONS*/
  12. #define SEP4020_ID_EMAC ((unsigned int) 28) // Ethernet Mac
  13. /* Davicom 9161 PHY */
  14. #define MII_DM9161_ID 0x0181b880
  15. #define MII_DM9161A_ID 0x0181b8a0
  16. /* Davicom specific registers */
  17. #define MII_DSCR_REG 16
  18. #define MII_DSCSR_REG 17
  19. #define MII_DSINTR_REG 21
  20. /* Intel LXT971A PHY */
  21. #define MII_LXT971A_ID 0x001378E0
  22. /* Intel specific registers */
  23. #define MII_ISINTE_REG 18
  24. #define MII_ISINTS_REG 19
  25. #define MII_LEDCTRL_REG 20
  26. /* Realtek RTL8201 PHY */
  27. #define MII_RTL8201_ID 0x00008200
  28. /* Broadcom BCM5221 PHY */
  29. #define MII_BCM5221_ID 0x004061e0
  30. /* Broadcom specific registers */
  31. #define MII_BCMINTR_REG 26
  32. /* National Semiconductor DP83847 */
  33. #define MII_DP83847_ID 0x20005c30
  34. /* Altima AC101L PHY */
  35. #define MII_AC101L_ID 0x00225520
  36. /* Micrel KS8721 PHY */
  37. #define MII_KS8721_ID 0x00221610
  38. /* ........................................................................ */
  39. #define MAX_RBUFF_SZ 0x600 /* 1518 rounded up */
  40. #define MAX_RX_DESCR 20 /* max number of receive buffers */
  41. #define MAX_TBUFF_SZ 0x600 /* 1518 rounded up */
  42. #define MAX_TX_DESCR 20 /* max number of receive buffers */
  43. #define EMAC_DESC_DONE 0x00000001 /* bit for if DMA is done */
  44. #define EMAC_DESC_WRAP 0x00000002 /* bit for wrap */
  45. #define EMAC_BROADCAST 0x80000000 /* broadcast address */
  46. #define EMAC_MULTICAST 0x40000000 /* multicast address */
  47. #define EMAC_UNICAST 0x20000000 /* unicast address */
  48. #define DM9161_inb(r) (*(volatile rt_uint8_t *)r)
  49. #define DM9161_outb(r, d) (*(volatile rt_uint8_t *)r = d)
  50. #define DM9161_inw(r) (*(volatile rt_uint16_t *)r)
  51. #define DM9161_outw(r, d) (*(volatile rt_uint16_t *)r = d)
  52. void rt_hw_dm9616_init(void);
  53. #endif