blob: 99581f0137618c03206929c3364edb7bdee59d5f [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 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenkfe8c2802002-11-03 00:38:21 +00006 */
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
20typedef 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 Denk77ddac92005-10-13 16:45:02 +020026} __attribute__ ((packed)) eth0_tx_desc_single;
wdenkfe8c2802002-11-03 00:38:21 +000027
28typedef 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 Denk77ddac92005-10-13 16:45:02 +020033} __attribute__ ((packed)) eth0_rx_desc_single;
wdenkfe8c2802002-11-03 00:38:21 +000034
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
40unsigned long TDN_ETH0 , RDN_ETH0; /* Rx/Tx current Descriptor Number*/
41unsigned int EVB64260_ETH0_irq;
42
43#define CLOSED 0
44#define OPENED 1
45
46#define PORT_ETH0 0
47
48extern eth0_tx_desc_single *eth0_tx_desc;
49extern eth0_rx_desc_single *eth0_rx_desc;
50extern char *eth0_tx_buffer;
51extern char *eth0_rx_buffer[NR];
52extern char *eth_data;
53
54extern int gt6426x_eth_poll(void *v);
Joe Hershberger10cbe3b2012-05-22 18:36:19 +000055extern int gt6426x_eth_transmit(void *v, char *p, unsigned int s);
wdenkfe8c2802002-11-03 00:38:21 +000056extern void gt6426x_eth_disable(void *v);
57extern int gt6426x_eth_probe(void *v, bd_t *bis);
58
59#endif /* __GT64260x_ETH_H__ */