at91rm9200_net.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * Ethernet: An implementation of the Ethernet Device Driver suite for the
  3. * uClinux 2.0.38 operating system. This Driver has been developed
  4. * for AT75C220 board.
  5. *
  6. * NOTE: The driver is implemented for one MAC
  7. *
  8. * Version: @(#)at91rm9200_net.h 1.0.0 01/10/2001
  9. *
  10. * Authors: Lineo Inc <www.lineo.com>
  11. *
  12. *
  13. * This program is free software; you can redistribute it and/or
  14. * modify it under the terms of the GNU General Public License
  15. * as published by the Free Software Foundation; either version
  16. * 2 of the License, or (at your option) any later version.
  17. */
  18. #ifndef AT91RM9200_ETHERNET
  19. #define AT91RM9200_ETHERNET
  20. #include <common.h>
  21. #include <asm/io.h>
  22. #include <asm/arch/hardware.h>
  23. #include "dm9161.h"
  24. #define FALSE 0
  25. #define TRUE 1
  26. #define ETHERNET_ADDRESS_SIZE 6
  27. typedef unsigned char UCHAR;
  28. /* Interface to drive the physical layer */
  29. typedef struct _AT91S_PhyOps
  30. {
  31. unsigned char (*Init)(AT91S_EMAC *pmac);
  32. unsigned int (*IsPhyConnected)(AT91S_EMAC *pmac);
  33. unsigned char (*GetLinkSpeed)(AT91S_EMAC *pmac);
  34. unsigned char (*AutoNegotiate)(AT91S_EMAC *pmac, int *);
  35. } AT91S_PhyOps,*AT91PS_PhyOps;
  36. #define EMAC_DESC_DONE 0x00000001 /* ownership bit */
  37. #define EMAC_DESC_WRAP 0x00000002 /* bit for wrap */
  38. /****************** function prototypes **********************/
  39. /* MII functions */
  40. static void at91rm9200_EmacEnableMDIO(AT91PS_EMAC p_mac);
  41. static void at91rm9200_EmacDisableMDIO(AT91PS_EMAC p_mac);
  42. static UCHAR at91rm9200_EmacReadPhy(AT91PS_EMAC p_mac, unsigned char RegisterAddress, unsigned short *pInput);
  43. static UCHAR at91rm9200_EmacWritePhy(AT91PS_EMAC p_mac, unsigned char RegisterAddress, unsigned short *pOutput);
  44. void at91rm92000_GetPhyInterface(void );
  45. #endif /* AT91RM9200_ETHERNET */