1 /* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
3 * Copyright 2013-2016 Freescale Semiconductor Inc.
4 * Copyright 2016-2017 NXP
7 #ifndef _FSL_DPBP_CMD_H
8 #define _FSL_DPBP_CMD_H
11 #define DPBP_VER_MAJOR 3
12 #define DPBP_VER_MINOR 3
14 /* Command versioning */
15 #define DPBP_CMD_BASE_VERSION 1
16 #define DPBP_CMD_ID_OFFSET 4
18 #define DPBP_CMD(id) ((id << DPBP_CMD_ID_OFFSET) | DPBP_CMD_BASE_VERSION)
21 #define DPBP_CMDID_CLOSE DPBP_CMD(0x800)
22 #define DPBP_CMDID_OPEN DPBP_CMD(0x804)
23 #define DPBP_CMDID_CREATE DPBP_CMD(0x904)
24 #define DPBP_CMDID_DESTROY DPBP_CMD(0x984)
25 #define DPBP_CMDID_GET_API_VERSION DPBP_CMD(0xa04)
27 #define DPBP_CMDID_ENABLE DPBP_CMD(0x002)
28 #define DPBP_CMDID_DISABLE DPBP_CMD(0x003)
29 #define DPBP_CMDID_GET_ATTR DPBP_CMD(0x004)
30 #define DPBP_CMDID_RESET DPBP_CMD(0x005)
31 #define DPBP_CMDID_IS_ENABLED DPBP_CMD(0x006)
33 #define DPBP_CMDID_SET_IRQ_ENABLE DPBP_CMD(0x012)
34 #define DPBP_CMDID_GET_IRQ_ENABLE DPBP_CMD(0x013)
35 #define DPBP_CMDID_SET_IRQ_MASK DPBP_CMD(0x014)
36 #define DPBP_CMDID_GET_IRQ_MASK DPBP_CMD(0x015)
37 #define DPBP_CMDID_GET_IRQ_STATUS DPBP_CMD(0x016)
38 #define DPBP_CMDID_CLEAR_IRQ_STATUS DPBP_CMD(0x017)
40 #define DPBP_CMDID_SET_NOTIFICATIONS DPBP_CMD(0x1b0)
41 #define DPBP_CMDID_GET_NOTIFICATIONS DPBP_CMD(0x1b1)
43 #define DPBP_CMDID_GET_FREE_BUFFERS_NUM DPBP_CMD(0x1b2)
46 struct dpbp_cmd_open {
50 struct dpbp_cmd_destroy {
54 #define DPBP_ENABLE 0x1
56 struct dpbp_rsp_is_enabled {
60 struct dpbp_rsp_get_attributes {
66 struct dpbp_cmd_set_notifications {
67 uint32_t depletion_entry;
68 uint32_t depletion_exit;
69 uint32_t surplus_entry;
70 uint32_t surplus_exit;
74 uint64_t message_iova;
77 struct dpbp_rsp_get_notifications {
78 uint32_t depletion_entry;
79 uint32_t depletion_exit;
80 uint32_t surplus_entry;
81 uint32_t surplus_exit;
85 uint64_t message_iova;
88 struct dpbp_rsp_get_api_version {
93 struct dpbp_rsp_get_num_free_bufs {
94 uint32_t num_free_bufs;
98 #endif /* _FSL_DPBP_CMD_H */