common/octeontx2: add IO handling APIs
[dpdk.git] / drivers / common / octeontx2 / otx2_io_generic.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2019 Marvell International Ltd.
3  */
4
5 #ifndef _OTX2_IO_GENERIC_H_
6 #define _OTX2_IO_GENERIC_H_
7
8 #define otx2_load_pair(val0, val1, addr)                        \
9 do {                                                            \
10         val0 = rte_read64_relaxed((void *)(addr));              \
11         val1 = rte_read64_relaxed((uint8_t *)(addr) + 8);       \
12 } while (0)
13
14 #define otx2_store_pair(val0, val1, addr)                       \
15 do {                                                            \
16         rte_write64_relaxed(val0, (void *)(addr));              \
17         rte_write64_relaxed(val1, (((uint8_t *)(addr)) + 8));   \
18 } while (0)
19
20 #define otx2_prefetch_store_keep(ptr) do {} while (0)
21
22 static inline uint64_t
23 otx2_atomic64_add_nosync(int64_t incr, int64_t *ptr)
24 {
25         RTE_SET_USED(ptr);
26         RTE_SET_USED(incr);
27
28         return 0;
29 }
30
31 static inline uint64_t
32 otx2_atomic64_add_sync(int64_t incr, int64_t *ptr)
33 {
34         RTE_SET_USED(ptr);
35         RTE_SET_USED(incr);
36
37         return 0;
38 }
39
40 static inline int64_t
41 otx2_lmt_submit(uint64_t io_address)
42 {
43         RTE_SET_USED(io_address);
44
45         return 0;
46 }
47
48 static __rte_always_inline void
49 otx2_lmt_mov(void *out, const void *in, const uint32_t lmtext)
50 {
51         RTE_SET_USED(out);
52         RTE_SET_USED(in);
53         RTE_SET_USED(lmtext);
54 }
55
56 static __rte_always_inline void
57 otx2_lmt_mov_seg(void *out, const void *in, const uint16_t segdw)
58 {
59         RTE_SET_USED(out);
60         RTE_SET_USED(in);
61         RTE_SET_USED(segdw);
62 }
63 #endif /* _OTX2_IO_GENERIC_H_ */