1
2
3
4
5
6
7
8
9
10
11 #ifndef __DWMAC100_H__
12 #define __DWMAC100_H__
13
14 #include <linux/phy.h>
15 #include "common.h"
16
17
18
19
20
21 #define MAC_CONTROL 0x00000000
22 #define MAC_ADDR_HIGH 0x00000004
23 #define MAC_ADDR_LOW 0x00000008
24 #define MAC_HASH_HIGH 0x0000000c
25 #define MAC_HASH_LOW 0x00000010
26 #define MAC_MII_ADDR 0x00000014
27 #define MAC_MII_DATA 0x00000018
28 #define MAC_FLOW_CTRL 0x0000001c
29 #define MAC_VLAN1 0x00000020
30 #define MAC_VLAN2 0x00000024
31
32
33 #define MAC_CONTROL_RA 0x80000000
34 #define MAC_CONTROL_BLE 0x40000000
35 #define MAC_CONTROL_HBD 0x10000000
36 #define MAC_CONTROL_PS 0x08000000
37 #define MAC_CONTROL_DRO 0x00800000
38 #define MAC_CONTROL_EXT_LOOPBACK 0x00400000
39 #define MAC_CONTROL_OM 0x00200000
40 #define MAC_CONTROL_F 0x00100000
41 #define MAC_CONTROL_PM 0x00080000
42 #define MAC_CONTROL_PR 0x00040000
43 #define MAC_CONTROL_IF 0x00020000
44 #define MAC_CONTROL_PB 0x00010000
45 #define MAC_CONTROL_HO 0x00008000
46 #define MAC_CONTROL_HP 0x00002000
47 #define MAC_CONTROL_LCC 0x00001000
48 #define MAC_CONTROL_DBF 0x00000800
49 #define MAC_CONTROL_DRTY 0x00000400
50 #define MAC_CONTROL_ASTP 0x00000100
51 #define MAC_CONTROL_BOLMT_10 0x00000000
52 #define MAC_CONTROL_BOLMT_8 0x00000040
53 #define MAC_CONTROL_BOLMT_4 0x00000080
54 #define MAC_CONTROL_BOLMT_1 0x000000c0
55 #define MAC_CONTROL_DC 0x00000020
56 #define MAC_CONTROL_TE 0x00000008
57 #define MAC_CONTROL_RE 0x00000004
58
59 #define MAC_CORE_INIT (MAC_CONTROL_HBD | MAC_CONTROL_ASTP)
60
61
62 #define MAC_FLOW_CTRL_PT_MASK 0xffff0000
63 #define MAC_FLOW_CTRL_PT_SHIFT 16
64 #define MAC_FLOW_CTRL_PASS 0x00000004
65 #define MAC_FLOW_CTRL_ENABLE 0x00000002
66 #define MAC_FLOW_CTRL_PAUSE 0x00000001
67
68
69 #define MAC_MII_ADDR_WRITE 0x00000002
70 #define MAC_MII_ADDR_BUSY 0x00000001
71
72
73
74
75
76
77 #define DMA_BUS_MODE_DBO 0x00100000
78 #define DMA_BUS_MODE_BLE 0x00000080
79 #define DMA_BUS_MODE_PBL_MASK 0x00003f00
80 #define DMA_BUS_MODE_PBL_SHIFT 8
81 #define DMA_BUS_MODE_DSL_MASK 0x0000007c
82 #define DMA_BUS_MODE_DSL_SHIFT 2
83 #define DMA_BUS_MODE_BAR_BUS 0x00000002
84 #define DMA_BUS_MODE_DEFAULT 0x00000000
85
86
87 #define DMA_CONTROL_SF 0x00200000
88
89
90 enum ttc_control {
91 DMA_CONTROL_TTC_DEFAULT = 0x00000000,
92 DMA_CONTROL_TTC_64 = 0x00004000,
93 DMA_CONTROL_TTC_128 = 0x00008000,
94 DMA_CONTROL_TTC_256 = 0x0000c000,
95 DMA_CONTROL_TTC_18 = 0x00400000,
96 DMA_CONTROL_TTC_24 = 0x00404000,
97 DMA_CONTROL_TTC_32 = 0x00408000,
98 DMA_CONTROL_TTC_40 = 0x0040c000,
99 DMA_CONTROL_SE = 0x00000008,
100 DMA_CONTROL_OSF = 0x00000004,
101 };
102
103
104 #define DMA_MISSED_FRAME_OVE 0x10000000
105 #define DMA_MISSED_FRAME_OVE_CNTR 0x0ffe0000
106 #define DMA_MISSED_FRAME_OVE_M 0x00010000
107 #define DMA_MISSED_FRAME_M_CNTR 0x0000ffff
108
109 extern const struct stmmac_dma_ops dwmac100_dma_ops;
110
111 #endif