From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0061.outbound.protection.outlook.com [104.47.36.61]) by dpdk.org (Postfix) with ESMTP id E65EC952 for ; Fri, 3 Mar 2017 08:13:21 +0100 (CET) Received: from BN6PR03CA0039.namprd03.prod.outlook.com (10.175.124.25) by CY1PR0301MB0731.namprd03.prod.outlook.com (10.160.159.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.933.12; Fri, 3 Mar 2017 07:13:20 +0000 Received: from BN1BFFO11FD041.protection.gbl (2a01:111:f400:7c10::1:168) by BN6PR03CA0039.outlook.office365.com (2603:10b6:404:10c::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12 via Frontend Transport; Fri, 3 Mar 2017 07:13:19 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; caviumnetworks.com; dkim=none (message not signed) header.d=none; caviumnetworks.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD041.mail.protection.outlook.com (10.58.144.104) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.933.11 via Frontend Transport; Fri, 3 Mar 2017 07:13:19 +0000 Received: from bf-netperf1.idc ([10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v237D506005035; Fri, 3 Mar 2017 00:13:16 -0700 From: Hemant Agrawal To: CC: , , , , , Date: Fri, 3 Mar 2017 18:16:20 +0530 Message-ID: <1488545223-25739-4-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> References: <1487205586-6785-1-git-send-email-hemant.agrawal@nxp.com> <1488545223-25739-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131329987996209370; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(7916002)(39380400002)(39840400002)(39850400002)(39400400002)(39410400002)(39450400003)(39860400002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(9170700003)(305945005)(85426001)(356003)(81166006)(8676002)(48376002)(189998001)(626004)(50466002)(86362001)(47776003)(5003940100001)(4326008)(8936002)(104016004)(5660300001)(50226002)(76176999)(110136004)(50986999)(8656002)(54906002)(2950100002)(6916009)(77096006)(38730400002)(6666003)(92566002)(33646002)(2906002)(2351001)(53936002)(105606002)(36756003)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0301MB0731; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:ovrnspm; A:1; MX:1; PTR:InfoDomainNonexistent; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD041; 1:v1FspvwzGZ0yn4hlMAiqTMAOdYtvbfJmr1meZ6JgoESzz1M2km0gS9z1EWNyHNIhzdViLUsTEHvgFHmvsyu+PrSftvs4F32SaegDzel+D0zkQKKuY2S1187QHjqUMBVg8ctbTaoBDkKSE5LY73kgHL8YvrM3z5iNPV6XB2TIa62NMLufOI8q37gwKCYTP8D00HiJw5/6YeDwq52+Hq6kZ1WnP/ZCJmVnXDoMQSoWKExh4lqeEcrP0ZAZK3hnbZ0VRFBUi2U/gV1qorpB0gA9jB47qioFv/grRk+dhl9bA70G/KiOYHbPza4kNgom7u0qQA8IyQVpPvtSlqePXkaK532klO8Vr51EYOFC5IMyjLBue5CfXelMh/19XwCuL3NoC2a+m/OVMOsfGLJnLOXuxe4nUWmVsZeNAVINdJ2qWqVOqAUej/pyoQVeZS7AflekZx5sMV7t85i6w1zktmuE6X0isbQxFefe18VSInFBseQs6bfRDjv4Ky+n1lSWxo3HTxTkbfoZVJbUs8qsdw5Z4PO7bfYxEN9/a0+x7t9mfi1MxlH3OIsOj2KzwWNfJORBTq9ZLrnJvpSAS5zRp0+zECW0rPRHTNGJHccR8ip+muXgtMjBSt0LmmANCc2Y11rs9Qq4BWscX4HCAd4WuNujcg== MIME-Version: 1.0 Content-Type: text/plain X-MS-Office365-Filtering-Correlation-Id: b864b8fb-60a7-41c3-6f79-08d46204c553 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0301MB0731; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0731; 3:jgIMpywA72HLg03N39SjB6vNILB0Y9zjf+piVYp+LFPiZ3YvuiUyyL8l/X/hSOytTdYbAmKDftzN37tvLtuX17UPFF/JirzdposkcvRVqS7zH5PD2gABQlQaiA6bB422rNtlVh3lpp3eq3rQaJLdrz2lucks5gCQOv3VCCHFWfcVgo4Kbp9RSchzFPv9hG5B7YRuA7Ui3m+RhHBaNDSYhgmysLxsTH8xSEX9bgVwNlGaVCMpHmE77AcFeC8DIxcqYHNS92E/ETj8BXCsEvDa2OKo+bX4Y4kdJoDm26yYQbG4W2GXY9Ae7gahFkCmEFf3m0CNWDOoiP28WtvsjitUvDHjYHqOd2ash6DHH7ZHSCT0F7IzQpmisxT04GdrZhrm; 25:7BkQvTuOlGt2bXO96oeoqGO8aR9JBDlbTaDnkpnjffez7lwv58zddmazjgkieAQCMCJTox4vyc2ZKMI6GFvirkRGKKs6ts7/FW4xpLoxhSOSAqOqasHuuHvZmA6sw+JFAFo+AParcxP8OwqjVaPvLsgF0pKl0RSwvKF5nGHZbJ8yOJls4/0SSt1bXXsdRwGMFtNbUpMqYO9djYSnpg0Q4+wRNPU1m2x0whu8bvNUH2A98HrR25fuDiZpZUFAscFOmJgPYz/LQ0H6Y917JD0TKlmvJZ8RfKqDCjW2KtGNHDlzZx1zN89ux0Rcw36e1AVjap57SJFBWF3GB8gD4141/fbcFG68V8z5GWSI/Vo68LHbIWgxmIxOqQm1VWitdPbPM87r2pklKuHmxEyBrBzUY6jz2Vd44euFXMHSo8mAhk/OcdXLGBqrGnL6oj+pkVC79/7hvVuuvIAC4TZEuTzNLA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0731; 31:p45giGW11tTdwHtQ/cIWcBTN4VxuYe/Rgx/JO/oXr/2yY4Oq5xFBM3qu+WP96WXLFndofKTELFdx5zXILrIdIo2JjaID3XW6c18/7+oZ2G6M5Id0X9rPWCsYL7T/I88ZWrBg8EqjaPQXQLSP0uZDbrtMFKFCWuogWSoBA22jgfnBWUgc2U3jLyWIFnnYBTnRs4r6Dnap/qHry58VzOEMGvXF7MkbjIJWd4fpHp8rJ6T07NL3lVTza6cju/TZvsTgaz6uK/v8uX1JgYnzezUvg+XC0Z3qcK0y9X57OAy0xNs= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6095060)(601004)(2401047)(5005006)(8121501046)(13018025)(13015025)(13017025)(13023025)(13024025)(10201501046)(3002001)(6055026)(6096035)(20161123559025)(20161123565025)(20161123556025)(20161123563025)(20161123561025); SRVR:CY1PR0301MB0731; BCL:0; PCL:0; RULEID:(400006); SRVR:CY1PR0301MB0731; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0731; 4:ltIoziTFMq/tSmlOPAcBCyjewPwR3H6r/DsAq962QGL1DXdJ8E0YsxAaglDSHB/gS+Zebhl1BTKXMJlMZawQcwQ9/r5lhY7XaiPe2UONjiWYx1zjhqeVUqg6WTsbDr+U4PPmABG/EtV1L+md98Rk64VqhapP8kibuVmpNWo0MZv38zS5OGToECFudiHfAqi0l16/3GwBun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v104jnqH?= =?us-ascii?Q?ploMBKhYhIcqIxuHSYvDvGz/jMgt6vzPYM0q4FzFr?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0731; 6:5iGXWGkpVVSwhdJdQ+ODqqeS3sAkTny8HgTicKHX3+a0kCJXeYqKHKl5SAcIJLrBCiwbebaJzeA4njZ4Zv+8MO5YoCsLN7/7hTZTMzowG0zzcrBZesjPKS+jiYu1KV9YEQpROhFSSQt18SWyVt1ZCkPRjWCZnoLIGyfIirJEEIQPDVG0zZRwfzSsBgSJHNfduX9dwDc0lYogP5e1t5vfl6Z2g7A8dqIqKMwm3GPk9SIUK/t+3+vqVwG8yVdF8MbzJ/Etf4o1/0xJNFBWgocKG82vG0Sp98Mf6yXBb8+T22zBQhbnb6yxUai71rALxaagTSooF22oeObCUg4xa1CkkzgHHuK7LQkeEKTwJfM/OuTdTMF+HHvwCg4U6rfvn+c/WU2LMNHxvFmRsDAm3TPv3JoGT5oLy2EGOkafemUWqXA=; 5:QrCjfB+YDTNPUU+fN5mpVGLvijG+4USaowFWFXmdImxfiWLmwa5uk/hv8jd3BBQV7F7z3AUyR+f8GVd1AHoDhFnJWvxOOYy7ZbfgF8N1PcG+1HGEZUgZRkZ+zhfmdy6zanMYhETPRrRFlR9sFD258RGa8QM+evKb699g5myHcnQJKO7jDcoSnOSYffv/Oxy1; 24:6SDAEt+PziUM6t5IKyQnxDGutuuTxj42YJyHZ+A0mGBRVS4yrVJb4nUHTj3EOKkv2DXXhBiROqimuLoTFhR1E88zyjivy4QBLaWKlheH3Y8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB0731; 7:RNki1CwKH/3xKQ41tETWXnYvckdcAeg9DzM174Efcsipu9uZRR67MpoT8u4lSjGcAZhbIBYXxfsBkp5TLB1zpm6Y19+FW5A8fFqUrBcevAi54UEqwsOLtkjW5r4rl5VJo6dPEZIsBgSRCkpkY5H09sshBlniU7XvtJz+w4vm/lC/+BjFznfzE9dAXLqnKe2Aa9RqPxlaYSpACyq1ltsxqEg4gGRSgi4ByCH14EjVi7jJKBR4NBhGUH8jwYyJFTKSZ01kXFA8U/mteu5O3PJabsGLFt56GpMaUnAEhjKYATT2A44+5PlEdM39bJjygbqhlBEYcOJkAZ+IK5SnPFxtlw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2017 07:13:19.4025 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB0731 Subject: [dpdk-dev] [PATCHv8 03/46] bus/fslmc: introducing fsl-mc bus driver 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: , X-List-Received-Date: Fri, 03 Mar 2017 07:13:22 -0000 The fslmc bus driver is a rte_bus driver which scans the fsl-mc bus for NXP DPAA2 SoCs. Signed-off-by: Hemant Agrawal --- MAINTAINERS | 3 + config/common_base | 5 + config/defconfig_arm64-dpaa2-linuxapp-gcc | 8 +- drivers/Makefile | 1 + drivers/bus/Makefile | 36 +++++++ drivers/bus/fslmc/Makefile | 66 +++++++++++++ drivers/bus/fslmc/fslmc_bus.c | 125 +++++++++++++++++++++++ drivers/bus/fslmc/rte_bus_fslmc_version.map | 8 ++ drivers/bus/fslmc/rte_fslmc.h | 148 ++++++++++++++++++++++++++++ 9 files changed, 399 insertions(+), 1 deletion(-) create mode 100644 drivers/bus/Makefile create mode 100644 drivers/bus/fslmc/Makefile create mode 100644 drivers/bus/fslmc/fslmc_bus.c create mode 100644 drivers/bus/fslmc/rte_bus_fslmc_version.map create mode 100644 drivers/bus/fslmc/rte_fslmc.h diff --git a/MAINTAINERS b/MAINTAINERS index 5030c1c..0eda467 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -356,6 +356,9 @@ M: Alejandro Lucero F: drivers/net/nfp/ F: doc/guides/nics/nfp.rst +NXP dpaa2 +M: Hemant Agrawal +F: drivers/bus/fslmc/ QLogic bnx2x M: Harish Patil M: Rasesh Mody diff --git a/config/common_base b/config/common_base index aeee13e..e7ab12f 100644 --- a/config/common_base +++ b/config/common_base @@ -287,6 +287,11 @@ CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_DRIVER=n CONFIG_RTE_LIBRTE_THUNDERX_NICVF_DEBUG_MBOX=n # +# Compile NXP DPAA2 FSL-MC Bus +# +CONFIG_RTE_LIBRTE_FSLMC_BUS=n + +# # Compile burst-oriented VIRTIO PMD driver # CONFIG_RTE_LIBRTE_VIRTIO_PMD=y diff --git a/config/defconfig_arm64-dpaa2-linuxapp-gcc b/config/defconfig_arm64-dpaa2-linuxapp-gcc index 66df54c..365ae5a 100644 --- a/config/defconfig_arm64-dpaa2-linuxapp-gcc +++ b/config/defconfig_arm64-dpaa2-linuxapp-gcc @@ -1,6 +1,7 @@ # BSD LICENSE # -# Copyright(c) 2016 Freescale Semiconductor, Inc. All rights reserved. +# Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved. +# Copyright (c) 2016 NXP. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -40,3 +41,8 @@ CONFIG_RTE_ARCH_ARM_TUNE="cortex-a57+fp+simd" # CONFIG_RTE_MAX_LCORE=8 CONFIG_RTE_MAX_NUMA_NODES=1 + +# +# Compile NXP DPAA2 FSL-MC Bus +# +CONFIG_RTE_LIBRTE_FSLMC_BUS=y diff --git a/drivers/Makefile b/drivers/Makefile index 81c03a8..e937449 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -31,6 +31,7 @@ include $(RTE_SDK)/mk/rte.vars.mk +DIRS-y += bus DIRS-y += net DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto diff --git a/drivers/bus/Makefile b/drivers/bus/Makefile new file mode 100644 index 0000000..60e9764 --- /dev/null +++ b/drivers/bus/Makefile @@ -0,0 +1,36 @@ +# BSD LICENSE +# +# Copyright(c) 2016 NXP. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of NXP nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +DIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc + +include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/bus/fslmc/Makefile b/drivers/bus/fslmc/Makefile new file mode 100644 index 0000000..ad28d8a --- /dev/null +++ b/drivers/bus/fslmc/Makefile @@ -0,0 +1,66 @@ +# BSD LICENSE +# +# Copyright(c) 2016 NXP. All rights reserved. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# * Neither the name of NXP nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +include $(RTE_SDK)/mk/rte.vars.mk + +# +# library name +# +LIB = librte_bus_fslmc.a + +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_PMD),y) +CONFIG_RTE_LIBRTE_FSLMC_BUS = $(CONFIG_RTE_LIBRTE_DPAA2_PMD) +endif + +ifeq ($(CONFIG_RTE_LIBRTE_DPAA2_DEBUG_INIT),y) +CFLAGS += -O0 -g +CFLAGS += "-Wno-error" +else +CFLAGS += -O3 +CFLAGS += $(WERROR_FLAGS) +endif +CFLAGS += "-Wno-strict-aliasing" + +CFLAGS += -I$(RTE_SDK)/drivers/bus/fslmc +CFLAGS += -I$(RTE_SDK)/lib/librte_eal/linuxapp/eal + +# versioning export map +EXPORT_MAP := rte_bus_fslmc_version.map + +# library version +LIBABIVER := 1 + +SRCS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += fslmc_bus.c + +# library dependencies +DEPDIRS-$(CONFIG_RTE_LIBRTE_FSLMC_BUS) += lib/librte_eal + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c new file mode 100644 index 0000000..8a4f519 --- /dev/null +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -0,0 +1,125 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2016 NXP. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of NXP nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "rte_fslmc.h" + +#define FSLMC_BUS_LOG(level, fmt, args...) \ + RTE_LOG(level, EAL, "%s(): " fmt "\n", __func__, ##args) + +struct rte_fslmc_bus rte_fslmc_bus; + +static int +rte_fslmc_scan(void) +{ + return 0; +} + +static int +rte_fslmc_match(struct rte_dpaa2_driver *dpaa2_drv, + struct rte_dpaa2_device *dpaa2_dev) +{ + if (dpaa2_drv->drv_type == dpaa2_dev->dev_type) + return 0; + + return 1; +} + +static int +rte_fslmc_probe(void) +{ + int ret = -1; + struct rte_dpaa2_device *dev; + struct rte_dpaa2_driver *drv; + + TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) { + TAILQ_FOREACH(drv, &rte_fslmc_bus.driver_list, next) { + ret = rte_fslmc_match(drv, dev); + if (ret) + continue; + + if (!drv->probe) + continue; + + ret = drv->probe(drv, dev); + if (ret) + FSLMC_BUS_LOG(ERR, "Unable to probe.\n"); + break; + } + } + return ret; +} + +/*register a fslmc bus based dpaa2 driver */ +void +rte_fslmc_driver_register(struct rte_dpaa2_driver *driver) +{ + RTE_VERIFY(driver); + + TAILQ_INSERT_TAIL(&rte_fslmc_bus.driver_list, driver, next); + /* Update Bus references */ + driver->fslmc_bus = &rte_fslmc_bus; +} + +/*un-register a fslmc bus based dpaa2 driver */ +void +rte_fslmc_driver_unregister(struct rte_dpaa2_driver *driver) +{ + struct rte_fslmc_bus *fslmc_bus; + + fslmc_bus = driver->fslmc_bus; + + TAILQ_REMOVE(&fslmc_bus->driver_list, driver, next); + /* Update Bus references */ + driver->fslmc_bus = NULL; +} + +struct rte_fslmc_bus rte_fslmc_bus = { + .bus = { + .scan = rte_fslmc_scan, + .probe = rte_fslmc_probe, + }, + .device_list = TAILQ_HEAD_INITIALIZER(rte_fslmc_bus.device_list), + .driver_list = TAILQ_HEAD_INITIALIZER(rte_fslmc_bus.driver_list), +}; + +RTE_REGISTER_BUS(FSLMC_BUS_NAME, rte_fslmc_bus.bus); diff --git a/drivers/bus/fslmc/rte_bus_fslmc_version.map b/drivers/bus/fslmc/rte_bus_fslmc_version.map new file mode 100644 index 0000000..41c80d9 --- /dev/null +++ b/drivers/bus/fslmc/rte_bus_fslmc_version.map @@ -0,0 +1,8 @@ +DPDK_17.05 { + global: + + rte_fslmc_driver_register; + rte_fslmc_driver_unregister; + + local: *; +}; diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h new file mode 100644 index 0000000..040ab95 --- /dev/null +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -0,0 +1,148 @@ +/*- + * BSD LICENSE + * + * Copyright (c) 2016 NXP. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of NXP nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _RTE_FSLMC_H_ +#define _RTE_FSLMC_H_ + +/** + * @file + * + * RTE FSLMC Bus Interface + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +/** Name of FSLMC Bus */ +#define FSLMC_BUS_NAME "FSLMC" + +struct rte_dpaa2_driver; + +/* DPAA2 Device and Driver lists for FSLMC bus */ +TAILQ_HEAD(rte_fslmc_device_list, rte_dpaa2_device); +TAILQ_HEAD(rte_fslmc_driver_list, rte_dpaa2_driver); + +extern struct rte_fslmc_bus rte_fslmc_bus; + +/** + * A structure describing a DPAA2 device. + */ +struct rte_dpaa2_device { + TAILQ_ENTRY(rte_dpaa2_device) next; /**< Next probed DPAA2 device. */ + struct rte_device device; /**< Inherit core device */ + union { + struct rte_eth_dev *eth_dev; /**< ethernet device */ + struct rte_cryptodev *cryptodev; /**< Crypto Device */ + }; + uint16_t dev_type; /**< Device Type */ + uint16_t object_id; /**< DPAA2 Object ID */ + struct rte_intr_handle intr_handle; /**< Interrupt handle */ + struct rte_dpaa2_driver *driver; /**< Associated driver */ +}; + +typedef int (*rte_dpaa2_probe_t)(struct rte_dpaa2_driver *dpaa2_drv, + struct rte_dpaa2_device *dpaa2_dev); +typedef int (*rte_dpaa2_remove_t)(struct rte_dpaa2_device *dpaa2_dev); + +/** + * A structure describing a DPAA2 driver. + */ +struct rte_dpaa2_driver { + TAILQ_ENTRY(rte_dpaa2_driver) next; /**< Next in list. */ + struct rte_driver driver; /**< Inherit core driver. */ + struct rte_fslmc_bus *fslmc_bus; /**< FSLMC bus reference */ + uint32_t drv_flags; /**< Flags for controlling device.*/ + uint16_t drv_type; /**< Driver Type */ + rte_dpaa2_probe_t probe; + rte_dpaa2_remove_t remove; +}; + +/* + * FSLMC bus + */ +struct rte_fslmc_bus { + struct rte_bus bus; /**< Generic Bus object */ + struct rte_fslmc_device_list device_list; + /**< FSLMC DPAA2 Device list */ + struct rte_fslmc_driver_list driver_list; + /**< FSLMC DPAA2 Driver list */ + int device_count; + /**< Optional: Count of devices on bus */ +}; + +/** + * Register a DPAA2 driver. + * + * @param driver + * A pointer to a rte_dpaa2_driver structure describing the driver + * to be registered. + */ +void rte_fslmc_driver_register(struct rte_dpaa2_driver *driver); + +/** + * Unregister a DPAA2 driver. + * + * @param driver + * A pointer to a rte_dpaa2_driver structure describing the driver + * to be unregistered. + */ +void rte_fslmc_driver_unregister(struct rte_dpaa2_driver *driver); + +/** Helper for DPAA2 device registration from driver (eth, crypto) instance */ +#define RTE_PMD_REGISTER_DPAA2(nm, dpaa2_drv) \ +RTE_INIT(dpaa2initfn_ ##nm); \ +static void dpaa2initfn_ ##nm(void) \ +{\ + (dpaa2_drv).driver.name = RTE_STR(nm);\ + rte_fslmc_driver_register(&dpaa2_drv); \ +} \ +RTE_PMD_EXPORT_NAME(nm, __COUNTER__) + +#ifdef __cplusplus +} +#endif + +#endif /* _RTE_FSLMC_H_ */ -- 1.9.1