From patchwork Fri Jan 11 11:58:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 155334 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp489131jaa; Fri, 11 Jan 2019 03:59:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4N8URVP9ZnVDP70VOYKIZtkkt8alkuy9ejawjQT6yRKmOMAYX614GGMgm+8a7WqOUCvblK X-Received: by 2002:a5d:5443:: with SMTP id w3mr12354031wrv.4.1547207989735; Fri, 11 Jan 2019 03:59:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547207989; cv=none; d=google.com; s=arc-20160816; b=dS3eoEuDepMiMr0kR4jVTbsWzwqUWxUG08Bk//Dk6f7VrPlqbKhp4vzhfQds3NjZhc RNVEgPuqSq8ogww/sa+qpXJqtCkZJ/KUA6vk9AjHpYZhc4EsR4q3D6Qn+t4CADjl1qCP MTxdIZKnHoP2NY0r7exY6j2X2ibz8U/k8W9v53Y5wvOjRXSyDPvBcOhJhsfbgsElSWTW rZ+3yaDRA5m3y3vPWu+doBPeoXXy+rm5dwz8rHSIOQOW8Jcr9DKejHbdNkxkSOkdAQ9j OeNio6H+p4+xNhKA6MUHUU5SKILCd6sySI/eo0YZeOHWgU64TaAej4cTi1k/HGgY+2Tb Yzfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:mime-version :content-transfer-encoding:spamdiagnosticmetadata :spamdiagnosticoutput:content-language:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:cc:to:from :dkim-signature; bh=uACaTqcVvtjcdqBGy31CXib3bZwAMh4OBpWbL1Br95Q=; b=Z6iCBpP8ccPZO+bj/yBXblJDxAosrVvJL5nGgzcjSscX4CUbFYveOUhexPTAvTQFbg YcPUkETj9pB39QTZXmNZ2XN7IoKCUk9JJKVcT80kW9fK7gVY2KwNkT9KxAnv0Cx7Zy/C /I0p3AItJrrSUh1w/hgC5CWjaP2cj0+buxiNZq7exDYyXjeauE5UsrTto77hW89QZCVn iRRSXEIJPjv2A02C5J1ogXnCyfNBhGLJR4EtEAs77PfIJRRVkLWbWgOJSwuoFDbM3MM1 kzT2nsUhJwVPB4FEzYIQA2udcLT/eBzDaVN7/DHyifjDa7Y9WaQvkJvA5nEgmpW0pksD sMtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="afU/Mm9G"; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id w18si43595443wrv.315.2019.01.11.03.59.49; Fri, 11 Jan 2019 03:59:49 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b="afU/Mm9G"; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 670181BA0C; Fri, 11 Jan 2019 12:58:26 +0100 (CET) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00042.outbound.protection.outlook.com [40.107.0.42]) by dpdk.org (Postfix) with ESMTP id 6B8061BACB for ; Fri, 11 Jan 2019 12:58:25 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uACaTqcVvtjcdqBGy31CXib3bZwAMh4OBpWbL1Br95Q=; b=afU/Mm9GJILRcwL6X7+G9vkdJSUYRAFYlIxIEvWnvNFK/3VMiv/6e4x9j5xne61R+Ohaj8dFodu1NpyRwMbi6lhjgFnRaVCXegq+WMY/qctFZRN6ZTqO94q50pH0PWzTf6zkLPUNaAWrfpYq4v2zH0nnLTQEJSLag9Q6/C6a9RU= Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (20.177.56.80) by VI1PR04MB6173.eurprd04.prod.outlook.com (20.179.27.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.11; Fri, 11 Jan 2019 11:58:24 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::b1eb:7e7e:7b90:7b4]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::b1eb:7e7e:7b90:7b4%4]) with mapi id 15.20.1516.016; Fri, 11 Jan 2019 11:58:24 +0000 From: Shreyansh Jain To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Hemant Agrawal , Roy Pledge , Youri Querry Thread-Topic: [PATCH v2 10/20] bus/fslmc: add dynamic config for memback portal mode Thread-Index: AQHUqaT05gjkm9061E+U6IArCLkTXw== Date: Fri, 11 Jan 2019 11:58:23 +0000 Message-ID: <20190111115712.6482-11-shreyansh.jain@nxp.com> References: <20181227062233.30781-1-hemant.agrawal@nxp.com> <20190111115712.6482-1-shreyansh.jain@nxp.com> In-Reply-To: <20190111115712.6482-1-shreyansh.jain@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.143.254.130] x-mailer: git-send-email 2.17.1 x-clientproxiedby: TY2PR01CA0030.jpnprd01.prod.outlook.com (2603:1096:404:ce::18) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR04MB6173; 6:jpeaaaJIkb2vTWawhSqb/YYc5LCKQOpWExYC5aQMqnFFT3YatL0WN22yyORU1gduGsWSytjhJaNoxXY6TT5qMQNUnslMiMqvDhGS+K/WMpBAZxIIaRIkNGrioEFZINQvgBBWbTRsb/kDKV0/iMv/ap7a1stDRiDrKR1VwqSfR2Qmdq8I5dppbs2Z24cM/gWAds2vqnnz6Yqs48r5hDGrP2gcRpgpVq6B2NNNC3UqFawAY1mvq3znLigaylo26gFCOCZiZrsnstmxZgI6sneHhKO4U8xpOfskDLOqUgnzsMVbdHBQQ3vVDpz14nxu+GJ9UyNPEh0XBNFhGvUdghmJfv6wqm4veUMwIXKD37pUzEBqsvDKb4sSqrkI8TnMBKGWBGqsK8PpHIdzoXXwtll2LlW21Pchg8bVlBznoE2DH3N3fQZcQzIdQtStD4K1udvcbYv/aPpm37BxBsgZFBtrxg==; 5:tiQ1/ubJV9qDR8lXj1F7YMMJfOe0gdA8NDg3+LjiXVpLbL17u9Pw34B+NUw1+zdvIt4DpxP/Yi9rO+/8bLaE84XDnJPuQakXUNjJQuGjfzx/EuTO8kU8fZ09f5pvoLpMCJa3cZK0Ns19ak07Zly4BXoAjkxP52snvFfjSMyUhvXT0h4Vs0qGgcEtjlazcVYsKDXi4JQvQXiUHRN80PCHfQ==; 7:GwcEgXugcyTheSe0dQLJVE1Rqf9Hxgo4M0VM4C8SiSSyE+6X2DEC6iPq1o5hKOHWm9/qrzoKGd8yq0QyCa8o90OJ44rWUJTLIq9jtszt74/JSIEiPcO6J+O1azoVHAbPJe2LC59FyigSfhgLY2k2ng== x-ms-office365-filtering-correlation-id: 52a39441-ff5d-4315-9e81-08d677bc167a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB6173; x-ms-traffictypediagnostic: VI1PR04MB6173: x-microsoft-antispam-prvs: x-forefront-prvs: 09144DB0F7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(346002)(366004)(136003)(39860400002)(396003)(199004)(189003)(6512007)(25786009)(1076003)(26005)(68736007)(3846002)(66066001)(6116002)(11346002)(6916009)(6486002)(486006)(54906003)(5660300001)(6436002)(2906002)(53936002)(36756003)(44832011)(316002)(14454004)(256004)(106356001)(446003)(105586002)(97736004)(102836004)(476003)(2351001)(2616005)(6506007)(50226002)(386003)(99286004)(86362001)(478600001)(52116002)(76176011)(55236004)(71200400001)(71190400001)(78486014)(81166006)(186003)(14444005)(2501003)(8676002)(1730700003)(8936002)(4326008)(5640700003)(81156014)(7736002)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB6173; H:VI1PR04MB4688.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: WQ03lgJzrwrtTQK9bzNjzDVFo8A4bEQB8FFVqiqINt6t16Sml0ZaO9/aAkTgOp29SrHqvaCZBSG+zB5c0odTOI7QgCK7IsZu1+0gnsKaHQDAOpE+BwXpsapGa0aadGDHdOZjnpyMyO3TY7LdvAnCvTCKce5gydUjuyPywK8PHUTUT2V/ubnPPtUCYBAMGQ8K4TpWS05wd/CdNhh10waglX3kTtvdDwXCP76K7ikvfFZCYcm+fLb5BWEnGKne7Q2SOk2Oc8yXriM4mWJoRImFG65DtHsqWlgRtGSvbLH4mPsTjULoAOo6IcNSWRU6i91Gg0Oaq+NJCIT3eNBeItuJsmjrtXV10t/cKF067Dre65g/RXVJnsNxzAeQp9y0OihHYwfVcy400mCFoUnme7DyuDooCNwgPK/kJOt3oCOAXMI= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52a39441-ff5d-4315-9e81-08d677bc167a X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2019 11:58:20.3523 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB6173 Subject: [dpdk-dev] [PATCH v2 10/20] bus/fslmc: add dynamic config for memback portal mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Hemant Agrawal Add flag in portal init to adjust the qbman memory type, to decide between legacy portal mode or newly introduced memory backed portals. Signed-off-by: Roy Pledge Signed-off-by: Youri Querry Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 + .../bus/fslmc/qbman/include/fsl_qbman_base.h | 11 +++- drivers/bus/fslmc/qbman/qbman_portal.c | 52 +++++++++++-------- drivers/bus/fslmc/qbman/qbman_sys.h | 20 ++++--- 4 files changed, 53 insertions(+), 32 deletions(-) -- 2.17.1 diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index ba2e28ce1..37723a094 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -509,6 +509,8 @@ dpaa2_create_dpio_device(int vdev_fd, p_des.cinh_bar = (void *)(dpio_dev->qbman_portal_ci_paddr); p_des.irq = -1; p_des.qman_version = attr.qbman_version; + p_des.eqcr_mode = qman_eqcr_vb_ring; + p_des.cena_access_mode = qman_cena_fastest_access; dpio_dev->sw_portal = qbman_swp_init(&p_des); if (dpio_dev->sw_portal == NULL) { diff --git a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h index bb60a98f9..48bdaafa4 100644 --- a/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h +++ b/drivers/bus/fslmc/qbman/include/fsl_qbman_base.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * * Copyright (C) 2014 Freescale Semiconductor, Inc. + * Copyright 2017-2018 NXP * */ #ifndef _FSL_QBMAN_BASE_H @@ -33,7 +34,12 @@ struct qbman_block_desc { enum qbman_eqcr_mode { qman_eqcr_vb_ring = 2, /* Valid bit, with eqcr in ring mode */ - qman_eqcr_vb_array, /* Valid bit, with eqcr in array mode */ + qman_eqcr_vb_array, /* Valid bit, with eqcr in array mode */ +}; + +enum qbman_cena_access_mode { + qman_cena_fastest_access = 0, /* Use memory backed node if available */ + qman_cena_direct_access, /* Use direct access to the CENA region */ }; /** @@ -46,6 +52,8 @@ enum qbman_eqcr_mode { * @qman_version: the qman version. * @eqcr_mode: Select the eqcr mode, currently only valid bit ring mode and * valid bit array mode are supported. + * @cena_access_mode: Mode used to access the CENA region, direct + * or memory backed. * * Descriptor for a QBMan software portal, expressed in terms that make sense to * the user context. Ie. on MC, this information is likely to be true-physical, @@ -62,6 +70,7 @@ struct qbman_swp_desc { int idx; uint32_t qman_version; enum qbman_eqcr_mode eqcr_mode; + enum qbman_cena_access_mode cena_access_mode; }; /* Driver object for managing a QBMan portal */ diff --git a/drivers/bus/fslmc/qbman/qbman_portal.c b/drivers/bus/fslmc/qbman/qbman_portal.c index 2f572a08b..08bfdc9f8 100644 --- a/drivers/bus/fslmc/qbman/qbman_portal.c +++ b/drivers/bus/fslmc/qbman/qbman_portal.c @@ -194,7 +194,8 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) p->sdq |= qbman_sdqcr_dct_prio_ics << QB_SDQCR_DCT_SHIFT; p->sdq |= qbman_sdqcr_fc_up_to_3 << QB_SDQCR_FC_SHIFT; p->sdq |= QMAN_SDQCR_TOKEN << QB_SDQCR_TOK_SHIFT; - if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) p->mr.valid_bit = QB_VALID_BIT; atomic_set(&p->vdq.busy, 1); @@ -233,7 +234,8 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_SDQCR, 0); p->eqcr.pi_ring_size = 8; - if ((qman_version & 0xFFFF0000) >= QMAN_REV_5000) { + if ((qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) { p->eqcr.pi_ring_size = 32; qbman_swp_enqueue_array_mode_ptr = qbman_swp_enqueue_array_mode_mem_back; @@ -253,7 +255,8 @@ struct qbman_swp *qbman_swp_init(const struct qbman_swp_desc *d) eqcr_pi = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_PI); p->eqcr.pi = eqcr_pi & p->eqcr.pi_mask; p->eqcr.pi_vb = eqcr_pi & QB_VALID_BIT; - if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) + if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) p->eqcr.ci = qbman_cinh_read(&p->sys, QBMAN_CINH_SWP_EQCR_CI) & p->eqcr.pi_mask; else @@ -362,10 +365,11 @@ void *qbman_swp_mc_start(struct qbman_swp *p) #ifdef QBMAN_CHECKING QBMAN_BUG_ON(p->mc.check != swp_mc_can_start); #endif - if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) - ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR); - else + if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (p->desc.cena_access_mode == qman_cena_fastest_access)) ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR_MEM); + else + ret = qbman_cena_write_start(&p->sys, QBMAN_CENA_SWP_CR); #ifdef QBMAN_CHECKING if (!ret) p->mc.check = swp_mc_can_submit; @@ -385,16 +389,17 @@ void qbman_swp_mc_submit(struct qbman_swp *p, void *cmd, uint8_t cmd_verb) * caller wants to OR but has forgotten to do so. */ QBMAN_BUG_ON((*v & cmd_verb) != *v); - if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) { - dma_wmb(); - *v = cmd_verb | p->mc.valid_bit; - qbman_cena_write_complete(&p->sys, QBMAN_CENA_SWP_CR, cmd); - clean(cmd); - } else { + if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (p->desc.cena_access_mode == qman_cena_fastest_access)) { *v = cmd_verb | p->mr.valid_bit; qbman_cena_write_complete(&p->sys, QBMAN_CENA_SWP_CR_MEM, cmd); dma_wmb(); qbman_cinh_write(&p->sys, QBMAN_CINH_SWP_CR_RT, QMAN_RT_MODE); + } else { + dma_wmb(); + *v = cmd_verb | p->mc.valid_bit; + qbman_cena_write_complete(&p->sys, QBMAN_CENA_SWP_CR, cmd); + clean(cmd); } #ifdef QBMAN_CHECKING p->mc.check = swp_mc_can_poll; @@ -407,30 +412,31 @@ void *qbman_swp_mc_result(struct qbman_swp *p) #ifdef QBMAN_CHECKING QBMAN_BUG_ON(p->mc.check != swp_mc_can_poll); #endif - if ((p->desc.qman_version & QMAN_REV_MASK) < QMAN_REV_5000) { - qbman_cena_invalidate_prefetch(&p->sys, - QBMAN_CENA_SWP_RR(p->mc.valid_bit)); - ret = qbman_cena_read(&p->sys, - QBMAN_CENA_SWP_RR(p->mc.valid_bit)); + if ((p->desc.qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (p->desc.cena_access_mode == qman_cena_fastest_access)) { + ret = qbman_cena_read(&p->sys, QBMAN_CENA_SWP_RR_MEM); + /* Command completed if the valid bit is toggled */ + if (p->mr.valid_bit != (ret[0] & QB_VALID_BIT)) + return NULL; /* Remove the valid-bit - * command completed iff the rest is non-zero */ verb = ret[0] & ~QB_VALID_BIT; if (!verb) return NULL; - p->mc.valid_bit ^= QB_VALID_BIT; + p->mr.valid_bit ^= QB_VALID_BIT; } else { - ret = qbman_cena_read(&p->sys, QBMAN_CENA_SWP_RR_MEM); - /* Command completed if the valid bit is toggled */ - if (p->mr.valid_bit != (ret[0] & QB_VALID_BIT)) - return NULL; + qbman_cena_invalidate_prefetch(&p->sys, + QBMAN_CENA_SWP_RR(p->mc.valid_bit)); + ret = qbman_cena_read(&p->sys, + QBMAN_CENA_SWP_RR(p->mc.valid_bit)); /* Remove the valid-bit - * command completed iff the rest is non-zero */ verb = ret[0] & ~QB_VALID_BIT; if (!verb) return NULL; - p->mr.valid_bit ^= QB_VALID_BIT; + p->mc.valid_bit ^= QB_VALID_BIT; } #ifdef QBMAN_CHECKING p->mc.check = swp_mc_can_start; diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index e3bd1c5e6..71f7a6782 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -389,7 +389,8 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, int i; int cena_region_size = 4*1024; - if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) cena_region_size = 64*1024; #ifdef RTE_ARCH_64 uint8_t wn = CENA_WRITE_ENABLE; @@ -416,7 +417,8 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, reg = qbman_cinh_read(s, QBMAN_CINH_SWP_CFG); QBMAN_BUG_ON(reg); #endif - if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) memset(s->addr_cena, 0, cena_region_size); else { /* Invalidate the portal memory. @@ -426,11 +428,12 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, dccivac(s->addr_cena + i); } - if (s->eqcr_mode == qman_eqcr_vb_array) + if (s->eqcr_mode == qman_eqcr_vb_array) { 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) + } else { + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 && + (d->cena_access_mode == qman_cena_fastest_access)) reg = qbman_set_swp_cfg(dqrr_size, wn, 1, 3, 2, 0, 1, 1, 1, 1, 1, 1); else @@ -438,11 +441,11 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, 1, 3, 2, 2, 1, 1, 1, 1, 1, 1); } - if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) { + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) reg |= 1 << SWP_CFG_CPBS_SHIFT | /* memory-backed mode */ 1 << SWP_CFG_VPM_SHIFT | /* VDQCR read triggered mode */ 1 << SWP_CFG_CPM_SHIFT; /* CR read triggered mode */ - } qbman_cinh_write(s, QBMAN_CINH_SWP_CFG, reg); reg = qbman_cinh_read(s, QBMAN_CINH_SWP_CFG); @@ -452,7 +455,8 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, return -1; } - if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000) { + if ((d->qman_version & QMAN_REV_MASK) >= QMAN_REV_5000 + && (d->cena_access_mode == qman_cena_fastest_access)) { qbman_cinh_write(s, QBMAN_CINH_SWP_EQCR_PI, QMAN_RT_MODE); qbman_cinh_write(s, QBMAN_CINH_SWP_RCR_PI, QMAN_RT_MODE); }