Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Freescale Layerscape MC I/O wrapper |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 4 | * Data Path Buffer Pool API |
| 5 | * Contains initialization APIs and runtime control APIs for DPBP |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 6 | * |
Yogesh Gaur | 1a0c4ae | 2018-05-09 10:52:17 +0530 | [diff] [blame] | 7 | * Copyright 2013-2016 Freescale Semiconductor, Inc. |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 8 | * Copyright 2017-2023 NXP |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 9 | */ |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 10 | |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 11 | #ifndef __FSL_DPBP_H |
| 12 | #define __FSL_DPBP_H |
| 13 | |
| 14 | /* DPBP Version */ |
Yogesh Gaur | 318c32f | 2017-11-15 11:59:31 +0530 | [diff] [blame] | 15 | #define DPBP_VER_MAJOR 3 |
| 16 | #define DPBP_VER_MINOR 3 |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 17 | |
| 18 | /* Command IDs */ |
Yogesh Gaur | 318c32f | 2017-11-15 11:59:31 +0530 | [diff] [blame] | 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 |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 24 | |
Yogesh Gaur | 318c32f | 2017-11-15 11:59:31 +0530 | [diff] [blame] | 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 |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 29 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 30 | #pragma pack(push, 1) |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 31 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 32 | struct dpbp_cmd_open { |
| 33 | __le32 dpbp_id; |
| 34 | }; |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 35 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 36 | struct dpbp_cmd_destroy { |
| 37 | __le32 object_id; |
| 38 | }; |
| 39 | |
| 40 | struct dpbp_rsp_get_attributes { |
| 41 | __le16 pad; |
| 42 | __le16 bpid; |
| 43 | __le32 id; |
| 44 | }; |
| 45 | |
| 46 | #pragma pack(pop) |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 47 | |
| 48 | struct fsl_mc_io; |
| 49 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 50 | int dpbp_open(struct fsl_mc_io *mc_io, u32 cmd_flags, int dpbp_id, u16 *token); |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 51 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 52 | int dpbp_close(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token); |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 53 | |
| 54 | /** |
Prabhakar Kushwaha | cf0c8cf | 2015-11-04 12:25:53 +0530 | [diff] [blame] | 55 | * struct dpbp_cfg - Structure representing DPBP configuration |
| 56 | * @options: place holder |
| 57 | */ |
| 58 | struct dpbp_cfg { |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 59 | u32 options; |
Prabhakar Kushwaha | cf0c8cf | 2015-11-04 12:25:53 +0530 | [diff] [blame] | 60 | }; |
| 61 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 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); |
Prabhakar Kushwaha | cf0c8cf | 2015-11-04 12:25:53 +0530 | [diff] [blame] | 64 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 65 | int dpbp_destroy(struct fsl_mc_io *mc_io, u16 dprc_token, u32 cmd_flags, |
| 66 | u32 obj_id); |
Prabhakar Kushwaha | cf0c8cf | 2015-11-04 12:25:53 +0530 | [diff] [blame] | 67 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 68 | int dpbp_enable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token); |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 69 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 70 | int dpbp_disable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token); |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 71 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 72 | int dpbp_reset(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token); |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 73 | |
| 74 | /** |
| 75 | * struct dpbp_attr - Structure representing DPBP attributes |
| 76 | * @id: DPBP object ID |
| 77 | * @version: DPBP version |
| 78 | * @bpid: Hardware buffer pool ID; should be used as an argument in |
| 79 | * acquire/release operations on buffers |
| 80 | */ |
| 81 | struct dpbp_attr { |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 82 | u32 id; |
| 83 | u16 bpid; |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 84 | }; |
| 85 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 86 | int dpbp_get_attributes(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, |
| 87 | struct dpbp_attr *attr); |
Yogesh Gaur | 318c32f | 2017-11-15 11:59:31 +0530 | [diff] [blame] | 88 | |
Ioana Ciornei | 2f232fa | 2023-05-31 19:04:30 +0300 | [diff] [blame] | 89 | int dpbp_get_api_version(struct fsl_mc_io *mc_io, u32 cmd_flags, |
| 90 | u16 *major_ver, u16 *minor_ver); |
Prabhakar Kushwaha | cfd9fbf | 2015-03-19 09:20:45 -0700 | [diff] [blame] | 91 | |
| 92 | #endif /* __FSL_DPBP_H */ |