From patchwork Wed Mar 14 07:56:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 131563 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp548711ljb; Wed, 14 Mar 2018 00:59:30 -0700 (PDT) X-Google-Smtp-Source: AG47ELv2KF3Q6bdSqubRjG9Pkq9QZNksU4ZJ+4R2v5pD02GBvXO1HeQYfL/NXoRFuaXMvsPHa/nJ X-Received: by 10.28.153.75 with SMTP id b72mr843137wme.127.1521014370289; Wed, 14 Mar 2018 00:59:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521014370; cv=none; d=google.com; s=arc-20160816; b=jD4s5v1xGrOkzsaAPYfaRZ6bNJ+LMqsPjT5negkAXPbkquERcg25nCCcmW7qHzv2P4 XlCxvL5sOXnMoGbs1o+L8i7HMuaNT27nVbOnBgdBem7YFHwiQeTULXgUN9naIQ81gaUA pGhtvOR0vMR2rbUCsh0qgfIEbVKe2XHebt0ab3Ixbgtrj0yYoLgmPtVe7xlD+5NLs4YI jTin3V160MZNLyubOB029fVf911lKIYnteYbmRsWOTgkz1obPGzr9ci8BPz6QpVh1kK7 0PG07KBZiujtUNinboEgRZScvkUa0aRVTnV5+2vl08W+YQm/xMjhKKjVdtEoSUuVwoIx 6L0g== 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=D5ZayIA0Luz9imyBsjRBDBVd6ar0B8p+oHMOVrgQX24=; b=ronMGxfm2CSQfExXNZtXGwBiywtA0Le28MbJXsO1kmXd0B/MYz7lL4Qdzlk4GiGIYr TZ8d8EXyL6yLTQGg4jIvGTAvVIRa4riR24DJxU38cEqX31Hz2YuyZfBxubMG46oE1O8o dKAG/aEun9JjRMpGUFrw2ro6pqogdw0x/5xrP8V3P73S6eZUgpaZq8/0TgNmhZsRBaqd n0hhFZG6i03CRwojRQbvBLkYg37zWHQmtdImuMMPCk0l7iosuBMTqJcwXZ5Frd2r7Cyi 733g2A7cLEa+YnUg4QKmk4eeuNtRaqlgmgr4M2EgsGE89qokvvxitxCH+jUCa3WvXESn 4eDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=b/tQVbkt; 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 e193si483910wmd.82.2018.03.14.00.59.30; Wed, 14 Mar 2018 00:59:30 -0700 (PDT) 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=b/tQVbkt; 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 B33867272; Wed, 14 Mar 2018 08:58:17 +0100 (CET) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40061.outbound.protection.outlook.com [40.107.4.61]) by dpdk.org (Postfix) with ESMTP id 708CC5F1F for ; Wed, 14 Mar 2018 08:58:07 +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=D5ZayIA0Luz9imyBsjRBDBVd6ar0B8p+oHMOVrgQX24=; b=b/tQVbkt1+6btyBrRfNsqvlIYvlcbPM42YjKPY3CUNWASWhj+lHPd8DaXgKxVsPQTmhv7aahB64baKEvSx/1B9EfsXdPP+Mv/bgAEVY/E9Ffd/He2sXiBesrlTgUX8byrmzmPg8n20wgecsS/6wOhK3M1f+GpVQGSHDnH2/Vqv4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=hemant.agrawal@nxp.com; Received: from bf-netperf1.ap.freescale.net (14.142.187.166) by AM2PR04MB0754.eurprd04.prod.outlook.com (2a01:111:e400:8411::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.548.13; Wed, 14 Mar 2018 07:58:05 +0000 From: Hemant Agrawal To: dev@dpdk.org, bruce.richardson@intel.com Cc: thomas@monjalon.net Date: Wed, 14 Mar 2018 13:26:02 +0530 Message-Id: <1521014166-3201-7-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521014166-3201-1-git-send-email-hemant.agrawal@nxp.com> References: <1519889597-5805-1-git-send-email-hemant.agrawal@nxp.com> <1521014166-3201-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: BM1PR0101CA0008.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:18::18) To AM2PR04MB0754.eurprd04.prod.outlook.com (2a01:111:e400:8411::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: afbfdce0-9361-4343-8bf5-08d58981521a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM2PR04MB0754; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0754; 3:1bR0Cd9X/v0oxzuZCfPT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4fEtj/0kXm3O9QWU/zEU8E9TQ3g5PWYLUliTs5u+S5FRBrAV41YV1UBuG1sJVhlLV7IX/0D5r5ciWX/oQdzJY0GLit3/GkTpNbMenJFRAJD9XPMMdlYgNI7oRM/Q+h1D+Gt3/5j9t/ylwm5c71gsi6OJlMIjb0CHFMpWWkYEFAaSHMCZvsaH4bdWiStNoz2AemL9gcJUpYsHodI3YxOx+AA1w2hjXIdemJrNQEzQZYbCLWolVSV3e8Qyb9S5Z5P7xuM3xsfsmYchUaO92HUbr9EDaEsnXR6Lx0wyu169yTRE+MIZ2gehCcScXOgYxR8; 4:YF5OzAcFypYYB7idEGZmb3lLDS0Cu6UixnAC78zt804Qj6ENP1XKStRfHAvJUqgAzxAJJZh31PDLXuXSiZymgkqUY8xEAv5nkMCCtm3HOIwHklNWMDjbr+LoErlu2v3XgIdosTqRj3JDNhcmammYVp2CPwS+zK9ET+qeI3pIzK5UxJ4KlB1WTlJ3cGiBAaA5OhbbhNzE+jdpyBSG0gWb0jyh5l6ehuG+qMuVuIYBWnlG+cTvLL105R6wlE0c1ItsTZQIY74pftVnF9B9o24dAzybSgTMYSJSBfrtvTkDZBNVMI6BBtHJQ0dB9XxNQXIy X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231221)(944501244)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM2PR04MB0754; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0754; X-Forefront-PRVS: 0611A21987 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(39860400002)(346002)(39380400002)(396003)(366004)(199004)(189003)(316002)(4326008)(16526019)(47776003)(6506007)(66066001)(186003)(52116002)(86362001)(386003)(55236004)(48376002)(2906002)(97736004)(68736007)(26005)(5660300001)(25786009)(105586002)(76176011)(51416003)(6512007)(50466002)(5009440100003)(6666003)(36756003)(16586007)(81166006)(6486002)(8936002)(106356001)(305945005)(7736002)(50226002)(6116002)(53936002)(81156014)(8676002)(2950100002)(3846002)(478600001)(110426004)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0754; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR04MB0754; 23:GKxSCvi8SYxpoKjyuBq7b8jx2H3LZK4AZRKiEmOI/?= gRfnklu+Vzhs9jnXXYnrdtCQCV1hesouRJHL2bLf77T+4sX53xI/czfPL8qFxNNpXvHSM8zBxsSqWnnGvOH/eNXez87Q3gq0Vn8J+YuTMmoDpEtiqra6unaK4uKf8INSx1w+OdPsyanmpQ6rsEmNurN4UjYn+ZvqYChxQEJSG9qvNXgSdlysdAAMAOTy9HltfOx2WYG63LEt/AQ7vQZbXQ3TVxbGIgLrTN2cfNGSLQNZECyYQMq5iRWk2SsrZu+P90DbPN9BCftoX909vUyrihjmp+ntYBPW4z3NOCHbrdyKMS/bfZHHus83UQ/xTnaoDLENZNtpO8SpDVzykOyMwxdXk5OrzfFoC4QkRoirVSEm9zGBFzT2RWNSBrvq+7GAs4DiPKIknQQK47RhEkzGMhTmfI8+cT1RNNJFIUheCt0f/WVXLdgkyToATxyvdskjjUNRrT14xxZwiYMmddkcS9yWiXf72nEXrWG+qeLV/e85HSOkZDuR7qdHb9dyXYpORTJhcfhRTaLLRbSacZaNOEVA4bYr1kOnwu6ivkv326U50Mujzcctg4HX8xE0TAz8VmwZCQ37kxkI6XXNjfeuz5M2bdV3JE764ELAFnmzD0KcfEnz6sfjuQHAvukhsSJlbIzxU6WKFJ5i+s5Imu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UNZ9M1iR61yPFk31A3On56ennSiBUEnkYEmD7Ab3xAyRFE=; 5:He4naBPM86poHBBHfSHFyLZgWhj+gcQPh+tqZDvqFT/i0ONBQh6ze7500drKDhq5zWj31qkXIhyczt89tsUTGdgJDt7xbis7WQdOCBLKJWVT6oJKVdqe6YfsXQrGkWSxBn5iRCxEHFaLjAUZRG3shOou1vmXSzupmPCmLauE/kU=; 24:SnAT6Ff8yg3HI4UmiqGsPVCj4yrmkY98pRYcWP6hFFMikgvrciFEZtAEwLFduxOep1asmtv80ajQwQmJGGn++ZRzqyZB1uTBwP0CuXVzuYM=; 7:+h5uTKjb5TaD4XifxXbT6A36v0cQRrBrK+UdQsl4/71Sp2n21SZWawujF56jlc6oClm96Nv+vcL6vJQ2lWauzubkTjOVfMXJTmljZq2P1DvIxi/Qj7Jao5EAeKZaOzIaiRtHiKVoy62oZLKy1y0UItKc0lJk8VNRio4AjEuTfbYQjcyUJmXKZPeGrIOHJXKBZeNsDLxzKBTl+kukIW6mXtgdiXXkFATJRVHM3s1L8YGMNuDgdvbpfwsHsOVns7Eb SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Mar 2018 07:58:05.6550 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: afbfdce0-9361-4343-8bf5-08d58981521a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0754 Subject: [dpdk-dev] [PATCH v3 06/10] bus/dpaa: enabling dpaa compilation for other platforms 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" Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/include/compat.h | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/bus/dpaa/include/compat.h b/drivers/bus/dpaa/include/compat.h index 53707bb..e4b5702 100644 --- a/drivers/bus/dpaa/include/compat.h +++ b/drivers/bus/dpaa/include/compat.h @@ -39,6 +39,7 @@ #include #include #include +#include /* The following definitions are primarily to allow the single-source driver * interfaces to be included by arbitrary program code. Ie. for interfaces that @@ -127,13 +128,15 @@ static inline void out_be32(volatile void *__p, u32 val) *p = rte_cpu_to_be_32(val); } +#define hwsync() rte_rmb() +#define lwsync() rte_wmb() + #define dcbt_ro(p) __builtin_prefetch(p, 0) #define dcbt_rw(p) __builtin_prefetch(p, 1) +#if defined(RTE_ARCH_ARM64) #define dcbz(p) { asm volatile("dc zva, %0" : : "r" (p) : "memory"); } #define dcbz_64(p) dcbz(p) -#define hwsync() rte_rmb() -#define lwsync() rte_wmb() #define dcbf(p) { asm volatile("dc cvac, %0" : : "r"(p) : "memory"); } #define dcbf_64(p) dcbf(p) #define dccivac(p) { asm volatile("dc civac, %0" : : "r"(p) : "memory"); } @@ -144,9 +147,27 @@ static inline void out_be32(volatile void *__p, u32 val) asm volatile("prfm pldl1keep, [%0, #64]" : : "r" (p)); \ } while (0) +#elif defined(RTE_ARCH_ARM) +#define dcbz(p) memset((p), 0, 32) +#define dcbz_64(p) memset((p), 0, 64) +#define dcbf(p) RTE_SET_USED(p) +#define dcbf_64(p) dcbf(p) +#define dccivac(p) RTE_SET_USED(p) +#define dcbit_ro(p) RTE_SET_USED(p) + +#else +#define dcbz(p) RTE_SET_USED(p) +#define dcbz_64(p) dcbz(p) +#define dcbf(p) RTE_SET_USED(p) +#define dcbf_64(p) dcbf(p) +#define dccivac(p) RTE_SET_USED(p) +#define dcbit_ro(p) RTE_SET_USED(p) +#endif + #define barrier() { asm volatile ("" : : : "memory"); } #define cpu_relax barrier +#if defined(RTE_ARCH_ARM64) static inline uint64_t mfatb(void) { uint64_t ret, ret_new, timeout = 200; @@ -160,6 +181,11 @@ static inline uint64_t mfatb(void) DPAA_BUG_ON(!timeout && (ret != ret_new)); return ret * 64; } +#else + +#define mfatb rte_rdtsc + +#endif /* Spin for a few cycles without bothering the bus */ static inline void cpu_spin(int cycles)