efi_loader: type of efi_secure_mode
[oweals/u-boot.git] / include / fsl-mc / fsl_dpbp.h
index 92c5437d891f05e0bc57b5ddc8aacc29608b4c69..2278ac952ea94d50962e72f3f59cb903badb6e62 100644 (file)
@@ -1,10 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0+ */
 /*
  * Freescale Layerscape MC I/O wrapper
  *
- * Copyright (C) 2013-2015 Freescale Semiconductor, Inc.
- * Author: German Rivera <German.Rivera@freescale.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
+ * Copyright 2013-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
  */
 /*!
  *  @file    fsl_dpbp.h
 #define __FSL_DPBP_H
 
 /* DPBP Version */
-#define DPBP_VER_MAJOR                         2
-#define DPBP_VER_MINOR                         1
+#define DPBP_VER_MAJOR                         3
+#define DPBP_VER_MINOR                         3
 
 /* Command IDs */
-#define DPBP_CMDID_CLOSE                               0x800
-#define DPBP_CMDID_OPEN                                        0x804
-#define DPBP_CMDID_CREATE                              0x904
-#define DPBP_CMDID_DESTROY                             0x900
-
-#define DPBP_CMDID_ENABLE                              0x002
-#define DPBP_CMDID_DISABLE                             0x003
-#define DPBP_CMDID_GET_ATTR                            0x004
-#define DPBP_CMDID_RESET                               0x005
+#define DPBP_CMDID_CLOSE                               0x8001
+#define DPBP_CMDID_OPEN                                        0x8041
+#define DPBP_CMDID_CREATE                              0x9041
+#define DPBP_CMDID_DESTROY                             0x9841
+#define DPBP_CMDID_GET_API_VERSION                     0xa041
+
+#define DPBP_CMDID_ENABLE                              0x0021
+#define DPBP_CMDID_DISABLE                             0x0031
+#define DPBP_CMDID_GET_ATTR                            0x0041
+#define DPBP_CMDID_RESET                               0x0051
+#define DPBP_CMDID_IS_ENABLED                          0x0061
 
 /*                cmd, param, offset, width, type, arg_name */
 #define DPBP_CMD_OPEN(cmd, dpbp_id) \
@@ -37,8 +38,6 @@
 do { \
        MC_RSP_OP(cmd, 0, 16, 16, uint16_t, attr->bpid); \
        MC_RSP_OP(cmd, 0, 32, 32, int,      attr->id);\
-       MC_RSP_OP(cmd, 1, 0,  16, uint16_t, attr->version.major);\
-       MC_RSP_OP(cmd, 1, 16, 16, uint16_t, attr->version.minor);\
 } while (0)
 
 /* Data Path Buffer Pool API
@@ -114,9 +113,10 @@ struct dpbp_cfg {
  * Return:     '0' on Success; Error code otherwise.
  */
 int dpbp_create(struct fsl_mc_io       *mc_io,
+               uint16_t                dprc_token,
                uint32_t                cmd_flags,
                const struct dpbp_cfg   *cfg,
-               uint16_t                *token);
+               uint32_t                *obj_id);
 
 /**
  * dpbp_destroy() - Destroy the DPBP object and release all its resources.
@@ -127,8 +127,9 @@ int dpbp_create(struct fsl_mc_io    *mc_io,
  * Return:     '0' on Success; error code otherwise.
  */
 int dpbp_destroy(struct fsl_mc_io      *mc_io,
+                uint16_t               dprc_token,
                 uint32_t               cmd_flags,
-                uint16_t               token);
+                uint32_t               obj_id);
 
 /**
  * dpbp_enable() - Enable the DPBP.
@@ -189,16 +190,7 @@ int dpbp_reset(struct fsl_mc_io    *mc_io,
  *             acquire/release operations on buffers
  */
 struct dpbp_attr {
-       int id;
-       /**
-        * struct version - Structure representing DPBP version
-        * @major:      DPBP major version
-        * @minor:      DPBP minor version
-        */
-       struct {
-               uint16_t major;
-               uint16_t minor;
-       } version;
+       uint32_t id;
        uint16_t bpid;
 };
 
@@ -217,6 +209,21 @@ int dpbp_get_attributes(struct fsl_mc_io   *mc_io,
                        uint16_t                token,
                        struct dpbp_attr        *attr);
 
+/**
+ * dpbp_get_api_version - Retrieve DPBP Major and Minor version info.
+ *
+ * @mc_io:     Pointer to MC portal's I/O object
+ * @cmd_flags: Command flags; one or more of 'MC_CMD_FLAG_'
+ * @major_ver: DPBP major version
+ * @minor_ver: DPBP minor version
+ *
+ * Return:     '0' on Success; Error code otherwise.
+ */
+int dpbp_get_api_version(struct fsl_mc_io *mc_io,
+                        u32 cmd_flags,
+                        u16 *major_ver,
+                        u16 *minor_ver);
+
 /** @} */
 
 #endif /* __FSL_DPBP_H */