From patchwork Tue Feb 27 17:25:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 129838 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp540124edc; Tue, 27 Feb 2018 09:28:21 -0800 (PST) X-Google-Smtp-Source: AH8x226fWHdgH2XS16gY7kTsig2fj8qz3mDitxsOs2HgLqxz1E6O1D4GEG2K1axjeDKhDqeOqLUc X-Received: by 10.223.189.8 with SMTP id j8mr14476706wrh.20.1519752501823; Tue, 27 Feb 2018 09:28:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519752501; cv=none; d=google.com; s=arc-20160816; b=b1CzZeDAaCZ1MLekw0q8XfQ+w06htNbqZ7FAB+VEENj5xooNpq/C5wnUixXG7ajFjA k/4rGLDx2wb/cQ49Bn1oL3AP13n5mtfo0usCwUb82prHRaDAlNsgI5SDp0BRIJwix7dT 3egB/weAqZpDfXJ6gxUUXLzu0EYsLTdDOabd1/FLeMisFNmK4NSdN+pAF/MYdIlhLmxB KGsXZh6y/Y7HJZduihYhGVoP033g3JhX5EtI4U0X2BLQBN4CXXF70EdPZXVtNi+KX1hA q5lxIOCR+XemzbzUJ0wV3FYO3WdM8BmhZu6TKZs90yb6/bzA+nrTPKM6cyKUCwkhMh0l ieYA== 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:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:dkim-signature:arc-authentication-results; bh=R3kl7+RrA6nHHRVWDDkrvpFcgPguwq4jMgmI6xgwWQo=; b=hvCb19rFk8nw7h+nIb9orY1PZtPkM5wc56S2cDTcz4Fc/BZw9K9jGzUrOJZ2dGRKZ4 1b2ohKerduksN1s7apSvWwZJj1DKbwmPiv/Zzpjo6saSFeQAIumD4wvBLH5tF3p3pqqz MEC1EYNUL36bnPvyQTGaqKSjZiWXn2a75fBLEuVHgtKYwEUwg2OsqfPr6X1dBq3JFq4F mMJALcya+eN/mnH0ip9EP90oJZ+v/IXODPanv+cPXH4EcXlgAHQraEBgdLbUnqxp6kFi u1JtMRvHPoDgTJkl2wGb+2DStEovWWgW160vRYrneKbH1HF008qf8zZztyLpSpW19hbc /KtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=ZcHn6t5V; 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 h30si3152870wrh.247.2018.02.27.09.28.21; Tue, 27 Feb 2018 09:28:21 -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=ZcHn6t5V; 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 932864F91; Tue, 27 Feb 2018 18:27:39 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0057.outbound.protection.outlook.com [104.47.0.57]) by dpdk.org (Postfix) with ESMTP id C9C274C9F for ; Tue, 27 Feb 2018 18:27:36 +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; bh=R3kl7+RrA6nHHRVWDDkrvpFcgPguwq4jMgmI6xgwWQo=; b=ZcHn6t5Vibn+evLES4KQRFl0kVNjRJfB5Nud5NAhOHizm1fzJl4yhEaxkjjEI9U5oOFTpe16t5zUBTsp+P4l4MFs0Rjz8g9xvztOg6eRrJfgLU2nzVFPx4JJsPu4csnQd7zzZbQxnnBeyXaVp0Kw8yo/3xTsfLLH52TgXEwTBOw= Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by DB4PR04MB0768.eurprd04.prod.outlook.com (2a01:111:e400:984d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Tue, 27 Feb 2018 17:27:34 +0000 From: Hemant Agrawal To: dev@dpdk.org, bruce.richardson@intel.com Cc: thomas@monjalon.net, shreyansh.jain@nxp.com Date: Tue, 27 Feb 2018 22:55:49 +0530 Message-Id: <1519752352-15442-5-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519752352-15442-1-git-send-email-hemant.agrawal@nxp.com> References: <1519752352-15442-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR0101CA0017.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::27) To DB4PR04MB0768.eurprd04.prod.outlook.com (2a01:111:e400:984d::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0217bab5-0dd8-4f34-cb3b-08d57e076434 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:DB4PR04MB0768; X-Microsoft-Exchange-Diagnostics: 1; DB4PR04MB0768; 3:aHt8EbJPSx4AEoTYnXcD40biMaNSF4xAF1JnoLiI/yOkKjaLj4jvOBeUP1vG8aGsRZmSGAtZqCC/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S7dNPonHQCFslo5Cz83g1OTp8kg8F6Nn7a4rfW/7CLRvyz6rgb8IA/yBxulBBLAx2nIIR8asQV8dft6w/7am2R99HR6yDP45R8r9uBE3hNmhcNTqRODzUT4QJ4MFmj50VbnMowN34Q1jdyLuB/0fM7X0K467w7hWF3JXbFIZ5Ty+77NJK/T1BjO6HP5F3dWbzskXR6F4mPvj0EhLmXHXFhzNt/BYvU9HaGb5jO1+SVYeCCiEW07bwvpHB11zbzH1CZlFrA+zpfUPV8; 4:eHBM8+AMu/or4gP3LYlM1LNze8YEAha38wvDIDsb7Q7UCpJnutdupW3kR7U95u970+cjg+U/rf9yAPVirEMTVrZriy4yrDwNZuUvOnzPTIxEmoII9QzrJkfjafOJtR/wUJJD+CoxpCoYexARjXsWX0yDf2fb42JKFX/VbxTftyJ2E0PBCgh2AyuGhb2PUO1CkwfgS0bcYzE1YWFk5smQQKc2TUNpBxk22xrBEKGddCEltJxHOc7TNldgTUOyo14P1vqw5dxPqD7Fa4RuwjujVoRj2CyDNX1Z0VjUDQT5mYYlQzVStegDr+JXZ8X7Oqp1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040501)(2401047)(8121501046)(5005006)(3002001)(3231220)(944501198)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:DB4PR04MB0768; BCL:0; PCL:0; RULEID:; SRVR:DB4PR04MB0768; X-Forefront-PRVS: 05961EBAFC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(366004)(396003)(376002)(39860400002)(39380400002)(346002)(199004)(189003)(26005)(316002)(68736007)(105586002)(16586007)(6512007)(36756003)(66066001)(2906002)(47776003)(386003)(6346003)(4326008)(53936002)(6486002)(8676002)(55236004)(8936002)(97736004)(81156014)(76176011)(3846002)(5009440100003)(7736002)(5660300001)(6116002)(25786009)(50226002)(6506007)(305945005)(478600001)(81166006)(51416003)(52116002)(6666003)(106356001)(86362001)(2950100002)(16526019)(48376002)(50466002)(186003)(110426004)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR04MB0768; H:bf-netperf1.ap.freescale.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB4PR04MB0768; 23:6sIOvAgBVD8/ZtyCaNBzBzCxQ8bldNqssXJRDKh2F?= iukDlVWoWYyrV6CTNXr+Dag+AFBO/o+Pj8wpDUmEpxTJG/q3t44+qzRRY0awThV34nfemO4elR3r02UeztkQqh6AM04jyk9Q+1U8BRUMPrgCqwshFYi8X1Mb93yK7aBYA4lthJEv94UYR2asGWWoMW9lsi8cySpNlR6sI6Pn0mordUxH8HLjcogIxx7Jik5gyj13Gixr1fgDHjlxItIzXhTkhD2VuedAap3baiXnfzobFlAHCLGppoNgLpMD/CpnTy5AckAVwySSBY+YHvHq6c34O+sYWXgkcZRgmspb8V0HPErS5CuHeQmmRT++dAy/dsetyhSjbPxyFijnmKFbF4dOdAqewbgsPwfeHsPm7PhLJ6YcvIid2EfKYOp28nQVKurOF7SLibAvKvsGWMYss0OZomiCJkKH0AinAxr5x1hsVBKZ1Xz3YjO+RSfRzOmuDEeZKjO8wAb5VZPBEZ6XgOYdUxWplXQ4529OLiHRxiqKCLmxQXaNfaQ3C8PttPd1z7MnOsElfReAS6hWEkTaxWUr1YiIW2mZbFFLHGjrjd+P20Y/X4CfpgVx7RyfauWj+LlXl9NksMZknuDc4Ge7rRReDFXyzDPdxH6jvvCERkr3sNGi1KjRuKImwzTnI1+aob7SPVIroQrCFWzvM3R8pDBTrnbSRJP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NJFHiAN18S2xdMAjA=; 24:UACUZO4xhpE7YUlpfHomtlOhWyYVuyBHr9S0jaJqE1utiOUgH2SAo7IPAl951iX5l5iHX3YPkTHxSXRSFUhz5DHLQCLJFCpyCswFdR5Yg5E=; 7:0/khj4gV6d0VZS+BfF0/O/+RGezwj8LU1OZvAbFtEDGdYn46lFQPnvPUA1zUFwtrRUCKnz/4kx4X3V9lXuWwuHdSxkzyLip4TLKVcG/1908YQ03X/F5Nfw4Ogp3k9AzS6VDWomcQOLXf64upkthbl93KZw4yYfbIgoYEhC+n8faIXWGE2vhLoWoq+xIcmK761LUdcr2ROL8nb7Giw0I/wxv8hWJokLFJojVevFhxI0SsscPdpExvZ6sQL3x5QNPm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2018 17:27:34.5095 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0217bab5-0dd8-4f34-cb3b-08d57e076434 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR04MB0768 Subject: [dpdk-dev] [PATCH 4/7] bus/fslmc: add 32 bit functional support for ARM 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" This patch adds the functional logic to make the dpaa2 drivers work on 32bit machine. Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/qbman_sys.h | 30 ++++++++++++++++++++++++++++-- drivers/bus/fslmc/qbman/qbman_sys_decl.h | 9 +++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/qbman_sys.h b/drivers/bus/fslmc/qbman/qbman_sys.h index 846788e..0b460c4 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys.h +++ b/drivers/bus/fslmc/qbman/qbman_sys.h @@ -20,6 +20,9 @@ #include "qbman_sys_decl.h" +#define CENA_WRITE_ENABLE 0 +#define CINH_WRITE_ENABLE 1 + /* Debugging assists */ static inline void __hexdump(unsigned long start, unsigned long end, unsigned long p, size_t sz, const unsigned char *c) @@ -178,7 +181,11 @@ static inline void *qbman_cena_write_start_wo_shadow(struct qbman_swp_sys *s, s->addr_cena, s->idx, offset); #endif QBMAN_BUG_ON(offset & 63); +#ifdef RTE_ARCH_64 return (s->addr_cena + offset); +#else + return (s->addr_cinh + offset); +#endif } static inline void qbman_cena_write_complete(struct qbman_swp_sys *s, @@ -191,11 +198,19 @@ static inline void qbman_cena_write_complete(struct qbman_swp_sys *s, s->addr_cena, s->idx, offset, shadow); hexdump(cmd, 64); #endif +#ifdef RTE_ARCH_64 for (loop = 15; loop >= 1; loop--) __raw_writel(shadow[loop], s->addr_cena + offset + loop * 4); lwsync(); __raw_writel(shadow[0], s->addr_cena + offset); +#else + for (loop = 15; loop >= 1; loop--) + __raw_writel(shadow[loop], s->addr_cinh + + offset + loop * 4); + lwsync(); + __raw_writel(shadow[0], s->addr_cinh + offset); +#endif dcbf(s->addr_cena + offset); } @@ -224,9 +239,15 @@ static inline void *qbman_cena_read(struct qbman_swp_sys *s, uint32_t offset) s->addr_cena, s->idx, offset, shadow); #endif +#ifdef RTE_ARCH_64 for (loop = 0; loop < 16; loop++) shadow[loop] = __raw_readl(s->addr_cena + offset + loop * 4); +#else + for (loop = 0; loop < 16; loop++) + shadow[loop] = __raw_readl(s->addr_cinh + offset + + loop * 4); +#endif #ifdef QBMAN_CENA_TRACE hexdump(shadow, 64); #endif @@ -313,6 +334,11 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, uint8_t dqrr_size) { uint32_t reg; +#ifndef RTE_ARCH_64 + uint8_t wn = CENA_WRITE_ENABLE; +#else + uint8_t wn = CINH_WRITE_ENABLE; +#endif s->addr_cena = d->cena_bar; s->addr_cinh = d->cinh_bar; @@ -333,10 +359,10 @@ static inline int qbman_swp_sys_init(struct qbman_swp_sys *s, QBMAN_BUG_ON(reg); #endif if (s->eqcr_mode == qman_eqcr_vb_array) - reg = qbman_set_swp_cfg(dqrr_size, 0, 0, 3, 2, 3, 1, 1, 1, 1, + reg = qbman_set_swp_cfg(dqrr_size, wn, 0, 3, 2, 3, 1, 1, 1, 1, 1, 1); else - reg = qbman_set_swp_cfg(dqrr_size, 0, 1, 3, 2, 2, 1, 1, 1, 1, + reg = qbman_set_swp_cfg(dqrr_size, wn, 2, 3, 2, 2, 1, 1, 1, 1, 1, 1); qbman_cinh_write(s, QBMAN_CINH_SWP_CFG, reg); reg = qbman_cinh_read(s, QBMAN_CINH_SWP_CFG); diff --git a/drivers/bus/fslmc/qbman/qbman_sys_decl.h b/drivers/bus/fslmc/qbman/qbman_sys_decl.h index f82bb18..5640b04 100644 --- a/drivers/bus/fslmc/qbman/qbman_sys_decl.h +++ b/drivers/bus/fslmc/qbman/qbman_sys_decl.h @@ -15,6 +15,7 @@ /****************/ /* arch assists */ /****************/ +#if defined(RTE_ARCH_ARM64) #define dcbz(p) { asm volatile("dc zva, %0" : : "r" (p) : "memory"); } #define lwsync() { asm volatile("dmb st" : : : "memory"); } #define dcbf(p) { asm volatile("dc cvac, %0" : : "r"(p) : "memory"); } @@ -28,3 +29,11 @@ static inline void prefetch_for_store(void *p) { asm volatile("prfm pstl1keep, [%0, #0]" : : "r" (p)); } +#elif defined(RTE_ARCH_ARM) +#define dcbz(p) memset(p, 0, 64) +#define lwsync() { asm volatile("dmb st" : : : "memory"); } +#define dcbf(p) RTE_SET_USED(p) +#define dccivac(p) RTE_SET_USED(p) +#define prefetch_for_load(p) { asm volatile ("pld [%0]" : : "r" (p)); } +#define prefetch_for_store(p) { asm volatile ("pld [%0]" : : "r" (p)); } +#endif