diff options
author | Haiying Wang <Haiying.wang@freescale.com> | 2015-10-02 16:19:14 (GMT) |
---|---|---|
committer | Haiying Wang <Haiying.wang@freescale.com> | 2015-10-13 17:33:28 (GMT) |
commit | 4c642e7af5e9e605b9fb6b8130216548c7bc180b (patch) | |
tree | fd00bfd48060767a5c9393ad8887bd145f0ce28c | |
parent | b8887bd4e0e4a13acda92f90939c8b9a15a10e64 (diff) | |
download | linux-fsl-qoriq-4c642e7af5e9e605b9fb6b8130216548c7bc180b.tar.xz |
fsl_qbman: enable sending cscn to dcp for old qman revision
Set CSCN_TARG with correct DCP portal in qman_create_cgr_to_dcp()
funciton for the qman revision < qman_3.0
JIRA issue# QLINUX-3814
Signed-off-by: Haiying Wang <Haiying.wang@freescale.com>
-rw-r--r-- | drivers/staging/fsl_qbman/qman_high.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/staging/fsl_qbman/qman_high.c b/drivers/staging/fsl_qbman/qman_high.c index 334d9ed..d17d301 100644 --- a/drivers/staging/fsl_qbman/qman_high.c +++ b/drivers/staging/fsl_qbman/qman_high.c @@ -2549,6 +2549,7 @@ EXPORT_SYMBOL(qman_modify_cgr); #define TARG_MASK(n) (0x80000000 >> (n->config->public_cfg.channel - \ QM_CHANNEL_SWPORTAL0)) +#define TARG_DCP_MASK(n) (0x80000000 >> (10 + n)) #define PORTAL_IDX(n) (n->config->public_cfg.channel - QM_CHANNEL_SWPORTAL0) static u8 qman_cgr_cpus[__CGR_NUM]; @@ -2630,13 +2631,9 @@ int qman_create_cgr_to_dcp(struct qman_cgr *cgr, u32 flags, u16 dcp_portal, { unsigned long irqflags __maybe_unused; struct qm_mcc_initcgr local_opts; + struct qm_mcr_querycgr cgr_state; int ret; - if ((qman_ip_rev & 0xFF00) < QMAN_REV30) { - pr_warn("This QMan version doesn't support to send CSCN to" - " DCP portal\n"); - return -EINVAL; - } /* We have to check that the provided CGRID is within the limits of the * data-structures, for obvious reasons. However we'll let h/w take * care of determining whether it's within the limits of what exists on @@ -2645,12 +2642,21 @@ int qman_create_cgr_to_dcp(struct qman_cgr *cgr, u32 flags, u16 dcp_portal, if (cgr->cgrid >= __CGR_NUM) return -EINVAL; + ret = qman_query_cgr(cgr, &cgr_state); + if (ret) + return ret; + memset(&local_opts, 0, sizeof(struct qm_mcc_initcgr)); if (opts) local_opts = *opts; - local_opts.cgr.cscn_targ_upd_ctrl = QM_CGR_TARG_UDP_CTRL_WRITE_BIT | + if ((qman_ip_rev & 0xFF00) >= QMAN_REV30) + local_opts.cgr.cscn_targ_upd_ctrl = + QM_CGR_TARG_UDP_CTRL_WRITE_BIT | QM_CGR_TARG_UDP_CTRL_DCP | dcp_portal; + else + local_opts.cgr.cscn_targ = cgr_state.cgr.cscn_targ | + TARG_DCP_MASK(dcp_portal); local_opts.we_mask |= QM_CGR_WE_CSCN_TARG; /* send init if flags indicate so */ |