]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - drivers/net/npe/include/npe.h
doc: SPI: Add qspi test details on AM43xx
[karo-tx-uboot.git] / drivers / net / npe / include / npe.h
1 /*
2  * (C) Copyright 2005
3  * Stefan Roese, DENX Software Engineering, sr@denx.de.
4  *
5  * SPDX-License-Identifier:     GPL-2.0+
6  */
7
8 #ifndef NPE_H
9 #define NPE_H
10
11 /*
12  * defines...
13  */
14 #define CONFIG_SYS_NPE_NUMS             1
15 #ifdef CONFIG_HAS_ETH1
16 #undef CONFIG_SYS_NPE_NUMS
17 #define CONFIG_SYS_NPE_NUMS             2
18 #endif
19
20 #define NPE_NUM_PORTS           3
21 #define ACTIVE_PORTS            1
22
23 #define NPE_PKT_SIZE            1600
24
25 #define CONFIG_DEVS_ETH_INTEL_NPE_MAX_RX_DESCRIPTORS    64
26 #define CONFIG_DEVS_ETH_INTEL_NPE_MAX_TX_DESCRIPTORS    2
27
28 #define NPE_MBUF_POOL_SIZE                                      \
29         ((CONFIG_DEVS_ETH_INTEL_NPE_MAX_TX_DESCRIPTORS +        \
30           CONFIG_DEVS_ETH_INTEL_NPE_MAX_RX_DESCRIPTORS) *       \
31          sizeof(IX_OSAL_MBUF) * ACTIVE_PORTS)
32
33 #define NPE_PKT_POOL_SIZE                                       \
34         ((CONFIG_DEVS_ETH_INTEL_NPE_MAX_TX_DESCRIPTORS +        \
35           CONFIG_DEVS_ETH_INTEL_NPE_MAX_RX_DESCRIPTORS) *       \
36          NPE_PKT_SIZE * ACTIVE_PORTS)
37
38 #define NPE_MEM_POOL_SIZE (NPE_MBUF_POOL_SIZE + NPE_PKT_POOL_SIZE)
39
40 #define PHY_AUTONEGOTIATE_TIMEOUT 4000  /* 4000 ms autonegotiate timeout */
41
42 /*
43  * structs...
44  */
45 struct npe {
46         u8                      active;           /* NPE active                         */
47         u8                      eth_id;           /* IX_ETH_PORT_1 or IX_ETH_PORT_2     */
48         u8                      phy_no;           /* which PHY (0 - 31)                 */
49         u8                      mac_address[6];
50
51         IX_OSAL_MBUF            *rxQHead;
52         IX_OSAL_MBUF            *txQHead;
53
54         u8                      *tx_pkts;
55         u8                      *rx_pkts;
56         IX_OSAL_MBUF            *rx_mbufs;
57         IX_OSAL_MBUF            *tx_mbufs;
58
59         int                     print_speed;
60
61         int                     rx_read;
62         int                     rx_write;
63         int                     rx_len[PKTBUFSRX];
64 };
65
66 /*
67  * prototypes...
68  */
69 extern int npe_miiphy_read (const char *devname, unsigned char addr,
70                             unsigned char reg, unsigned short *value);
71 extern int npe_miiphy_write (const char *devname, unsigned char addr,
72                              unsigned char reg, unsigned short value);
73
74 #endif /* ifndef NPE_H */