Modified patch originates from Andy Green <andy@openmoko.com>
[u-boot-openmoko/mini2440.git] / board / evb64260 / eth.h
blobbeb6db16dfb93b3ee61ac27fb69fdaa2301d1499
1 /*
2 * (C) Copyright 2001
3 * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc.
5 * See file CREDITS for list of people who contributed to this
6 * project.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
25 * eth.h - header file for the polled mode GT ethernet driver
28 #ifndef __GT6426x_ETH_H__
29 #define __GT6426x_ETH_H__
31 #include <asm/types.h>
32 #include <asm/io.h>
33 #include <asm/byteorder.h>
34 #include <common.h>
36 typedef struct eth0_tx_desc_struct {
37 volatile __u32 bytecount_reserved;
38 volatile __u32 command_status;
39 volatile struct eth0_tx_desc_struct * next_desc;
40 /* Note - the following will not work for 64 bit addressing */
41 volatile unsigned char * buff_pointer;
42 } __attribute__ ((packed)) eth0_tx_desc_single;
44 typedef struct eth0_rx_desc_struct {
45 volatile __u32 buff_size_byte_count;
46 volatile __u32 command_status;
47 volatile struct eth0_rx_desc_struct * next_desc;
48 volatile unsigned char * buff_pointer;
49 } __attribute__ ((packed)) eth0_rx_desc_single;
51 #define NT 20 /* Number of Transmit buffers */
52 #define NR 20 /* Number of Receive buffers */
53 #define MAX_BUFF_SIZE (1536+2*CACHE_LINE_SIZE) /* 1600 */
54 #define ETHERNET_PORTS_DIFFERENCE_OFFSETS 0x400
56 unsigned long TDN_ETH0 , RDN_ETH0; /* Rx/Tx current Descriptor Number*/
57 unsigned int EVB64260_ETH0_irq;
59 #define CLOSED 0
60 #define OPENED 1
62 #define PORT_ETH0 0
64 extern eth0_tx_desc_single *eth0_tx_desc;
65 extern eth0_rx_desc_single *eth0_rx_desc;
66 extern char *eth0_tx_buffer;
67 extern char *eth0_rx_buffer[NR];
68 extern char *eth_data;
70 extern int gt6426x_eth_poll(void *v);
71 extern int gt6426x_eth_transmit(void *v, volatile char *p, unsigned int s);
72 extern void gt6426x_eth_disable(void *v);
73 extern int gt6426x_eth_probe(void *v, bd_t *bis);
75 #endif /* __GT64260x_ETH_H__ */