wdenk | 381669a | 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 | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 4 | * for AT75C220 board. |
wdenk | 381669a | 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 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 13 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 381669a | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef AT91RM9200_ETHERNET |
| 17 | #define AT91RM9200_ETHERNET |
| 18 | |
| 19 | #include <common.h> |
| 20 | #include <asm/io.h> |
| 21 | #include <asm/arch/hardware.h> |
wdenk | 381669a | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 22 | |
wdenk | 381669a | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 23 | #define ETHERNET_ADDRESS_SIZE 6 |
| 24 | |
| 25 | typedef unsigned char UCHAR; |
| 26 | |
| 27 | /* Interface to drive the physical layer */ |
| 28 | typedef struct _AT91S_PhyOps |
| 29 | { |
| 30 | unsigned char (*Init)(AT91S_EMAC *pmac); |
| 31 | unsigned int (*IsPhyConnected)(AT91S_EMAC *pmac); |
| 32 | unsigned char (*GetLinkSpeed)(AT91S_EMAC *pmac); |
| 33 | unsigned char (*AutoNegotiate)(AT91S_EMAC *pmac, int *); |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 34 | |
wdenk | 381669a | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 35 | } AT91S_PhyOps,*AT91PS_PhyOps; |
| 36 | |
| 37 | |
| 38 | #define EMAC_DESC_DONE 0x00000001 /* ownership bit */ |
| 39 | #define EMAC_DESC_WRAP 0x00000002 /* bit for wrap */ |
| 40 | |
| 41 | /****************** function prototypes **********************/ |
| 42 | |
| 43 | /* MII functions */ |
wdenk | 6e44b0f | 2004-08-02 23:39:03 +0000 | [diff] [blame] | 44 | void at91rm9200_EmacEnableMDIO(AT91PS_EMAC p_mac); |
| 45 | void at91rm9200_EmacDisableMDIO(AT91PS_EMAC p_mac); |
| 46 | UCHAR at91rm9200_EmacReadPhy(AT91PS_EMAC p_mac, unsigned char RegisterAddress, unsigned short *pInput); |
| 47 | UCHAR at91rm9200_EmacWritePhy(AT91PS_EMAC p_mac, unsigned char RegisterAddress, unsigned short *pOutput); |
Wolfgang Denk | bc650fa | 2005-10-05 01:51:29 +0200 | [diff] [blame] | 48 | void at91rm9200_GetPhyInterface(AT91PS_PhyOps p_phyops); |
wdenk | 381669a | 2003-06-16 23:50:08 +0000 | [diff] [blame] | 49 | |
| 50 | #endif /* AT91RM9200_ETHERNET */ |