From patchwork Thu Mar 1 07:33:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 130125 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp2482553edc; Wed, 28 Feb 2018 23:36:26 -0800 (PST) X-Google-Smtp-Source: AG47ELvnGcB42nOEAzVujA05inqk5qN3DSyUobsLPyJOb3B7J3Ct9G42v6JEU3OcoVTDPxKGVKG4 X-Received: by 10.28.142.135 with SMTP id q129mr977931wmd.112.1519889786386; Wed, 28 Feb 2018 23:36:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519889786; cv=none; d=google.com; s=arc-20160816; b=x2/wOI2n0e+UoQqKTuDsxNWIMzimxh08wudOSmprXAQCd8shoUrQ1tzZ1C/qF6LJra wFcQv9NbyyG93lhUc/7IdH4o80PIU03eSqESwV3/7OUiXHJsiorFPsHzFvdpC/Ge+maX izt/rdFlpl0hsASFdnXGmfxSQljOqAf/Z2ZGKkADX/3H+FMVs5SIB3czuihDpMhPrllY ZGNIEEna1Gro20qiYu8yRM9ZjNs1ieciHmtFJAUV6/mRYmhu7BTeOrkee/CoXPCOOmWh 8REMLu9fsbSxYFa8JowZVCvm+/Qe5BW6Xg0N4miyU0DdRTBZjET00Ncl3V8p1ogvPFXk 3IKw== 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=vH8/j4Hz+CeVA31FfmRpE1siTQDwcSYSUJExFDvVhrQca8oLy5aP+o1Qsvpj53vZY2 PIhYchEbizkXNHDBpoP85qO+kRwgMf4QxZC+EJGgNCRWVY53vp1bKVhE+XOUCsi7N/YP aea+NenWGIIHdtNDpBujYLIri81Rw7hyMRw0LWwFrxQ8mrucpvrHvDeaYcNisLwtgcoM zXb0W+aULWZXPiylQFRgP0Fft4YXPvlnO+meYlV7LCf+GENsg8aRxFOGix3pDkMFu3pT CAY8XFAC6ZFui8JpCMv/AO9k+AP8bfzURNjrqSVzBnxWSgRfLTkNsRbJ/zYty7N84iSK CcWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nxp.com header.s=selector1 header.b=qf5I+3lu; 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 6si2332284wmf.138.2018.02.28.23.36.26; Wed, 28 Feb 2018 23:36:26 -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=qf5I+3lu; 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 302AE5F1A; Thu, 1 Mar 2018 08:35:06 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0077.outbound.protection.outlook.com [104.47.2.77]) by dpdk.org (Postfix) with ESMTP id 351315F11 for ; Thu, 1 Mar 2018 08:35:04 +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=qf5I+3luoSn9pgFuB1NFSeLdNy0dRCUor0V8OK1xGbNtCmd6FRk30TdGvZVlNLtAVC9J9myQOLbuJ5ZaJfQ4s1sdt+6wPcZfXnY+wj+REX89748sQArV39PCi2eQD2bneIwT3esiQd+vgUb95ZtVAclnq2bjJ9L2VnXhwnqyppc= 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 AM2PR04MB0753.eurprd04.prod.outlook.com (2a01:111:e400:8411::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Thu, 1 Mar 2018 07:35:02 +0000 From: Hemant Agrawal To: dev@dpdk.org, bruce.richardson@intel.com Cc: thomas@monjalon.net Date: Thu, 1 Mar 2018 13:03:13 +0530 Message-Id: <1519889597-5805-7-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1519889597-5805-1-git-send-email-hemant.agrawal@nxp.com> References: <1519752352-15442-1-git-send-email-hemant.agrawal@nxp.com> <1519889597-5805-1-git-send-email-hemant.agrawal@nxp.com> MIME-Version: 1.0 X-Originating-IP: [14.142.187.166] X-ClientProxiedBy: PN1PR0101CA0043.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c00:c::29) To AM2PR04MB0753.eurprd04.prod.outlook.com (2a01:111:e400:8411::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6538b73b-7e9a-47aa-7b70-08d57f46f208 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM2PR04MB0753; X-Microsoft-Exchange-Diagnostics: 1; AM2PR04MB0753; 3:JJZnp6+nsvS71haEaZLKWR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ODYaSRtNUL8DnKMo12AT+Lm3j53qYcuwDmuUq1NVTg+Ln9ubEaLk1iv8zyjSJ9wbIg0mYh9OQZ3lGa27UCQUgbErggMUfJk6gUaX9RfbLMC5MTSVD+CX36mcDQXU96/3ITWu5vGImDo2NL+MxDOkG9SG5ws+oEHjNGXOWaK2LtCLT7kkAlVm0UU3ajU+yTO9BUAZo6ktcmC+scPIUh0P2hBMp6xrgzdWYzz6M/+aXevimLs1o/t6fUWDNFPYVRDZjWDEEPExUqRl4sfsKlnjLnQ+Vzv1xAma/V9q1btkqSkvTMQNGii7NSO3wIaRETUw0T+KU67wPvBKMm; 4:POIPGogIYtFQVn44nfBiyyJ9uvlcsSNpjNuNb7KzUENrK4ddLDvtA1yPuiRbKX04y1l6JkwAcpJTGoXU3VNKlqlFll/GUkVTkkvSA5Vqtp5kZCMtJF2gX6aqz24M/oJzTXe7G4/PbKRYhO69DKWpVvvL2Yo286Xl9kttCMs9Jeye0e8BASjuPGCu0MU6NslgG3dPk/dsI7cUCd5aNshm1IrXBpbOToB+8vm3htFv88MUSAvaOF6allxPc1Nrih065JLdXf+6cw1TPAY0hFdwtftMRFw1FNQ9T1P6/R65GJvWFtVSFT0l/jU1BaW5A7qh 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)(944501224)(52105095)(93006095)(93001095)(10201501046)(6055026)(6041288)(20161123558120)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:AM2PR04MB0753; BCL:0; PCL:0; RULEID:; SRVR:AM2PR04MB0753; X-Forefront-PRVS: 05986C03E0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(39380400002)(366004)(346002)(39860400002)(199004)(189003)(7736002)(8676002)(26005)(16526019)(386003)(55236004)(106356001)(81166006)(50226002)(47776003)(81156014)(6506007)(66066001)(8936002)(16586007)(316002)(2906002)(4326008)(25786009)(6116002)(5660300001)(3846002)(186003)(86362001)(305945005)(6512007)(2950100002)(6666003)(97736004)(50466002)(48376002)(478600001)(5009440100003)(52116002)(36756003)(53936002)(68736007)(76176011)(51416003)(6486002)(105586002)(110426004)(473944003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR04MB0753; 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; AM2PR04MB0753; 23:uLeGWSmGgfoKb53gETgVkOLLYRpVwxIxTc3Bjgbri?= IE0hqiET0pCne4zTCURNhAGDubrhAdBXWJhz5GrsXqRnDw7BY+yFV+5DQ96+0zpAU1QT0jDKCx1zaU7AEvOBpaUNb3lO5xv6kv4Pf8Ree1saU1t9jaK0xdVVx/9Y7gCfXXQMQNrKXuR/LMJPkTtc7jOtRRXRlavubd8hRkKH7LaGSc2ZU1MtQBep2Hx15NZCu3iOBjbOP1v3zGiT17mIBzkW4Mns11URSzYDyRE5dQ4Ion5XRjyekvxgvEuMkWDG1JFpzjR2YUba9Wku655oDoOVEBM/4m6dgY7plgCkJOUHC8czVYqu+Mo29ISu93SP4vEA1n4eaW7pz4AF8DAj9bTysZqM0Tf/eu0lPLR8CYs7NRee4sv3zEkG9YpFWruUXdfiqDe/gL2Ohx2F1QbWlalnR4x4aAqjcIo5x33RlOg8jBHzmMxvafTHvH90gK4308l/cvPHolOcZqVhwuAXXJALAcms1jSkc4mxMI3+GRD+LMUF87fjclDWCz0rVbgTAzP8B5gRMt/ZiQRDnIIRNwojRA6L5nvfM5zRuy9YIJG16BYVOZT0JvDsf5xUyV5GCVPQAWakLhC1Hoxs6W/7OWCjwIDAuiAGBPBTsDDwC4kpVZexjQRcNovcvcdkVDODgH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=; 24:7s88bFYE5FaxRmp/ImHlvEaoLM837EsSSxpzC6U/UGhzwIq2B5nb7lka5+Gh92owrT/oqBEHq7GOp9q8YMNKTm6NgCw1tnwuY5BwXB6qKTs=; 7:S3f0ymWwm/MK2jPK3iueCDZRCI+HPqzH1QRQtS8UTH4fto8gy2r7NQA4HdJD15RC3g3hLAV1OmngS2fv++S/IpIJIZbZ323b2Y5qN4oOiC7r/xwUjUh3lqPXTgb1faLTRQ0zOBYmXvhKp3dCpnwUxztzsXxR5o7SrHXKowO6z4PHvwgYko8kXb3pHeyBthJHukzTeH5dWU0wVhDsGpjaqHvA0+kf9mkuFpLdUAP1uFgWpCAN6oEBr8YA7ZOeE/N1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2018 07:35:02.0373 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6538b73b-7e9a-47aa-7b70-08d57f46f208 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM2PR04MB0753 Subject: [dpdk-dev] [PATCH v2 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)