Commit 1f1c25c7 authored by Prabhakar Kushwaha's avatar Prabhakar Kushwaha Committed by York Sun

drivers: fsl-mc: Update flibs to mc-0.6.0.1

Update flibs changes to mc-0.6.0.1 for dpmang, dprc, dpni and dpio objects
Also rename qbman_portal_ce/ci_paddr to qbman_portal_ce/ci_offset in
dpio_attr. These are now offsets from the SoC QBMan portals base.
Signed-off-by: default avatarJ. German Rivera <German.Rivera@freescale.com>
Signed-off-by: default avatarPrabhakar Kushwaha <prabhakar@freescale.com>
Reviewed-by: default avatarYork Sun <yorksun@freescale.com>
parent c1000c12
......@@ -313,7 +313,7 @@ int dpni_set_counter(struct fsl_mc_io *mc_io,
int dpni_set_link_cfg(struct fsl_mc_io *mc_io,
uint16_t token,
struct dpni_link_cfg *cfg)
const struct dpni_link_cfg *cfg)
{
struct mc_command cmd = { 0 };
......
......@@ -610,14 +610,16 @@ int dpio_init(struct dprc_obj_desc obj_desc)
printf("dpio_enable() failed %d\n", err);
goto err_get_enable;
}
debug("ce_paddr=0x%llx, ci_paddr=0x%llx, portalid=%d, prios=%d\n",
attr.qbman_portal_ce_paddr,
attr.qbman_portal_ci_paddr,
debug("ce_offset=0x%llx, ci_offset=0x%llx, portalid=%d, prios=%d\n",
attr.qbman_portal_ce_offset,
attr.qbman_portal_ci_offset,
attr.qbman_portal_id,
attr.num_priorities);
p_des.cena_bar = (void *)attr.qbman_portal_ce_paddr;
p_des.cinh_bar = (void *)attr.qbman_portal_ci_paddr;
p_des.cena_bar = (void *)(SOC_QBMAN_PORTALS_BASE_ADDR
+ attr.qbman_portal_ce_offset);
p_des.cinh_bar = (void *)(SOC_QBMAN_PORTALS_BASE_ADDR
+ attr.qbman_portal_ci_offset);
dflt_dpio->sw_portal = qbman_swp_init(&p_des);
if (dflt_dpio->sw_portal == NULL) {
......
......@@ -8,8 +8,8 @@
#define _FSL_DPIO_H
/* DPIO Version */
#define DPIO_VER_MAJOR 2
#define DPIO_VER_MINOR 1
#define DPIO_VER_MAJOR 3
#define DPIO_VER_MINOR 0
/* Command IDs */
#define DPIO_CMDID_CLOSE 0x800
......@@ -31,8 +31,8 @@ do { \
MC_RSP_OP(cmd, 0, 32, 16, uint16_t, attr->qbman_portal_id);\
MC_RSP_OP(cmd, 0, 48, 8, uint8_t, attr->num_priorities);\
MC_RSP_OP(cmd, 0, 56, 4, enum dpio_channel_mode, attr->channel_mode);\
MC_RSP_OP(cmd, 1, 0, 64, uint64_t, attr->qbman_portal_ce_paddr);\
MC_RSP_OP(cmd, 2, 0, 64, uint64_t, attr->qbman_portal_ci_paddr);\
MC_RSP_OP(cmd, 1, 0, 64, uint64_t, attr->qbman_portal_ce_offset);\
MC_RSP_OP(cmd, 2, 0, 64, uint64_t, attr->qbman_portal_ci_offset);\
MC_RSP_OP(cmd, 3, 0, 16, uint16_t, attr->version.major);\
MC_RSP_OP(cmd, 3, 16, 16, uint16_t, attr->version.minor);\
} while (0)
......@@ -42,6 +42,7 @@ do { \
*/
struct fsl_mc_io;
/**
* dpio_open() - Open a control session for the specified object
* @mc_io: Pointer to MC portal's I/O object
......@@ -61,18 +62,9 @@ struct fsl_mc_io;
int dpio_open(struct fsl_mc_io *mc_io, int dpio_id, uint16_t *token);
/**
* dpio_open() - Open a control session for the specified object
* dpio_close() - Close the control session of the object
* @mc_io: Pointer to MC portal's I/O object
* @dpio_id: DPIO unique ID
* @token: Returned token; use in subsequent API calls
*
* This function can be used to open a control session for an
* already created object; an object may have been declared in
* the DPL or by calling the dpio_create() function.
* This function returns a unique authentication token,
* associated with the specific object ID and the specific MC
* portal; this token must be used in all subsequent commands for
* this specific object.
* @token: Token of DPIO object
*
* Return: '0' on Success; Error code otherwise.
*/
......@@ -121,10 +113,8 @@ int dpio_reset(struct fsl_mc_io *mc_io, uint16_t token);
* struct dpio_attr - Structure representing DPIO attributes
* @id: DPIO object ID
* @version: DPIO version
* @qbman_portal_ce_paddr: Physical address of the software portal
* cache-enabled area
* @qbman_portal_ci_paddr: Physical address of the software portal
* cache-inhibited area
* @qbman_portal_ce_offset: offset of the software portal cache-enabled area
* @qbman_portal_ci_offset: offset of the software portal cache-inhibited area
* @qbman_portal_id: Software portal ID
* @channel_mode: Notification channel mode
* @num_priorities: Number of priorities for the notification channel (1-8);
......@@ -141,8 +131,8 @@ struct dpio_attr {
uint16_t major;
uint16_t minor;
} version;
uint64_t qbman_portal_ce_paddr;
uint64_t qbman_portal_ci_paddr;
uint64_t qbman_portal_ce_offset;
uint64_t qbman_portal_ci_offset;
uint16_t qbman_portal_id;
enum dpio_channel_mode channel_mode;
uint8_t num_priorities;
......
......@@ -14,7 +14,7 @@ struct fsl_mc_io;
/**
* Management Complex firmware version information
*/
#define MC_VER_MAJOR 6
#define MC_VER_MAJOR 7
#define MC_VER_MINOR 0
/**
......
This diff is collapsed.
......@@ -10,7 +10,7 @@
#define _FSL_DPRC_H
/* DPRC Version */
#define DPRC_VER_MAJOR 2
#define DPRC_VER_MAJOR 4
#define DPRC_VER_MINOR 0
/* Command IDs */
......@@ -88,6 +88,22 @@ do { \
MC_RSP_OP(cmd, 4, 40, 8, char, obj_desc->type[13]);\
MC_RSP_OP(cmd, 4, 48, 8, char, obj_desc->type[14]);\
MC_RSP_OP(cmd, 4, 56, 8, char, obj_desc->type[15]);\
MC_RSP_OP(cmd, 5, 0, 8, char, obj_desc->label[0]);\
MC_RSP_OP(cmd, 5, 8, 8, char, obj_desc->label[1]);\
MC_RSP_OP(cmd, 5, 16, 8, char, obj_desc->label[2]);\
MC_RSP_OP(cmd, 5, 24, 8, char, obj_desc->label[3]);\
MC_RSP_OP(cmd, 5, 32, 8, char, obj_desc->label[4]);\
MC_RSP_OP(cmd, 5, 40, 8, char, obj_desc->label[5]);\
MC_RSP_OP(cmd, 5, 48, 8, char, obj_desc->label[6]);\
MC_RSP_OP(cmd, 5, 56, 8, char, obj_desc->label[7]);\
MC_RSP_OP(cmd, 6, 0, 8, char, obj_desc->label[8]);\
MC_RSP_OP(cmd, 6, 8, 8, char, obj_desc->label[9]);\
MC_RSP_OP(cmd, 6, 16, 8, char, obj_desc->label[10]);\
MC_RSP_OP(cmd, 6, 24, 8, char, obj_desc->label[11]);\
MC_RSP_OP(cmd, 6, 32, 8, char, obj_desc->label[12]);\
MC_RSP_OP(cmd, 6, 40, 8, char, obj_desc->label[13]);\
MC_RSP_OP(cmd, 6, 48, 8, char, obj_desc->label[14]);\
MC_RSP_OP(cmd, 6, 56, 8, char, obj_desc->label[15]);\
} while (0)
/* cmd, param, offset, width, type, arg_name */
......@@ -175,10 +191,32 @@ do { \
/* param, offset, width, type, arg_name */
#define DPRC_RSP_GET_OBJ_REGION(cmd, region_desc) \
do { \
MC_RSP_OP(cmd, 1, 0, 64, uint64_t, region_desc->base_paddr);\
MC_RSP_OP(cmd, 1, 0, 64, uint64_t, region_desc->base_offset);\
MC_RSP_OP(cmd, 2, 0, 32, uint32_t, region_desc->size); \
} while (0)
/* cmd, param, offset, width, type, arg_name */
#define DPRC_CMD_SET_OBJ_LABEL(cmd, obj_index, label) \
do { \
MC_CMD_OP(cmd, 0, 0, 32, int, obj_index); \
MC_CMD_OP(cmd, 1, 0, 8, char, label[0]);\
MC_CMD_OP(cmd, 1, 8, 8, char, label[1]);\
MC_CMD_OP(cmd, 1, 16, 8, char, label[2]);\
MC_CMD_OP(cmd, 1, 24, 8, char, label[3]);\
MC_CMD_OP(cmd, 1, 32, 8, char, label[4]);\
MC_CMD_OP(cmd, 1, 40, 8, char, label[5]);\
MC_CMD_OP(cmd, 1, 48, 8, char, label[6]);\
MC_CMD_OP(cmd, 1, 56, 8, char, label[7]);\
MC_CMD_OP(cmd, 2, 0, 8, char, label[8]);\
MC_CMD_OP(cmd, 2, 8, 8, char, label[9]);\
MC_CMD_OP(cmd, 2, 16, 8, char, label[10]);\
MC_CMD_OP(cmd, 2, 24, 8, char, label[11]);\
MC_CMD_OP(cmd, 2, 32, 8, char, label[12]);\
MC_CMD_OP(cmd, 2, 40, 8, char, label[13]);\
MC_CMD_OP(cmd, 2, 48, 8, char, label[14]);\
MC_CMD_OP(cmd, 2, 56, 8, char, label[15]);\
} while (0)
/* cmd, param, offset, width, type, arg_name */
#define DPRC_CMD_CONNECT(cmd, endpoint1, endpoint2) \
do { \
......@@ -294,6 +332,7 @@ do { \
/* Data Path Resource Container API
* Contains DPRC API for managing and querying DPAA resources
*/
struct fsl_mc_io;
/**
......@@ -366,7 +405,7 @@ int dprc_close(struct fsl_mc_io *mc_io, uint16_t token);
/* Object initialization allowed - software context associated with this
* container is allowed to invoke object initialization operations.
*/
#define DPRC_CFG_OPT_OBJ_CREATE_ALLOWED 0x00000004
#define DPRC_CFG_OPT_OBJ_CREATE_ALLOWED 0x00000004
/* Topology change allowed - software context associated with this
* container is allowed to invoke topology operations, such as attach/detach
......@@ -389,11 +428,13 @@ int dprc_close(struct fsl_mc_io *mc_io, uint16_t token);
* @portal_id: Portal ID; if set to 'DPRC_GET_PORTAL_ID_FROM_POOL', a free
* portal ID is allocated by the DPRC
* @options: Combination of 'DPRC_CFG_OPT_<X>' options
* @label: Object's label
*/
struct dprc_cfg {
uint16_t icid;
int portal_id;
uint64_t options;
char label[16];
};
/**
......@@ -484,6 +525,7 @@ int dprc_get_obj_count(struct fsl_mc_io *mc_io, uint16_t token, int *obj_count);
* @irq_count: Number of interrupts supported by the object
* @region_count: Number of mappable regions supported by the object
* @state: Object state: combination of DPRC_OBJ_STATE_ states
* @label: Object label
*/
struct dprc_obj_desc {
char type[16];
......@@ -494,6 +536,7 @@ struct dprc_obj_desc {
uint8_t irq_count;
uint8_t region_count;
uint32_t state;
char label[16];
};
/**
......@@ -516,8 +559,8 @@ int dprc_get_obj(struct fsl_mc_io *mc_io,
struct dprc_obj_desc *obj_desc);
/**
* dprc_get_res_count() - Obtains the number of free resources that are assigned
* to this container, by pool type
* dprc_get_res_count() - Obtains the number of free resources that are
* assigned to this container, by pool type
* @mc_io: Pointer to MC portal's I/O object
* @token: Token of DPRC object
* @type: pool type
......@@ -574,11 +617,14 @@ int dprc_get_res_ids(struct fsl_mc_io *mc_io,
/**
* struct dprc_region_desc - Mappable region descriptor
* @base_paddr: Region base physical address
* @base_offset: Region offset from region's base address.
* For DPMCP and DPRC objects, region base is offset from SoC MC portals
* base address; For DPIO, region base is offset from SoC QMan portals
* base address
* @size: Region size (in bytes)
*/
struct dprc_region_desc {
uint64_t base_paddr;
uint64_t base_offset;
uint32_t size;
};
......@@ -642,8 +688,8 @@ int dprc_disconnect(struct fsl_mc_io *mc_io,
/**
* dprc_get_connection() - Get connected endpoint and link status if connection
* exists.
* @mc_io Pointer to MC portal's I/O object
* @token Token of DPRC object
* @mc_io Pointer to MC portal's I/O object
* @token Token of DPRC object
* @endpoint1 Endpoint 1 configuration parameters
* @endpoint2 Returned endpoint 2 configuration parameters
* @state: Returned link state: 1 - link is up, 0 - link is down
......
......@@ -27,6 +27,7 @@
(MCFAPR_PL_MASK | MCFAPR_BMT_MASK)
#define SOC_MC_PORTALS_BASE_ADDR ((void __iomem *)0x00080C000000)
#define SOC_QBMAN_PORTALS_BASE_ADDR ((void __iomem *)0x000818000000)
#define SOC_MC_PORTAL_STRIDE 0x10000
#define SOC_MC_PORTAL_ADDR(_portal_id) \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment