xref: /dpdk/drivers/net/nfp/nfpcore/nfp6000/nfp_xpb.h (revision c7e9729da6b521ee8a1f8bb3a1fa4c156f059ced)
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Netronome Systems, Inc.
3  * All rights reserved.
4  */
5 
6 #ifndef __NFP_XPB_H__
7 #define __NFP_XPB_H__
8 
9 /*
10  * For use with NFP6000 Databook "XPB Addressing" section
11  */
12 #define NFP_XPB_OVERLAY(island)  (((island) & 0x3f) << 24)
13 
14 #define NFP_XPB_ISLAND(island)   (NFP_XPB_OVERLAY(island) + 0x60000)
15 
16 #define NFP_XPB_ISLAND_of(offset) (((offset) >> 24) & 0x3F)
17 
18 /*
19  * For use with NFP6000 Databook "XPB Island and Device IDs" chapter
20  */
21 #define NFP_XPB_DEVICE(island, slave, device) \
22 				(NFP_XPB_OVERLAY(island) | \
23 				 (((slave) & 3) << 22) | \
24 				 (((device) & 0x3f) << 16))
25 
26 #endif /* NFP_XPB_H */
27