summaryrefslogtreecommitdiff
path: root/drivers/bus
diff options
context:
space:
mode:
authorHemant Agrawal <hemant.agrawal@nxp.com>2019-01-11 12:24:34 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-01-14 17:44:29 +0100
commitff8e5f10c39d1c02d5f16db2c3958ea60e780468 (patch)
tree7f4acc277bc97e8761d52dbbc5f753ce20174a63 /drivers/bus
parentc1870f65e62fbdf5da742cf2cfbcf238a52b46ed (diff)
downloaddpdk-next-eventdev-ff8e5f10c39d1c02d5f16db2c3958ea60e780468.zip
dpdk-next-eventdev-ff8e5f10c39d1c02d5f16db2c3958ea60e780468.tar.gz
dpdk-next-eventdev-ff8e5f10c39d1c02d5f16db2c3958ea60e780468.tar.xz
bus/fslmc: upgrade to latest qbman library
This patch upgrades and sync the dpdk based qbman code with new version of qbman flib. Signed-off-by: Youri Querry <youri.querry_1@nxp.com> Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/fslmc/qbman/qbman_portal.c8
-rw-r--r--drivers/bus/fslmc/qbman/qbman_sys.h17
2 files changed, 15 insertions, 10 deletions
diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c
index bbea37e..2f572a0 100644
--- a/drivers/bus/fslmc/qbman/qbman_portal.c
+++ b/drivers/bus/fslmc/qbman/qbman_portal.c
@@ -201,7 +201,7 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d)
p->vdq.valid_bit = QB_VALID_BIT;
p->dqrr.valid_bit = QB_VALID_BIT;
qman_version = p->desc.qman_version;
- if ((qman_version & 0xFFFF0000) < QMAN_REV_4100) {
+ if ((qman_version & QMAN_REV_MASK) < QMAN_REV_4100) {
p->dqrr.dqrr_size = 4;
p->dqrr.reset_bug = 1;
} else {
@@ -1315,9 +1315,9 @@ const struct qbman_result *qbman_swp_dqrr_next_mem_back(struct qbman_swp *s)
*/
flags = p->dq.stat;
response_verb = verb & QBMAN_RESPONSE_VERB_MASK;
- if ((response_verb == QBMAN_RESULT_DQ) &&
- (flags & QBMAN_DQ_STAT_VOLATILE) &&
- (flags & QBMAN_DQ_STAT_EXPIRED))
+ if ((response_verb == QBMAN_RESULT_DQ)
+ && (flags & QBMAN_DQ_STAT_VOLATILE)
+ && (flags & QBMAN_DQ_STAT_EXPIRED))
atomic_inc(&s->vdq.busy);
return p;
}
diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h
index 0571097..e3bd1c5 100644
--- a/drivers/bus/fslmc/qbman/qbman_sys.h
+++ b/drivers/bus/fslmc/qbman/qbman_sys.h
@@ -387,6 +387,10 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s,
{
uint32_t reg;
int i;
+ int cena_region_size = 4*1024;
+
+ if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000)
+ cena_region_size = 64*1024;
#ifdef RTE_ARCH_64
uint8_t wn = CENA_WRITE_ENABLE;
#else
@@ -396,7 +400,8 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s,
s->addr_cena = d->cena_bar;
s->addr_cinh = d->cinh_bar;
s->idx = (uint32_t)d->idx;
- s->cena = malloc(64*1024);
+ s->cena = malloc(cena_region_size);
+
if (!s->cena) {
pr_err("Could not allocate page for cena shadow\n");
return -1;
@@ -412,12 +417,12 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s,
QBMAN_BUG_ON(reg);
#endif
if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000)
- memset(s->addr_cena, 0, 64*1024);
+ memset(s->addr_cena, 0, cena_region_size);
else {
/* Invalidate the portal memory.
* This ensures no stale cache lines
*/
- for (i = 0; i < 0x1000; i += 64)
+ for (i = 0; i < cena_region_size; i += 64)
dccivac(s->addr_cena + i);
}
@@ -425,12 +430,12 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s,
reg = qbman_set_swp_cfg(dqrr_size, wn,
0, 3, 2, 3, 1, 1, 1, 1, 1, 1);
else {
- if ((d->qman_version & QMAN_REV_MASK) < QMAN_REV_5000)
+ if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000)
reg = qbman_set_swp_cfg(dqrr_size, wn,
- 1, 3, 2, 2, 1, 1, 1, 1, 1, 1);
+ 1, 3, 2, 0, 1, 1, 1, 1, 1, 1);
else
reg = qbman_set_swp_cfg(dqrr_size, wn,
- 1, 3, 2, 0, 1, 1, 1, 1, 1, 1);
+ 1, 3, 2, 2, 1, 1, 1, 1, 1, 1);
}
if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) {