OpenCores
URL https://opencores.org/ocsvn/1g_ethernet_dpi/1g_ethernet_dpi/trunk

Subversion Repositories 1g_ethernet_dpi

[/] [1g_ethernet_dpi/] [trunk/] [hw/] [src/] [rtl/] [tri_mode_emac/] [sw/] [src/] [tri_mode_emac.h] - Blame information for rev 4

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 4 kuzmi4
 
2
#ifndef __TRI_MODE_MAC_H__
3
#define __TRI_MODE_MAC_H__
4
 
5
#ifdef __cplusplus
6
extern "C" {
7
#endif
8
 
9
#include "xil_types.h"
10
 
11
// 
12
#define MARVELL_PHY_ID          (0x0141)
13
#define MARVELL_PHY_MODEL       (0x0CC0)    // 88E1111: [9:4] == 00100
14
#define MARVELL_PHY_MODEL_MSK   (0x0FF0)    
15
 
16
#define MARVELL_PHY_ID_OK(x)    (x == MARVELL_PHY_ID)
17
#define MARVELL_PHY_MODEL_OK(x) ((x & MARVELL_PHY_MODEL_MSK) == MARVELL_PHY_MODEL)
18
// 
19
#define MARVELL_PHY_RGMII       (0x0B)      // 88E1111Datasheet_Rev_J.pdf: HWCFG_MODE[3:0] == 1011 / reg 0_27
20
 
21
 
22
// Management configuration register address     (0x500)
23
#define CONFIG_MANAGEMENT_ADD   0x0500
24
// Flow control configuration register address   (0x40C)
25
#define CONFIG_FLOW_CTRL_ADD    0x040C
26
 
27
// Receiver configuration register address       (0x404)
28
#define RECEIVER_ADD            0x0404
29
 
30
// Transmitter configuration register address    (0x408)
31
#define TRANSMITTER_ADD         0x0408
32
 
33
// Speed configuration register address    (0x410)
34
#define SPEED_CONFIG_ADD        0x0410
35
 
36
// Unicast Word 0 configuration register address (0x700)
37
#define CONFIG_UNI0_CTRL_ADD    0x0700
38
 
39
// Unicast Word 1 configuration register address (0x704)
40
#define CONFIG_UNI1_CTRL_ADD    0x0704
41
 
42
// Address Filter configuration register address (0x708)
43
#define CONFIG_ADDR_CTRL_ADD    0x0708
44
 
45
 
46
// MDIO registers
47
#define MDIO_CONTROL            0x0504
48
#define MDIO_TX_DATA            0x0508
49
#define MDIO_RX_DATA            0x050C
50
// MDIO IF op
51
#define MDIO_OP_RD              2
52
#define MDIO_OP_WR              1
53
//
54
 
55
//#define IORD_XLNX_TEMAC_MDIO(base, reg) 
56
//#define IOWR_XLNX_TEMAC_MDIO(base, reg) 
57
 
58
/* IEEE PHY register definition */
59
enum {
60
    TSE_PHY_MDIO_CONTROL     = 0,
61
    TSE_PHY_MDIO_STATUS      = 1,
62
    TSE_PHY_MDIO_PHY_ID1     = 2,
63
    TSE_PHY_MDIO_PHY_ID2     = 3,
64
    TSE_PHY_MDIO_ADV         = 4,
65
    TSE_PHY_MDIO_REMADV      = 5,
66
 
67
    TSE_PHY_MDIO_AN_EXT              = 6,
68
    TSE_PHY_MDIO_1000BASE_T_CTRL     = 9,
69
    TSE_PHY_MDIO_1000BASE_T_STATUS   = 10,
70
    TSE_PHY_MDIO_EXT_STATUS          = 15
71
};
72
#define MRVL_PHY_MDIO_SPEC_STS_C    (17) // 88E1111Datasheet_Rev_J.pdf: Page 0, Register 17
73
#define MRVL_PHY_MDIO_ESPEC_CTRL    (20) // 88E1111Datasheet_Rev_J.pdf: Page Any, Registe 20
74
#define MRVL_PHY_MDIO_ESPEC_STS     (27) // 88E1111Datasheet_Rev_J.pdf: Page Any, Registe 27
75
 
76
typedef struct {
77
    // base-addr
78
    u32 base;
79
    // mac
80
    u32 mac_high;
81
    u32 mac_low;
82
    // ip-addr
83
    u32 ip_addr;
84
} tmemac_cfg_t;
85
 
86
 
87
int tri_mode_emac_init(tmemac_cfg_t *iv_tmemac_cfg);
88
 
89
#ifdef __cplusplus
90
}
91
#endif
92
 
93
#endif // __TRI_MODE_MAC_H__

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.