wdenk | 2abbe07 | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 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 |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 4 | * for AT75C220 board. |
wdenk | 2abbe07 | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 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 | |
| 19 | #ifndef AT91RM9200_ETHERNET |
| 20 | #define AT91RM9200_ETHERNET |
| 21 | |
| 22 | #include <common.h> |
| 23 | #include <asm/io.h> |
| 24 | #include <asm/arch/hardware.h> |
wdenk | 2abbe07 | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 25 | |
| 26 | #define FALSE 0 |
| 27 | #define TRUE 1 |
| 28 | |
| 29 | |
| 30 | #define ETHERNET_ADDRESS_SIZE 6 |
| 31 | |
| 32 | typedef unsigned char UCHAR; |
| 33 | |
| 34 | /* Interface to drive the physical layer */ |
| 35 | typedef struct _AT91S_PhyOps |
| 36 | { |
| 37 | unsigned char (*Init)(AT91S_EMAC *pmac); |
| 38 | unsigned int (*IsPhyConnected)(AT91S_EMAC *pmac); |
| 39 | unsigned char (*GetLinkSpeed)(AT91S_EMAC *pmac); |
| 40 | unsigned char (*AutoNegotiate)(AT91S_EMAC *pmac, int *); |
wdenk | 8bde7f7 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 41 | |
wdenk | 2abbe07 | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 42 | } AT91S_PhyOps,*AT91PS_PhyOps; |
| 43 | |
| 44 | |
| 45 | #define EMAC_DESC_DONE 0x00000001 /* ownership bit */ |
| 46 | #define EMAC_DESC_WRAP 0x00000002 /* bit for wrap */ |
| 47 | |
| 48 | /****************** function prototypes **********************/ |
| 49 | |
| 50 | /* MII functions */ |
wdenk | 429168e | 2004-08-02 23:39:03 +0000 | [diff] [blame] | 51 | void at91rm9200_EmacEnableMDIO(AT91PS_EMAC p_mac); |
| 52 | void at91rm9200_EmacDisableMDIO(AT91PS_EMAC p_mac); |
| 53 | UCHAR at91rm9200_EmacReadPhy(AT91PS_EMAC p_mac, unsigned char RegisterAddress, unsigned short *pInput); |
| 54 | UCHAR at91rm9200_EmacWritePhy(AT91PS_EMAC p_mac, unsigned char RegisterAddress, unsigned short *pOutput); |
Wolfgang Denk | 080bdb7 | 2005-10-05 01:51:29 +0200 | [diff] [blame] | 55 | void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops); |
wdenk | 2abbe07 | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 56 | |
| 57 | #endif /* AT91RM9200_ETHERNET */ |