New upstream version 18.08
[deb_dpdk.git] / drivers / net / ark / ark_pktdir.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2015-2018 Atomic Rules LLC
3  */
4
5 #ifndef _ARK_PKTDIR_H_
6 #define _ARK_PKTDIR_H_
7
8 #include <stdint.h>
9
10 #define ARK_PKTDIR_BASE_ADR  0xa0000
11
12 typedef void *ark_pkt_dir_t;
13
14
15 /* The packet director is an internal Arkville hardware module for
16  * directing packet data in non-typical flows, such as testing.
17  * This module is *not* intended for end-user manipulation, hence
18  * there is minimal documentation.
19  */
20
21 /*
22  * This is an overlay structures to a memory mapped FPGA device.  These
23  * structs will never be instantiated in ram memory
24  */
25 struct ark_pkt_dir_regs {
26         uint32_t ctrl;
27         uint32_t status;
28         uint32_t stall_cnt;
29 } __attribute__ ((packed));
30
31 struct ark_pkt_dir_inst {
32         volatile struct ark_pkt_dir_regs *regs;
33 };
34
35 ark_pkt_dir_t ark_pktdir_init(void *base);
36 void ark_pktdir_uninit(ark_pkt_dir_t handle);
37 void ark_pktdir_setup(ark_pkt_dir_t handle, uint32_t v);
38 uint32_t ark_pktdir_stall_cnt(ark_pkt_dir_t handle);
39 uint32_t ark_pktdir_status(ark_pkt_dir_t handle);
40
41 #endif