wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2001 |
| 3 | * Josh Huber <huber@mclx.com>, Mission Critical Linux, Inc. |
| 4 | * |
| 5 | * See file CREDITS for list of people who contributed to this |
| 6 | * project. |
| 7 | * |
| 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. |
| 12 | * |
| 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. |
| 17 | * |
| 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 |
| 22 | */ |
| 23 | |
| 24 | /* |
| 25 | * eth.h - header file for the polled mode GT ethernet driver |
| 26 | */ |
| 27 | |
| 28 | #ifndef __GT6426x_ETH_H__ |
| 29 | #define __GT6426x_ETH_H__ |
| 30 | |
| 31 | #include <asm/types.h> |
| 32 | #include <asm/io.h> |
| 33 | #include <asm/byteorder.h> |
| 34 | #include <common.h> |
| 35 | |
| 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; |
Wolfgang Denk | 7fb5266 | 2005-10-13 16:45:02 +0200 | [diff] [blame] | 42 | } __attribute__ ((packed)) eth0_tx_desc_single; |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 43 | |
| 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; |
Wolfgang Denk | 7fb5266 | 2005-10-13 16:45:02 +0200 | [diff] [blame] | 49 | } __attribute__ ((packed)) eth0_rx_desc_single; |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 50 | |
| 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 |
| 55 | |
| 56 | unsigned long TDN_ETH0 , RDN_ETH0; /* Rx/Tx current Descriptor Number*/ |
| 57 | unsigned int EVB64260_ETH0_irq; |
| 58 | |
| 59 | #define CLOSED 0 |
| 60 | #define OPENED 1 |
| 61 | |
| 62 | #define PORT_ETH0 0 |
| 63 | |
| 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; |
| 69 | |
| 70 | extern int gt6426x_eth_poll(void *v); |
Joe Hershberger | e4e0488 | 2012-05-22 18:36:19 +0000 | [diff] [blame] | 71 | extern int gt6426x_eth_transmit(void *v, char *p, unsigned int s); |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 72 | extern void gt6426x_eth_disable(void *v); |
| 73 | extern int gt6426x_eth_probe(void *v, bd_t *bis); |
| 74 | |
| 75 | #endif /* __GT64260x_ETH_H__ */ |