blob: beb6db16dfb93b3ee61ac27fb69fdaa2301d1499 [file] [log] [blame]
wdenkfe8c2802002-11-03 00:38:21 +00001/*
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
36typedef 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 Denk77ddac92005-10-13 16:45:02 +020042} __attribute__ ((packed)) eth0_tx_desc_single;
wdenkfe8c2802002-11-03 00:38:21 +000043
44typedef 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 Denk77ddac92005-10-13 16:45:02 +020049} __attribute__ ((packed)) eth0_rx_desc_single;
wdenkfe8c2802002-11-03 00:38:21 +000050
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
56unsigned long TDN_ETH0 , RDN_ETH0; /* Rx/Tx current Descriptor Number*/
57unsigned int EVB64260_ETH0_irq;
58
59#define CLOSED 0
60#define OPENED 1
61
62#define PORT_ETH0 0
63
64extern eth0_tx_desc_single *eth0_tx_desc;
65extern eth0_rx_desc_single *eth0_rx_desc;
66extern char *eth0_tx_buffer;
67extern char *eth0_rx_buffer[NR];
68extern char *eth_data;
69
70extern int gt6426x_eth_poll(void *v);
71extern int gt6426x_eth_transmit(void *v, volatile char *p, unsigned int s);
72extern void gt6426x_eth_disable(void *v);
73extern int gt6426x_eth_probe(void *v, bd_t *bis);
74
75#endif /* __GT64260x_ETH_H__ */