From patchwork Fri Jan 11 12:24:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shreyansh Jain X-Patchwork-Id: 155343 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp516924jaa; Fri, 11 Jan 2019 04:26:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN6EsUOfnAR9PWgDXxAxgQN2V6SWJMy16gdneLKHiecXvUgyfJWNzdbn5AeEa0LPzoozQn3y X-Received: by 2002:adf:a211:: with SMTP id p17mr13313500wra.179.1547209563117; Fri, 11 Jan 2019 04:26:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547209563; cv=none; d=google.com; s=arc-20160816; b=kmK0gotkUJMKkDEU3M+NYPNxDZUu75TWBJZ7QOvaDRwolfQj8CrCLoX/OtM3LZ3Ifa r2Wt3ejlEzmsE7h0ZBpRN/OzxxDPabOF4v/8F6UVHIVlb0B7AhUBwAZN8tpjC4V0s1D9 qDqEelR4zmtwEvbFRzsCg4HyF5AApWinQzJMgP+fU5obNKPxHCCx8gZ0TDor8Xk29sv6 5SK6jCAfgudcuUCu8/dygpdsG9v21PYBDpBhC9XDlslVElk+OnguM/m7SyX6XBWE9QFm AD5OXJhC6DuJBX6RWkgiDH5Zv7SEAC5Fex9S1h8vlk9pFLPjj9PKdzjjjTCCcaZli+iW i2tA== 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=ctq6SPXgdunYykmrYaDJq79dp8OHlhZG9wMS3U/NjfndmDABx5dYW5gmuhVtCURhlT +ZTdCC8DIjeHuNqQ9bB2IXbcScolt5l/8Z20BlZTtq5jiMIu6xPNvuGNrRWD4sNBwoDU 0tMKpjwoIzQkBIiE57uG2KUqBzJAJYOFm/ckKI+52LlKOP5UEEoK/DB1Un/UkiwtPhUr cD+7lkryojzKTJXGyu71xeUFCUHTCeVqeP7mtYt9EOiKEevYv+1tZThEjH61+PjSBnZe nsbYcdP8M/COhlkscmzXiv8Q54QF5J7m0DXNM8WCBPejnMppJxSgOiAk7mt1z+K2Gmlq MSZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=oR2eJWT9; 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 z13si24662465wrr.57.2019.01.11.04.26.02; Fri, 11 Jan 2019 04:26:03 -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=oR2eJWT9; 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 F29CE1BBDF; Fri, 11 Jan 2019 13:24:41 +0100 (CET) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140087.outbound.protection.outlook.com [40.107.14.87]) by dpdk.org (Postfix) with ESMTP id 2FAEB1BBFF for ; Fri, 11 Jan 2019 13:24:40 +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=oR2eJWT9K2PWsASJw235ByF+JXFBy5r6/QHopFnRbq6gKWtE4JmhyBM7gKYve3/pQ6usGATeeX9/XEcQ1L+Vwryv0ZR3s0JW4z/VUSED2U9f/8HWFoSG7S08/fmVlI+WjPv4cW2oErRLKrwLs5a9F83Oi018iHZsfagBG8dGO0Y= Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (20.177.56.80) by VI1PR04MB5694.eurprd04.prod.outlook.com (20.178.126.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.14; Fri, 11 Jan 2019 12:24:38 +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 12:24:38 +0000 From: Shreyansh Jain To: "dev@dpdk.org" CC: "ferruh.yigit@intel.com" , Hemant Agrawal , Roy Pledge , Youri Querry Thread-Topic: [PATCH v3 10/19] bus/fslmc: add dynamic config for memback portal mode Thread-Index: AQHUqaieU2cMrhfM4EyrPu8sd1ye6A== Date: Fri, 11 Jan 2019 12:24:38 +0000 Message-ID: <20190111122305.7133-11-shreyansh.jain@nxp.com> References: <20190111115712.6482-1-shreyansh.jain@nxp.com> <20190111122305.7133-1-shreyansh.jain@nxp.com> In-Reply-To: <20190111122305.7133-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: TY2PR01CA0017.jpnprd01.prod.outlook.com (2603:1096:404:a::29) 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; VI1PR04MB5694; 6:6yccELHt7sqlFCDflVGf0t599zpdXpT3qsPsWUokf6MYkH0x1EsiHtEy1S7aRIE7M6q5UfIWtyUVVio/XrtjlTMgMbUtylMsJmHPhpchT3oL8eWXnf2x7drvmnDX6KZhNloY5l1vG05HMeaEiqqN00ECvY0vnvqJbtJukrOWpU0q6oAMvXqpL0P5wd/V5J1aNWkCF3Tg6NyjVbErAO4/NAUIBNJ8m4Z5PJ+gXqvT1lv26NfL6YYWqxlr/Reb119rxo78k4GPnMSbpLnizp0gg3DQUHp1WihbWEwtuGd4kntRrlJbfAtjIk4T2edxRv/EZsnrWgmwkJwg726LA8odlWoYLozYs3eZx5kcpgxWU/jja3OgCzFhcls+c05W9fw2hUIpfpa52cCaCHBKvf1o2T47xbnB9wjtVPcAjb8fv5jtsmExqLmnq9H9Vi9m7Gl6mX0BDC4fHwfdIRfRSzKenA==; 5:I4mc0/ZHsemiT3wPmI85/kfS4/TBfGIL50hKINCn9bujLZ2/mRUv7nS549qs0xlzgVByvyg6GGLicTvjcHMd+95i1dT8NPVy7e34Fhh7G1vIQYcnk6tjue4OlxG5LCXj+mLs5zvb22UR/R7UOQBj4iZXWpWi1ePU5FxFRzlD7VJ3W+HUfp9Hox08gjTu0/TcXfDQ0/JifdfLau3lknrOEQ==; 7:6tUzCBWXHBXixY+wDTPGlKuT7R0npwLrWcoDvMDJgAyYhnfEot8CZlTX+/MSleESgcg1p8i0RhobeqVU1SNgv3yhuzTCMWwom6HeSrBhbovkFjQFR/Ue1p+M48ZHHMH+5TphpHY8qd5WG6W6dgddNw== x-ms-office365-filtering-correlation-id: 5702777b-0bf3-45b8-f702-08d677bfc114 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:VI1PR04MB5694; x-ms-traffictypediagnostic: VI1PR04MB5694: x-microsoft-antispam-prvs: x-forefront-prvs: 09144DB0F7 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(136003)(39860400002)(346002)(396003)(199004)(189003)(446003)(71190400001)(26005)(8676002)(186003)(11346002)(14454004)(54906003)(476003)(2616005)(102836004)(386003)(7736002)(55236004)(6506007)(105586002)(99286004)(305945005)(478600001)(256004)(14444005)(1076003)(50226002)(36756003)(68736007)(2906002)(53936002)(5640700003)(6512007)(6916009)(76176011)(66066001)(106356001)(6486002)(25786009)(6436002)(78486014)(97736004)(486006)(52116002)(316002)(86362001)(6116002)(3846002)(81166006)(1730700003)(81156014)(8936002)(2351001)(44832011)(2501003)(71200400001)(5660300001)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB5694; 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: BnwnJY5JgheluXAbT1+P5EKOpGrE6gm7lyw2r54vMY2IGTqpFDajm+7vkviOPaQa3uvm+tRnPruClzXwCbyH26Rlkhd5OwdPhlff2OrXxO9KksvAGXeImafjyA2xIaU+TTsn3UzvFAHzJPAGhpkiLskPQy7wGlSL37+zFZXcXlDyE2qDrEwbaUz7Ynd2BiOypC44Pua0zcFcFsJLBgEGUaFWflKp5kpqiHKZjWtIZ3VJILZ5/kvmVQhDgO2trvgWYqd8a9sP/icP0DOOXNVy6f1sp5fVcp0afmcxUNnl5+q7pmLH58TGpABvuFVF7MTUGw0jUgzbC9poaf+SjtGSEyvOZ6PZgzj4E7dOoQozUUMM79zLfYjufDsHy2HPxWLhASKaRMHG0GDk4y79KQ4XSLPg2whcPujvQqJw0wHRiXU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5702777b-0bf3-45b8-f702-08d677bfc114 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2019 12:24:34.9897 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5694 Subject: [dpdk-dev] [PATCH v3 10/19] 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); }