From patchwork Tue Feb 27 17:25:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 129839 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp540372edc; Tue, 27 Feb 2018 09:28:35 -0800 (PST) X-Google-Smtp-Source: AH8x22557szN7FxWjr6mIK6562u01rzrU4ElPqMxqrzgYaGd5Smj+TSRPb30ZMiVT71KL2WmuRTS X-Received: by 10.223.172.168 with SMTP id o37mr12724070wrc.268.1519752515475; Tue, 27 Feb 2018 09:28:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519752515; cv=none; d=google.com; s=arc-20160816; b=P2IH60FYIJeadxbRPblzBSlFetbFdO4Lq2hVgjl7jKIXrc+2Ytt0CGhsEAhMUEgOWq DQYhvqt1vXQ4+wZXtEypHaCzYhZMTu9IdcxpRnczZiQyw4/kiOs/8IeO7j32iZ9/44MU XtH0GJxmyloQjCXeK3tUfYBBvj9X/NntjM1EqdE3k9tDScjXbPd+92jHFd8TSiwBDdqB hU0vJcWcQ1mEeq7eBu2/jPmNCg5Q6Gxb/a48XTzP3zx2usT9K4P4fqrrjvzqx5ws2JbA Lj/vBA+974OeSb16IfVkLxfrRWffnoZYcWP2YK95HbLW+pmNjUN4gOtG2hyWS1F/2ffo KSRA== 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=hp1tyidJ8hh27GWYHHTJcUwbOJdognw91M+75VmftCOEVCFirLYmgm2/fpiK9SsIqd ZssMUvm3RTRH7j6bsuQHyVda/sB1Hw/i+Tc5dPZlx+iWxVPflRVCbWv9vePwCTJ04irB RdGFgsWXjg/5EMv4NOCVvs7DqQ6rYB04R8IMUULLghwWlqEbmgQXanSrroFusdgW4ssl SMr8BQKrhYtCZ0EFzzFUv5AELETxm0UxXUbMkCHGmyHRCeWmtWPyDdox0rx3KCvMf2jT wna3rGwuHYElZP5nZGOXQQ5owR3sswfUPJF7koGvBgLgUKejAZC2qvaHAyRZhP9G4Rfo BVyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=tTllBsFt; 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 n55si1534481wrf.550.2018.02.27.09.28.35; Tue, 27 Feb 2018 09:28:35 -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=tTllBsFt; 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 B2B464CAB; Tue, 27 Feb 2018 18:27:43 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0079.outbound.protection.outlook.com [104.47.0.79]) by dpdk.org (Postfix) with ESMTP id 8FC024CAF for ; Tue, 27 Feb 2018 18:27:37 +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=tTllBsFtgrIgCtNYDiu8xTfmdAt8nGjRT+SXdvF2lSgNuKitN8WE5bkMs//oUZKwQ3BsqszIE3TPV+VdtSjlzEoDSTRKUpmGxfhqofLaaRAt13K9hho5RjnCNiKJl7EdxKQsqA741FMY5wtJkKepXapKgPlPrhbIe6smUIcOYVM= 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:35 +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:50 +0530 Message-Id: <1519752352-15442-6-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: 6c256aa3-a306-4277-87b8-08d57e0764f3 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:Doh7UfvBkjU68l3xNtMJbRi3R9Ii8ct+PWlknO7A5qo2IFcp+6fNszgbb4FygZGSmv0VVUTZEPXRE3plVvdboWFI5b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meJ2OrsJDnXhy1a2TmuTK/rb/3sCtprsncMKdgSXDZFvhAJ3EGe6SOF6ZxXD7nmL89rF3KW/CaKDlfBKUsLUOyv9wpcSFB4lDr+SAODUgKQ3dOZ69u95yFtn59somrSvPfvRAu1JDszrGABjsbP1W5/IevdnfpHEABs1m5fpDq/C/5M1QBXHp9My+iMUijJ5pzBquJmcpkZ7MEkA0raNYy3OkVBYlyJjT+IHumNtB6Ym1EpkZLJmaHj+qaif5+1eA4JfARZH; 4:9OlyzEHAa0fodvA+KsvPis6HeCOtyjt8TAdODMdy480UNmU/2Xe2hzRrmFRaqU1QrxFC/rC0MliXXGqUHbR0Qc4+Dua+m+k6afoaZH/AsLtphF7/CY23WYTd/4juRO1BQBjtZG9FgriklhukA3UL+p9k38ZC2F8h0VTGxF+u/oVkNHq9JsD6ZzvHuVlU5kt2Wa2lAke2ZLl2AVpkiQJQiDMjQxaGKXsZ9hM4kF78nJL7AB0V2xVkWLGvp0vr/fqo3qkepsAyenaRsy5jBLg9r2c7WKTjq9mGr78X5VIVrAC8VqqMelmtP46qGIUTrq5O 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:xQLPI/4Ri0Quuhk1HHfjVZyyGt7OvF43F3jBProw0?= OXs6HY+hdSBpxoj/D/7dY+PMtDbnz6a3Mgqs/QmpATWuMEZEQwE+DzzHOfbEsOgGrsddu+NLje1ocgFKV0Na2fjbCdrKcNV4AUzI/veQZitusXrObRDGdURQo8RI9af6yJEvELs1c23H2hCP7XPjJbZCdT67lbv6Pjpaav3phC/fj1rDgWzjm0WDDaiT/Ov2ppXZtzsO/luliIXk3JmNHkbCNhlz2isEpWBsEvXK+3U1X7BNKT5XOorZeXpPcG+pTB1Rf0l0KUJDgfIX6onmZO2yCVTtaCnZMAcgjc0U+5B+EDdWxriKc5sDqhc3NIlMBRFtscJHGuke66WKDSZPY+HW95VhoIX/u3oBJcTacc3hedY7K7IuwSzN0bXFzACytMg4bEf72LIqkS1w66E1sK6aa+Aluto5EokznPesJCy/yPyN9tNfskMQZPVLkXM7fafKgB31X62d3AVQPP4cYD4DOfjCCp4D2zoUuaJLg2IImMCyKkCqBRL2JcF+/NdZbJpmknQJ4R7PMmQ+X+KU/t6jH8LVSeesBEJTGEpfU1nb7pvbWUeQuJnH3R96YNR8FZT4ybS9v49A/nXgCdmWANswRaWhMrzuni4jXB0W/ih/yt3EpiqhyhDBRXZ/tKT/uEEVTsoMD6imx3UZopn45HaSoFqgicY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wFKbo=; 24:JOVIKjMgsbW+axvyOmltY9DJ79Z0eC91n3GiBaMOnxRFE9h1gcPZq4oMldSiP58R6xyEFST8w9tiTH8eYXq8Y17JJqrXFhFJ+aGTCbkvjS8=; 7:g53kRdckDctCv8t5IsURPojFYHGIs22HZOdJD5Y99Z3+mu+TzjYjOTMNJ29WMpkIBpDlIE+NQWWxLbCIciMZHzodLK+pednlmWRxDC1JdRp8zUS98TsujjT3ZY4ubu+r8CF2RgVAsBrT55e42eayVM2XVDumaIycIGIVy1IMZKvBuMjutVRP378HXnW0dyyFx/mE0yl2BwAewsq2kZSpLTTPl9igEh4nFNu7+MtZxJOE8vkgAEthW0opBM1HQqQw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2018 17:27:35.7595 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c256aa3-a306-4277-87b8-08d57e0764f3 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 5/7] 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)