b0c19266b238caf8145162b22a8476ae6f93ac4e
[dpdk.git] / drivers / common / octeontx2 / otx2_common.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2019 Marvell International Ltd.
3  */
4
5 #ifndef _OTX2_COMMON_H_
6 #define _OTX2_COMMON_H_
7
8 #include <rte_common.h>
9 #include <rte_io.h>
10 #include <rte_memory.h>
11
12 #include "hw/otx2_rvu.h"
13 #include "hw/otx2_nix.h"
14 #include "hw/otx2_npc.h"
15 #include "hw/otx2_npa.h"
16 #include "hw/otx2_sso.h"
17 #include "hw/otx2_ssow.h"
18 #include "hw/otx2_tim.h"
19
20 /* Alignment */
21 #define OTX2_ALIGN  128
22
23 /* Bits manipulation */
24 #ifndef BIT_ULL
25 #define BIT_ULL(nr) (1ULL << (nr))
26 #endif
27 #ifndef BIT
28 #define BIT(nr)     (1UL << (nr))
29 #endif
30
31 /* Compiler attributes */
32 #ifndef __hot
33 #define __hot   __attribute__((hot))
34 #endif
35
36 /* IO Access */
37 #define otx2_read64(addr) rte_read64_relaxed((void *)(addr))
38 #define otx2_write64(val, addr) rte_write64_relaxed((val), (void *)(addr))
39
40 #if defined(RTE_ARCH_ARM64)
41 #include "otx2_io_arm64.h"
42 #else
43 #include "otx2_io_generic.h"
44 #endif
45
46 #endif /* _OTX2_COMMON_H_ */