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 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | /* |
| 9 | * eth.h - header file for the polled mode GT ethernet driver |
| 10 | */ |
| 11 | |
| 12 | #ifndef __GT6426x_ETH_H__ |
| 13 | #define __GT6426x_ETH_H__ |
| 14 | |
| 15 | #include <asm/types.h> |
| 16 | #include <asm/io.h> |
| 17 | #include <asm/byteorder.h> |
| 18 | #include <common.h> |
| 19 | |
| 20 | typedef struct eth0_tx_desc_struct { |
| 21 | volatile __u32 bytecount_reserved; |
| 22 | volatile __u32 command_status; |
| 23 | volatile struct eth0_tx_desc_struct * next_desc; |
| 24 | /* Note - the following will not work for 64 bit addressing */ |
| 25 | volatile unsigned char * buff_pointer; |
Wolfgang Denk | 77ddac9 | 2005-10-13 16:45:02 +0200 | [diff] [blame] | 26 | } __attribute__ ((packed)) eth0_tx_desc_single; |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 27 | |
| 28 | typedef struct eth0_rx_desc_struct { |
| 29 | volatile __u32 buff_size_byte_count; |
| 30 | volatile __u32 command_status; |
| 31 | volatile struct eth0_rx_desc_struct * next_desc; |
| 32 | volatile unsigned char * buff_pointer; |
Wolfgang Denk | 77ddac9 | 2005-10-13 16:45:02 +0200 | [diff] [blame] | 33 | } __attribute__ ((packed)) eth0_rx_desc_single; |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 34 | |
| 35 | #define NT 20 /* Number of Transmit buffers */ |
| 36 | #define NR 20 /* Number of Receive buffers */ |
| 37 | #define MAX_BUFF_SIZE (1536+2*CACHE_LINE_SIZE) /* 1600 */ |
| 38 | #define ETHERNET_PORTS_DIFFERENCE_OFFSETS 0x400 |
| 39 | |
| 40 | unsigned long TDN_ETH0 , RDN_ETH0; /* Rx/Tx current Descriptor Number*/ |
| 41 | unsigned int EVB64260_ETH0_irq; |
| 42 | |
| 43 | #define CLOSED 0 |
| 44 | #define OPENED 1 |
| 45 | |
| 46 | #define PORT_ETH0 0 |
| 47 | |
| 48 | extern eth0_tx_desc_single *eth0_tx_desc; |
| 49 | extern eth0_rx_desc_single *eth0_rx_desc; |
| 50 | extern char *eth0_tx_buffer; |
| 51 | extern char *eth0_rx_buffer[NR]; |
| 52 | extern char *eth_data; |
| 53 | |
| 54 | extern int gt6426x_eth_poll(void *v); |
Joe Hershberger | 10cbe3b | 2012-05-22 18:36:19 +0000 | [diff] [blame] | 55 | extern int gt6426x_eth_transmit(void *v, char *p, unsigned int s); |
wdenk | fe8c280 | 2002-11-03 00:38:21 +0000 | [diff] [blame] | 56 | extern void gt6426x_eth_disable(void *v); |
| 57 | extern int gt6426x_eth_probe(void *v, bd_t *bis); |
| 58 | |
| 59 | #endif /* __GT64260x_ETH_H__ */ |