1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Freescale Layerscape MC I/O wrapper
4 * Data Path Buffer Pool API
5 * Contains initialization APIs and runtime control APIs for DPBP
7 * Copyright 2013-2016 Freescale Semiconductor, Inc.
8 * Copyright 2017-2023 NXP
15 #define DPBP_VER_MAJOR 3
16 #define DPBP_VER_MINOR 3
19 #define DPBP_CMDID_CLOSE 0x8001
20 #define DPBP_CMDID_OPEN 0x8041
21 #define DPBP_CMDID_CREATE 0x9041
22 #define DPBP_CMDID_DESTROY 0x9841
23 #define DPBP_CMDID_GET_API_VERSION 0xa041
25 #define DPBP_CMDID_ENABLE 0x0021
26 #define DPBP_CMDID_DISABLE 0x0031
27 #define DPBP_CMDID_GET_ATTR 0x0041
28 #define DPBP_CMDID_RESET 0x0051
32 struct dpbp_cmd_open {
36 struct dpbp_cmd_destroy {
40 struct dpbp_rsp_get_attributes {
50 int dpbp_open(struct fsl_mc_io *mc_io, u32 cmd_flags, int dpbp_id, u16 *token);
52 int dpbp_close(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
55 * struct dpbp_cfg - Structure representing DPBP configuration
56 * @options: place holder
62 int dpbp_create(struct fsl_mc_io *mc_io, u16 dprc_token, u32 cmd_flags,
63 const struct dpbp_cfg *cfg, u32 *obj_id);
65 int dpbp_destroy(struct fsl_mc_io *mc_io, u16 dprc_token, u32 cmd_flags,
68 int dpbp_enable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
70 int dpbp_disable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
72 int dpbp_reset(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
75 * struct dpbp_attr - Structure representing DPBP attributes
77 * @version: DPBP version
78 * @bpid: Hardware buffer pool ID; should be used as an argument in
79 * acquire/release operations on buffers
86 int dpbp_get_attributes(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
87 struct dpbp_attr *attr);
89 int dpbp_get_api_version(struct fsl_mc_io *mc_io, u32 cmd_flags,
90 u16 *major_ver, u16 *minor_ver);
92 #endif /* __FSL_DPBP_H */