GNU Linux-libre 4.19.264-gnu1
[releases.git] / drivers / net / ethernet / apm / xgene-v2 / enet.h
1 /*
2  * Applied Micro X-Gene SoC Ethernet v2 Driver
3  *
4  * Copyright (c) 2017, Applied Micro Circuits Corporation
5  * Author(s): Iyappan Subramanian <isubramanian@apm.com>
6  *            Keyur Chudgar <kchudgar@apm.com>
7  *
8  * This program is free software; you can redistribute  it and/or modify it
9  * under  the terms of  the GNU General  Public License as published by the
10  * Free Software Foundation;  either version 2 of the  License, or (at your
11  * 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, see <http://www.gnu.org/licenses/>.
20  */
21
22 #ifndef __XGENE_ENET_V2_ENET_H__
23 #define __XGENE_ENET_V2_ENET_H__
24
25 #define ENET_CLKEN              0xc008
26 #define ENET_SRST               0xc000
27 #define ENET_SHIM               0xc010
28 #define CFG_MEM_RAM_SHUTDOWN    0xd070
29 #define BLOCK_MEM_RDY           0xd074
30
31 #define MEM_RDY                 0xffffffff
32 #define DEVM_ARAUX_COH          BIT(19)
33 #define DEVM_AWAUX_COH          BIT(3)
34
35 #define CFG_FORCE_LINK_STATUS_EN        0x229c
36 #define FORCE_LINK_STATUS               0x22a0
37 #define CFG_LINK_AGGR_RESUME            0x27c8
38 #define RX_DV_GATE_REG                  0x2dfc
39
40 void xge_wr_csr(struct xge_pdata *pdata, u32 offset, u32 val);
41 u32 xge_rd_csr(struct xge_pdata *pdata, u32 offset);
42 int xge_port_reset(struct net_device *ndev);
43 void xge_port_init(struct net_device *ndev);
44
45 #endif  /* __XGENE_ENET_V2_ENET__H__ */